ell.
Suggested-by: Paolo Bonzini
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 8
1 file changed, 8 insertions(+)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index 519fe84f2100..c209f1232928 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x8
clone of "kernel-starship-5.11"
Maxim Levitsky (4):
KVM: x86: determine if an exception has an error code only when
injecting it.
KVM: x86: mmu: initialize fault.async_page_fault in walk_addr_generic
KVM: x86: pending exception must be be injected even with an injected
e
A page fault can be queued while vCPU is in real paged mode on AMD, and
AMD manual asks the user to always intercept it
(otherwise result is undefined).
The resulting VM exit, does have an error code.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/x86.c | 13 +
1 file changed, 9
This field was left uninitialized by a mistake.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/mmu/paging_tmpl.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index d9f66cc459e84..3dc9a25772bd8 100644
--- a/arch/x86/kvm/mmu
Injected events should not block a pending exception, but rather,
should either be lost or be delivered to the nested hypervisor as part of
exitintinfo/IDT_VECTORING_INFO
(if nested hypervisor intercepts the pending exception)
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 7
Signed-off-by: Maxim Levitsky
---
arch/x86/include/asm/kvm_host.h | 23 +-
arch/x86/include/uapi/asm/kvm.h | 14 +-
arch/x86/kvm/svm/nested.c | 62 +++---
arch/x86/kvm/svm/svm.c | 8 +-
arch/x86/kvm/vmx/nested.c | 114 +-
arch/x86/kvm/vmx/vmx.c | 14
On Thu, 2021-02-25 at 17:41 +0200, Maxim Levitsky wrote:
> clone of "kernel-starship-5.11"
>
> Maxim Levitsky (4):
> KVM: x86: determine if an exception has an error code only when
> injecting it.
> KVM: x86: mmu: initialize fault.async_page_fault in wa
On Thu, 2021-02-25 at 17:05 +0100, Paolo Bonzini wrote:
> On 25/02/21 16:41, Maxim Levitsky wrote:
> > Injected events should not block a pending exception, but rather,
> > should either be lost or be delivered to the nested hypervisor as part of
> > exitintinfo/IDT_VECTORIN
On Thu, 2021-03-18 at 16:35 +, Sean Christopherson wrote:
> On Thu, Mar 18, 2021, Joerg Roedel wrote:
> > On Thu, Mar 18, 2021 at 11:24:25AM +0200, Maxim Levitsky wrote:
> > > But again this is a debug feature, and it is intended to allow the user
> > > t
s nested migration of 32 bit nested guests which was broken due
to incorrect cached values of these msrs being read if L1 changed these
msrs with vmload prior to L2 entry.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 97 --
arch/x86/kvm/svm/sv
This is similar to existing 'guest_cpuid_is_amd_or_hygon'
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/cpuid.h | 8
1 file changed, 8 insertions(+)
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
index 2a0c5064497f3..ded84d244f19f 100644
--- a/arch/x86/kvm/cpu
ual vmload/save is
force disabled.
Best regards,
Maxim Levitsky
Maxim Levitsky (2):
KVM: x86: add guest_cpuid_is_intel
KVM: nSVM: improve SYSENTER emulation on AMD
arch/x86/kvm/cpuid.h | 8
arch/x86/kvm/svm/svm.c | 97 --
arch/x86/kvm
On Mon, 2021-03-15 at 18:56 +0100, Paolo Bonzini wrote:
> On 15/03/21 18:43, Maxim Levitsky wrote:
> > + if (!guest_cpuid_is_intel(vcpu)) {
> > + /*
> > +* If hardware supports Virtual VMLOAD VMSAVE then enable it
> > +* in VMCB an
feature on Intel as well.
Best regards,
Maxim Levitsky
Maxim Levitsky (3):
scripts/gdb: rework lx-symbols gdb script
KVM: x86: guest debug: don't inject interrupts while single stepping
KVM: SVM: allow to intercept all exceptions for debug
arch/x86/include/asm/kvm_host.h | 2 +
st kernel panic as soon as it skips over the 'int3'
instruction and executes the garbage tail of the optcode on which
the breakpoint was placed.
Signed-off-by: Maxim Levitsky
---
kernel/module.c | 8 ++-
scripts/gdb/linux/symbols.py | 106 +
ge is only active when guest is debugged, it won't affect
KVM running normal 'production' VMs.
Signed-off-by: Maxim Levitsky
Tested-by: Stefano Garzarella
---
arch/x86/kvm/x86.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/
s is based on an idea first shown here:
https://patchwork.kernel.org/project/kvm/patch/20160301192822.gd22...@pd.tnic/
CC: Borislav Petkov
Signed-off-by: Maxim Levitsky
---
arch/x86/include/asm/kvm_host.h | 2 +
arch/x86/kvm/svm/svm.c | 77 -
arch/x86/kvm
On Tue, 2021-03-16 at 09:16 +0100, Paolo Bonzini wrote:
> On 15/03/21 19:19, Maxim Levitsky wrote:
> > On Mon, 2021-03-15 at 18:56 +0100, Paolo Bonzini wrote:
> > > On 15/03/21 18:43, Maxim Levitsky wrote:
> > > > +
On Tue, 2021-03-16 at 09:32 +0100, Joerg Roedel wrote:
> Hi Maxim,
>
> On Tue, Mar 16, 2021 at 12:10:20AM +0200, Maxim Levitsky wrote:
> > -static int (*const svm_exit_handlers[])(struct kvm_vcpu *vcpu) = {
> > +static int (*svm_exit_handlers[])(struct kvm_vcpu *vcpu) = {
&
On Mon, 2021-03-15 at 16:37 -0700, Sean Christopherson wrote:
> On Tue, Mar 16, 2021, Maxim Levitsky wrote:
> > This change greatly helps with two issues:
> >
> > * Resuming from a breakpoint is much more reliable.
> >
> > When resuming execution from a br
On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote:
> On 16.03.21 00:37, Sean Christopherson wrote:
> > On Tue, Mar 16, 2021, Maxim Levitsky wrote:
> > > This change greatly helps with two issues:
> > >
> > > * Resuming from a breakpoint is much more re
On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrote:
> On 16.03.21 11:59, Maxim Levitsky wrote:
> > On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote:
> > > On 16.03.21 00:37, Sean Christopherson wrote:
> > > > On Tue, Mar 16, 2021, Maxim Levitsky wrote:
> >
On Tue, 2021-03-16 at 14:38 +0100, Jan Kiszka wrote:
> On 15.03.21 23:10, Maxim Levitsky wrote:
> > Fix several issues that are present in lx-symbols script:
> >
> > * Track module unloads by placing another software breakpoint at
> > 'free_module'
> >
On Tue, 2021-03-16 at 14:46 +0100, Jan Kiszka wrote:
> On 16.03.21 13:34, Maxim Levitsky wrote:
> > On Tue, 2021-03-16 at 12:27 +0100, Jan Kiszka wrote:
> > > On 16.03.21 11:59, Maxim Levitsky wrote:
> > > > On Tue, 2021-03-16 at 10:16 +0100, Jan Kiszka wrote:
>
On Tue, 2021-03-16 at 18:01 +0100, Jan Kiszka wrote:
> On 16.03.21 17:50, Sean Christopherson wrote:
> > On Tue, Mar 16, 2021, Maxim Levitsky wrote:
> > > On Tue, 2021-03-16 at 16:31 +0100, Jan Kiszka wrote:
> > > > Back then, when I was hacking on the gdb-stub and KV
On Thu, 2021-03-18 at 10:19 +0100, Joerg Roedel wrote:
> On Tue, Mar 16, 2021 at 12:51:20PM +0200, Maxim Levitsky wrote:
> > I agree but what is wrong with that?
> > This is a debug feature, and it only can be enabled by the root,
> > and so someone might actually wan
Replace svm_vcpu_init_msrpm with svm_vcpu_alloc_msrpm, that also allocates
the msr bitmap and add svm_vcpu_free_msrpm to free it.
This will be used later to move the nested msr permission bitmap allocation
to nested.c
No functional change intended.
Signed-off-by: Maxim Levitsky
---
arch/x86
this currently.
Best regards,
Maxim Levitsky
Maxim Levitsky (8):
KVM: SVM: rename a variable in the svm_create_vcpu
KVM: nSVM: rename nested 'vmcb' to vmcb_gpa in few places
KVM: SVM: refactor msr permission bitmap allocation
KVM: x86: allow kvm_x86_ops.set_efer to r
The 'page' is to hold the vcpu's vmcb so name it as such to
avoid confusion.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 03dd7bac803
This will be used later to return an error when setting this msr fails.
For VMX, it already has an error condition when EFER is
not in the shared MSR list, so return an error in this case.
Signed-off-by: Maxim Levitsky
---
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/kvm/svm/svm.c
This way we don't waste memory on VMs which don't enable
nesting virtualization
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 43 +++
arch/x86/kvm/svm/svm.c| 62 +++
arch/x86/kvm/svm/svm.h| 6 +++
No functional change intended other that slightly higher memory usage,
since this patch doesn't touch the data area of the cached vmcb.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 96 +++
arch/x86/kvm/svm/svm.c| 10 ++--
arch/x86/kvm/sv
c the updated save state area of the guest,
to the cache, although this is probably overkill.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 131 ++
arch/x86/kvm/svm/svm.c| 6 +-
arch/x86/kvm/svm/svm.h| 4 +-
3 files changed, 97 inser
This allows us to only read fields that are marked as dirty by the nested
guest on vmentry.
I doubt that this has any perf impact but this way it is a bit closer
to real hardware.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 58 +--
arch/x86
No functional changes.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 10 +-
arch/x86/kvm/svm/svm.c| 13 +++--
arch/x86/kvm/svm/svm.h| 2 +-
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm
On Thu, 2020-08-20 at 12:19 +0200, Paolo Bonzini wrote:
> On 20/08/20 12:00, Maxim Levitsky wrote:
> > > Please use vmcb12_gpa, and svm->nested.vmcb12 for the VMCB in patch 6.
> > >
> > > (You probably also what to have local variables named vmcb12 in patc
On Thu, 2020-08-20 at 12:18 +0200, Paolo Bonzini wrote:
> On 20/08/20 12:05, Maxim Levitsky wrote:
> > > You probably should set clean to 0 also if the guest doesn't have the
> > > VMCBCLEAN feature (so, you first need an extra patch to add the
> > > VMCBCLE
On Thu, 2020-08-20 at 12:01 +0200, Paolo Bonzini wrote:
> On 20/08/20 11:13, Maxim Levitsky wrote:
> > + u32 clean = nested_vmcb->control.clean;
> > +
> > + if (svm->nested.vmcb_gpa != vmcb_gpa) {
> > + svm->nested.vmcb_gpa = vmcb_gpa;
> >
On Thu, 2020-08-20 at 12:56 +0200, Paolo Bonzini wrote:
> On 20/08/20 12:23, Maxim Levitsky wrote:
> > I fully agree that adding local variable is a good idea anyway.
> >
> > I was just noting that svm->nested.vmcb is already about the nested
> > (e.g vmcb12) thus I
On Thu, 2020-08-20 at 11:56 +0200, Paolo Bonzini wrote:
> On 20/08/20 11:13, Maxim Levitsky wrote:
> > No functional changes.
> >
> > Signed-off-by: Maxim Levitsky
> > ---
> > arch/x86/kvm/svm/nested.c | 10 +-
> > arch/x86/kvm/svm/svm.c| 13 ++
On Thu, 2020-08-20 at 11:58 +0200, Paolo Bonzini wrote:
> On 20/08/20 11:13, Maxim Levitsky wrote:
> > @@ -3912,6 +3914,14 @@ static int svm_pre_leave_smm(struct kvm_vcpu *vcpu,
> > const char *smstate)
> > vmcb_gpa = GET_SMSTATE(u64, smstate, 0x7ee0);
&g
On Thu, 2020-08-20 at 11:55 +0200, Paolo Bonzini wrote:
> On 20/08/20 11:13, Maxim Levitsky wrote:
> > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> > index 06668e0f93e7..f0bb7f622dca 100644
> > --- a/arch/x86/kvm/svm/svm.c
> > +++ b/arch/x86/kvm/svm/s
ts, in one case even with
L3 running, but note that due to unrelated issue, migration with nested
guest running didn't work for me with or without this series.
I am investigating this currently.
Best regards,
Maxim Levitsky
Maxim Levitsky (7):
KVM: SVM: rename a variable in the svm_c
This way we don't waste memory on VMs which don't enable
nesting virtualization
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 43 ++
arch/x86/kvm/svm/svm.c| 56 +--
arch/x86/kvm/svm/svm.h| 6
No functional changes.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 10 +-
arch/x86/kvm/svm/svm.c| 13 +++--
arch/x86/kvm/svm/svm.h| 2 +-
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm
s are probably redundant, since the code sets them to fixed
value, but it won't hurt to have them
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/emulate.c | 22 +-
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emula
indicate
emulation failure which should triple fault the guest.
* Check that that guest CPUID supports SVM (due to the same issue as above)
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 29 ++---
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git
The 'page' is to hold the vcpu's vmcb so name it as such to
avoid confusion.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 03dd7bac803
This will be used later to return an error when setting this msr fails.
For VMX, it already has an error condition when EFER is
not in the shared MSR list, so return an error in this case.
Signed-off-by: Maxim Levitsky
---
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/kvm/svm/svm.c
Replace svm_vcpu_init_msrpm with svm_vcpu_alloc_msrpm, that also allocates
the msr bitmap and add svm_vcpu_free_msrpm to free it.
This will be used later to move the nested msr permission bitmap allocation
to nested.c
No functional change intended.
Signed-off-by: Maxim Levitsky
---
arch/x86
On Thu, 2020-08-20 at 17:43 -0700, Sean Christopherson wrote:
> On Thu, Aug 20, 2020 at 02:43:56PM -0700, Jim Mattson wrote:
> > On Thu, Aug 20, 2020 at 6:34 AM Maxim Levitsky wrote:
> > > This will be used later to return an error when setting this msr fails.
> > >
&g
never setup nesed msr bitmap on nested
state load after migration.
Patch #3 was 'migrated' ;-) from my other patch series to make it smaller,
which is about more strict checks when we about to return to a nested guest,
from SMM.
Best regards,
Maxim Levitsky
Maxim Levitsky (3):
area, and so indicate
emulation failure which should triple fault the guest.
* Check that that guest CPUID supports SVM (due to the same issue as above)
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 29 ++---
1 file changed, 18 insertions(+), 11 deletions
the vmcb).
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index fb68467e60496..95fdf068fe4c1 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/
This code was missing and was forcing the L2 run with L1's msr
permission bitmap
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index 95fdf068fe4c1..e90bc436f5849 1
ested.
Best regards,
Maxim Levitsky
Maxim Levitsky (8):
KVM: SVM: rename a variable in the svm_create_vcpu
KVM: nSVM: rename nested vmcb to vmcb12
KVM: SVM: refactor msr permission bitmap allocation
KVM: SVM: use __GFP_ZERO instead of clear_page
KVM: SVM: refactor exit labels in svm_cr
Another small refactoring.
Suggested-by: Jim Mattson
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index ddbb05614af4f..290b2d0cd78e3 100644
--- a/arch/x86/kvm
The 'page' is to hold the vcpu's vmcb so name it as such to
avoid confusion.
Signed-off-by: Maxim Levitsky
Reviewed-by: Jim Mattson
---
arch/x86/kvm/svm/svm.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/
This is to be more consistient with VMX, and to support
upcoming addition of vmcb02
Hopefully no functional changes.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 225 +++---
arch/x86/kvm/svm/svm.c| 10 +-
arch/x86/kvm/svm/svm.h| 2
Replace svm_vcpu_init_msrpm with svm_vcpu_alloc_msrpm, that also allocates
the msr bitmap and add svm_vcpu_free_msrpm to free it.
This will be used later to move the nested msr permission bitmap allocation
to nested.c
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 45
This way we don't waste memory on VMs which don't use
nesting virtualization even if it is available to them.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 42 +++
arch/x86/kvm/svm/svm.c| 52 +--
ar
Kernel coding style suggests not to use labels like error1,error2
Suggested-by: Jim Mattson
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index
s are probably redundant, since the code sets them to fixed
value, but it won't hurt to have them
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/emulate.c | 22 +-
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emula
This will be used later to return an error when setting this msr fails.
Note that we ignore this return value for qemu initiated writes to
avoid breaking backward compatibility.
Signed-off-by: Maxim Levitsky
---
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/kvm/svm/svm.c | 3
ested.
Best regards,
Maxim Levitsky
Maxim Levitsky (8):
KVM: SVM: rename a variable in the svm_create_vcpu
KVM: nSVM: rename nested vmcb to vmcb12
KVM: SVM: refactor msr permission bitmap allocation
KVM: SVM: use __GFP_ZERO instead of clear_page
KVM: SVM: refactor exit labels in svm_cr
This is to be more consistient with VMX, and to support
upcoming addition of vmcb02
Hopefully no functional changes.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 225 +++---
arch/x86/kvm/svm/svm.c| 10 +-
arch/x86/kvm/svm/svm.h| 2
The 'page' is to hold the vcpu's vmcb so name it as such to
avoid confusion.
Signed-off-by: Maxim Levitsky
Reviewed-by: Jim Mattson
---
arch/x86/kvm/svm/svm.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/
On Thu, 2020-08-27 at 20:04 +0300, Maxim Levitsky wrote:
> This patch series does some refactoring and implements on demand nested state
> area
> This way at least guests that don't use nesting won't waste memory
> on nested state.
>
> This patch series is based on p
Another small refactoring.
Suggested-by: Jim Mattson
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index ddbb05614af4f..290b2d0cd78e3 100644
--- a/arch/x86/kvm
Kernel coding style suggests not to use labels like error1,error2
Suggested-by: Jim Mattson
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index
Replace svm_vcpu_init_msrpm with svm_vcpu_alloc_msrpm, that also allocates
the msr bitmap and add svm_vcpu_free_msrpm to free it.
This will be used later to move the nested msr permission bitmap allocation
to nested.c
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/svm.c | 45
This will be used later to return an error when setting this msr fails.
Note that we ignore this return value for qemu initiated writes to
avoid breaking backward compatibility.
Signed-off-by: Maxim Levitsky
---
arch/x86/include/asm/kvm_host.h | 2 +-
arch/x86/kvm/svm/svm.c | 3
s are probably redundant, since the code sets them to fixed
value, but it won't hurt to have them
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/emulate.c | 22 +-
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emula
This way we don't waste memory on VMs which don't use
nesting virtualization even if it is available to them.
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/svm/nested.c | 42 +++
arch/x86/kvm/svm/svm.c| 52 +--
ar
bled
would eventually crash and show IOMMU errors like that:
AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0055 address=0xfffdf800
flags=0x0008]
Fixes: e52d58d54a321 ("iommu/amd: Use cmpxchg_double() when updating 128-bit
IRTE")
Signed-off-by: Maxim Levitsky
---
drivers/iommu/
that there were several bugs introduced to xconfig recently
due to attempt to support both Qt4 and Qt5. Maybe we should only support one
version?
I tried gconfig even thinking maybe nobody uses xconfig these days
but gconfig seems to lack search function.
Best regards,
Maxim Levitsky
On Sat, 2020-09-12 at 18:32 +0200, Paolo Bonzini wrote:
> On 27/08/20 19:11, Maxim Levitsky wrote:
> > + hsave_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
> > + if (!hsave_page)
> > + goto error;
> > +
>
> I think an error here should be just
On Mon, 2020-12-07 at 11:29 -0600, Oliver Upton wrote:
> On Thu, Dec 3, 2020 at 11:12 AM Maxim Levitsky wrote:
> > These two new ioctls allow to more precisly capture and
> > restore guest's TSC state.
> >
> > Both ioctls are meant to be used to accurately migra
On Mon, 2020-12-07 at 10:04 -0800, Andy Lutomirski wrote:
> > On Dec 7, 2020, at 9:00 AM, Maxim Levitsky wrote:
> >
> > On Mon, 2020-12-07 at 08:53 -0800, Andy Lutomirski wrote:
> > > > > On Dec 7, 2020, at 8:38 AM, Thomas Gleixner
> > > > > wr
On Mon, 2020-12-07 at 20:29 -0300, Marcelo Tosatti wrote:
> On Thu, Dec 03, 2020 at 07:11:16PM +0200, Maxim Levitsky wrote:
> > These two new ioctls allow to more precisly capture and
> > restore guest's TSC state.
> >
> > Both ioctls are meant to be used to accur
On Tue, 2020-12-08 at 17:02 +0100, Thomas Gleixner wrote:
> On Tue, Dec 08 2020 at 16:50, Maxim Levitsky wrote:
> > On Mon, 2020-12-07 at 20:29 -0300, Marcelo Tosatti wrote:
> > > > +This ioctl allows to reconstruct the guest's IA32_TSC and TSC_ADJUST
> > &
On Tue, 2020-12-08 at 17:40 +0100, Thomas Gleixner wrote:
> On Tue, Dec 08 2020 at 13:13, Maxim Levitsky wrote:
> > On Mon, 2020-12-07 at 11:29 -0600, Oliver Upton wrote:
> > > How would a VMM maintain the phase relationship between guest TSCs
> > > using these io
On Tue, 2020-12-08 at 09:58 -0600, Oliver Upton wrote:
> +cc Sean's new handle
>
> On Tue, Dec 8, 2020 at 9:57 AM Oliver Upton wrote:
> > On Tue, Dec 8, 2020 at 5:13 AM Maxim Levitsky wrote:
> > > On Mon, 2020-12-07 at 11:29 -0600, Oliver Upton wrote:
> >
On Mon, 2020-11-30 at 16:16 -0300, Marcelo Tosatti wrote:
> Hi Maxim,
>
> On Mon, Nov 30, 2020 at 03:35:57PM +0200, Maxim Levitsky wrote:
> > Hi!
> >
> > This is the first version of the work to make TSC migration more accurate,
> > as was defined by Paulo at:
On Sun, 2020-12-06 at 17:19 +0100, Thomas Gleixner wrote:
> On Thu, Dec 03 2020 at 19:11, Maxim Levitsky wrote:
> > + case KVM_SET_TSC_STATE: {
> > + struct kvm_tsc_state __user *user_tsc_state = argp;
> > + struct kvm_tsc_state tsc_state;
> &g
On Thu, 2020-12-03 at 17:18 -0300, Marcelo Tosatti wrote:
> On Thu, Dec 03, 2020 at 01:39:42PM +0200, Maxim Levitsky wrote:
> > On Tue, 2020-12-01 at 16:48 -0300, Marcelo Tosatti wrote:
> > > On Tue, Dec 01, 2020 at 02:30:39PM +0200, Maxim Levitsky wrote:
> > > > On
On Mon, 2020-12-07 at 08:53 -0800, Andy Lutomirski wrote:
> > On Dec 7, 2020, at 8:38 AM, Thomas Gleixner wrote:
> >
> > On Mon, Dec 07 2020 at 14:16, Maxim Levitsky wrote:
> > > > On Sun, 2020-12-06 at 17:19 +0100, Thomas Gleixner wrote:
> > >
On Tue, 2020-12-01 at 20:35 +0100, Thomas Gleixner wrote:
> On Mon, Nov 30 2020 at 15:35, Maxim Levitsky wrote:
> > The idea of masterclock is that when the host TSC is synchronized
> > (or as kernel call it, stable), and the guest TSC is synchronized as well,
> > then we can
st regards,
Maxim Levitsky
Maxim Levitsky (1):
KVM: x86: ignore SIPIs that are received while not in wait-for-sipi
state
arch/x86/kvm/lapic.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
--
2.26.2
ccept_events vs check_nested_events")
Signed-off-by: Maxim Levitsky
---
arch/x86/kvm/lapic.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index e3ee597ff5404..6a87623aa578e 100644
--- a/arch/x86/kvm/lapic.c
+++ b/
These two new ioctls allow to more precisly capture and
restore guest's TSC state.
Both ioctls are meant to be used to accurately migrate guest TSC
even when there is a significant downtime during the migration.
Suggested-by: Paolo Bonzini
Signed-off-by: Maxim Levitsky
---
Documentation
Run the test once with quirk enabled and once disabled,
and adjust the expected values accordingly.
Signed-off-by: Maxim Levitsky
---
.../selftests/kvm/x86_64/tsc_msrs_test.c | 79 ---
1 file changed, 69 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests
pping it to 0
- updated tsc_msr_test unit test to cover this feature
- refactoring
Patches to enable this feature in qemu are in the process of
being sent to qemu-devel mailing list.
Best regards,
Maxim Levitsky
Maxim Levitsky (3):
KVM: x86: implement KVM_{GET|SET}_TSC_STATE
KVM: x
sted-by: Paolo Bonzini
Signed-off-by: Maxim Levitsky
---
arch/x86/include/uapi/asm/kvm.h | 1 +
arch/x86/kvm/x86.c | 19 ++-
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 8e76d
ending this to make guest use it
even when bare tsc is used, and also implement whatever logic is
needed to jump the guest clock forward when this bit is set.
What do you think?
Best regards,
Maxim Levitsky
>
> Paolo
>
On Thu, 2020-12-10 at 12:48 +0100, Paolo Bonzini wrote:
> On 08/12/20 18:08, Maxim Levitsky wrote:
> > > Even if you support TSCADJUST and let the guest write to it does not
> > > change the per guest offset at all. TSCADJUST is per [v]CPU and adds on
> > >
On Tue, 2020-12-01 at 20:43 +0100, Thomas Gleixner wrote:
> On Mon, Nov 30 2020 at 15:35, Maxim Levitsky wrote:
> > + struct kvm_tsc_info {
> > + __u32 flags;
> > + __u64 nsec;
> > + __u64 tsc;
> > + __u64 tsc_adjust;
> > + };
> >
On Tue, 2020-12-01 at 16:48 -0300, Marcelo Tosatti wrote:
> On Tue, Dec 01, 2020 at 02:30:39PM +0200, Maxim Levitsky wrote:
> > On Mon, 2020-11-30 at 16:16 -0300, Marcelo Tosatti wrote:
> > > Hi Maxim,
> > >
> > > On Mon, Nov 30, 2020 at 03:35:57PM +02
done with new CPUID bit,
or always when KVM
is detected,
(or even when *any* hypervisor is detected)
I also don't mind if we only disable tsc sync logic or
set X86_FEATURE_TSC_RELIABLE which will disable it
and the clocksource watchdog.
Best regards,
Maxim Levitsky
as well.
> >
> > If the host TSC is not synchronized, then don't even try.
>
> This reminds me: if you’re adding a new kvm feature that tells the guest that
> the TSC works well, could you perhaps only have one structure for all vCPUs
> in the same guest?
I won&
201 - 300 of 540 matches
Mail list logo