Skip to contentSkip to conversation

linux-next: manual merge of the kvm-arm tree with the arm64 tree

DISCUSSION Stephen Rothwell 5 participants 6 messages Jan 22, 2015 – Jan 23, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the kvm-arm tree got a conflict in arch/arm64/include/asm/kvm_arm.h between commit 6e53031ed840 ("arm64:
kvm: remove ESR_EL2_* macros") from the arm64 tree and commit 0d97f8848104 ("arm/arm64: KVM: add tracing support for arm64 exit handler") from the kvm-arm tree.

I fixed it up (see below, but this probably requires more work) and can carry the fix as necessary (no action is required).

Signature · 54 lines
Cheers,
Stephen Rothwell                    [email protected]

diff --cc arch/arm64/include/asm/kvm_arm.h
index 94674eb7e7bb,3da2d3acec0b..000000000000
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@@ -192,4 -217,46 +192,6 @@@
  /* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
  #define HPFAR_MASK	(~UL(0xf))
  
 -#define ESR_EL2_EC_UNKNOWN	(0x00)
 -#define ESR_EL2_EC_WFI		(0x01)
 -#define ESR_EL2_EC_CP15_32	(0x03)
 -#define ESR_EL2_EC_CP15_64	(0x04)
 -#define ESR_EL2_EC_CP14_MR	(0x05)
 -#define ESR_EL2_EC_CP14_LS	(0x06)
 -#define ESR_EL2_EC_FP_ASIMD	(0x07)
 -#define ESR_EL2_EC_CP10_ID	(0x08)
 -#define ESR_EL2_EC_CP14_64	(0x0C)
 -#define ESR_EL2_EC_ILL_ISS	(0x0E)
 -#define ESR_EL2_EC_SVC32	(0x11)
 -#define ESR_EL2_EC_HVC32	(0x12)
 -#define ESR_EL2_EC_SMC32	(0x13)
 -#define ESR_EL2_EC_SVC64	(0x15)
 -#define ESR_EL2_EC_HVC64	(0x16)
 -#define ESR_EL2_EC_SMC64	(0x17)
 -#define ESR_EL2_EC_SYS64	(0x18)
 -#define ESR_EL2_EC_IABT		(0x20)
 -#define ESR_EL2_EC_IABT_HYP	(0x21)
 -#define ESR_EL2_EC_PC_ALIGN	(0x22)
 -#define ESR_EL2_EC_DABT		(0x24)
 -#define ESR_EL2_EC_DABT_HYP	(0x25)
 -#define ESR_EL2_EC_SP_ALIGN	(0x26)
 -#define ESR_EL2_EC_FP_EXC32	(0x28)
 -#define ESR_EL2_EC_FP_EXC64	(0x2C)
 -#define ESR_EL2_EC_SERROR	(0x2F)
 -#define ESR_EL2_EC_BREAKPT	(0x30)
 -#define ESR_EL2_EC_BREAKPT_HYP	(0x31)
 -#define ESR_EL2_EC_SOFTSTP	(0x32)
 -#define ESR_EL2_EC_SOFTSTP_HYP	(0x33)
 -#define ESR_EL2_EC_WATCHPT	(0x34)
 -#define ESR_EL2_EC_WATCHPT_HYP	(0x35)
 -#define ESR_EL2_EC_BKPT32	(0x38)
 -#define ESR_EL2_EC_VECTOR32	(0x3A)
 -#define ESR_EL2_EC_BRK64	(0x3C)
 -
 -#define ESR_EL2_EC_xABT_xFSR_EXTABT	0x10
 -
 -#define ESR_EL2_EC_WFI_ISS_WFE	(1 << 0)
 -
+ #define ESR_EL2_HVC_IMM_MASK	((1UL << 16) - 1)
+ 
  #endif /* __ARM64_KVM_ARM_H__ */
#1 lore raw

On Thu, Jan 22 2015 at 5:07:04 am GMT, Stephen Rothwell <[email protected]> wrote:

Hi Stephen,

Quoted 8 lines

Today's linux-next merge of the kvm-arm tree got a conflict in arch/arm64/include/asm/kvm_arm.h between commit 6e53031ed840 ("arm64:
kvm: remove ESR_EL2_* macros") from the arm64 tree and commit 0d97f8848104 ("arm/arm64: KVM: add tracing support for arm64 exit handler") from the kvm-arm tree.

I fixed it up (see below, but this probably requires more work) and can carry the fix as necessary (no action is required).

Thanks for dealing with this. I think the following patch should be applied on top of your resolution, making the new macro part of the asm/esr.h file.

Mark, Wei: does it match your expectations?

Thanks,

	M.
arch/arm64/include/asm/esr.h +1 -0
index 6216709..92bbae3 100644
@@ -96,6 +96,7 @@
 #define ESR_ELx_COND_SHIFT	(20)
 #define ESR_ELx_COND_MASK	(UL(0xF) << ESR_ELx_COND_SHIFT)
 #define ESR_ELx_WFx_ISS_WFE	(UL(1) << 0)
+#define ESR_ELx_xVC_IMM_MASK	((1UL << 16) - 1)
 
 #ifndef __ASSEMBLY__
 #include <asm/types.h>
arch/arm64/include/asm/kvm_arm.h +0 -2
index 53fbc1e..94674eb 100644
@@ -192,6 +192,4 @@
 /* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
 #define HPFAR_MASK	(~UL(0xf))
 
-#define ESR_EL2_HVC_IMM_MASK	((1UL << 16) - 1)
-
 #endif /* __ARM64_KVM_ARM_H__ */
arch/arm64/include/asm/kvm_emulate.h +1 -1
index b861ff6..bbc17cd 100644
@@ -133,7 +133,7 @@ static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
 
 static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu)
 {
-	return kvm_vcpu_get_hsr(vcpu) & ESR_EL2_HVC_IMM_MASK;
+	return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;
 }
 
 static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
Signature · 1 line
Jazz is not dead. It just smells funny.
reviewer
#2 lore raw
Quoted 10 lines · Marc Zyngier

On Thu, Jan 22 2015 at 5:07:04 am GMT, Stephen Rothwell <[email protected]> wrote:

Hi Stephen,

Quoted 6 lines

Today's linux-next merge of the kvm-arm tree got a conflict in arch/arm64/include/asm/kvm_arm.h between commit 6e53031ed840 ("arm64:
kvm: remove ESR_EL2_* macros") from the arm64 tree and commit 0d97f8848104 ("arm/arm64: KVM: add tracing support for arm64 exit handler") from the kvm-arm tree.

Quoted 8 lines
Quoted 2 lines

I fixed it up (see below, but this probably requires more work) and can carry the fix as necessary (no action is required).

Thanks for dealing with this. I think the following patch should be applied on top of your resolution, making the new macro part of the asm/esr.h file.

Mark, Wei: does it match your expectations?

The below patch looks fine to me.

I suspected we mighh see something like this, so I kept my arm64/common-esr-macros branch [1] stable. Catalin merged this into the arm64 for-next/core branch.

I guess the easiest way to solve the conflict would be if the kvm-arm tree also merged that and fixed the fallout there?

Thanks,
Mark.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/common-esr-macros

Quoted 45 lines

Thanks,

	M.
arch/arm64/include/asm/esr.h +1 -0
index 6216709..92bbae3 100644
@@ -96,6 +96,7 @@
 #define ESR_ELx_COND_SHIFT	(20)
 #define ESR_ELx_COND_MASK	(UL(0xF) << ESR_ELx_COND_SHIFT)
 #define ESR_ELx_WFx_ISS_WFE	(UL(1) << 0)
+#define ESR_ELx_xVC_IMM_MASK	((1UL << 16) - 1)
 
 #ifndef __ASSEMBLY__
 #include <asm/types.h>
arch/arm64/include/asm/kvm_arm.h +0 -2
index 53fbc1e..94674eb 100644
@@ -192,6 +192,4 @@
 /* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
 #define HPFAR_MASK	(~UL(0xf))
 
-#define ESR_EL2_HVC_IMM_MASK	((1UL << 16) - 1)
-
 #endif /* __ARM64_KVM_ARM_H__ */
arch/arm64/include/asm/kvm_emulate.h +1 -1
index b861ff6..bbc17cd 100644
@@ -133,7 +133,7 @@ static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
 
 static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu)
 {
-	return kvm_vcpu_get_hsr(vcpu) & ESR_EL2_HVC_IMM_MASK;
+	return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;
 }
 
 static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
Signature · 2 lines
-- 
Jazz is not dead. It just smells funny.
#3 lore raw

Hi Mark,

Quoted 19 lines · On Thu, 22 Jan 2015 10:29:20 +0000 Mark Rutland <[email protected]> wrote:
Quoted 8 lines · Marc Zyngier
Quoted 6 lines · Stephen Rothwell

Today's linux-next merge of the kvm-arm tree got a conflict in arch/arm64/include/asm/kvm_arm.h between commit 6e53031ed840 ("arm64:
kvm: remove ESR_EL2_* macros") from the arm64 tree and commit 0d97f8848104 ("arm/arm64: KVM: add tracing support for arm64 exit handler") from the kvm-arm tree.

Quoted 8 lines
Quoted 2 lines

I fixed it up (see below, but this probably requires more work) and can carry the fix as necessary (no action is required).

Thanks for dealing with this. I think the following patch should be applied on top of your resolution, making the new macro part of the asm/esr.h file.

Mark, Wei: does it match your expectations?

Quoted 8 lines

The below patch looks fine to me.

I suspected we mighh see something like this, so I kept my arm64/common-esr-macros branch [1] stable. Catalin merged this into the arm64 for-next/core branch.

I guess the easiest way to solve the conflict would be if the kvm-arm tree also merged that and fixed the fallout there?

Yes, that would be a good resolution. In the mean time, I will apply the merge fix patch to my tree (I will remove it when the above resolution is done).

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#4 lore raw
In reply to Marc Zyngier
Quoted 10 lines · Marc Zyngier

On Thu, Jan 22 2015 at 5:07:04 am GMT, Stephen Rothwell <[email protected]> wrote:

Hi Stephen,

Quoted 6 lines

Today's linux-next merge of the kvm-arm tree got a conflict in arch/arm64/include/asm/kvm_arm.h between commit 6e53031ed840 ("arm64:
kvm: remove ESR_EL2_* macros") from the arm64 tree and commit 0d97f8848104 ("arm/arm64: KVM: add tracing support for arm64 exit handler") from the kvm-arm tree.

Quoted 8 lines
Quoted 2 lines

I fixed it up (see below, but this probably requires more work) and can carry the fix as necessary (no action is required).

Thanks for dealing with this. I think the following patch should be applied on top of your resolution, making the new macro part of the asm/esr.h file.

Mark, Wei: does it match your expectations?

Looks good to me. Thanks for handling this issue.

-Wei

Quoted 42 lines

Thanks,

	M.
arch/arm64/include/asm/esr.h +1 -0
index 6216709..92bbae3 100644
@@ -96,6 +96,7 @@
 #define ESR_ELx_COND_SHIFT	(20)
 #define ESR_ELx_COND_MASK	(UL(0xF) << ESR_ELx_COND_SHIFT)
 #define ESR_ELx_WFx_ISS_WFE	(UL(1) << 0)
+#define ESR_ELx_xVC_IMM_MASK	((1UL << 16) - 1)
 
 #ifndef __ASSEMBLY__
 #include <asm/types.h>
arch/arm64/include/asm/kvm_arm.h +0 -2
index 53fbc1e..94674eb 100644
@@ -192,6 +192,4 @@
 /* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
 #define HPFAR_MASK	(~UL(0xf))
 
-#define ESR_EL2_HVC_IMM_MASK	((1UL << 16) - 1)
-
 #endif /* __ARM64_KVM_ARM_H__ */
arch/arm64/include/asm/kvm_emulate.h +1 -1
index b861ff6..bbc17cd 100644
@@ -133,7 +133,7 @@ static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
 
 static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu)
 {
-	return kvm_vcpu_get_hsr(vcpu) & ESR_EL2_HVC_IMM_MASK;
+	return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;
 }
 
 static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)
#5 lore raw
In reply to Marc Zyngier
Quoted 52 lines · Marc Zyngier

On Thu, Jan 22 2015 at 5:07:04 am GMT, Stephen Rothwell <[email protected]> wrote:

Hi Stephen,

Quoted 8 lines

Today's linux-next merge of the kvm-arm tree got a conflict in arch/arm64/include/asm/kvm_arm.h between commit 6e53031ed840 ("arm64:
kvm: remove ESR_EL2_* macros") from the arm64 tree and commit 0d97f8848104 ("arm/arm64: KVM: add tracing support for arm64 exit handler") from the kvm-arm tree.

I fixed it up (see below, but this probably requires more work) and can carry the fix as necessary (no action is required).

Thanks for dealing with this. I think the following patch should be applied on top of your resolution, making the new macro part of the asm/esr.h file.

Mark, Wei: does it match your expectations?

Thanks,

	M.
arch/arm64/include/asm/esr.h +1 -0
index 6216709..92bbae3 100644
@@ -96,6 +96,7 @@
 #define ESR_ELx_COND_SHIFT	(20)
 #define ESR_ELx_COND_MASK	(UL(0xF) << ESR_ELx_COND_SHIFT)
 #define ESR_ELx_WFx_ISS_WFE	(UL(1) << 0)
+#define ESR_ELx_xVC_IMM_MASK	((1UL << 16) - 1)
 
 #ifndef __ASSEMBLY__
 #include <asm/types.h>
arch/arm64/include/asm/kvm_arm.h +0 -2
index 53fbc1e..94674eb 100644
@@ -192,6 +192,4 @@
 /* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
 #define HPFAR_MASK	(~UL(0xf))
 
-#define ESR_EL2_HVC_IMM_MASK	((1UL << 16) - 1)
-
 #endif /* __ARM64_KVM_ARM_H__ */
arch/arm64/include/asm/kvm_emulate.h +0 -0
index b861ff6..bbc17cd 100644

arch/arm64/include/asm/kvm_emulate.h static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu) · line 139

Quoted 8 lines
arch/arm64/include/asm/kvm_emulate.h +1 -1
@@ -133,7 +133,7 @@ static inline phys_addr_t kvm_vcpu_get_fault_ipa(const struct kvm_vcpu *vcpu)
 
 static inline u32 kvm_vcpu_hvc_get_imm(const struct kvm_vcpu *vcpu)
 {
-	return kvm_vcpu_get_hsr(vcpu) & ESR_EL2_HVC_IMM_MASK;
+	return kvm_vcpu_get_hsr(vcpu) & ESR_ELx_xVC_IMM_MASK;
 }
 
 static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu)

This looks good to me too, I'll sync with Paolo on how to get this upstream.

-Christoffer