X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=b052eeeca556df241bdc3e8c0f3194e06a0e50b4;hp=96802d44c7d3d74a860a3361dfa501b78ba9dc1c;hb=a6865d183eedbdf3e5510e4be89dcb5ce51b5953;hpb=dc450df7818a872a3e8a3725ec97bdc273756b06 diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 96802d4..b052eee 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -37,6 +37,7 @@ #include #include +#include extern void v3_stgi(); @@ -191,8 +192,9 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { - if (vm_info->io_map.num_ports > 0) { - struct vmm_io_hook * iter; + if ( !RB_EMPTY_ROOT(&(vm_info->io_map)) ) { + struct v3_io_hook * iter; + struct rb_node * io_node = v3_rb_first(&(vm_info->io_map)); addr_t io_port_bitmap; io_port_bitmap = (addr_t)V3_VAddr(V3_AllocPages(3)); @@ -202,14 +204,16 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { //PrintDebug("Setting up IO Map at 0x%x\n", io_port_bitmap); - FOREACH_IO_HOOK(vm_info->io_map, iter) { + do { + iter = rb_entry(io_node, struct v3_io_hook, tree_node); + ushort_t port = iter->port; uchar_t * bitmap = (uchar_t *)io_port_bitmap; bitmap += (port / 8); // PrintDebug("Setting Bit for port 0x%x\n", port); *bitmap |= 1 << (port % 8); - } + } while ((io_node = v3_rb_next(io_node))); //PrintDebugMemDump((uchar_t*)io_port_bitmap, PAGE_SIZE *2);