Test MSR exits to userspace
v3 cover Test MSR exits to userspace
This patchset adds additional testing to the series ("Allow user space to restrict and augment MSR emulation") by Alexander Graf <[email protected]>, and supliments the selftest in that series.
This patchset introduces exception handling into the kvm selftest framework which is then used in the test to be able to handle #GPs that are injected into the guest from userspace.
The test focuses on two main areas:
1) It tests the MSR filter API.
2) It tests MSR permission bitmaps.
v1 -> v2:
- Use exception_handlers instead of gs base to pass table to the guest.
- Move unexpected vector assert to processor.c.
v2 -> v3:
- Add stubs for assert_on_unhandled_exception() in aarch64 and s390x.
Aaron Lewis (4):
selftests: kvm: Fix the segment descriptor layout to match the actual
layout
selftests: kvm: Clear uc so UCALL_NONE is being properly reported
selftests: kvm: Add exception handling to selftests
selftests: kvm: Test MSR exiting to userspace
tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 20 +- .../testing/selftests/kvm/include/kvm_util.h | 2 + .../selftests/kvm/include/x86_64/processor.h | 26 +- .../selftests/kvm/lib/aarch64/processor.c | 4 + .../testing/selftests/kvm/lib/aarch64/ucall.c | 3 + tools/testing/selftests/kvm/lib/kvm_util.c | 5 + .../selftests/kvm/lib/kvm_util_internal.h | 2 + .../selftests/kvm/lib/s390x/processor.c | 4 + tools/testing/selftests/kvm/lib/s390x/ucall.c | 3 + .../selftests/kvm/lib/x86_64/handlers.S | 81 +++ .../selftests/kvm/lib/x86_64/processor.c | 117 +++- .../testing/selftests/kvm/lib/x86_64/ucall.c | 3 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 14 files changed, 820 insertions(+), 11 deletions(-) create mode 100644 tools/testing/selftests/kvm/lib/x86_64/handlers.S create mode 100644 tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
Signature · 1 line
2.28.0.1011.ga647a8990f-goog
PATCH v3 1/4 selftests: kvm: Fix the segment descriptor layout to match the actual layout
Fix the layout of 'struct desc64' to match the layout described in the SDM Vol 3, Chapter 3 "Protected-Mode Memory Management", section 3.4.5 "Segment Descriptors", Figure 3-8 "Segment Descriptor". The test added later in this series relies on this and crashes if this layout is not correct.
--- tools/testing/selftests/kvm/include/x86_64/processor.h | 2 +- tools/testing/selftests/kvm/lib/x86_64/processor.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/kvm/include/x86_64/processor.h +1 -1
@@ -59,7 +59,7 @@ struct gpr64_regs {struct desc64 {uint16_t limit0;uint16_t base0; -unsigned base1:8 , s:1 , type:4 , dpl:2 , p:1 ; +unsigned base1:8 , type:4 , s:1 , dpl:2 , p:1 ;unsigned limit1:4 , avl:1 , l:1 , db:1 , g:1 , base2:8 ;uint32_t base3;uint32_t zero1;
tools/testing/selftests/kvm/lib/x86_64/processor.c +2 -1
@@ -392,11 +392,12 @@ static void kvm_seg_fill_gdt_64bit(struct kvm_vm *vm, struct kvm_segment *segp) desc->limit0 = segp->limit &0xFFFF ; desc->base0 = segp->base &0xFFFF ; desc->base1 = segp->base >>16 ; - desc->s = segp->s; desc->type = segp->type; + desc->s = segp->s; desc->dpl = segp->dpl; desc->p = segp->present; desc->limit1 = segp->limit >>16 ; + desc->avl = segp->avl; desc->l = segp->l; desc->db = segp->db; desc->g = segp->g;
Signature · 1 line
2.28.0.1011.ga647a8990f-goog
PATCH v3 2/4 selftests: kvm: Clear uc so UCALL_NONE is being properly reported
In reply to Aaron LewisEnsure the out value 'uc' in get_ucall() is properly reporting UCALL_NONE if the call fails. The return value will be correctly reported, however, the out parameter 'uc' will not be. Clear the struct to ensure the correct value is being reported in the out parameter.
--- tools/testing/selftests/kvm/lib/aarch64/ucall.c | 3 +++ tools/testing/selftests/kvm/lib/s390x/ucall.c | 3 +++ tools/testing/selftests/kvm/lib/x86_64/ucall.c | 3 +++ 3 files changed, 9 insertions(+)
tools/testing/selftests/kvm/lib/aarch64/ucall.c +3 -0
@@ -94,6 +94,9 @@ uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc)struct kvm_run *run =vcpu_state (vm, vcpu_id);struct ucall ucall = {}; +if (uc) +memset (uc,0 ,sizeof (*uc)); +if (run->exit_reason ==KVM_EXIT_MMIO && run->mmio.phys_addr == (uint64_t )ucall_exit_mmio_addr) {vm_vaddr_t gva;
tools/testing/selftests/kvm/lib/s390x/ucall.c +3 -0
@@ -38,6 +38,9 @@ uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc)struct kvm_run *run =vcpu_state (vm, vcpu_id);struct ucall ucall = {}; +if (uc) +memset (uc,0 ,sizeof (*uc)); + if (run->exit_reason == KVM_EXIT_S390_SIEIC && run->s390_sieic.icptcode == 4 && (run->s390_sieic.ipa >> 8) == 0x83 && /* 0x83 means DIAGNOSE */
tools/testing/selftests/kvm/lib/x86_64/ucall.c +3 -0
@@ -40,6 +40,9 @@ uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc)struct kvm_run *run =vcpu_state (vm, vcpu_id);struct ucall ucall = {}; +if (uc) +memset (uc,0 ,sizeof (*uc)); +if (run->exit_reason ==KVM_EXIT_IO && run->io.port ==UCALL_PIO_PORT ) {struct kvm_regs regs;
Signature · 1 line
2.28.0.1011.ga647a8990f-goog
PATCH v3 3/4 selftests: kvm: Add exception handling to selftests
In reply to Aaron LewisAdd the infrastructure needed to enable exception handling in selftests. This allows any of the exception and interrupt vectors to be overridden in the guest.
---
v1 -> v2:
- Use exception_handlers instead of gs base to pass table to the guest.
- Move unexpected vector assert to processor.c.
v2 -> v3:
- Add stubs for assert_on_unhandled_exception() in aarch64 and s390x.
--- tools/testing/selftests/kvm/Makefile | 19 ++- .../testing/selftests/kvm/include/kvm_util.h | 2 + .../selftests/kvm/include/x86_64/processor.h | 24 ++++ .../selftests/kvm/lib/aarch64/processor.c | 4 + tools/testing/selftests/kvm/lib/kvm_util.c | 3 + .../selftests/kvm/lib/kvm_util_internal.h | 2 + .../selftests/kvm/lib/s390x/processor.c | 4 + .../selftests/kvm/lib/x86_64/handlers.S | 81 +++++++++++++ .../selftests/kvm/lib/x86_64/processor.c | 114 +++++++++++++++++- 9 files changed, 244 insertions(+), 9 deletions(-) create mode 100644 tools/testing/selftests/kvm/lib/x86_64/handlers.S
tools/testing/selftests/kvm/Makefile +13 -6
@@ -34,7 +34,7 @@ ifeq ($(ARCH),s390) endif LIBKVM = lib/assert.c lib/elf.c lib/io.c lib/kvm_util.c lib/sparsebit.c lib/test_util.c -LIBKVM_x86_64 = lib/x86_64/processor.c lib/x86_64/vmx.c lib/x86_64/svm.c lib/x86_64/ucall.c +LIBKVM_x86_64 = lib/x86_64/processor.c lib/x86_64/vmx.c lib/x86_64/svm.c lib/x86_64/ucall.c lib/x86_64/handlers.S LIBKVM_aarch64 = lib/aarch64/processor.c lib/aarch64/ucall.c LIBKVM_s390x = lib/s390x/processor.c lib/s390x/ucall.c
@@ -110,14 +110,21 @@ LDFLAGS += -pthread $(no-pie-option) $(pgste-option) include ../lib.mk STATIC_LIBS := $(OUTPUT)/libkvm.a -LIBKVM_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM)) -EXTRA_CLEAN += $(LIBKVM_OBJ) $(STATIC_LIBS) cscope.* +LIBKVM_C := $(filter %.c,$(LIBKVM)) +LIBKVM_S := $(filter %.S,$(LIBKVM)) +LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C)) +LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S)) +EXTRA_CLEAN += $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(STATIC_LIBS) cscope.* + +x := $(shell mkdir -p $(sort $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ)))) +$(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ -x := $(shell mkdir -p $(sort $(dir $(LIBKVM_OBJ)))) -$(LIBKVM_OBJ): $(OUTPUT)/%.o: %.c +$(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@ -$(OUTPUT)/libkvm.a: $(LIBKVM_OBJ) +LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) +$(OUTPUT)/libkvm.a: $(LIBKVM_OBJS) $(AR) crs $@ $^ x := $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS))))
tools/testing/selftests/kvm/include/kvm_util.h +2 -0
@@ -294,6 +294,8 @@ int vm_create_device(struct kvm_vm *vm, struct kvm_create_device *cd);memcpy (&(g), _p,sizeof (g)); \ }) +void assert_on_unhandled_exception (struct kvm_vm *vm,uint32_t vcpuid); +/* Common ucalls */ enum {UCALL_NONE ,
tools/testing/selftests/kvm/include/x86_64/processor.h +24 -0
@@ -36,6 +36,8 @@#define X86_CR4_SMAP (1ul << 21)#define X86_CR4_PKE (1ul << 22) +#define UNEXPECTED_VECTOR_PORT 0xfff0u +/* General Registers in 64-Bit Mode */ struct gpr64_regs {u64 rax;
@@ -239,6 +241,11 @@ static inline struct desc_ptr get_idt(void)return idt; } +static inline void outl (uint16_t port,uint32_t value) +{ + __asm__ __volatile__("outl %%eax, %%dx" : :"d" (port),"a" (value)); +} +#define SET_XMM (__var, __xmm) \ asm volatile("movq %0, %%"#__xmm : : "r"(__var) : #__xmm)
@@ -338,6 +345,23 @@ uint32_t kvm_get_cpuid_max_basic(void);uint32_t kvm_get_cpuid_max_extended (void );void kvm_get_cpu_address_width (unsigned int *pa_bits,unsigned int *va_bits); +struct ex_regs { +uint64_t rax, rcx, rdx, rbx; +uint64_t rbp, rsi, rdi; +uint64_t r8, r9, r10, r11; +uint64_t r12, r13, r14, r15; +uint64_t vector; +uint64_t error_code; +uint64_t rip; +uint64_t cs; +uint64_t rflags; +}; + +void vm_init_descriptor_tables (struct kvm_vm *vm); +void vcpu_init_descriptor_tables (struct kvm_vm *vm,uint32_t vcpuid); +void vm_handle_exception (struct kvm_vm *vm,int vector, +void (*handler)(struct ex_regs *)); +/* * Basic CPU control in CR0 */
tools/testing/selftests/kvm/lib/aarch64/processor.c +4 -0
@@ -350,3 +350,7 @@ void vcpu_args_set(struct kvm_vm *vm, uint32_t vcpuid, unsigned int num, ...)va_end (ap); } + +void assert_on_unhandled_exception (struct kvm_vm *vm,uint32_t vcpuid) +{ +}
tools/testing/selftests/kvm/lib/kvm_util.c +3 -0
@@ -1195,6 +1195,9 @@ int _vcpu_run(struct kvm_vm *vm, uint32_t vcpuid)do { rc =ioctl (vcpu->fd,KVM_RUN ,NULL ); }while (rc ==-1 && errno ==EINTR ); + +assert_on_unhandled_exception (vm, vcpuid); +return rc; }
tools/testing/selftests/kvm/lib/kvm_util_internal.h +2 -0
@@ -50,6 +50,8 @@ struct kvm_vm {vm_paddr_t pgd;vm_vaddr_t gdt;vm_vaddr_t tss; +vm_vaddr_t idt; +vm_vaddr_t handlers; };struct vcpu *vcpu_find (struct kvm_vm *vm,uint32_t vcpuid);
tools/testing/selftests/kvm/lib/s390x/processor.c +4 -0
@@ -241,3 +241,7 @@ void vcpu_dump(FILE *stream, struct kvm_vm *vm, uint32_t vcpuid, uint8_t indent)fprintf (stream,"%*spstate: psw: 0x%.16llx:0x%.16llx\n" , indent,"" , vcpu->state->psw_mask, vcpu->state->psw_addr); } + +void assert_on_unhandled_exception (struct kvm_vm *vm,uint32_t vcpuid) +{ +}
tools/testing/selftests/kvm/lib/x86_64/handlers.S new file +81 -0
81 lines not on this page · raw message
tools/testing/selftests/kvm/lib/x86_64/processor.c +111 -3
132 lines not on this page · raw message
Signature · 1 line
2.28.0.1011.ga647a8990f-goog
Re: [PATCH v3 3/4] selftests: kvm: Add exception handling to selftests
Quoted 6 lines · Aaron Lewis
Add the infrastructure needed to enable exception handling in selftests. This allows any of the exception and interrupt vectors to be overridden in the guest.
Signed-off-by Aaron Lewis <[email protected]>
Alex
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
PATCH v3 4/4 selftests: kvm: Test MSR exiting to userspace
In reply to Aaron LewisAdd a selftest to test that when the ioctl KVM_X86_SET_MSR_FILTER is called with an MSR list, those MSRs exit to userspace.
This test uses 3 MSRs to test this:
1. MSR_IA32_XSS, an MSR the kernel knows about.
2. MSR_IA32_FLUSH_CMD, an MSR the kernel does not know about.
3. MSR_NON_EXISTENT, an MSR invented in this test for the purposes of passing a fake MSR from the guest to userspace. KVM just acts as a pass through.
Userspace is also able to inject a #GP. This is demonstrated when MSR_IA32_XSS and MSR_IA32_FLUSH_CMD are misused in the test. When this happens a #GP is initiated in userspace to be thrown in the guest which is handled gracefully by the exception handling framework introduced earlier in this series.
Tests for the generic instruction emulator were also added. For this to work the module parameter kvm.force_emulation_prefix=1 has to be enabled. If it isn't enabled the tests will be skipped.
A test was also added to ensure the MSR permission bitmap is being set correctly by executing reads and writes of MSR_FS_BASE and MSR_GS_BASE in the guest while alternating which MSR userspace should intercept. If the permission bitmap is being set correctly only one of the MSRs should be coming through at a time, and the guest should be able to read and write the other one directly.
--- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 2 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 4 files changed, 564 insertions(+) create mode 100644 tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
tools/testing/selftests/kvm/.gitignore +1 -0
@@ -15,6 +15,7 @@ /x86_64/vmx_preemption_timer_test /x86_64/svm_vmcall_test /x86_64/sync_regs_test +/x86_64/userspace_msr_exit_test /x86_64/vmx_close_while_nested_test /x86_64/vmx_dirty_log_test /x86_64/vmx_set_nested_state_test
tools/testing/selftests/kvm/Makefile +1 -0
@@ -49,6 +49,7 @@ TEST_GEN_PROGS_x86_64 += x86_64/state_test TEST_GEN_PROGS_x86_64 += x86_64/vmx_preemption_timer_test TEST_GEN_PROGS_x86_64 += x86_64/svm_vmcall_test TEST_GEN_PROGS_x86_64 += x86_64/sync_regs_test +TEST_GEN_PROGS_x86_64 += x86_64/userspace_msr_exit_test TEST_GEN_PROGS_x86_64 += x86_64/vmx_close_while_nested_test TEST_GEN_PROGS_x86_64 += x86_64/vmx_dirty_log_test TEST_GEN_PROGS_x86_64 += x86_64/vmx_set_nested_state_test
tools/testing/selftests/kvm/lib/kvm_util.c +2 -0
@@ -1593,6 +1593,8 @@ static struct exit_reason { {KVM_EXIT_INTERNAL_ERROR, "INTERNAL_ERROR"}, {KVM_EXIT_OSI, "OSI"}, {KVM_EXIT_PAPR_HCALL, "PAPR_HCALL"}, + {KVM_EXIT_X86_RDMSR, "RDMSR"}, + {KVM_EXIT_X86_WRMSR, "WRMSR"}, #ifdef KVM_EXIT_MEMORY_NOT_PRESENT {KVM_EXIT_MEMORY_NOT_PRESENT, "MEMORY_NOT_PRESENT"}, #endif
tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c new file +560 -0
560 lines not on this page · raw message
Signature · 1 line
2.28.0.1011.ga647a8990f-goog
Re: [PATCH v3 4/4] selftests: kvm: Test MSR exiting to userspace
Quoted 30 lines · Aaron Lewis
Add a selftest to test that when the ioctl
KVM_X86_SET_MSR_FILTERis called with an MSR list, those MSRs exit to userspace.This test uses 3 MSRs to test this:
1.MSR_IA32_XSS, an MSR the kernel knows about.
2.MSR_IA32_FLUSH_CMD, an MSR the kernel does not know about.
3.MSR_NON_EXISTENT, an MSR invented in this test for the purposes of passing a fake MSR from the guest to userspace. KVM just acts as a pass through.Userspace is also able to inject a #GP. This is demonstrated when
MSR_IA32_XSSandMSR_IA32_FLUSH_CMDare misused in the test. When this happens a #GP is initiated in userspace to be thrown in the guest which is handled gracefully by the exception handling framework introduced earlier in this series.Tests for the generic instruction emulator were also added. For this to work the module parameter kvm.force_emulation_prefix=1 has to be enabled. If it isn't enabled the tests will be skipped.
A test was also added to ensure the MSR permission bitmap is being set correctly by executing reads and writes of
MSR_FS_BASEandMSR_GS_BASEin the guest while alternating which MSR userspace should intercept. If the permission bitmap is being set correctly only one of the MSRs should be coming through at a time, and the guest should be able to read and write the other one directly.Signed-off-by Aaron Lewis <[email protected]>Reviewed-by Alexander Graf <[email protected]>
Quoted 8 lines
--- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 2 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 4 files changed, 564 insertions(+) create mode 100644 tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
It looks like the rest of this patchset has been accepted upstream. Is this one okay to be taken too?
Paolo Bonzini
maintainerRe: [PATCH v3 4/4] selftests: kvm: Test MSR exiting to userspace
Quoted 10 lines · Aaron Lewis
Quoted 10 lines
Signed-off-by Aaron Lewis<[email protected]>Reviewed-by Alexander Graf<[email protected]>--- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 2 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 4 files changed, 564 insertions(+)create mode 100644
tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
Quoted 3 lines
It looks like the rest of this patchset has been accepted upstream. Is this one okay to be taken too?
I needed more time to understand the overlap between the tests, but yes.
Paolo
Re: [PATCH v3 4/4] selftests: kvm: Test MSR exiting to userspace
Quoted 12 lines · Paolo Bonzini
Quoted 10 lines · Aaron Lewis
Quoted 10 lines
Signed-off-by Aaron Lewis<[email protected]>Reviewed-by Alexander Graf<[email protected]>--- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 2 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 4 files changed, 564 insertions(+)create mode 100644
tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.c
Quoted 8 lines
Quoted 3 lines
It looks like the rest of this patchset has been accepted upstream. Is this one okay to be taken too?
I needed more time to understand the overlap between the tests, but yes.
Paolo
Pinging this thread.
Just wanted to check if this will be upstreamed soon or if there are any questions about it.
Paolo Bonzini
maintainerRe: [PATCH v3 4/4] selftests: kvm: Test MSR exiting to userspace
Quoted 19 lines · Aaron Lewis
Quoted 18 lines · Paolo Bonzini
Quoted 10 lines · Aaron Lewis
Quoted 10 lines
Signed-off-by Aaron Lewis<[email protected]>Reviewed-by Alexander Graf<[email protected]>--- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 2 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 4 files changed, 564 insertions(+)create mode 100644
tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.cQuoted 3 lines
It looks like the rest of this patchset has been accepted upstream. Is this one okay to be taken too?
I needed more time to understand the overlap between the tests, but yes.
Quoted 7 lines
Quoted 2 lines
Paolo
Pinging this thread.
Just wanted to check if this will be upstreamed soon or if there are any questions about it.
Yes, I'm queuing it. Any objections to replacing x86_64/user_msr_test.c completely, since this test is effectively a superset?
Paolo
Re: [PATCH v3 4/4] selftests: kvm: Test MSR exiting to userspace
Quoted 26 lines · Paolo Bonzini
Quoted 24 lines · Aaron Lewis
Quoted 12 lines · Paolo Bonzini
Quoted 10 lines · Aaron Lewis
Quoted 10 lines
Signed-off-by Aaron Lewis<[email protected]>Reviewed-by Alexander Graf<[email protected]>--- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 2 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 4 files changed, 564 insertions(+)create mode 100644
tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.cQuoted 8 lines
Quoted 3 lines
It looks like the rest of this patchset has been accepted upstream. Is this one okay to be taken too?
I needed more time to understand the overlap between the tests, but yes.
Paolo
Pinging this thread.
Quoted 8 lines
Quoted 2 lines
Just wanted to check if this will be upstreamed soon or if there are any questions about it.
Yes, I'm queuing it. Any objections to replacing
x86_64/user_msr_test.ccompletely, since this test is effectively a superset?Paolo
Hi Paolo,
The main difference between the two tests is my test does not exercise the KVM_MSR_FILTER_DEFAULT_DENY flag. If Alex is okay with that test being replaced I'm okay with it. However, I wouldn't be opposed to adding it from user_msr_test.c into mine. That way they are all in one place.
Cheers,
Aaron
Re: [PATCH v3 4/4] selftests: kvm: Test MSR exiting to userspace
Quoted 40 lines · Aaron Lewis
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
Quoted 26 lines · Paolo Bonzini
Quoted 24 lines · Aaron Lewis
Quoted 12 lines · Paolo Bonzini
Quoted 10 lines · Aaron Lewis
Quoted 10 lines
Signed-off-by Aaron Lewis<[email protected]>Reviewed-by Alexander Graf<[email protected]>--- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 2 + .../kvm/x86_64/userspace_msr_exit_test.c | 560 ++++++++++++++++++ 4 files changed, 564 insertions(+) create mode 100644 tools/testing/selftests/kvm/x86_64/userspace_msr_exit_test.cQuoted 8 lines
Quoted 3 lines
It looks like the rest of this patchset has been accepted upstream. Is this one okay to be taken too?
I needed more time to understand the overlap between the tests, but yes.
Paolo
Pinging this thread.
Quoted 8 lines
Quoted 2 lines
Just wanted to check if this will be upstreamed soon or if there are any questions about it.
Yes, I'm queuing it. Any objections to replacing
x86_64/user_msr_test.ccompletely, since this test is effectively a superset?Paolo
Quoted 7 lines
Hi Paolo,
The main difference between the two tests is my test does not exercise the
KVM_MSR_FILTER_DEFAULT_DENYflag. If Alex is okay with that test being replaced I'm okay with it. However, I wouldn't be opposed to adding it fromuser_msr_test.cinto mine. That way they are all in one place.
I think that would be best. Would you happen to have some time to just merge them quickly? It's probably best to first apply both, and then have one patch that merges them. :)
Thanks!
Alex
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Re: [PATCH v3 4/4] selftests: kvm: Test MSR exiting to userspace
Quoted 15 lines
Quoted 7 lines
Quoted 6 lines
Yes, I'm queuing it. Any objections to replacing
x86_64/user_msr_test.ccompletely, since this test is effectively a superset?Paolo
Quoted 7 lines
Hi Paolo,
The main difference between the two tests is my test does not exercise the
KVM_MSR_FILTER_DEFAULT_DENYflag. If Alex is okay with that test being replaced I'm okay with it. However, I wouldn't be opposed to adding it fromuser_msr_test.cinto mine. That way they are all in one place.
Quoted 3 lines
I think that would be best. Would you happen to have some time to just merge them quickly? It's probably best to first apply both, and then have one patch that merges them. :)
Yes, I can merge them.
Quoted 17 lines
Thanks!
Alex
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879