aboutsummaryrefslogtreecommitdiff
path: root/target/i386/hax-interface.h
diff options
context:
space:
mode:
authorYu Ning <yu.ning@intel.com>2018-01-12 18:22:35 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2018-02-13 11:44:13 +0100
commit7a5235c9e679c58be41c7f0d2f4092ded8bd01f2 (patch)
tree0c92f3550a57df5df589a7b87df0768ed66b3eec /target/i386/hax-interface.h
parent7b40951922616628d028622fed5aaeec63275201 (diff)
downloadqemu-7a5235c9e679c58be41c7f0d2f4092ded8bd01f2.zip
qemu-7a5235c9e679c58be41c7f0d2f4092ded8bd01f2.tar.gz
qemu-7a5235c9e679c58be41c7f0d2f4092ded8bd01f2.tar.bz2
hax: Support guest RAM sizes of 4GB or more
Since HAX_VM_IOCTL_ALLOC_RAM takes a 32-bit size, it cannot handle RAM blocks of 4GB or larger, which is why HAXM can only run guests with less than 4GB of RAM. Solve this problem by utilizing the new HAXM API, HAX_VM_IOCTL_ADD_RAMBLOCK, which takes a 64-bit size, to register RAM blocks with the HAXM kernel module. The new API is first added in HAXM 7.0.0, and its availablility and be confirmed by the presence of the HAX_CAP_64BIT_RAMBLOCK capability flag. When the guest RAM size reaches 7GB, QEMU will ask HAXM to set up a memory mapping that covers a 4GB region, which will fail, because HAX_VM_IOCTL_SET_RAM also takes a 32-bit size. Work around this limitation by splitting the large mapping into small ones and calling HAX_VM_IOCTL_SET_RAM multiple times. Bug: https://bugs.launchpad.net/qemu/+bug/1735576 Signed-off-by: Yu Ning <yu.ning@intel.com> Message-Id: <1515752555-12784-1-git-send-email-yu.ning@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/hax-interface.h')
-rw-r--r--target/i386/hax-interface.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/i386/hax-interface.h b/target/i386/hax-interface.h
index d141308..93d5fcb 100644
--- a/target/i386/hax-interface.h
+++ b/target/i386/hax-interface.h
@@ -308,6 +308,13 @@ struct hax_alloc_ram_info {
uint32_t pad;
uint64_t va;
} __attribute__ ((__packed__));
+
+struct hax_ramblock_info {
+ uint64_t start_va;
+ uint64_t size;
+ uint64_t reserved;
+} __attribute__ ((__packed__));
+
#define HAX_RAM_INFO_ROM 0x01 /* Read-Only */
#define HAX_RAM_INFO_INVALID 0x80 /* Unmapped, usually used for MMIO */
struct hax_set_ram_info {
@@ -327,6 +334,7 @@ struct hax_set_ram_info {
#define HAX_CAP_MEMQUOTA 0x2
#define HAX_CAP_UG 0x4
+#define HAX_CAP_64BIT_RAMBLOCK 0x8
struct hax_capabilityinfo {
/* bit 0: 1 - working