We implement Hyper-V SynIC and synthetic timers in KVM too so there's some
room for code sharing.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 69 ++
drivers/hv/hv.c| 2 +-
drivers/hv/hyperv_vmbus.h | 68
We implement Hyper-V SynIC and synthetic timers in KVM too so there's some
room for code sharing.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 69 ++
drivers/hv/hv.c| 2 +-
drivers/hv/hyperv_vmbus.h | 68
stimer_send_msg() takes not less than 1500 cpu cycles and
stimer_notify_direct() can usually be done in 300-400. WS2016 without
Hyper-V, however, always sticks to non-direct version.
Signed-off-by: Vitaly Kuznetsov
---
- Changes since v1: avoid open-coding stimer_mark_pending
-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 12 +++-
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 9533133be566..e6a2a085644a 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -206,7 +206,7 @@ static void
stimer_send_msg() takes not less than 1500 cpu cycles and
stimer_notify_direct() can usually be done in 300-400. WS2016 without
Hyper-V, however, always sticks to non-direct version.
Signed-off-by: Vitaly Kuznetsov
---
- Changes since v1: avoid open-coding stimer_mark_pending
-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 12 +++-
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 9533133be566..e6a2a085644a 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -206,7 +206,7 @@ static void
instead of sending a SynIC message.
Qemu and kvm-unit-test patches for testing this series can be found in
v1 submission:
https://lkml.org/lkml/2018/11/13/972
Vitaly Kuznetsov (4):
x86/hyper-v: move synic/stimer control structures definitions to
hyperv-tlfs.h
x86/kvm/hyper-v: use stimer config
As a preparation to implementing Direct Mode for Hyper-V synthetic
timers switch to using stimer config definition from hyperv-tlfs.h.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 6 --
arch/x86/include/asm/kvm_host.h| 2 +-
arch/x86/kvm/hyperv.c
instead of sending a SynIC message.
Qemu and kvm-unit-test patches for testing this series can be found in
v1 submission:
https://lkml.org/lkml/2018/11/13/972
Vitaly Kuznetsov (4):
x86/hyper-v: move synic/stimer control structures definitions to
hyperv-tlfs.h
x86/kvm/hyper-v: use stimer config
As a preparation to implementing Direct Mode for Hyper-V synthetic
timers switch to using stimer config definition from hyperv-tlfs.h.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 6 --
arch/x86/include/asm/kvm_host.h| 2 +-
arch/x86/kvm/hyperv.c
Ahmed Soliman writes:
> Hello once again,
>
> I noticed that there is still more problems with kvmself test (at
> least on my machine)
>
> Any test that would successfully reach the guest's code immediately
> VMexit by a shutdown.
>
> $ ./vmx_tsc_adjust_test
> Test Assertion Failure
>
Ahmed Soliman writes:
> Hello once again,
>
> I noticed that there is still more problems with kvmself test (at
> least on my machine)
>
> Any test that would successfully reach the guest's code immediately
> VMexit by a shutdown.
>
> $ ./vmx_tsc_adjust_test
> Test Assertion Failure
>
Srinivasan
Acked-by: Jiri Kosina
Signed-off-by: Vitaly Kuznetsov
---
- It seems the patch slipped through the cracks, resending.
---
drivers/hid/hid-hyperv.c | 2 +-
drivers/input/serio/hyperv-keyboard.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drive
Srinivasan
Acked-by: Jiri Kosina
Signed-off-by: Vitaly Kuznetsov
---
- It seems the patch slipped through the cracks, resending.
---
drivers/hid/hid-hyperv.c | 2 +-
drivers/input/serio/hyperv-keyboard.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drive
Ahmed Soliman writes:
> Hello,
> On Thu, Nov 15, 2018 at 4:50 PM Andrew Jones wrote:
>>
>> On Thu, Nov 15, 2018 at 03:36:44PM +0200, Ahmed Soliman wrote:
>> > mmap(NULL, 6291456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
>> > -1, 0) = 0x7f46ea2a1000
>> > madvise(0x7f46ea2a1000, 6291456,
Ahmed Soliman writes:
> Hello,
> On Thu, Nov 15, 2018 at 4:50 PM Andrew Jones wrote:
>>
>> On Thu, Nov 15, 2018 at 03:36:44PM +0200, Ahmed Soliman wrote:
>> > mmap(NULL, 6291456, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
>> > -1, 0) = 0x7f46ea2a1000
>> > madvise(0x7f46ea2a1000, 6291456,
stimer_send_msg() takes not less than 1500 cpu cycles and
stimer_notify_direct() can usually be done in 300-400. WS2016 without
Hyper-V, however, always sticks to non-direct version.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c| 71 +++-
arch/x86/kvm
stimer_send_msg() takes not less than 1500 cpu cycles and
stimer_notify_direct() can usually be done in 300-400. WS2016 without
Hyper-V, however, always sticks to non-direct version.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c| 71 +++-
arch/x86/kvm
Signed-off-by: Vitaly Kuznetsov
---
x86/Makefile.common| 3 +
x86/hyperv.h | 7 ++
x86/hyperv_stimer_direct.c | 250 +
x86/unittests.cfg | 6 +
4 files changed, 266 insertions(+)
create mode 100644 x86
Signed-off-by: Vitaly Kuznetsov
---
linux-headers/linux/kvm.h | 1 +
target/i386/cpu.c | 1 +
target/i386/cpu.h | 1 +
target/i386/hyperv-proto.h | 1 +
target/i386/kvm.c | 11 +++
5 files changed, 15 insertions(+)
diff --git a/linux-headers/linux/kvm.h b
Signed-off-by: Vitaly Kuznetsov
---
x86/Makefile.common| 3 +
x86/hyperv.h | 7 ++
x86/hyperv_stimer_direct.c | 250 +
x86/unittests.cfg | 6 +
4 files changed, 266 insertions(+)
create mode 100644 x86
Signed-off-by: Vitaly Kuznetsov
---
linux-headers/linux/kvm.h | 1 +
target/i386/cpu.c | 1 +
target/i386/cpu.h | 1 +
target/i386/hyperv-proto.h | 1 +
target/i386/kvm.c | 11 +++
5 files changed, 15 insertions(+)
diff --git a/linux-headers/linux/kvm.h b
As a preparation to implementing Direct Mode for Hyper-V synthetic
timers switch to using stimer config definition from hyperv-tlfs.h.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 6 --
arch/x86/include/asm/kvm_host.h| 2 +-
arch/x86/kvm/hyperv.c
As a preparation to implementing Direct Mode for Hyper-V synthetic
timers switch to using stimer config definition from hyperv-tlfs.h.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 6 --
arch/x86/include/asm/kvm_host.h| 2 +-
arch/x86/kvm/hyperv.c
patches for testing purposes.
Vitaly Kuznetsov (3):
x86/hyper-v: move synic/stimer control structures definitions to
hyperv-tlfs.h
x86/kvm/hyper-v: use stimer config definition from hyperv-tlfs.h
x86/kvm/hyper-v: direct mode for synthetic timers
arch/x86/include/asm/hyperv-tlfs.h | 73
We implement Hyper-V SynIC and synthetic timers in KVM too so there's some
room for code sharing.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 69 ++
drivers/hv/hv.c| 2 +-
drivers/hv/hyperv_vmbus.h | 68
patches for testing purposes.
Vitaly Kuznetsov (3):
x86/hyper-v: move synic/stimer control structures definitions to
hyperv-tlfs.h
x86/kvm/hyper-v: use stimer config definition from hyperv-tlfs.h
x86/kvm/hyper-v: direct mode for synthetic timers
arch/x86/include/asm/hyperv-tlfs.h | 73
We implement Hyper-V SynIC and synthetic timers in KVM too so there's some
room for code sharing.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/hyperv-tlfs.h | 69 ++
drivers/hv/hv.c| 2 +-
drivers/hv/hyperv_vmbus.h | 68
Jim Mattson writes:
> I'm not convinced that the "one size fits all" and "context-free"
> approaches to VMCS shadowing are terribly effective.
>
> For example, we never shadow VMX_INSTRUCTION_INFO, but if we just
> reflected an exit to L1 for which that field is defined, there's
> probably a
Jim Mattson writes:
> I'm not convinced that the "one size fits all" and "context-free"
> approaches to VMCS shadowing are terribly effective.
>
> For example, we never shadow VMX_INSTRUCTION_INFO, but if we just
> reflected an exit to L1 for which that field is defined, there's
> probably a
Tianyu Lan writes:
> Hi Vitaly:
> Thanks for your review.
>
> On 11/6/2018 11:50 PM, Vitaly Kuznetsov wrote:
>> ltyker...@gmail.com writes:
>>
>>> From: Lan Tianyu
>>>
>>> This patch is to initialize ept_pointer to INVALID_PAGE and c
Tianyu Lan writes:
> Hi Vitaly:
> Thanks for your review.
>
> On 11/6/2018 11:50 PM, Vitaly Kuznetsov wrote:
>> ltyker...@gmail.com writes:
>>
>>> From: Lan Tianyu
>>>
>>> This patch is to initialize ept_pointer to INVALID_PAGE and c
"Rafael J. Wysocki" writes:
> On Mon, Sep 24, 2018 at 11:24 AM Jiri Kosina wrote:
>>
>> On Wed, 12 Sep 2018, Vitaly Kuznetsov wrote:
>>
>> > It makes little sense but still possible to put Hyper-V guests into
>> > suspend-to-idle state. T
"Rafael J. Wysocki" writes:
> On Mon, Sep 24, 2018 at 11:24 AM Jiri Kosina wrote:
>>
>> On Wed, 12 Sep 2018, Vitaly Kuznetsov wrote:
>>
>> > It makes little sense but still possible to put Hyper-V guests into
>> > suspend-to-idle state. T
ltyker...@gmail.com writes:
> From: Lan Tianyu
>
> This patch is to initialize ept_pointer to INVALID_PAGE and check it
> before flushing ept tlb. If ept_pointer is invalidated, bypass the flush
> request.
>
> Signed-off-by: Lan Tianyu
> ---
> arch/x86/kvm/vmx.c | 16 +---
> 1 file
ltyker...@gmail.com writes:
> From: Lan Tianyu
>
> This patch is to initialize ept_pointer to INVALID_PAGE and check it
> before flushing ept tlb. If ept_pointer is invalidated, bypass the flush
> request.
>
> Signed-off-by: Lan Tianyu
> ---
> arch/x86/kvm/vmx.c | 16 +---
> 1 file
-by: Paolo Bonzini
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 10 +-
arch/x86/kvm/vmx_shadow_fields.h | 5 +
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index abeeb45d1c33..641a65b30685 100644
-by: Paolo Bonzini
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 10 +-
arch/x86/kvm/vmx_shadow_fields.h | 5 +
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index abeeb45d1c33..641a65b30685 100644
Paolo Bonzini writes:
> On 17/10/2018 19:08, Jim Mattson wrote:
>> I believe that ESXi reads GUEST_CS_AR_BYTES on every VM-exit to
>> determine code size.
>
> Which makes me wonder, maybe we should add GUEST_SS_AR_BYTES which is
> where the CPL lives. But then your tests from last year didn't
Paolo Bonzini writes:
> On 17/10/2018 19:08, Jim Mattson wrote:
>> I believe that ESXi reads GUEST_CS_AR_BYTES on every VM-exit to
>> determine code size.
>
> Which makes me wonder, maybe we should add GUEST_SS_AR_BYTES which is
> where the CPL lives. But then your tests from last year didn't
Paolo Bonzini writes:
> On 16/10/2018 18:50, Vitaly Kuznetsov wrote:
>> +if (!hv_evmcs || !(hv_evmcs->hv_clean_fields &
>> + HV_VMX_ENLIGHTENED_CLEAN_FIELD_GUEST_GRP2)) {
>> +vmcs_write16(GUEST_CS_SELECTO
Paolo Bonzini writes:
> On 16/10/2018 18:50, Vitaly Kuznetsov wrote:
>> +if (!hv_evmcs || !(hv_evmcs->hv_clean_fields &
>> + HV_VMX_ENLIGHTENED_CLEAN_FIELD_GUEST_GRP2)) {
>> +vmcs_write16(GUEST_CS_SELECTO
Call Trace:
? __schedule+0x1fe/0x7e0
schedule+0x28/0x80
suspend_devices_and_enter+0x4ac/0x750
pm_suspend+0x2c0/0x310
Register a PM notifier to disable the detector on suspend and re-enable
back on wakeup.
Signed-off-by: Vitaly Kuznetsov
---
Changes since v3:
- Handle PM_RESTORE_PREPARE
Call Trace:
? __schedule+0x1fe/0x7e0
schedule+0x28/0x80
suspend_devices_and_enter+0x4ac/0x750
pm_suspend+0x2c0/0x310
Register a PM notifier to disable the detector on suspend and re-enable
back on wakeup.
Signed-off-by: Vitaly Kuznetsov
---
Changes since v3:
- Handle PM_RESTORE_PREPARE
Call Trace:
? __schedule+0x1fe/0x7e0
schedule+0x28/0x80
suspend_devices_and_enter+0x4ac/0x750
pm_suspend+0x2c0/0x310
Register a PM notifier to disable the detector on suspend and re-enable
back on wakeup.
Signed-off-by: Vitaly Kuznetsov
---
Changes since v2:
- Resurrect 'v1' as zeroing time
Call Trace:
? __schedule+0x1fe/0x7e0
schedule+0x28/0x80
suspend_devices_and_enter+0x4ac/0x750
pm_suspend+0x2c0/0x310
Register a PM notifier to disable the detector on suspend and re-enable
back on wakeup.
Signed-off-by: Vitaly Kuznetsov
---
Changes since v2:
- Resurrect 'v1' as zeroing time
Modify test library and add eVMCS test. This includes nVMX save/restore
testing.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/Makefile |1 +
tools/testing/selftests/kvm/include/evmcs.h | 1098 +
.../selftests/kvm/include/x86_64/vmx.h
Modify test library and add eVMCS test. This includes nVMX save/restore
testing.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/Makefile |1 +
tools/testing/selftests/kvm/include/evmcs.h | 1098 +
.../selftests/kvm/include/x86_64/vmx.h
Add support for get/set of nested state when Enlightened VMCS is in use.
A new KVM_STATE_NESTED_EVMCS flag to indicate eVMCS on the vCPU was enabled
is added.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/uapi/asm/kvm.h | 1 +
arch/x86/kvm/vmx.c | 78
Pick up the latest kvm.h definitions.
Signed-off-by: Vitaly Kuznetsov
---
tools/include/uapi/linux/kvm.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 07548de5c988..a67ea86edb0b 100644
--- a/tools/include/uapi
Add support for get/set of nested state when Enlightened VMCS is in use.
A new KVM_STATE_NESTED_EVMCS flag to indicate eVMCS on the vCPU was enabled
is added.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/uapi/asm/kvm.h | 1 +
arch/x86/kvm/vmx.c | 78
Pick up the latest kvm.h definitions.
Signed-off-by: Vitaly Kuznetsov
---
tools/include/uapi/linux/kvm.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 07548de5c988..a67ea86edb0b 100644
--- a/tools/include/uapi
Split prepare_for_vmx_operation() into prepare_for_vmx_operation() and
load_vmcs() so we can inject GUEST_SYNC() in between.
Signed-off-by: Vitaly Kuznetsov
---
.../selftests/kvm/include/x86_64/vmx.h| 1 +
tools/testing/selftests/kvm/lib/x86_64/vmx.c | 5 +
.../testing/selftests
It is perfectly valid for a guest to do VMXON and not do VMPTRLD. This
state needs to be preserved on migration.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
It is perfectly valid for a guest to do VMXON and not do VMPTRLD. This
state needs to be preserved on migration.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
Split prepare_for_vmx_operation() into prepare_for_vmx_operation() and
load_vmcs() so we can inject GUEST_SYNC() in between.
Signed-off-by: Vitaly Kuznetsov
---
.../selftests/kvm/include/x86_64/vmx.h| 1 +
tools/testing/selftests/kvm/lib/x86_64/vmx.c | 5 +
.../testing/selftests
off-by: Vitaly Kuznetsov
---
arch/x86/kvm/lapic.c | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 79358fd6a71c..3cd227ff807f 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2647,14 +2647,22 @@
off-by: Vitaly Kuznetsov
---
arch/x86/kvm/lapic.c | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 79358fd6a71c..3cd227ff807f 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2647,14 +2647,22 @@
tened VMCS structure for the current L2 guest permanently mapped
from struct nested_vmx instead of mapping it every time.
Suggested-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 115 ++---
1 file changed, 108 insertions(+), 7 deletion
(and
a bit ugly).
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 118 +
1 file changed, 65 insertions(+), 53 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index cfb44acd4291..0b665c74fadc 100644
--- a/arch/x86/kvm/vmx.c
VP assist pages may hold valuable data which needs to be preserved across
migration. Clean PV EOI portion of the data on init, the guest is
responsible for making sure there's no garbage in the rest.
This will be used for nVMX migration, eVMCS address needs to be preserved.
Signed-off-by: Vitaly
tened VMCS structure for the current L2 guest permanently mapped
from struct nested_vmx instead of mapping it every time.
Suggested-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 115 ++---
1 file changed, 108 insertions(+), 7 deletion
(and
a bit ugly).
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 118 +
1 file changed, 65 insertions(+), 53 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index cfb44acd4291..0b665c74fadc 100644
--- a/arch/x86/kvm/vmx.c
VP assist pages may hold valuable data which needs to be preserved across
migration. Clean PV EOI portion of the data on init, the guest is
responsible for making sure there's no garbage in the rest.
This will be used for nVMX migration, eVMCS address needs to be preserved.
Signed-off-by: Vitaly
KVM_CAP_HYPERV_ENLIGHTENED_VMCS. The version is to
be advertised to the nested hypervisor, currently done via a cpuid
leaf for Hyper-V.
Suggested-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Liran Alon
---
arch/x86/include/asm/kvm_host.h | 3 +++
arch/x86/kvm/svm.c | 9
arch/x86
Adds hv_evmcs pointer and implement copy_enlightened_to_vmcs12() and
copy_enlightened_to_vmcs12().
prepare_vmcs02()/prepare_vmcs02_full() separation is not valid for
Enlightened VMCS, do full sync for now.
Suggested-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 440
KVM_CAP_HYPERV_ENLIGHTENED_VMCS. The version is to
be advertised to the nested hypervisor, currently done via a cpuid
leaf for Hyper-V.
Suggested-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Liran Alon
---
arch/x86/include/asm/kvm_host.h | 3 +++
arch/x86/kvm/svm.c | 9
arch/x86
Adds hv_evmcs pointer and implement copy_enlightened_to_vmcs12() and
copy_enlightened_to_vmcs12().
prepare_vmcs02()/prepare_vmcs02_full() separation is not valid for
Enlightened VMCS, do full sync for now.
Suggested-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 440
Split off EVMCS1_UNSUPPORTED_* macros so we can re-use them when
enabling Enlightened VMCS for Hyper-V on KVM.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 108 -
1 file changed, 47 insertions(+), 61 deletions(-)
diff --git a/arch/x86/kvm
Split off EVMCS1_UNSUPPORTED_* macros so we can re-use them when
enabling Enlightened VMCS for Hyper-V on KVM.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/vmx.c | 108 -
1 file changed, 47 insertions(+), 61 deletions(-)
diff --git a/arch/x86/kvm
From: Ladi Prosek
The state related to the VP assist page is still managed by the LAPIC
code in the pv_eoi field.
Signed-off-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Liran Alon
---
arch/x86/kvm/hyperv.c | 23 +--
arch/x86/kvm/hyperv.h | 4
arch
From: Ladi Prosek
The state related to the VP assist page is still managed by the LAPIC
code in the pv_eoi field.
Signed-off-by: Ladi Prosek
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Liran Alon
---
arch/x86/kvm/hyperv.c | 23 +--
arch/x86/kvm/hyperv.h | 4
arch
cpuid
loop in WS2016 with Hyper-V role on KVM: 15200 cycles -> 13700 cycles).
Ladi Prosek (1):
KVM: hyperv: define VP assist page helpers
Vitaly Kuznetsov (12):
KVM: VMX: refactor evmcs_sanitize_exec_ctrls()
KVM: nVMX: add KVM_CAP_HYPERV_ENLIGHTENED_VMCS capability
KVM: nVMX: add enlighten
cpuid
loop in WS2016 with Hyper-V role on KVM: 15200 cycles -> 13700 cycles).
Ladi Prosek (1):
KVM: hyperv: define VP assist page helpers
Vitaly Kuznetsov (12):
KVM: VMX: refactor evmcs_sanitize_exec_ctrls()
KVM: nVMX: add KVM_CAP_HYPERV_ENLIGHTENED_VMCS capability
KVM: nVMX: add enlighten
Paolo Bonzini writes:
> On 13/09/2018 19:05, Vitaly Kuznetsov wrote:
>> It is perfectly valid for a guest to do VMXON and not do VMPTRLD. This
>> state needs to be preserved on migration.
>>
>> Signed-off-by: Vitaly Kuznetsov
>
> Please cover this in state-
Paolo Bonzini writes:
> On 13/09/2018 19:05, Vitaly Kuznetsov wrote:
>> It is perfectly valid for a guest to do VMXON and not do VMPTRLD. This
>> state needs to be preserved on migration.
>>
>> Signed-off-by: Vitaly Kuznetsov
>
> Please cover this in state-
Tianyu Lan writes:
> On Thu, Oct 11, 2018 at 8:18 PM Vitaly Kuznetsov wrote:
>>
>> Tianyu Lan writes:
>>
>> > On Thu, Oct 11, 2018 at 6:32 PM Vitaly Kuznetsov
>> > wrote:
>> >>
>> >> I'm observing random crashes in multi-vCPU
Tianyu Lan writes:
> On Thu, Oct 11, 2018 at 8:18 PM Vitaly Kuznetsov wrote:
>>
>> Tianyu Lan writes:
>>
>> > On Thu, Oct 11, 2018 at 6:32 PM Vitaly Kuznetsov
>> > wrote:
>> >>
>> >> I'm observing random crashes in multi-vCPU
Tianyu Lan writes:
> On Thu, Oct 11, 2018 at 6:32 PM Vitaly Kuznetsov wrote:
>>
>> I'm observing random crashes in multi-vCPU L2 guests running on KVM on
>> Hyper-V. I bisected the issue to the commit 877ad952be3d ("KVM: vmx: Add
>> tlb_remote_flush callbac
Tianyu Lan writes:
> On Thu, Oct 11, 2018 at 6:32 PM Vitaly Kuznetsov wrote:
>>
>> I'm observing random crashes in multi-vCPU L2 guests running on KVM on
>> Hyper-V. I bisected the issue to the commit 877ad952be3d ("KVM: vmx: Add
>> tlb_remote_flush callbac
So apparently, Hyper-V doesn't expect us to pass naked EPTP, only PML4
pointer should be used. Strip off EPT configuration information before
calling into vmx_hv_remote_flush_tlb().
Fixes: 877ad952be3d ("KVM: vmx: Add tlb_remote_flush callback support")
Signed-off-by: Vitaly Kuznetso
So apparently, Hyper-V doesn't expect us to pass naked EPTP, only PML4
pointer should be used. Strip off EPT configuration information before
calling into vmx_hv_remote_flush_tlb().
Fixes: 877ad952be3d ("KVM: vmx: Add tlb_remote_flush callback support")
Signed-off-by: Vitaly Kuznetso
MMU reconfiguration in init_kvm_tdp_mmu()/kvm_init_shadow_mmu() can be
avoided if the source data used to configure it didn't change; enhance
MMU extended role with the required fields and consolidate common code in
kvm_calc_mmu_role_common().
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean
From: Paolo Bonzini
Just inline the contents into the sole caller, kvm_init_mmu is now
public.
Suggested-by: Vitaly Kuznetsov
Signed-off-by: Paolo Bonzini
Reviewed-by: Sean Christopherson
---
arch/x86/include/asm/kvm_host.h | 1 -
arch/x86/kvm/mmu.c | 12
arch/x86
We don't use root page role for nested_mmu, however, optimizing out
re-initialization in case nothing changed is still valuable as this
is done for every nested vmentry.
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean Christopherson
---
arch/x86/kvm/mmu.c | 6 ++
1 file changed, 6
MMU reconfiguration in init_kvm_tdp_mmu()/kvm_init_shadow_mmu() can be
avoided if the source data used to configure it didn't change; enhance
MMU extended role with the required fields and consolidate common code in
kvm_calc_mmu_role_common().
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean
From: Paolo Bonzini
Just inline the contents into the sole caller, kvm_init_mmu is now
public.
Suggested-by: Vitaly Kuznetsov
Signed-off-by: Paolo Bonzini
Reviewed-by: Sean Christopherson
---
arch/x86/include/asm/kvm_host.h | 1 -
arch/x86/kvm/mmu.c | 12
arch/x86
We don't use root page role for nested_mmu, however, optimizing out
re-initialization in case nothing changed is still valuable as this
is done for every nested vmentry.
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean Christopherson
---
arch/x86/kvm/mmu.c | 6 ++
1 file changed, 6
In preparation to MMU reconfiguration avoidance we need a space to
cache source data. As this partially intersects with kvm_mmu_page_role,
create 64bit sized union kvm_mmu_role holding both base and extended data.
No functional change.
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean
In preparation to MMU reconfiguration avoidance we need a space to
cache source data. As this partially intersects with kvm_mmu_page_role,
create 64bit sized union kvm_mmu_role holding both base and extended data.
No functional change.
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean
MMU re-initialization is expensive, in particular,
update_permission_bitmask() and update_pkru_bitmask() are.
Cache the data used to setup shadow EPT MMU and avoid full re-init when
it is unchanged.
Signed-off-by: Vitaly Kuznetsov
Sean Christopherson
---
Changes since v3:
- Use '!!' instead
MMU re-initialization is expensive, in particular,
update_permission_bitmask() and update_pkru_bitmask() are.
Cache the data used to setup shadow EPT MMU and avoid full re-init when
it is unchanged.
Signed-off-by: Vitaly Kuznetsov
Sean Christopherson
---
Changes since v3:
- Use '!!' instead
about 1000 cpu cycles on nested vmexit.
Brief look at SVM makes me think it can be optimized the exact same way,
I'll do this in a separate series.
Paolo Bonzini (1):
x86/kvm/mmu: get rid of redundant kvm_mmu_setup()
Vitaly Kuznetsov (8):
x86/kvm/mmu: make vcpu->mmu a pointer to the cu
Add an option to specify which MMU root we want to free. This will
be used when nested and non-nested MMUs for L1 are split.
Signed-off-by: Vitaly Kuznetsov
Signed-off-by: Paolo Bonzini
Reviewed-by: Sean Christopherson
---
arch/x86/include/asm/kvm_host.h | 3 ++-
arch/x86/kvm/mmu.c
As a preparation to full MMU split between L1 and L2 make vcpu->arch.mmu
a pointer to the currently used mmu. For now, this is always
vcpu->arch.root_mmu. No functional change.
Signed-off-by: Vitaly Kuznetsov
Signed-off-by: Paolo Bonzini
Reviewed-by: Sean Christopherson
---
arch/x86/i
; the improved hit rate is not very important for
single vCPU performance, but it avoids contention on the mmu_lock for
many vCPUs.
On the nested CPUID benchmark, with 16 vCPUs, an L2->L1->L2 vmexit
goes from 42k to 26k cycles.
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean Christop
kvm_init_shadow_ept_mmu() doesn't set get_pdptr() hook and is this
not a problem just because MMU context is already initialized and this
hook points to kvm_pdptr_read(). As we're intended to use a dedicated
MMU for shadow EPT MMU set this hook explicitly.
Signed-off-by: Vitaly Kuznetsov
Signed
; the improved hit rate is not very important for
single vCPU performance, but it avoids contention on the mmu_lock for
many vCPUs.
On the nested CPUID benchmark, with 16 vCPUs, an L2->L1->L2 vmexit
goes from 42k to 26k cycles.
Signed-off-by: Vitaly Kuznetsov
Reviewed-by: Sean Christop
kvm_init_shadow_ept_mmu() doesn't set get_pdptr() hook and is this
not a problem just because MMU context is already initialized and this
hook points to kvm_pdptr_read(). As we're intended to use a dedicated
MMU for shadow EPT MMU set this hook explicitly.
Signed-off-by: Vitaly Kuznetsov
Signed
about 1000 cpu cycles on nested vmexit.
Brief look at SVM makes me think it can be optimized the exact same way,
I'll do this in a separate series.
Paolo Bonzini (1):
x86/kvm/mmu: get rid of redundant kvm_mmu_setup()
Vitaly Kuznetsov (8):
x86/kvm/mmu: make vcpu->mmu a pointer to the cu
901 - 1000 of 4372 matches
Mail list logo