Re: [Qemu-devel] [PATCH] WHPX Add signature CPUID

2018-05-15 Thread Justin Terry (VM) via Qemu-devel
Thanks for the patch Lucian. Looks good to me! -Justin > -Original Message- > From: petrutlucia...@gmail.com > Sent: Tuesday, May 15, 2018 4:38 AM > Cc: Lucian Petrut ; apilotti > ; Justin Terry

Re: [Qemu-devel] [PATCH] WHPX Add signature CPUID

2018-05-16 Thread Justin Terry (VM) via Qemu-devel
Hey Paolo, I agree that in the future it would be great if the Windows Hypervisor Platform supported that and if that happens there is no reason to differentiate the two. However, today WHPX actually doesn’t support any of the synthetic enlightenments that Hyper-V does. We are really trying to

Re: [Qemu-devel] [PATCH 2/2] WHPX: register for unrecognized MSR exits

2018-06-18 Thread Justin Terry (VM) via Qemu-devel
Hey Paolo, Thanks for the reply. I am certainly open for suggestions if you have any here. This was originally reported when running the android kernel which I believe is Linux 4.4. I agree that newer kernels do seem to handle #GP more gracefully than others but it doesn’t help down level

Re: [Qemu-devel] [PATCH v3 2/3] WHPX: dynamically load WHP libraries

2018-06-04 Thread Justin Terry (VM) via Qemu-devel
Paolo - I saw that this merged with commit: 327fccb288976f95808efa968082fc9d4a9ced84 but it seems to be missing whp-dispatch.h so now the build is failing. Any idea how this file failed to get included? Thanks, Justin > -Original Message- > From: petrutlucia...@gmail.com > Sent:

[Qemu-devel] [PATCH 1/2] WHPX workaround bug in OSVW handling

2018-06-05 Thread Justin Terry (VM) via Qemu-devel
Adds a workaround to an incorrect value setting CPUID Fn8000_0001_ECX[bit 9 OSVW] = 1. This can cause a guest linux kernel to panic when an issue to rdmsr C001_0140h returns 0. Disabling this feature correctly allows the guest to boot without accessing the osv workarounds. Signed-off-by: Justin

[Qemu-devel] [PATCH 2/2] WHPX: register for unrecognized MSR exits

2018-06-05 Thread Justin Terry (VM) via Qemu-devel
Some variations of Linux kernels end up accessing MSR's that the Windows Hypervisor doesn't implement which causes a GP to be returned to the guest. This fix registers QEMU for unimplemented MSR access and globally returns 0 on reads and ignores writes. This behavior is allows the Linux kernel to

Re: [Qemu-devel] Cannot launch QEMU with -accel whpx

2018-04-26 Thread Justin Terry (VM) via Qemu-devel
Hey Wenchao, It looks like your specs should fully support running this. Did you by chance forget to enable the Windows optional feature? Having the lib/dll’s from the SDK isn’t all you need. Try: (admin) PS> Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform (reboot the

Re: [Qemu-devel] [PATCH 0/4] Implements the Windows Hypervisor Platform accelerator

2018-01-16 Thread Justin Terry (VM) via Qemu-devel
erator Am 12.01.2018 um 21:22 schrieb Justin Terry (VM) via Qemu-devel: > Hello QEMU Community! > > Over the past few months the Hyper-V team at Microsoft has been > working hard on a new user-mode API for our hypervisor that will be > released as part of the upcoming SDK. This n

Re: [Qemu-devel] [PATCH 0/4] Implements the Windows Hypervisor Platform accelerator

2018-01-17 Thread Justin Terry (VM) via Qemu-devel
Hey Paolo, Thanks for all the feedback. After talking with various members of the team around these scenarios I think its best we add the migration blockers for all of your comments unfortunately. The answers to your question are below: 1. For CPUID. The API has support for an

Re: [Qemu-devel] [PATCH v2 0/4] Updates based on feedback.

2018-01-25 Thread Justin Terry (VM) via Qemu-devel
.@microsoft.com> > Cc: qemu-devel@nongnu.org; pbonz...@redhat.com; r...@twiddle.net; > ehabk...@redhat.com; crosthwaite.pe...@gmail.com > Subject: Re: [Qemu-devel] [PATCH v2 0/4] Updates based on feedback. > > On Mon, Jan 22, 2018 at 01:07:45PM -0800, Justin Terry (VM) via Qemu

[Qemu-devel] [PATCH 4/4] Add the WHPX acceleration enlightenments

2018-01-12 Thread Justin Terry (VM) via Qemu-devel
Implements the WHPX accelerator cpu enlightenments to actually use the whpx-all accelerator on Windows platforms. Signed-off-by: Justin Terry (VM) --- cpus.c| 66 ++- include/sysemu/hw_accel.h | 13 ++

[Qemu-devel] [PATCH 1/4] Add the Windows Hypervisor Platform accelerator.

2018-01-12 Thread Justin Terry (VM) via Qemu-devel
Introduces the configure support for the new Windows Hypervisor Platform that allows for hypervisor acceleration from usermode components on the Windows platform. Signed-off-by: Justin Terry (VM) --- configure | 48 +++-

[Qemu-devel] [PATCH 0/4] Implements the Windows Hypervisor Platform accelerator

2018-01-12 Thread Justin Terry (VM) via Qemu-devel
Hello QEMU Community! Over the past few months the Hyper-V team at Microsoft has been working hard on a new user-mode API for our hypervisor that will be released as part of the upcoming SDK. This new API adds user-mode capabilities to create and manage partitions at the hypervisor level,

[Qemu-devel] [PATCH 3/4] Introduce the WHPX impl

2018-01-12 Thread Justin Terry (VM) via Qemu-devel
Implements the Windows Hypervisor Platform accelerator (WHPX) target. Which acts as a hypervisor accelerator for QEMU on the Windows platform. This enables QEMU much greater speed over the emulated x86_64 path's that are taken on Windows today. 1. Adds support for vPartition management. 2. Adds

[Qemu-devel] [PATCH 2/4] Add the WHPX vcpu API

2018-01-12 Thread Justin Terry (VM) via Qemu-devel
Adds support for the Windows Hypervisor Platform accelerator (WHPX) stubs and introduces the whpx.h sysemu API for managing the vcpu scheduling and management. Signed-off-by: Justin Terry (VM) --- accel/stubs/Makefile.objs | 9 + accel/stubs/whpx-stub.c | 48

Re: [Qemu-devel] [PATCH v2 0/4] Updates based on feedback.

2018-01-29 Thread Justin Terry (VM) via Qemu-devel
Hi All, Is there any additional feedback I can address here to help out the process? Please let me know. Thanks again, Justin > -Original Message- > From: Justin Terry (VM) > Sent: Monday, January 22, 2018 1:08 PM > To: qemu-devel@nongnu.org > Cc: pbonz...@redhat.com;

Re: [Qemu-devel] [PATCH v2 0/4] Updates based on feedback.

2018-01-30 Thread Justin Terry (VM) via Qemu-devel
No worries at all Paolo. I was just making sure I didn’t miss something. We have been working on some minor fixups/perf improvements on our end and I will submit those patches after this merges. I figured it would be easier because they will be very small and isolated so easier to review moving

[Qemu-devel] [PATCH 7/8] WHXP Removes the use of WHvGetExitContextSize

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
The use of WHvGetExitContextSize will break ABI compatibility if the platform changes the context size while a qemu compiled executable does not recompile. To avoid this we now use sizeof and let the platform determine which version of the struction was passed for ABI compatibility.

[Qemu-devel] [PATCH 2/8] Resolves WHPX breaking changes in SDK 17095

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
1. Fixes the changes required to the WHvTryMmioEmulation, WHvTryIoEmulation, and WHvEmulatorCreateEmulator based on the new VpContext forwarding. 2. Removes the WHvRunVpExitReasonAlerted case. Signed-off-by: Justin Terry (VM) --- target/i386/whpx-all.c | 26

[Qemu-devel] [PATCH 5/8] Fix WHPX typo in 'mmio'

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
Renames the usage of 'memio' to 'mmio' in the emulator callbacks. Signed-off-by: Justin Terry (VM) --- target/i386/whpx-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index

[Qemu-devel] [PATCH 1/8] Fixing WHPX casing to match SDK

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
Fixes an issue where the SDK that was releases had a different casing for the *.h and *.lib files causing a build break if linked directly from Windows Kits. Signed-off-by: Justin Terry (VM) --- configure | 10 +- target/i386/whpx-all.c | 4 ++-- 2

[Qemu-devel] [PATCH 0/8] WHPX updates based on the 17095 insider sdk.

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
This change set includes fixes for two breaking changes that were introduced in the Windows Insider SDK 17095. First, the casing of the headers/libs changed such that a direct reference out of Windows Kits will fail during compile on case sensitive file systems. Second, a few API's were modified

[Qemu-devel] [PATCH 8/8] WHPX improve interrupt notification registration

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
Improves the usage of the InterruptNotification registration by skipping the additional call to WHvSetVirtualProcessorRegisters if we have already registered for the window exit. Signed-off-by: Justin Terry (VM) --- target/i386/whpx-all.c | 7 +++ 1 file changed, 3

[Qemu-devel] [PATCH 6/8] Fix WHPX issue leaking tpr values

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
Fixes an issue where if the tpr is assigned to the array but not a different value from what is already expected on the vp the code will skip incrementing the reg_count. In this case its possible that we set an invalid memory section of the next call for DeliverabilityNotifications that was not

[Qemu-devel] [PATCH 3/8] Remove unnecessary WHPX __debugbreak();

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
Minor code cleanup. The calls to __debugbreak() are not required and should no longer be used to prevent unnecessary breaks. Signed-off-by: Justin Terry (VM) --- target/i386/whpx-all.c | 12 1 file changed, 12 deletions(-) diff --git a/target/i386/whpx-all.c

[Qemu-devel] [PATCH 4/8] Fix WHPX additional lock acquisition

2018-02-26 Thread Justin Terry (VM) via Qemu-devel
The code already is holding the qemu_mutex for the IO thread. We do not need to additionally take the lock again in this case. Signed-off-by: Justin Terry (VM) --- target/i386/whpx-all.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/whpx-all.c

Re: [Qemu-devel] Problem building QEMU with whpx support

2018-07-09 Thread Justin Terry (VM) via Qemu-devel
Hey Umang, Sorry I missed this. There is no official documentation for building QEMU on WHP as there is really no difference to cross compiling QEMU in general. However, yes you can cross compile this on 18.04 (and other distros). After installing the correct packages (mingw-w64) you will end

Re: [Qemu-devel] [PATCH 0/4] Implements the Windows Hypervisor Platform accelerator

2018-01-16 Thread Justin Terry (VM) via Qemu-devel
Hey Stefan, Again thanks for the feedback. The short answer is that it will be first available on an Windows 10 Insider Preview release: https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewSDK. I just don’t know which one exactly. When this is released I will for sure update

Re: [Qemu-devel] [PATCH 0/4] Implements the Windows Hypervisor Platform accelerator

2018-01-22 Thread Justin Terry (VM) via Qemu-devel
t; Platform accelerator > > Am 18.01.2018 um 00:41 schrieb Justin Terry (VM) via Qemu-devel: > > Hey Paolo, > [...] > > 4. This will be supported on Windows 10 hosts (I don’t have the insider > build number yet) and it will require an Intel processor with VT-x and > Unr

Re: [Qemu-devel] [PATCH 0/4] Implements the Windows Hypervisor Platform accelerator

2018-01-22 Thread Justin Terry (VM) via Qemu-devel
Perfect. Thanks Paolo. Will submit the Patch V2 with your requested changes today. Justin > -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Thursday, January 18, 2018 12:16 AM > To: Justin Terry (VM) > Cc: qemu-devel@nongnu.org

[Qemu-devel] [PATCH v2 4/4] Add the WHPX acceleration enlightenments

2018-01-22 Thread Justin Terry (VM) via Qemu-devel
Implements the WHPX accelerator cpu enlightenments to actually use the whpx-all accelerator on Windows platforms. Signed-off-by: Justin Terry (VM) --- cpus.c| 66 ++- include/sysemu/hw_accel.h | 13 ++

[Qemu-devel] [PATCH v2 1/4] Add the Windows Hypervisor Platform accelerator.

2018-01-22 Thread Justin Terry (VM) via Qemu-devel
Introduces the configure support for the new Windows Hypervisor Platform that allows for hypervisor acceleration from usermode components on the Windows platform. Signed-off-by: Justin Terry (VM) --- configure | 48 +++-

[Qemu-devel] [PATCH v2 0/4] Updates based on feedback.

2018-01-22 Thread Justin Terry (VM) via Qemu-devel
Updates based on review feedback. 1. Fixes style issues and properly ran the scripts/checkpatch pre submission. 2. Added migration blockers for CPUID, dirty memory tracking, and XSAVE/XRSTOR. 3. Fixed some bugs around register states when using bios vs efi. Justin Terry (VM) (4): Add the

[Qemu-devel] [PATCH v2 3/4] Introduce the WHPX impl

2018-01-22 Thread Justin Terry (VM) via Qemu-devel
Implements the Windows Hypervisor Platform accelerator (WHPX) target. Which acts as a hypervisor accelerator for QEMU on the Windows platform. This enables QEMU much greater speed over the emulated x86_64 path's that are taken on Windows today. 1. Adds support for vPartition management. 2. Adds

[Qemu-devel] [PATCH v2 2/4] Add the WHPX vcpu API

2018-01-22 Thread Justin Terry (VM) via Qemu-devel
Adds support for the Windows Hypervisor Platform accelerator (WHPX) stubs and introduces the whpx.h sysemu API for managing the vcpu scheduling and management. Signed-off-by: Justin Terry (VM) --- accel/stubs/Makefile.objs | 9 + accel/stubs/whpx-stub.c | 48

[Qemu-devel] [PATCH 2/3] WHPX fix WHvSetPartitionProperty in PropertyCode

2018-03-14 Thread Justin Terry (VM) via Qemu-devel
This fixes a breaking change to WHvSetPartitionProperty to pass the 'in' PropertyCode on function invocation introduced in Windows Insider SDK 17110. Usage of this indicates the PropertyCode of the opaque PropertyBuffer passed in on function invocation. Also fixes the removal of the PropertyCode

[Qemu-devel] [PATCH 0/3] WHPX introduce changes for Windows Insider SDK 17110

2018-03-14 Thread Justin Terry (VM) via Qemu-devel
This change set fixes two breaking changes that were introduced in the Windows Insider SDK 17110. First, a change to the WHvGetCapability function decl to include the 'out' WrittenSizeInBytes. Second, changes to the WHvSetPartitionProperty function decl and WHV_PARTITION_PROPERTY structure to

[Qemu-devel] [PATCH 1/3] WHPX fix WHvGetCapability out WrittenSizeInBytes

2018-03-14 Thread Justin Terry (VM) via Qemu-devel
This fixes a breaking change to WHvGetCapability to include the 'out' WrittenSizeInBytes introduced in Windows Insider SDK 17110. This specifies on return the safe length to read into the WHV_CAPABILITY structure passed to the call. Signed-off-by: Justin Terry (VM) ---

[Qemu-devel] [PATCH 3/3] WHPX improve vcpu_post_run perf

2018-03-14 Thread Justin Terry (VM) via Qemu-devel
This removes the additional call to WHvGetVirtualProcessorRegisters in whpx_vcpu_post_run now that the WHV_VP_EXIT_CONTEXT is returned in all WHV_RUN_VP_EXIT_CONTEXT structures. Signed-off-by: Justin Terry (VM) --- target/i386/whpx-all.c | 41

Re: [Qemu-devel] [PATCH] WHPX fixes an issue with CPUID 1 not returning CPUID_EXT_HYPERVISOR

2018-04-16 Thread Justin Terry (VM) via Qemu-devel
Hey Eduardo/Paolo, I have not forgotten about your responses. I am working out how best to do this in our platform and will send a follow up patch (this one is already merged) to fully support the -cpu flag. It looks like all the pieces are in place between the two and we just need a bit of

Re: [Qemu-devel] [PATCH] WHPX fixes an issue with CPUID 1 not returning CPUID_EXT_HYPERVISOR

2018-03-28 Thread Justin Terry (VM) via Qemu-devel
Hey Eduardo Responses inline. Thanks! > -Original Message- > From: Eduardo Habkost > Sent: Wednesday, March 28, 2018 10:51 AM > To: Justin Terry (VM) > Cc: qemu-devel@nongnu.org; pbonz...@redhat.com; r...@twiddle.net > Subject: Re: [PATCH]

[Qemu-devel] [PATCH] WHPX fixes an issue with CPUID 1 not returning CPUID_EXT_HYPERVISOR

2018-03-26 Thread Justin Terry (VM) via Qemu-devel
Implements the CPUID trap for CPUID 1 to include the CPUID_EXT_HYPERVISOR flag in the ECX results. This was preventing some older linux kernels from booting when trying to access MSR's that dont make sense when virtualized. Signed-off-by: Justin Terry (VM) ---

Re: [Qemu-devel] [PATCH 0/3] WHPX introduce changes for Windows Insider SDK 17110

2019-01-23 Thread Justin Terry (VM) via Qemu-devel
17, 2019 12:38 PM > To: Justin Terry (VM) ; qemu-devel@nongnu.org > Cc: pbonz...@redhat.com; ehabk...@redhat.com; r...@twiddle.net > Subject: Re: [Qemu-devel] [PATCH 0/3] WHPX introduce changes for > Windows Insider SDK 17110 > > Am 14.03.2018 um 15:52 schrieb Justi

Re: [Qemu-devel] [PATCH for 4.1] Fix broken build with WHPX enabled

2019-07-15 Thread Justin Terry (VM) via Qemu-devel
Thanks Philippe, LGTM (not a maintainer) FYI here are some docs on WHvSetPartitionProperty method. I know they aren’t comprehensive but they help: https://docs.microsoft.com/en-us/virtualization/api/hypervisor-platform/funcs/whvsetpartitionproperty Not sure if you are asking for something with