linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the kvm-x86 tree with the kvm tree
@ 2024-04-12  3:14 Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2024-04-12  3:14 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini
  Cc: KVM, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

Hi all,

Today's linux-next merge of the kvm-x86 tree got a conflict in:

  arch/x86/kvm/svm/svm.c

between commit:

  605bbdc12bc8 ("KVM: SEV: store VMSA features in kvm_sev_info")

from the kvm tree and commit:

  c92be2fd8edf ("KVM: SVM: Save/restore non-volatile GPRs in SEV-ES VMRUN via host save area")

from the kvm-x86 tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/x86/kvm/svm/svm.c
index 0f3b59da0d4a,9aaf83c8d57d..000000000000
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@@ -1511,12 -1524,8 +1516,8 @@@ static void svm_prepare_switch_to_guest
  	 * or subsequent vmload of host save area.
  	 */
  	vmsave(sd->save_area_pa);
- 	if (sev_es_guest(vcpu->kvm)) {
- 		struct sev_es_save_area *hostsa;
- 		hostsa = (struct sev_es_save_area *)(page_address(sd->save_area) + 0x400);
- 
- 		sev_es_prepare_switch_to_guest(svm, hostsa);
- 	}
+ 	if (sev_es_guest(vcpu->kvm))
 -		sev_es_prepare_switch_to_guest(sev_es_host_save_area(sd));
++		sev_es_prepare_switch_to_guest(svm, sev_es_host_save_area(sd));
  
  	if (tsc_scaling)
  		__svm_write_tsc_multiplier(vcpu->arch.tsc_scaling_ratio);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: manual merge of the kvm-x86 tree with the kvm tree
  2024-02-20  2:48 Stephen Rothwell
@ 2024-02-20 15:33 ` Sean Christopherson
  0 siblings, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2024-02-20 15:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Paolo Bonzini, KVM, Linux Kernel Mailing List,
	Linux Next Mailing List, Paul Durrant

On Tue, Feb 20, 2024, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the kvm-x86 tree got a conflict in:
> 
>   include/uapi/linux/kvm.h
> 
> between commit:
> 
>   bcac0477277e ("KVM: x86: move x86-specific structs to uapi/asm/kvm.h")
> 
> from the kvm tree and commits:
> 
>   01a871852b11 ("KVM: x86/xen: allow shared_info to be mapped by fixed HVA")
>   3a0c9c41959d ("KVM: x86/xen: allow vcpu_info to be mapped by fixed HVA")
> 
> from the kvm-x86 tree.

/facepalm

I asked Paolo for a topic branch specifically to avoid this conflict, and then
managed to forget about it.  I'll rebase the xen patches and force push.

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

* linux-next: manual merge of the kvm-x86 tree with the kvm tree
@ 2024-02-20  2:48 Stephen Rothwell
  2024-02-20 15:33 ` Sean Christopherson
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2024-02-20  2:48 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini
  Cc: KVM, Linux Kernel Mailing List, Linux Next Mailing List, Paul Durrant

[-- Attachment #1: Type: text/plain, Size: 2981 bytes --]

Hi all,

Today's linux-next merge of the kvm-x86 tree got a conflict in:

  include/uapi/linux/kvm.h

between commit:

  bcac0477277e ("KVM: x86: move x86-specific structs to uapi/asm/kvm.h")

from the kvm tree and commits:

  01a871852b11 ("KVM: x86/xen: allow shared_info to be mapped by fixed HVA")
  3a0c9c41959d ("KVM: x86/xen: allow vcpu_info to be mapped by fixed HVA")

from the kvm-x86 tree.

I fixed it up (I used the former version of this file and applied the
following fix up patch) and can carry the fix as necessary. This is now
fixed as far as linux-next is concerned, but any non trivial conflicts
should be mentioned to your upstream maintainer when your tree is
submitted for merging.  You may also want to consider cooperating with
the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 20 Feb 2024 13:44:11 +1100
Subject: [PATCH] fixup for code moving to arch/x86/include/uapi/asm/kvm.h

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/x86/include/uapi/asm/kvm.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 0ad6bda1fc39..ad29984d5e39 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -549,6 +549,7 @@ struct kvm_x86_mce {
 #define KVM_XEN_HVM_CONFIG_EVTCHN_SEND		(1 << 5)
 #define KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG	(1 << 6)
 #define KVM_XEN_HVM_CONFIG_PVCLOCK_TSC_UNSTABLE	(1 << 7)
+#define KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA	(1 << 8)
 
 struct kvm_xen_hvm_config {
 	__u32 flags;
@@ -567,9 +568,10 @@ struct kvm_xen_hvm_attr {
 		__u8 long_mode;
 		__u8 vector;
 		__u8 runstate_update_flag;
-		struct {
+		union {
 			__u64 gfn;
 #define KVM_XEN_INVALID_GFN ((__u64)-1)
+			__u64 hva;
 		} shared_info;
 		struct {
 			__u32 send_port;
@@ -611,6 +613,8 @@ struct kvm_xen_hvm_attr {
 #define KVM_XEN_ATTR_TYPE_XEN_VERSION		0x4
 /* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG */
 #define KVM_XEN_ATTR_TYPE_RUNSTATE_UPDATE_FLAG	0x5
+/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA */
+#define KVM_XEN_ATTR_TYPE_SHARED_INFO_HVA	0x6
 
 struct kvm_xen_vcpu_attr {
 	__u16 type;
@@ -618,6 +622,7 @@ struct kvm_xen_vcpu_attr {
 	union {
 		__u64 gpa;
 #define KVM_XEN_INVALID_GPA ((__u64)-1)
+		__u64 hva;
 		__u64 pad[8];
 		struct {
 			__u64 state;
@@ -648,6 +653,8 @@ struct kvm_xen_vcpu_attr {
 #define KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID		0x6
 #define KVM_XEN_VCPU_ATTR_TYPE_TIMER		0x7
 #define KVM_XEN_VCPU_ATTR_TYPE_UPCALL_VECTOR	0x8
+/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA */
+#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO_HVA	0x9
 
 /* Secure Encrypted Virtualization command */
 enum sev_cmd_id {
-- 
2.43.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2024-04-12  3:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-12  3:14 linux-next: manual merge of the kvm-x86 tree with the kvm tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2024-02-20  2:48 Stephen Rothwell
2024-02-20 15:33 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).