debuggers.hg
diff xen/arch/x86/domain.c @ 3668:d55d523078f7
bitkeeper revision 1.1159.212.77 (4202221693AFbvFZWeMHHIjQfbzTIQ)
More x86_64 prgress. Many more gaps filled in. Next step is DOM0
construction.
Signed-off-by: keir.fraser@cl.cam.ac.uk
More x86_64 prgress. Many more gaps filled in. Next step is DOM0
construction.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author | kaf24@scramble.cl.cam.ac.uk |
---|---|
date | Thu Feb 03 13:07:34 2005 +0000 (2005-02-03) |
parents | 060c1ea52343 |
children | 677cb76cff18 |
line diff
1.1 --- a/xen/arch/x86/domain.c Thu Feb 03 09:11:33 2005 +0000 1.2 +++ b/xen/arch/x86/domain.c Thu Feb 03 13:07:34 2005 +0000 1.3 @@ -261,9 +261,8 @@ static void continue_nonidle_task(struct 1.4 void arch_do_createdomain(struct exec_domain *ed) 1.5 { 1.6 struct domain *d = ed->domain; 1.7 -#ifdef ARCH_HAS_FAST_TRAP 1.8 + 1.9 SET_DEFAULT_FAST_TRAP(&ed->thread); 1.10 -#endif 1.11 1.12 if ( d->id == IDLE_DOMAIN_ID ) 1.13 { 1.14 @@ -276,7 +275,6 @@ void arch_do_createdomain(struct exec_do 1.15 d->shared_info = (void *)alloc_xenheap_page(); 1.16 memset(d->shared_info, 0, PAGE_SIZE); 1.17 ed->vcpu_info = &d->shared_info->vcpu_data[ed->eid]; 1.18 - d->shared_info->arch.mfn_to_pfn_start = m2p_start_mfn; 1.19 SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d); 1.20 machine_to_phys_mapping[virt_to_phys(d->shared_info) >> 1.21 PAGE_SHIFT] = INVALID_P2M_ENTRY; 1.22 @@ -453,10 +451,8 @@ int arch_final_setup_guestos(struct exec 1.23 &c->trap_ctxt, 1.24 sizeof(d->thread.traps)); 1.25 1.26 -#ifdef ARCH_HAS_FAST_TRAP 1.27 if ( (rc = (int)set_fast_trap(d, c->fast_trap_idx)) != 0 ) 1.28 return rc; 1.29 -#endif 1.30 1.31 d->mm.ldt_base = c->ldt_base; 1.32 d->mm.ldt_ents = c->ldt_ents; 1.33 @@ -498,8 +494,6 @@ int arch_final_setup_guestos(struct exec 1.34 return 0; 1.35 } 1.36 1.37 -#if defined(__i386__) /* XXX */ 1.38 - 1.39 void new_thread(struct exec_domain *d, 1.40 unsigned long start_pc, 1.41 unsigned long start_stack, 1.42 @@ -515,8 +509,8 @@ void new_thread(struct exec_domain *d, 1.43 * ESI = start_info 1.44 * [EAX,EBX,ECX,EDX,EDI,EBP are zero] 1.45 */ 1.46 - ec->ds = ec->es = ec->fs = ec->gs = ec->ss = FLAT_RING1_DS; 1.47 - ec->cs = FLAT_RING1_CS; 1.48 + ec->ds = ec->es = ec->fs = ec->gs = ec->ss = FLAT_GUESTOS_DS; 1.49 + ec->cs = FLAT_GUESTOS_CS; 1.50 ec->eip = start_pc; 1.51 ec->esp = start_stack; 1.52 ec->esi = start_info; 1.53 @@ -530,18 +524,19 @@ void new_thread(struct exec_domain *d, 1.54 * This special macro can be used to load a debugging register 1.55 */ 1.56 #define loaddebug(thread,register) \ 1.57 - __asm__("movl %0,%%db" #register \ 1.58 + __asm__("mov %0,%%db" #register \ 1.59 : /* no output */ \ 1.60 :"r" (thread->debugreg[register])) 1.61 1.62 - 1.63 void switch_to(struct exec_domain *prev_p, struct exec_domain *next_p) 1.64 { 1.65 struct thread_struct *next = &next_p->thread; 1.66 struct tss_struct *tss = init_tss + smp_processor_id(); 1.67 execution_context_t *stack_ec = get_execution_context(); 1.68 int i; 1.69 +#ifdef CONFIG_VMX 1.70 unsigned long vmx_domain = next_p->thread.arch_vmx.flags; 1.71 +#endif 1.72 1.73 __cli(); 1.74 1.75 @@ -573,7 +568,9 @@ void switch_to(struct exec_domain *prev_ 1.76 loaddebug(next, 7); 1.77 } 1.78 1.79 - if (vmx_domain) { 1.80 +#ifdef CONFIG_VMX 1.81 + if ( vmx_domain ) 1.82 + { 1.83 /* Switch page tables. */ 1.84 write_ptbase(&next_p->mm); 1.85 1.86 @@ -583,13 +580,16 @@ void switch_to(struct exec_domain *prev_ 1.87 1.88 __sti(); 1.89 return; 1.90 - } 1.91 + } 1.92 +#endif 1.93 1.94 SET_FAST_TRAP(&next_p->thread); 1.95 1.96 +#ifdef __i386__ 1.97 /* Switch the guest OS ring-1 stack. */ 1.98 tss->esp1 = next->guestos_sp; 1.99 tss->ss1 = next->guestos_ss; 1.100 +#endif 1.101 1.102 /* Switch page tables. */ 1.103 write_ptbase(&next_p->mm); 1.104 @@ -632,8 +632,6 @@ long do_iopl(domid_t domain, unsigned in 1.105 return 0; 1.106 } 1.107 1.108 -#endif 1.109 - 1.110 unsigned long hypercall_create_continuation( 1.111 unsigned int op, unsigned int nr_args, ...) 1.112 {