From: BitKeeper B. <ri...@su...> - 2004-12-15 19:07:12
|
ChangeSet 1.1604, 2004/11/24 12:07:16+00:00, cl...@ar... sync w/ head. linux-2.6.9-xen-sparse/drivers/xen/blkback/blkback.c | 1 linux-2.6.9-xen-sparse/drivers/xen/blkfront/blkfront.c | 1 xen/arch/x86/irq.c | 19 ++-- xen/arch/x86/traps.c | 78 +++++++++-------- xen/arch/x86/x86_32/asm-offsets.c | 22 ++-- xen/arch/x86/x86_32/entry.S | 31 +++--- xen/arch/x86/x86_32/seg_fixup.c | 14 +-- xen/include/asm-x86/processor.h | 15 +-- 8 files changed, 98 insertions(+), 83 deletions(-) diff -Nru a/linux-2.6.9-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6.9-xen-sparse/drivers/xen/blkback/blkback.c --- a/linux-2.6.9-xen-sparse/drivers/xen/blkback/blkback.c 2004-12-15 14:07:08 -05:00 +++ b/linux-2.6.9-xen-sparse/drivers/xen/blkback/blkback.c 2004-12-15 14:07:08 -05:00 @@ -11,6 +11,7 @@ */ #include "common.h" +#include <asm-xen/evtchn.h> /* * These are rather arbitrary. They are fairly large because adjacent requests diff -Nru a/linux-2.6.9-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6.9-xen-sparse/drivers/xen/blkfront/blkfront.c --- a/linux-2.6.9-xen-sparse/drivers/xen/blkfront/blkfront.c 2004-12-15 14:07:08 -05:00 +++ b/linux-2.6.9-xen-sparse/drivers/xen/blkfront/blkfront.c 2004-12-15 14:07:08 -05:00 @@ -44,6 +44,7 @@ #include <linux/interrupt.h> #include <scsi/scsi.h> #include <asm-xen/ctrl_if.h> +#include <asm-xen/evtchn.h> typedef unsigned char byte; /* from linux/ide.h */ diff -Nru a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c --- a/xen/arch/x86/irq.c 2004-12-15 14:07:08 -05:00 +++ b/xen/arch/x86/irq.c 2004-12-15 14:07:08 -05:00 @@ -188,22 +188,22 @@ u8 nr_guests; u8 in_flight; u8 shareable; - struct domain *guest[IRQ_MAX_GUESTS]; + struct exec_domain *guest[IRQ_MAX_GUESTS]; } irq_guest_action_t; static void __do_IRQ_guest(int irq) { irq_desc_t *desc = &irq_desc[irq]; irq_guest_action_t *action = (irq_guest_action_t *)desc->action; - struct domain *d; + struct exec_domain *ed; int i; for ( i = 0; i < action->nr_guests; i++ ) { - d = action->guest[i]; - if ( !test_and_set_bit(irq, &d->pirq_mask) ) + ed = action->guest[i]; + if ( !test_and_set_bit(irq, &ed->domain->pirq_mask) ) action->in_flight++; - send_guest_pirq(d, irq); + send_guest_pirq(ed, irq); } } @@ -235,8 +235,9 @@ return 0; } -int pirq_guest_bind(struct domain *d, int irq, int will_share) +int pirq_guest_bind(struct exec_domain *ed, int irq, int will_share) { + struct domain *d = ed->domain; irq_desc_t *desc = &irq_desc[irq]; irq_guest_action_t *action; unsigned long flags; @@ -279,7 +280,7 @@ /* Attempt to bind the interrupt target to the correct CPU. */ if ( desc->handler->set_affinity != NULL ) desc->handler->set_affinity( - irq, apicid_to_phys_cpu_present(d->processor)); + irq, apicid_to_phys_cpu_present(ed->processor)); } else if ( !will_share || !action->shareable ) { @@ -296,7 +297,7 @@ goto out; } - action->guest[action->nr_guests++] = d; + action->guest[action->nr_guests++] = ed; out: spin_unlock_irqrestore(&desc->lock, flags); @@ -330,7 +331,7 @@ else { i = 0; - while ( action->guest[i] != d ) + while ( action->guest[i] && action->guest[i]->domain != d ) i++; memmove(&action->guest[i], &action->guest[i+1], IRQ_MAX_GUESTS-i-1); action->nr_guests--; diff -Nru a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c --- a/xen/arch/x86/traps.c 2004-12-15 14:07:08 -05:00 +++ b/xen/arch/x86/traps.c 2004-12-15 14:07:08 -05:00 @@ -240,8 +240,8 @@ struct xen_regs *regs, int use_error_code) { - struct domain *d = current; - struct trap_bounce *tb = &d->thread.trap_bounce; + struct exec_domain *ed = current; + struct trap_bounce *tb = &ed->thread.trap_bounce; trap_info_t *ti; unsigned long fixup; @@ -260,7 +260,7 @@ tb->error_code = regs->error_code; } if ( TI_GET_IF(ti) ) - d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1; + ed->vcpu_info->evtchn_upcall_mask = 1; return 0; xen_fault: @@ -307,8 +307,8 @@ asmlinkage int do_int3(struct xen_regs *regs) { - struct domain *d = current; - struct trap_bounce *tb = &d->thread.trap_bounce; + struct exec_domain *ed = current; + struct trap_bounce *tb = &ed->thread.trap_bounce; trap_info_t *ti; DEBUGGER_trap_entry(TRAP_int3, regs); @@ -325,7 +325,7 @@ tb->cs = ti->cs; tb->eip = ti->address; if ( TI_GET_IF(ti) ) - d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1; + ed->vcpu_info->evtchn_upcall_mask = 1; return 0; } @@ -371,10 +371,12 @@ { trap_info_t *ti; unsigned long off, addr, fixup; - struct domain *d = current; + struct exec_domain *ed = current; + struct domain *d = ed->domain; extern int map_ldt_shadow_page(unsigned int); - struct trap_bounce *tb = &d->thread.trap_bounce; - int cpu = d->processor; + struct trap_bounce *tb = &ed->thread.trap_bounce; + int cpu = ed->processor; + int ret; __asm__ __volatile__ ("movl %%cr2,%0" : "=r" (addr) : ); @@ -388,7 +390,9 @@ unlikely((addr >> L2_PAGETABLE_SHIFT) == ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l2_idx) ) { + LOCK_BIGLOCK(d); ptwr_flush(PTWR_PT_ACTIVE); + UNLOCK_BIGLOCK(d); return EXCRET_fault_fixed; } @@ -396,40 +400,43 @@ ((regs->error_code & 3) == 3) && /* write-protection fault */ ptwr_do_page_fault(addr) ) { - if ( unlikely(d->mm.shadow_mode) ) + if ( unlikely(ed->mm.shadow_mode) ) (void)shadow_fault(addr, regs->error_code); return EXCRET_fault_fixed; } } - if ( unlikely(d->mm.shadow_mode) && + if ( unlikely(ed->mm.shadow_mode) && (addr < PAGE_OFFSET) && shadow_fault(addr, regs->error_code) ) return EXCRET_fault_fixed; - if ( unlikely(addr >= LDT_VIRT_START) && - (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) ) + if ( unlikely(addr >= LDT_VIRT_START(ed)) && + (addr < (LDT_VIRT_START(ed) + (ed->mm.ldt_ents*LDT_ENTRY_SIZE))) ) { /* * Copy a mapping from the guest's LDT, if it is valid. Otherwise we * send the fault up to the guest OS to be handled. */ - off = addr - LDT_VIRT_START; - addr = d->mm.ldt_base + off; - if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) ) + LOCK_BIGLOCK(d); + off = addr - LDT_VIRT_START(ed); + addr = ed->mm.ldt_base + off; + ret = map_ldt_shadow_page(off >> PAGE_SHIFT); + UNLOCK_BIGLOCK(d); + if ( likely(ret) ) return EXCRET_fault_fixed; /* successfully copied the mapping */ } if ( unlikely(!(regs->cs & 3)) ) goto xen_fault; - ti = d->thread.traps + 14; + ti = ed->thread.traps + 14; tb->flags = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE | TBF_EXCEPTION_CR2; tb->cr2 = addr; tb->error_code = regs->error_code; tb->cs = ti->cs; tb->eip = ti->address; if ( TI_GET_IF(ti) ) - d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1; + ed->vcpu_info->evtchn_upcall_mask = 1; return 0; xen_fault: @@ -437,7 +444,7 @@ if ( likely((fixup = search_exception_table(regs->eip)) != 0) ) { perfc_incrc(copy_user_faults); - if ( !d->mm.shadow_mode ) + if ( !ed->mm.shadow_mode ) DPRINTK("Page fault: %08x -> %08lx\n", regs->eip, fixup); regs->eip = fixup; return 0; @@ -472,8 +479,9 @@ asmlinkage int do_general_protection(struct xen_regs *regs) { - struct domain *d = current; - struct trap_bounce *tb = &d->thread.trap_bounce; + struct exec_domain *ed = current; + struct domain *d = ed->domain; + struct trap_bounce *tb = &ed->thread.trap_bounce; trap_info_t *ti; unsigned long fixup; @@ -530,7 +538,7 @@ tb->cs = ti->cs; tb->eip = ti->address; if ( TI_GET_IF(ti) ) - d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1; + ed->vcpu_info->evtchn_upcall_mask = 1; return 0; gp_in_kernel: @@ -592,10 +600,10 @@ return; if ( test_and_clear_bit(0, &nmi_softirq_reason) ) - send_guest_virq(dom0, VIRQ_PARITY_ERR); + send_guest_virq(dom0->exec_domain[0], VIRQ_PARITY_ERR); |