This repository was archived by the owner on Jan 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -65,5 +65,7 @@ struct config_t {
6565};
6666
6767#define HAX_MAX_VCPUS 16
68+ // Matches the number of bits in vm_mid_bits (see vm.c)
69+ #define HAX_MAX_VMS 64
6870
6971#endif // HAX_CORE_CONFIG_H_
Original file line number Diff line number Diff line change 3535#include "include/hax_core_interface.h"
3636#include "include/ept.h"
3737#include "include/paging.h"
38+ #include "include/config.h"
3839
39- static uint8_t vm_mid_bits = 0 ;
40- #define VM_MID_BIT 8
40+ static uint64_t vm_mid_bits = 0 ;
4141
4242#ifdef HAX_ARCH_X86_32
4343static void gpfn_to_hva_recycle_total (struct vm_t * vm , uint64_t cr3_cur ,
@@ -48,7 +48,7 @@ static int get_free_vm_mid(void)
4848{
4949 int i ;
5050
51- for (i = 0 ; i < VM_MID_BIT ; i ++ ) {
51+ for (i = 0 ; i < HAX_MAX_VMS ; i ++ ) {
5252 if (!hax_test_and_set_bit (i , (uint64_t * )& vm_mid_bits ))
5353 return i ;
5454 }
@@ -64,7 +64,7 @@ static void hax_put_vm_mid(int id)
6464
6565static int valid_vm_mid (int vm_id )
6666{
67- return (vm_id >= 0 ) && (vm_id < VM_MID_BIT );
67+ return (vm_id >= 0 ) && (vm_id < HAX_MAX_VMS );
6868}
6969
7070int hax_vm_set_qemuversion (struct vm_t * vm , struct hax_qemu_version * ver )
You can’t perform that action at this time.
0 commit comments