qemu-patch-raspberry4/target/i386
Eduardo Habkost 258fe08bd3 x86: host-phys-bits-limit option
Some downstream distributions of QEMU set host-phys-bits=on by
default.  This worked very well for most use cases, because
phys-bits really didn't have huge consequences. The only
difference was on the CPUID data seen by guests, and on the
handling of reserved bits.

This changed in KVM commit 855feb673640 ("KVM: MMU: Add 5 level
EPT & Shadow page table support").  Now choosing a large
phys-bits value for a VM has bigger impact: it will make KVM use
5-level EPT even when it's not really necessary.  This means
using the host phys-bits value may not be the best choice.

Management software could address this problem by manually
configuring phys-bits depending on the size of the VM and the
amount of MMIO address space required for hotplug.  But this is
not trivial to implement.

However, there's another workaround that would work for most
cases: keep using the host phys-bits value, but only if it's
smaller than 48.  This patch makes this possible by introducing a
new "-cpu" option: "host-phys-bits-limit".  Management software
or users can make sure they will always use 4-level EPT using:
"host-phys-bits=on,host-phys-bits-limit=48".

This behavior is still not enabled by default because QEMU
doesn't enable host-phys-bits=on by default.  But users,
management software, or downstream distributions may choose to
change their defaults using the new option.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20181211192527.13254-1-ehabkost@redhat.com>
[ehabkost: removed test code while some issues are addressed]
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-01-14 12:23:36 -02:00
..
hvf i386: hvf: drop debug printf in decode_sldtgroup 2018-12-18 14:57:48 +01:00
arch_dump.c dump: add kernel_gs_base to QEMU CPU state 2018-07-16 16:13:34 +02:00
arch_memory_mapping.c exec,dump,i386,ppc,s390x: don't include exec/cpu-all.h explicitly 2017-09-19 18:21:33 +02:00
bpt_helper.c target-i386: Fix eflags.TF/#DB handling of syscall/sysret insns 2016-12-22 16:01:04 +01:00
cc_helper.c target-i386: Use ctpop helper 2017-01-10 08:49:59 -08:00
cc_helper_template.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
cpu-qom.h i386: refactor KVM cpuid code so that it applies to hvf as well 2017-12-22 15:01:48 +01:00
cpu.c x86: host-phys-bits-limit option 2019-01-14 12:23:36 -02:00
cpu.h x86: host-phys-bits-limit option 2019-01-14 12:23:36 -02:00
excp_helper.c target/i386: rename HF_SVMI_MASK to HF_GUEST_MASK 2018-10-02 19:09:12 +02:00
fpu_helper.c target/*/cpu.h: remove softfloat.h 2018-02-21 10:20:24 +00:00
gdbstub.c x86: Fix x86_64 'g' packet response to gdb from 32-bit mode. 2016-12-22 16:00:25 +01:00
hax-all.c target: hax: fix errors in comment 2018-12-11 18:28:47 +01:00
hax-i386.h hax: Support for Linux hosts 2019-01-11 13:57:24 +01:00
hax-interface.h hax: Support guest RAM sizes of 4GB or more 2018-02-13 11:44:13 +01:00
hax-mem.c qemu/queue.h: leave head structs anonymous unless necessary 2019-01-11 15:46:55 +01:00
hax-posix.c hax: Support for Linux hosts 2019-01-11 13:57:24 +01:00
hax-posix.h hax: Support for Linux hosts 2019-01-11 13:57:24 +01:00
hax-windows.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
hax-windows.h hax: Support guest RAM sizes of 4GB or more 2018-02-13 11:44:13 +01:00
helper.c icount: fix cpu_restore_state_from_tb for non-tb-exit cases 2018-04-11 09:05:22 +10:00
helper.h target-i386: correctly propagate retaddr into SVM helpers 2017-02-16 18:37:01 +01:00
hyperv-proto.h x86: hv_evmcs CPU flag support 2018-11-06 21:35:04 +01:00
hyperv-stub.c hyperv: qom-ify SynIC 2018-10-19 13:44:14 +02:00
hyperv.c hyperv: process POST_MESSAGE hypercall 2018-10-19 13:44:14 +02:00
hyperv.h hyperv: qom-ify SynIC 2018-10-19 13:44:14 +02:00
int_helper.c target-i386: Use clz and ctz opcodes 2017-01-10 08:06:11 -08:00
kvm-stub.c hyperv: ensure VP index equal to QEMU cpu_index 2018-07-16 16:58:16 +02:00
kvm.c i386/kvm: expose HV_CPUID_ENLIGHTMENT_INFO.EAX and HV_CPUID_NESTED_FEATURES.EAX as feature words 2019-01-14 12:23:36 -02:00
kvm_i386.h hyperv: ensure VP index equal to QEMU cpu_index 2018-07-16 16:58:16 +02:00
machine.c hyperv: qom-ify SynIC 2018-10-19 13:44:14 +02:00
Makefile.objs hax: Support for Linux hosts 2019-01-11 13:57:24 +01:00
mem_helper.c target/i386: Convert to HAVE_CMPXCHG128 2018-10-18 19:46:53 -07:00
misc_helper.c i386: implement MSR_SMI_COUNT for TCG 2018-07-30 14:00:11 +02:00
monitor.c i386/monitor.c: make addresses canonical for "info mem" and "info tlb" 2018-07-02 15:41:18 +02:00
mpx_helper.c target/i386: move cpu_sync_bndcs_hflags() function 2017-07-05 09:12:44 +02:00
ops_sse.h target/i386: fix phminposuw in-place operation 2017-09-19 14:09:11 +02:00
ops_sse_header.h target-i386: Use ctpop helper 2017-01-10 08:49:59 -08:00
seg_helper.c target/i386: Clear RF on SYSCALL instruction 2018-11-06 21:35:05 +01:00
sev-stub.c sev/i386: add sev_get_capabilities() 2018-03-13 17:36:06 +01:00
sev.c Clean up includes 2018-12-20 10:29:08 +01:00
sev_i386.h sev/i386: add sev_get_capabilities() 2018-03-13 17:36:06 +01:00
shift_helper_template.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
smm_helper.c i386: implement MSR_SMI_COUNT for TCG 2018-07-30 14:00:11 +02:00
svm.h target-i386: Add NPT support 2018-07-02 15:41:18 +02:00
svm_helper.c target/i386: rename HF_SVMI_MASK to HF_GUEST_MASK 2018-10-02 19:09:12 +02:00
TODO Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
trace-events sev/i386: finalize the SEV guest launch flow 2018-03-13 17:36:05 +01:00
translate.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
whp-dispatch.h Clean up includes 2018-12-20 10:29:08 +01:00
whpx-all.c WHPX: register for unrecognized MSR exits 2018-06-28 19:05:36 +02:00
xsave_helper.c Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00