All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] kvm selftest cleanup
@ 2022-01-18 14:01 Yang Zhong
  2022-01-18 14:01 ` [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header Yang Zhong
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yang Zhong @ 2022-01-18 14:01 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, seanjc, yang.zhong

Patch 1 to sync KVM_CAP_XSAVE2 to 208, and patch 2 only cleanup
processor.c file with tabs as Sean requested before. Those two
patches were based on latest Linux release(commit id: e3a8b6a1e70c).

Yang Zhong (2):
  kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header
  kvm: selftests: Use tabs to replace spaces

 tools/include/uapi/linux/kvm.h                |  2 +-
 .../selftests/kvm/lib/x86_64/processor.c      | 70 +++++++++----------
 2 files changed, 36 insertions(+), 36 deletions(-)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header
  2022-01-18 14:01 [PATCH 0/2] kvm selftest cleanup Yang Zhong
@ 2022-01-18 14:01 ` Yang Zhong
  2022-01-18 16:54   ` Sean Christopherson
  2022-01-18 14:01 ` [PATCH 2/2] kvm: selftests: Use tabs to replace spaces Yang Zhong
  2022-01-19 18:35 ` [PATCH 0/2] kvm selftest cleanup Paolo Bonzini
  2 siblings, 1 reply; 7+ messages in thread
From: Yang Zhong @ 2022-01-18 14:01 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, seanjc, yang.zhong

Need sync KVM_CAP_XSAVE2 from linux header to here.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 tools/include/uapi/linux/kvm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index f066637ee206..63b96839186c 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -1131,7 +1131,7 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
 #define KVM_CAP_ARM_MTE 205
 #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
-#define KVM_CAP_XSAVE2 207
+#define KVM_CAP_XSAVE2 208
 
 #ifdef KVM_CAP_IRQ_ROUTING
 

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] kvm: selftests: Use tabs to replace spaces
  2022-01-18 14:01 [PATCH 0/2] kvm selftest cleanup Yang Zhong
  2022-01-18 14:01 ` [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header Yang Zhong
@ 2022-01-18 14:01 ` Yang Zhong
  2022-01-19 18:35 ` [PATCH 0/2] kvm selftest cleanup Paolo Bonzini
  2 siblings, 0 replies; 7+ messages in thread
From: Yang Zhong @ 2022-01-18 14:01 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, seanjc, yang.zhong

Only cleanup this processor.c by using tabs to replace spaces.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 .../selftests/kvm/lib/x86_64/processor.c      | 70 +++++++++----------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index babb0f28575c..6aaa95b76d81 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -1136,25 +1136,25 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
 	list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0]));
 	list->nmsrs = nmsrs;
 	r = ioctl(vm->kvm_fd, KVM_GET_MSR_INDEX_LIST, list);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MSR_INDEX_LIST, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MSR_INDEX_LIST, r: %i",
+		    r);
 
 	state = malloc(sizeof(*state) + nmsrs * sizeof(state->msrs.entries[0]));
 	r = ioctl(vcpu->fd, KVM_GET_VCPU_EVENTS, &state->events);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_VCPU_EVENTS, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_VCPU_EVENTS, r: %i",
+		    r);
 
 	r = ioctl(vcpu->fd, KVM_GET_MP_STATE, &state->mp_state);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MP_STATE, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MP_STATE, r: %i",
+		    r);
 
 	r = ioctl(vcpu->fd, KVM_GET_REGS, &state->regs);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_REGS, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_REGS, r: %i",
+		    r);
 
 	r = vcpu_save_xsave_state(vm, vcpu, state);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_XSAVE, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_XSAVE, r: %i",
+		    r);
 
 	if (kvm_check_cap(KVM_CAP_XCRS)) {
 		r = ioctl(vcpu->fd, KVM_GET_XCRS, &state->xcrs);
@@ -1163,17 +1163,17 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
 	}
 
 	r = ioctl(vcpu->fd, KVM_GET_SREGS, &state->sregs);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_SREGS, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_SREGS, r: %i",
+		    r);
 
 	if (nested_size) {
 		state->nested.size = sizeof(state->nested_);
 		r = ioctl(vcpu->fd, KVM_GET_NESTED_STATE, &state->nested);
 		TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_NESTED_STATE, r: %i",
-			r);
+			    r);
 		TEST_ASSERT(state->nested.size <= nested_size,
-			"Nested state size too big, %i (KVM_CHECK_CAP gave %i)",
-			state->nested.size, nested_size);
+			    "Nested state size too big, %i (KVM_CHECK_CAP gave %i)",
+			    state->nested.size, nested_size);
 	} else
 		state->nested.size = 0;
 
@@ -1181,12 +1181,12 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
 	for (i = 0; i < nmsrs; i++)
 		state->msrs.entries[i].index = list->indices[i];
 	r = ioctl(vcpu->fd, KVM_GET_MSRS, &state->msrs);
-        TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed MSR was 0x%x)",
-                r, r == nmsrs ? -1 : list->indices[r]);
+	TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed MSR was 0x%x)",
+		    r, r == nmsrs ? -1 : list->indices[r]);
 
 	r = ioctl(vcpu->fd, KVM_GET_DEBUGREGS, &state->debugregs);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_DEBUGREGS, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_DEBUGREGS, r: %i",
+		    r);
 
 	free(list);
 	return state;
@@ -1199,7 +1199,7 @@ void vcpu_load_state(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_x86_state *s
 
 	r = ioctl(vcpu->fd, KVM_SET_SREGS, &state->sregs);
 	TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_SREGS, r: %i",
-                r);
+		    r);
 
 	r = ioctl(vcpu->fd, KVM_SET_MSRS, &state->msrs);
 	TEST_ASSERT(r == state->msrs.nmsrs,
@@ -1214,28 +1214,28 @@ void vcpu_load_state(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_x86_state *s
 
 	r = ioctl(vcpu->fd, KVM_SET_XSAVE, state->xsave);
 	TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_XSAVE, r: %i",
-                r);
+		    r);
 
 	r = ioctl(vcpu->fd, KVM_SET_VCPU_EVENTS, &state->events);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_VCPU_EVENTS, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_VCPU_EVENTS, r: %i",
+		    r);
 
 	r = ioctl(vcpu->fd, KVM_SET_MP_STATE, &state->mp_state);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_MP_STATE, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_MP_STATE, r: %i",
+		    r);
 
 	r = ioctl(vcpu->fd, KVM_SET_DEBUGREGS, &state->debugregs);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_DEBUGREGS, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_DEBUGREGS, r: %i",
+		    r);
 
 	r = ioctl(vcpu->fd, KVM_SET_REGS, &state->regs);
-        TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_REGS, r: %i",
-                r);
+	TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_REGS, r: %i",
+		    r);
 
 	if (state->nested.size) {
 		r = ioctl(vcpu->fd, KVM_SET_NESTED_STATE, &state->nested);
 		TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_NESTED_STATE, r: %i",
-			r);
+			    r);
 	}
 }
 
@@ -1485,14 +1485,14 @@ struct kvm_cpuid2 *vcpu_get_supported_hv_cpuid(struct kvm_vm *vm, uint32_t vcpui
 
 static inline unsigned x86_family(unsigned int eax)
 {
-        unsigned int x86;
+	unsigned int x86;
 
-        x86 = (eax >> 8) & 0xf;
+	x86 = (eax >> 8) & 0xf;
 
-        if (x86 == 0xf)
-                x86 += (eax >> 20) & 0xff;
+	if (x86 == 0xf)
+		x86 += (eax >> 20) & 0xff;
 
-        return x86;
+	return x86;
 }
 
 unsigned long vm_compute_max_gfn(struct kvm_vm *vm)

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header
  2022-01-18 14:01 ` [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header Yang Zhong
@ 2022-01-18 16:54   ` Sean Christopherson
  2022-01-19  1:51     ` Yang Zhong
  0 siblings, 1 reply; 7+ messages in thread
From: Sean Christopherson @ 2022-01-18 16:54 UTC (permalink / raw)
  To: Yang Zhong; +Cc: kvm, pbonzini

On Tue, Jan 18, 2022, Yang Zhong wrote:
> Need sync KVM_CAP_XSAVE2 from linux header to here.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  tools/include/uapi/linux/kvm.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
> index f066637ee206..63b96839186c 100644
> --- a/tools/include/uapi/linux/kvm.h
> +++ b/tools/include/uapi/linux/kvm.h
> @@ -1131,7 +1131,7 @@ struct kvm_ppc_resize_hpt {
>  #define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
>  #define KVM_CAP_ARM_MTE 205
>  #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
> -#define KVM_CAP_XSAVE2 207
> +#define KVM_CAP_XSAVE2 208

Any reason not to opportunistically sync the entire file?  E.g. this diff looks
rather confusing without pulling in KVM_CAP_VM_GPA_BITS (that consumes "207").

>  
>  #ifdef KVM_CAP_IRQ_ROUTING
>  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header
  2022-01-18 16:54   ` Sean Christopherson
@ 2022-01-19  1:51     ` Yang Zhong
  0 siblings, 0 replies; 7+ messages in thread
From: Yang Zhong @ 2022-01-19  1:51 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: kvm, pbonzini, yang.zhong

On Tue, Jan 18, 2022 at 04:54:51PM +0000, Sean Christopherson wrote:
> On Tue, Jan 18, 2022, Yang Zhong wrote:
> > Need sync KVM_CAP_XSAVE2 from linux header to here.
> > 
> > Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> > ---
> >  tools/include/uapi/linux/kvm.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
> > index f066637ee206..63b96839186c 100644
> > --- a/tools/include/uapi/linux/kvm.h
> > +++ b/tools/include/uapi/linux/kvm.h
> > @@ -1131,7 +1131,7 @@ struct kvm_ppc_resize_hpt {
> >  #define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
> >  #define KVM_CAP_ARM_MTE 205
> >  #define KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM 206
> > -#define KVM_CAP_XSAVE2 207
> > +#define KVM_CAP_XSAVE2 208
> 
> Any reason not to opportunistically sync the entire file?  E.g. this diff looks
> rather confusing without pulling in KVM_CAP_VM_GPA_BITS (that consumes "207").
> 

  Thanks Sean, I checked this file history, Arnaldo Carvalho de Melo <acme@redhat.com>,
  who always sync this header with kernel source, so maybe much better if he can do this.

  Please ignore this patch and help review patch 2, thanks!

  Yang
   


> >  
> >  #ifdef KVM_CAP_IRQ_ROUTING
> >  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] kvm selftest cleanup
  2022-01-18 14:01 [PATCH 0/2] kvm selftest cleanup Yang Zhong
  2022-01-18 14:01 ` [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header Yang Zhong
  2022-01-18 14:01 ` [PATCH 2/2] kvm: selftests: Use tabs to replace spaces Yang Zhong
@ 2022-01-19 18:35 ` Paolo Bonzini
  2022-01-20  1:04   ` Yang Zhong
  2 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2022-01-19 18:35 UTC (permalink / raw)
  To: Yang Zhong, kvm; +Cc: seanjc

On 1/18/22 15:01, Yang Zhong wrote:
> Patch 1 to sync KVM_CAP_XSAVE2 to 208, and patch 2 only cleanup
> processor.c file with tabs as Sean requested before. Those two
> patches were based on latest Linux release(commit id: e3a8b6a1e70c).
> 
> Yang Zhong (2):
>    kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header
>    kvm: selftests: Use tabs to replace spaces
> 
>   tools/include/uapi/linux/kvm.h                |  2 +-
>   .../selftests/kvm/lib/x86_64/processor.c      | 70 +++++++++----------
>   2 files changed, 36 insertions(+), 36 deletions(-)
> 

Hi,

I sent a slightly more complete version of both patches.

Thanks,

Paolo


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] kvm selftest cleanup
  2022-01-19 18:35 ` [PATCH 0/2] kvm selftest cleanup Paolo Bonzini
@ 2022-01-20  1:04   ` Yang Zhong
  0 siblings, 0 replies; 7+ messages in thread
From: Yang Zhong @ 2022-01-20  1:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, seanjc, yang.zhong

On Wed, Jan 19, 2022 at 07:35:05PM +0100, Paolo Bonzini wrote:
> On 1/18/22 15:01, Yang Zhong wrote:
> >Patch 1 to sync KVM_CAP_XSAVE2 to 208, and patch 2 only cleanup
> >processor.c file with tabs as Sean requested before. Those two
> >patches were based on latest Linux release(commit id: e3a8b6a1e70c).
> >
> >Yang Zhong (2):
> >   kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header
> >   kvm: selftests: Use tabs to replace spaces
> >
> >  tools/include/uapi/linux/kvm.h                |  2 +-
> >  .../selftests/kvm/lib/x86_64/processor.c      | 70 +++++++++----------
> >  2 files changed, 36 insertions(+), 36 deletions(-)
> >
> 
> Hi,
> 
> I sent a slightly more complete version of both patches.
>

  Thanks Paolo, :).

  Yang
 
> Thanks,
> 
> Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-20  1:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 14:01 [PATCH 0/2] kvm selftest cleanup Yang Zhong
2022-01-18 14:01 ` [PATCH 1/2] kvm: selftests: Sync KVM_CAP_XSAVE2 from linux header Yang Zhong
2022-01-18 16:54   ` Sean Christopherson
2022-01-19  1:51     ` Yang Zhong
2022-01-18 14:01 ` [PATCH 2/2] kvm: selftests: Use tabs to replace spaces Yang Zhong
2022-01-19 18:35 ` [PATCH 0/2] kvm selftest cleanup Paolo Bonzini
2022-01-20  1:04   ` Yang Zhong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.