Re: [PATCH 5/6] KVM: SVM: pass a proper reason in kvm_emulate_instruction()

2021-04-14 Thread David Edmondson
On Tuesday, 2021-04-13 at 11:45:52 -07, Aaron Lewis wrote: >> >> > Depending on what you're trying to do with the info, maybe there's a better >> > option. E.g. Aaron is working on a series that includes passing pass the >> > code >> > stream (instruction bytes) to userspace on emulation failure

Re: [PATCH 0/6] KVM: x86: Make the cause of instruction emulation available to user-space

2021-04-13 Thread David Edmondson
On Monday, 2021-04-12 at 11:34:33 -07, Jim Mattson wrote: > On Mon, Apr 12, 2021 at 6:09 AM David Edmondson > wrote: >> >> Instruction emulation happens for a variety of reasons, yet on error >> we have no idea exactly what triggered it. Add a cause of emulation to >&g

Re: [PATCH 5/6] KVM: SVM: pass a proper reason in kvm_emulate_instruction()

2021-04-13 Thread David Edmondson
On Monday, 2021-04-12 at 16:04:02 GMT, Sean Christopherson wrote: > +Aaron > > On Mon, Apr 12, 2021, David Edmondson wrote: >> From: Joao Martins >> >> Declare various causes of emulation and use them as appropriate. >> >> Signed-off-by: Joao Mar

[PATCH 2/6] KVM: x86: pass emulation_reason to handle_emulation_failure()

2021-04-12 Thread David Edmondson
From: Joao Martins Make the emulation_reason available up stack when reporting an emulation failure. Signed-off-by: Joao Martins Signed-off-by: David Edmondson --- arch/x86/kvm/x86.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/x86.c b

[PATCH 4/6] KVM: x86: pass a proper reason to kvm_emulate_instruction()

2021-04-12 Thread David Edmondson
From: Joao Martins Declare various causes of emulation and use them as appropriate. Signed-off-by: Joao Martins Signed-off-by: David Edmondson --- arch/x86/include/asm/kvm_host.h | 6 ++ arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/kvm/x86.c | 5 +++-- 3 files changed

[PATCH 0/6] KVM: x86: Make the cause of instruction emulation available to user-space

2021-04-12 Thread David Edmondson
Instruction emulation happens for a variety of reasons, yet on error we have no idea exactly what triggered it. Add a cause of emulation to the various originators and pass it upstream when emulation fails. Joao originally produced the patches but is busy with other things and I wanted to use it,

[PATCH 6/6] KVM: VMX: pass a proper reason in kvm_emulate_instruction()

2021-04-12 Thread David Edmondson
From: Joao Martins Declare various causes of emulation and use them as appropriate. Signed-off-by: Joao Martins Signed-off-by: David Edmondson --- arch/x86/include/asm/kvm_host.h | 5 + arch/x86/kvm/vmx/vmx.c | 17 + 2 files changed, 14 insertions(+), 8

[PATCH 1/6] KVM: x86: add an emulation_reason to x86_emulate_instruction()

2021-04-12 Thread David Edmondson
From: Joao Martins Emulation can happen for a variety of reasons, yet on error we have no idea exactly what triggered it. Expand x86_emulate_instruction() to carry an @emulation_reason argument. Signed-off-by: Joao Martins Signed-off-by: David Edmondson --- arch/x86/kvm/mmu/mmu.c | 4

[PATCH 5/6] KVM: SVM: pass a proper reason in kvm_emulate_instruction()

2021-04-12 Thread David Edmondson
From: Joao Martins Declare various causes of emulation and use them as appropriate. Signed-off-by: Joao Martins Signed-off-by: David Edmondson --- arch/x86/include/asm/kvm_host.h | 6 ++ arch/x86/kvm/svm/avic.c | 3 ++- arch/x86/kvm/svm/svm.c | 26

[PATCH 3/6] KVM: x86: add emulation_reason to kvm_emulate_instruction()

2021-04-12 Thread David Edmondson
From: Joao Martins Allow kvm_emulate_instruction() callers to provide the cause of instruction emulation, which is then passed along to x86_emulation_instruction(). Signed-off-by: Joao Martins Signed-off-by: David Edmondson --- arch/x86/include/asm/kvm_host.h | 10 -- arch/x86/kvm

Re: [PATCH v5 0/5] KVM: x86: dump_vmcs: don't assume GUEST_IA32_EFER, show MSR autoloads/autosaves

2021-03-29 Thread David Edmondson
On Thursday, 2021-03-18 at 12:08:36 GMT, David Edmondson wrote: > v2: > - Don't use vcpu->arch.efer when GUEST_IA32_EFER is not available (Paolo). > - Dump the MSR autoload/autosave lists (Paolo). > > v3: > - Rebase to master. > - Check only the load controls (Sea

[PATCH v5 0/5] KVM: x86: dump_vmcs: don't assume GUEST_IA32_EFER, show MSR autoloads/autosaves

2021-03-18 Thread David Edmondson
list if it's there (Paulo). - Calculate and show the effective EFER if it is not coming from either the VMCS or the MSR autoload list (Sean). v4: - Ensure that each changeset builds with just the previous set. v5: - Rebase. - Remove some cruft from changeset comments. - Add S-by as approp

[PATCH v5 5/5] KVM: x86: dump_vmcs should include the autoload/autostore MSR lists

2021-03-18 Thread David Edmondson
When dumping the current VMCS state, include the MSRs that are being automatically loaded/stored during VM entry/exit. Suggested-by: Paolo Bonzini Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/vmx

[PATCH v5 4/5] KVM: x86: dump_vmcs should show the effective EFER

2021-03-18 Thread David Edmondson
If EFER is not being loaded from the VMCS, show the effective value by reference to the MSR autoload list or calculation. Suggested-by: Sean Christopherson Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 20 arch/x86/kvm/vmx/vmx.h | 2 +- 2 files changed, 17

[PATCH v5 3/5] KVM: x86: dump_vmcs should consider only the load controls of EFER/PAT

2021-03-18 Thread David Edmondson
When deciding whether to dump the GUEST_IA32_EFER and GUEST_IA32_PAT fields of the VMCS, examine only the VM entry load controls, as saving on VM exit has no effect on whether VM entry succeeds or fails. Suggested-by: Sean Christopherson Signed-off-by: David Edmondson --- arch/x86/kvm/vmx

[PATCH v5 1/5] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-03-18 Thread David Edmondson
t use GUEST_IA32_EFER to decide whether to print the PDPTRs - always do so if the fields exist. Fixes: 4eb64dce8d0a ("KVM: x86: dump VMCS on invalid entry") Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x8

[PATCH v5 2/5] KVM: x86: dump_vmcs should not conflate EFER and PAT presence in VMCS

2021-03-18 Thread David Edmondson
Show EFER and PAT based on their individual entry/exit controls. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index b0ee9d240f73..6ab9e4d69aac

[PATCH v4 5/5] KVM: x86: dump_vmcs should include the autoload/autostore MSR lists

2021-02-24 Thread David Edmondson
When dumping the current VMCS state, include the MSRs that are being automatically loaded/stored during VM entry/exit. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c

[PATCH v4 2/5] KVM: x86: dump_vmcs should not conflate EFER and PAT presence in VMCS

2021-02-24 Thread David Edmondson
Show EFER and PAT based on their individual entry/exit controls. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index ea1b3a671d51..90d677d72502

[PATCH v4 1/5] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-02-24 Thread David Edmondson
t use GUEST_IA32_EFER to decide whether to print the PDPTRs - always do so if the fields exist. Fixes: 4eb64dce8d0a ("KVM: x86: dump VMCS on invalid entry") Signed-off-by: David Edmondson if valid --- arch/x86/kvm/vmx/vmx.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git

[PATCH v4 0/5] KVM: x86: dump_vmcs: don't assume GUEST_IA32_EFER, show MSR autoloads/autosaves

2021-02-24 Thread David Edmondson
list if it's there (Paulo). - Calculate and show the effective EFER if it is not coming from either the VMCS or the MSR autoload list (Sean). v4: - Ensure that each changeset builds with just the previous set. David Edmondson (5): KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER i

[PATCH v4 4/5] KVM: x86: dump_vmcs should show the effective EFER

2021-02-24 Thread David Edmondson
If EFER is not being loaded from the VMCS, show the effective value by reference to the MSR autoload list or calculation. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 20 arch/x86/kvm/vmx/vmx.h | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff

[PATCH v4 3/5] KVM: x86: dump_vmcs should consider only the load controls of EFER/PAT

2021-02-24 Thread David Edmondson
When deciding whether to dump the GUEST_IA32_EFER and GUEST_IA32_PAT fields of the VMCS, examine only the VM entry load controls, as saving on VM exit has no effect on whether VM entry succeeds or fails. Suggested-by: Sean Christopherson Signed-off-by: David Edmondson --- arch/x86/kvm/vmx

Re: [PATCH v3 4/5] KVM: x86: dump_vmcs should show the effective EFER

2021-02-24 Thread David Edmondson
Bah, I will resend the series, as it won't build with patch 4 but without patch 5. On Wednesday, 2021-02-24 at 13:29:18 UTC, David Edmondson wrote: > If EFER is not being loaded from the VMCS, show the effective value by > reference to the MSR autoload list or calculation. > &

Re: [PATCH v2 2/3] KVM: x86: dump_vmcs should not conflate EFER and PAT presence in VMCS

2021-02-24 Thread David Edmondson
On Tuesday, 2021-02-23 at 14:58:29 -08, Sean Christopherson wrote: > On Fri, Feb 19, 2021, David Edmondson wrote: >> Show EFER and PAT based on their individual entry/exit controls. >> >> Signed-off-by: David Edmondson >> --- >> arch/x86/kvm/vmx/vmx.c |

Re: [PATCH v2 1/3] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-02-24 Thread David Edmondson
On Tuesday, 2021-02-23 at 15:13:54 -08, Jim Mattson wrote: > On Tue, Feb 23, 2021 at 2:51 PM Sean Christopherson wrote: >> >> On Fri, Feb 19, 2021, David Edmondson wrote: >> > If the VM entry/exit controls for loading/saving MSR_EFER are either >> > not

[PATCH v3 3/5] KVM: x86: dump_vmcs should consider only the load controls of EFER/PAT

2021-02-24 Thread David Edmondson
When deciding whether to dump the GUEST_IA32_EFER and GUEST_IA32_PAT fields of the VMCS, examine only the VM entry load controls, as saving on VM exit has no effect on whether VM entry succeeds or fails. Suggested-by: Sean Christopherson Signed-off-by: David Edmondson --- arch/x86/kvm/vmx

[PATCH v3 1/5] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-02-24 Thread David Edmondson
t use GUEST_IA32_EFER to decide whether to print the PDPTRs - always do so if the fields exist. Fixes: 4eb64dce8d0a ("KVM: x86: dump VMCS on invalid entry") Signed-off-by: David Edmondson if valid --- arch/x86/kvm/vmx/vmx.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git

[PATCH v3 2/5] KVM: x86: dump_vmcs should not conflate EFER and PAT presence in VMCS

2021-02-24 Thread David Edmondson
Show EFER and PAT based on their individual entry/exit controls. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index ea1b3a671d51..90d677d72502

[PATCH v3 0/5] KVM: x86: dump_vmcs: don't assume GUEST_IA32_EFER, show MSR autoloads/autosaves

2021-02-24 Thread David Edmondson
list if it's there (Paulo). - Calculate and show the effective EFER if it is not coming from either the VMCS or the MSR autoload list (Sean). David Edmondson (5): KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid KVM: x86: dump_vmcs should not conflate EFER and PAT presence

[PATCH v3 4/5] KVM: x86: dump_vmcs should show the effective EFER

2021-02-24 Thread David Edmondson
If EFER is not being loaded from the VMCS, show the effective value by reference to the MSR autoload list or calculation. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c

[PATCH v3 5/5] KVM: x86: dump_vmcs should include the autoload/autostore MSR lists

2021-02-24 Thread David Edmondson
When dumping the current VMCS state, include the MSRs that are being automatically loaded/stored during VM entry/exit. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 25 + arch/x86/kvm/vmx/vmx.h | 2 +- 2 files changed, 22 insertions(+), 5 deletions

[PATCH v2 3/3] KVM: x86: dump_vmcs should include the autoload/autostore MSR lists

2021-02-19 Thread David Edmondson
When dumping the current VMCS state, include the MSRs that are being automatically loaded/stored during VM entry/exit. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 25 + arch/x86/kvm/vmx/vmx.h | 2 +- 2 files changed, 22 insertions(+), 5 deletions

[PATCH v2 2/3] KVM: x86: dump_vmcs should not conflate EFER and PAT presence in VMCS

2021-02-19 Thread David Edmondson
Show EFER and PAT based on their individual entry/exit controls. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 818051c9fa10..25090e3683ca

[PATCH v2 1/3] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-02-19 Thread David Edmondson
t use GUEST_IA32_EFER to decide whether to print the PDPTRs - do so if the EPT is in use and CR4.PAE is set. Fixes: 4eb64dce8d0a ("KVM: x86: dump VMCS on invalid entry") Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff -

[PATCH v2 0/3] KVM: x86: dump_vmcs: don't assume GUEST_IA32_EFER, show MSR autoloads/autosaves

2021-02-19 Thread David Edmondson
v2: - Don't use vcpu->arch.efer when GUEST_IA32_EFER is not available (Paolo). - Show EFER and PAT seperately, as appropriate. - Dump the MSR autoload/autosave lists (Paolo). David Edmondson (3): KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid KVM: x86: dump_vmcs sh

Re: [PATCH] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-02-18 Thread David Edmondson
On Thursday, 2021-02-18 at 14:01:40 +01, Paolo Bonzini wrote: > On 18/02/21 13:56, David Edmondson wrote: >> On Thursday, 2021-02-18 at 12:54:52 +01, Paolo Bonzini wrote: >> >>> On 18/02/21 11:04, David Edmondson wrote: >>>> When dumping the VMCS, retrieve

Re: [PATCH] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-02-18 Thread David Edmondson
On Thursday, 2021-02-18 at 12:54:52 +01, Paolo Bonzini wrote: > On 18/02/21 11:04, David Edmondson wrote: >> When dumping the VMCS, retrieve the current guest value of EFER from >> the kvm_vcpu structure if neither VM_EXIT_SAVE_IA32_EFER or >> VM_ENTRY_LOAD_IA32_EFER is se

[PATCH] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid

2021-02-18 Thread David Edmondson
CS on invalid entry") Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 14 +- arch/x86/kvm/vmx/vmx.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index eb69fef57485..74ea4fe6f35e 100644 --- a/arch/x

[PATCH] KVM: x86: clflushopt should be treated as a no-op by emulation

2020-11-03 Thread David Edmondson
The instruction emulator ignores clflush instructions, yet fails to support clflushopt. Treat both similarly. Fixes: 13e457e0eebf ("KVM: x86: Emulator does not decode clflush well") Signed-off-by: David Edmondson --- arch/x86/kvm/emulate.c | 8 +++- 1 file changed, 7 insert

[PATCH] HID: multitouch: Re-enable trackpoint and buttons on Lenovo X1 Tab gen2

2020-10-16 Thread David Edmondson
Use the FORCE_MULTI_INPUT class and quirk added in commit 40d5bb87377a ("HID: multitouch: enable multi-input as a quirk for some devices") to enable event reporting from both the trackpad and the trackpoint/buttons in the Lenovo X1 Tab gen2. Signed-off-by: David Edmondson --- It se

Re: [RFC PATCH v4 04/10] vfio/pci: let vfio_pci know number of vendor regions and vendor irqs

2020-06-11 Thread David Edmondson
On Thursday, 2020-06-04 at 22:15:42 -04, Yan Zhao wrote: > On Thu, Jun 04, 2020 at 05:25:15PM +0200, Cornelia Huck wrote: >> On Sun, 17 May 2020 22:49:44 -0400 >> Yan Zhao wrote: >> >> > This allows a simpler VFIO_DEVICE_GET_INFO ioctl in vendor driver >> > >> > Cc: Kevin Tian >> > Signed-off-