diff --git a/tools/ioemu/iodev/cpu.cc b/tools/ioemu/iodev/cpu.cc index 5d8c09a342..17a85539ce 100644 --- a/tools/ioemu/iodev/cpu.cc +++ b/tools/ioemu/iodev/cpu.cc @@ -213,6 +213,10 @@ bx_cpu_c::cpu_loop(int max_instr_count) #endif interrupt(vector); } + /* we check DMA after interrupt check*/ + while(BX_HRQ){ + DEV_dma_raise_hlda(); + } if (send_event) { int ret; diff --git a/tools/ioemu/iodev/dma.cc b/tools/ioemu/iodev/dma.cc index 9b99bad5f5..afe0238a92 100644 --- a/tools/ioemu/iodev/dma.cc +++ b/tools/ioemu/iodev/dma.cc @@ -182,6 +182,14 @@ bx_dma_c::init(void) } BX_DMA_THIS s[1].chan[0].used = 1; // cascade channel in use BX_INFO(("channel 4 used by cascade")); + bios_init(); +} + +/* Remove it when guest fw ready*/ + void +bx_dma_c::bios_init(void){ + BX_DMA_THIS s[1].mask[0] = 0; // unmask cascade channel + BX_DMA_THIS s[1].chan[0].mode.mode_type = 3; // cascade mode for channel 4 } void @@ -189,6 +197,7 @@ bx_dma_c::reset(unsigned type) { reset_controller(0); reset_controller(1); + bios_init(); } void diff --git a/tools/ioemu/iodev/dma.h b/tools/ioemu/iodev/dma.h index 90ac9da707..9f6c4eb60e 100644 --- a/tools/ioemu/iodev/dma.h +++ b/tools/ioemu/iodev/dma.h @@ -46,6 +46,7 @@ public: ~bx_dma_c(void); virtual void init(void); + virtual void bios_init(void); virtual void reset(unsigned type); virtual void raise_HLDA(void); virtual void set_DRQ(unsigned channel, bx_bool val); diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index d13d765843..80c57856cb 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -330,6 +330,8 @@ static void monitor_rm_pagetable(struct exec_domain *ed) l2_pgentry_t *mpl2e; unsigned long mpfn; + ASSERT( pagetable_val(m->monitor_table) ); + mpl2e = (l2_pgentry_t *) map_domain_mem(pagetable_val(m->monitor_table)); /* * First get the pfn for guest_pl2e_cache by looking at monitor_table diff --git a/xen/arch/x86/vmx_platform.c b/xen/arch/x86/vmx_platform.c index 9ee99cd227..e4875dc042 100644 --- a/xen/arch/x86/vmx_platform.c +++ b/xen/arch/x86/vmx_platform.c @@ -372,7 +372,7 @@ static int inst_copy_from_guest(char *buf, unsigned long guest_eip, int inst_len ma = (mfn << PAGE_SHIFT) | (guest_eip & (PAGE_SIZE - 1)); inst_start = (unsigned char *)map_domain_mem(ma); - strncpy(buf, inst_start, inst_len); + memcpy(buf, inst_start, inst_len); unmap_domain_mem(inst_start); } else { // Todo: In two page frames