[Qemu-devel] [PATCH] vcpu_dirty: share the same field in CPUState for all accelerators

2017-06-18 Thread Sergio Andres Gomez Del Real
This patch simply replaces the separate boolean field in CPUState that kvm, hax (and upcoming hvf) have for keeping track of vcpu dirtiness with a single shared field. Signed-off-by: Sergio Andres Gomez Del Real --- include/qom/cpu.h | 5 +++-- kvm-all.c | 18

[Qemu-devel] [PATCH] xsave_helper: pull xsave and xrstor out of kvm.c into helper function

2017-06-26 Thread Sergio Andres Gomez Del Real
This patch pulls out of kvm.c and into the new files the implementation for the xsave and xrstor instructions. This so they can be shared by kvm and hvf. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/Makefile.objs | 1 + target/i386/cpu.h | 2 + target/i386/kvm.c

[Qemu-devel] [PATCH 06/14] hvf: add compilation rules to Makefile.objs

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit adds to target/i386/Makefile.objs the necessary rules so that the new files for hvf are compiled by the build system. It also adds handling of the -enable-hvf argument in the main function in vl.c. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/Makefile.objs | 1 + vl.c

[Qemu-devel] [PATCH 05/14] hvf: use new helper functions for put/get xsave

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit makes use of the helper functions for handling xsave in xsave_helper.c, which are shared with kvm. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86hvf.c | 63 ++ 1 file changed, 8 insertions(+), 55 deletions(-) diff

[Qemu-devel] [PATCH 00/14] add support for Hypervisor.framework in QEMU

2017-08-27 Thread Sergio Andres Gomez Del Real
ally planned to implement that didn't make it include: page fault handling in the emulator and implementing the dummy_signal to handle the SIG_IPI signal without race conditions. Hopefully these can be implemented in the near future. Sergio Andres Gomez Del Real (14): hvf: add support for Hyp

[Qemu-devel] [PATCH 01/14] hvf: add support for Hypervisor.framework in the configure script

2017-08-27 Thread Sergio Andres Gomez Del Real
This patch adds to the configure script the code to support the --enable-hvf argument. If the OS is Darwin, it checks for presence of HVF in the system. The patch also adds strings related to HVF in the file qemu-options.hx Signed-off-by: Sergio Andres Gomez Del Real --- configure | 32

[Qemu-devel] [PATCH 09/14] hvf: implement hvf_get_supported_cpuid

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit implements hvf_get_supported_cpuid, which returns the set of features supported by both the host processor and the hypervisor. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86_cpuid.c | 138 ++ 1 file changed, 138

[Qemu-devel] [PATCH 04/14] hvf: add fields to CPUState and CPUX86State; add definitions

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit adds some fields specific to hvf in CPUState and CPUX86State. It also adds some handy #defines. Signed-off-by: Sergio Andres Gomez Del Real --- include/qom/cpu.h | 8 target/i386/cpu.h | 23 +++ 2 files changed, 31 insertions(+) diff --git a/include

[Qemu-devel] [PATCH 11/14] hvf: implement vga dirty page tracking

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit implements setting the tracking of dirty pages, using hvf's interface to protect guest memory. It uses the MemoryListener callback mechanism through .log_start/stop/sync Signed-off-by: Sergio Andres Gomez Del Real --- include/sysemu/hvf.h | 5 target/i386/hvf-all.c

[Qemu-devel] [PATCH 10/14] hvf: refactor cpuid code

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit adds code to request the cpuid features supported by the host and hvf; it calls hvf_get_supported_cpuid if hvf is compiled with QEMU and enabled. Signed-off-by: Sergio Andres Gomez Del Real --- cpus.c| 2 + include/qom/cpu.h | 6 +-- include/sysemu/hvf.h

[Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf code in cpus.c

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit surrounds the hvf parts of cpus.c with conditional macros so that they are rightly ignored on other platforms. Signed-off-by: Sergio Andres Gomez Del Real --- cpus.c | 147 +++ include/sysemu/hvf.h | 5 +- 2 files

[Qemu-devel] [PATCH 14/14] hvf: inject General Protection Fault when vmexit through vmcall

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit injects a GP fault when the guest vmexit's by executing a vmcall instruction. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/hvf-all.c b/target/i386/hvf-all.c index 25e4f

[Qemu-devel] [PATCH 08/14] apic: add function to apic that will be used by hvf

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit moves (hides) the function apic_get_highest_priority_irr to apic.c and exports it through the interface in apic.h for use by hvf. Signed-off-by: Sergio Andres Gomez Del Real --- hw/intc/apic.c | 11 +++ include/hw/i386/apic.h | 1 + 2 files changed, 12 insertions

[Qemu-devel] [PATCH 13/14] hvf: refactor event injection code for hvf

2017-08-27 Thread Sergio Andres Gomez Del Real
This commit refactors the event-injection code for hvf through using the appropriate fields already provided by CPUX86State. At vmexit, it fills these fields so that hvf_inject_interrupts can just retrieve them without calling into hvf. Signed-off-by: Sergio Andres Gomez Del Real --- target

[Qemu-devel] [PATCH 12/14] hvf: move fields from CPUState to CPUX86State

2017-08-27 Thread Sergio Andres Gomez Del Real
;env' (which is what we really need) through the 'cpu' everytime. Signed-off-by: Sergio Andres Gomez Del Real --- include/qom/cpu.h | 2 - target/i386/cpu.h | 7 + target/i386/hvf-all.c | 125 +++ target/i386/hvf-utils/x86.c

[Qemu-devel] [PATCH v4 00/14] add support for Hypervisor.framework in QEMU

2017-09-13 Thread Sergio Andres Gomez Del Real
gnal without race conditions. Hopefully these can be implemented in the near future. Event injection was tested through the eventinj kvm test. The latest Debian and Damn Small Linux images were executed, although by now ways it was an exhaustive testing. Sergio Andres Gomez Del Real (14): hvf: add s

[Qemu-devel] [PATCH v4 03/14] hvf: fix licensing issues; isolate task handling code (GPL v2-only)

2017-09-13 Thread Sergio Andres Gomez Del Real
, and the corresponding compilation rule is added to target/i386/hvf-utils/Makefile.objs. Note that rules for compiling are still missing from target/i386/Makefile.objs; they will be added later in this patchset. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-all.c

[Qemu-devel] [PATCH v4 07/14] apic: add function to apic that will be used by hvf

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch adds the function apic_get_highest_priority_irr to apic.c and exports it through the interface in apic.h for use by hvf. Signed-off-by: Sergio Andres Gomez Del Real --- hw/intc/apic.c | 12 include/hw/i386/apic.h | 1 + 2 files changed, 13 insertions(+) diff

[Qemu-devel] [PATCH v4 11/14] hvf: refactor cpuid code

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch generalizes some code in cpu.c, sharing code and data between hvf and kvm. It also begins calling the new hvf_get_supported_cpuid where appropriate. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/cpu-qom.h | 4 +-- target/i386/cpu.c | 77

[Qemu-devel] [PATCH v4 01/14] hvf: add support for Hypervisor.framework in the configure script

2017-09-13 Thread Sergio Andres Gomez Del Real
no enable hvf; the legacy '-enable-hvf' will not be supported. Signed-off-by: Sergio Andres Gomez Del Real --- configure | 38 ++ qemu-options.hx | 10 +- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/configure b/config

[Qemu-devel] [PATCH v4 09/14] hvf: use new helper functions for put/get xsave

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch makes use of the helper functions for handling xsave in xsave_helper.c, which are shared with kvm. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86hvf.c | 63 ++ 1 file changed, 8 insertions(+), 55 deletions(-) diff

[Qemu-devel] [PATCH v4 14/14] hvf: inject General Protection Fault when vmexit through vmcall

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch injects a GP fault when the guest vmexit's by executing a vmcall instruction. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/hvf-all.c b/target/i386/hvf-all.c index 105a6

[Qemu-devel] [PATCH v4 12/14] hvf: implement vga dirty page tracking

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch implements setting the tracking of dirty vga pages, using hvf's interface to protect guest memory. It uses the MemoryListener callback mechanism through .log_start/stop/sync Signed-off-by: Sergio Andres Gomez Del Real --- include/sysemu/hvf.h | 5 target/i386/hvf-all.c

[Qemu-devel] [PATCH v4 05/14] hvf: add code to cpus.c and do refactoring in preparation for compiling

2017-09-13 Thread Sergio Andres Gomez Del Real
nt patches. Signed-off-by: Sergio Andres Gomez Del Real --- cpus.c | 47 include/sysemu/hvf.h | 30 ++- target/i386/hvf-all.c | 485 + target/i386/hvf-utils/x86.c| 2 +- target/i386/hvf-utils/x

[Qemu-devel] [PATCH v4 08/14] hvf: add compilation rules to Makefile.objs

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch adds to target/i386/Makefile.objs the necessary rules so that the new files for hvf are compiled by the build system. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/Makefile.objs | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/Makefile.objs b/target/i386

[Qemu-devel] [PATCH v4 13/14] hvf: refactor event injection code for hvf

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch refactors the event-injection code for hvf by using the appropriate fields already provided by CPUX86State. At vmexit, it fills these fields so that hvf_inject_interrupts can just retrieve them without calling into hvf. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386

[Qemu-devel] [PATCH v4 10/14] hvf: implement hvf_get_supported_cpuid

2017-09-13 Thread Sergio Andres Gomez Del Real
This patch implements hvf_get_supported_cpuid, which returns the set of features supported by both the host processor and the hypervisor. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86_cpuid.c | 138 ++ 1 file changed, 138

[Qemu-devel] [PATCH v2 00/13] add support for Hypervisor.framework in QEMU

2017-08-30 Thread Sergio Andres Gomez Del Real
that didn't make it include: page fault handling in the emulator and implementing the dummy_signal to handle the SIG_IPI signal without race conditions. Hopefully these can be implemented in the near future. Sergio Andres Gomez Del Real (13): hvf: add support for Hypervisor.framework in t

[Qemu-devel] [PATCH v2 03/13] hvf: add compilation rules to Makefile.objs

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit adds to target/i386/Makefile.objs the necessary rules so that the new files for hvf are compiled by the build system. It also adds handling of the -enable-hvf argument in the main function in vl.c. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/Makefile.objs | 1 + 1

[Qemu-devel] [PATCH v2 01/13] hvf: add support for Hypervisor.framework in the configure script

2017-08-30 Thread Sergio Andres Gomez Del Real
no enable hvf; the legacy '-enable-hvf' will not be supported. Signed-off-by: Sergio Andres Gomez Del Real --- configure | 38 ++ qemu-options.hx | 10 +- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/configure b/config

[Qemu-devel] [PATCH v2 06/13] hvf: use new helper functions for put/get xsave

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit makes use of the helper functions for handling xsave in xsave_helper.c, which are shared with kvm. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86hvf.c | 63 ++ 1 file changed, 8 insertions(+), 55 deletions(-) diff

[Qemu-devel] [PATCH v2 07/13] apic: add function to apic that will be used by hvf

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit adds the function apic_get_highest_priority_irr to apic.c and exports it through the interface in apic.h for use by hvf. Signed-off-by: Sergio Andres Gomez Del Real --- hw/intc/apic.c | 11 +++ include/hw/i386/apic.h | 1 + 2 files changed, 12 insertions(+) diff

[Qemu-devel] [PATCH v2 05/13] hvf: add fields to CPUState and CPUX86State; add definitions

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit adds some fields specific to hvf in CPUState and CPUX86State. It also adds some handy #defines. Signed-off-by: Sergio Andres Gomez Del Real --- include/qom/cpu.h | 2 ++ target/i386/cpu.h | 23 +++ 2 files changed, 25 insertions(+) diff --git a/include/qom

[Qemu-devel] [PATCH v2 10/13] hvf: implement vga dirty page tracking

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit implements setting the tracking of dirty pages, using hvf's interface to protect guest memory. It uses the MemoryListener callback mechanism through .log_start/stop/sync Signed-off-by: Sergio Andres Gomez Del Real --- include/sysemu/hvf.h | 5 target/i386/hvf-all.c

[Qemu-devel] [PATCH v2 13/13] hvf: inject General Protection Fault when vmexit through vmcall

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit injects a GP fault when the guest vmexit's by executing a vmcall instruction. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/hvf-all.c b/target/i386/hvf-all.c index 430af

[Qemu-devel] [PATCH v2 09/13] hvf: refactor cpuid code

2017-08-30 Thread Sergio Andres Gomez Del Real
This patch generalizes some code in cpu.c, sharing code and data between hvf and kvm. It also beings calling the new hvf_get_supported_cpuid where appropriate. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/cpu-qom.h | 4 +-- target/i386/cpu.c | 80

[Qemu-devel] [PATCH v2 08/13] hvf: implement hvf_get_supported_cpuid

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit implements hvf_get_supported_cpuid, which returns the set of features supported by both the host processor and the hypervisor. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86_cpuid.c | 138 ++ 1 file changed, 138

[Qemu-devel] [PATCH v2 12/13] hvf: refactor event injection code for hvf

2017-08-30 Thread Sergio Andres Gomez Del Real
This commit refactors the event-injection code for hvf through using the appropriate fields already provided by CPUX86State. At vmexit, it fills these fields so that hvf_inject_interrupts can just retrieve them without calling into hvf. Signed-off-by: Sergio Andres Gomez Del Real --- target

[Qemu-devel] [PATCH v2 11/13] hvf: move fields from CPUState to CPUX86State

2017-08-30 Thread Sergio Andres Gomez Del Real
;env' (which is what we really need) through the 'cpu' everytime. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/cpu.h | 7 + target/i386/hvf-all.c | 125 +++ target/i386/hvf-utils/x86.c| 4 +- target/i386/hvf-utils/x86.h

[Qemu-devel] [PATCH v3 00/14] add support for Hypervisor.framework in QEMU

2017-09-04 Thread Sergio Andres Gomez Del Real
uselessly specific to hvf and unified some of the state between kvm/tcg and hvf. Some features initially planned to implement that didn't make it include: page fault handling in the emulator and implementing the dummy_signal to handle the SIG_IPI signal without race conditions. Hopefully these can

[Qemu-devel] [PATCH v3 01/14] hvf: add support for Hypervisor.framework in the configure script

2017-09-04 Thread Sergio Andres Gomez Del Real
no enable hvf; the legacy '-enable-hvf' will not be supported. Signed-off-by: Sergio Andres Gomez Del Real --- configure | 38 ++ qemu-options.hx | 10 +- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/configure b/config

[Qemu-devel] [PATCH v3 10/14] hvf: implement hvf_get_supported_cpuid

2017-09-04 Thread Sergio Andres Gomez Del Real
This commit implements hvf_get_supported_cpuid, which returns the set of features supported by both the host processor and the hypervisor. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86_cpuid.c | 138 ++ 1 file changed, 138

[Qemu-devel] [PATCH v3 08/14] hvf: add compilation rules to Makefile.objs

2017-09-04 Thread Sergio Andres Gomez Del Real
This commit adds to target/i386/Makefile.objs the necessary rules so that the new files for hvf are compiled by the build system. It also adds handling of the -enable-hvf argument in the main function in vl.c. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/Makefile.objs | 1 + 1

[Qemu-devel] [PATCH v3 07/14] apic: add function to apic that will be used by hvf

2017-09-04 Thread Sergio Andres Gomez Del Real
This commit adds the function apic_get_highest_priority_irr to apic.c and exports it through the interface in apic.h for use by hvf. Signed-off-by: Sergio Andres Gomez Del Real --- hw/intc/apic.c | 12 include/hw/i386/apic.h | 1 + 2 files changed, 13 insertions(+) diff

[Qemu-devel] [PATCH v3 03/14] hvf: fix licensing issues; isolate task handling code (GPL v2-only)

2017-09-04 Thread Sergio Andres Gomez Del Real
Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-all.c | 173 +++ target/i386/hvf-utils/Makefile.objs | 2 +- target/i386/hvf-utils/vmx.h | 14 +-- target/i386/hvf-utils/x86.c | 14 +-- target/i386/hvf-utils/x86.h

[Qemu-devel] [PATCH v3 09/14] hvf: use new helper functions for put/get xsave

2017-09-04 Thread Sergio Andres Gomez Del Real
This commit makes use of the helper functions for handling xsave in xsave_helper.c, which are shared with kvm. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-utils/x86hvf.c | 63 ++ 1 file changed, 8 insertions(+), 55 deletions(-) diff

[Qemu-devel] [PATCH v3 12/14] hvf: implement vga dirty page tracking

2017-09-04 Thread Sergio Andres Gomez Del Real
This commit implements setting the tracking of dirty pages, using hvf's interface to protect guest memory. It uses the MemoryListener callback mechanism through .log_start/stop/sync Signed-off-by: Sergio Andres Gomez Del Real --- include/sysemu/hvf.h | 5 target/i386/hvf-all.c

[Qemu-devel] [PATCH v3 13/14] hvf: refactor event injection code for hvf

2017-09-04 Thread Sergio Andres Gomez Del Real
This commit refactors the event-injection code for hvf through using the appropriate fields already provided by CPUX86State. At vmexit, it fills these fields so that hvf_inject_interrupts can just retrieve them without calling into hvf. Signed-off-by: Sergio Andres Gomez Del Real --- target

[Qemu-devel] [PATCH v3 11/14] hvf: refactor cpuid code

2017-09-04 Thread Sergio Andres Gomez Del Real
This patch generalizes some code in cpu.c, sharing code and data between hvf and kvm. It also beings calling the new hvf_get_supported_cpuid where appropriate. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/cpu-qom.h | 4 +-- target/i386/cpu.c | 76

[Qemu-devel] [PATCH v3 05/14] hvf: add code to cpus.c and do refactoring in preparation for compiling

2017-09-04 Thread Sergio Andres Gomez Del Real
Signed-off-by: Sergio Andres Gomez Del Real --- cpus.c| 44 +++ include/sysemu/hvf.h | 22 ++ target/i386/hvf-all.c | 89 +++ target/i386/hvf-utils/x86.c | 2 +- target/i386

[Qemu-devel] [PATCH v3 14/14] hvf: inject General Protection Fault when vmexit through vmcall

2017-09-04 Thread Sergio Andres Gomez Del Real
This commit injects a GP fault when the guest vmexit's by executing a vmcall instruction. Signed-off-by: Sergio Andres Gomez Del Real --- target/i386/hvf-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/hvf-all.c b/target/i386/hvf-all.c index 8fc6a

[Qemu-devel] [PATCH v3 06/14] hvf: handle fields from CPUState and CPUX86State

2017-09-04 Thread Sergio Andres Gomez Del Real
;env' (which is what we really need) through the 'cpu' everytime. This commit also adds some fields specific to hvf in CPUState and CPUX86State. It also adds some handy #defines. Signed-off-by: Sergio Andres Gomez Del Real --- include/qom/cpu.h | 2 + target/i386