Skip to contentSkip to conversation

arm64/sysreg: ISR register conversions

PATCH Superseded Mark Brown 2 participants 11 messages Dec 6, 2022 – Dec 7, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover arm64/sysreg: ISR register conversions

This series pulls the generated sysreg updates out of the previously posted series for NMI support then adds an incremental patch on top of that using the generated constant for ISR_EL1.A in the KVM entry code suggested by Marc Zyngier. This should hopefully help these progress without getting tied up by the more involved NMI rework (and cut down the size of that series if they do get merged).

Mark Brown (3):
arm64/sysreg: Add definition for ICC_NMIAR1_EL1 arm64/sysreg: Add definition of ISR_EL1
KVM: arm64: Use symbolic definition for ISR_EL1.A

 arch/arm64/kvm/hyp/entry.S |  2 +-
 arch/arm64/tools/sysreg    | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

base-commit: 30a0b95b1335e12efef89dd78518ed3e4a71a763

Signature · 1 line
2.30.2
author
#1 lore raw

PATCH 1/3 arm64/sysreg: Add definition for ICC_NMIAR1_EL1

FEAT_NMI adds a new interrupt status register for NMIs, ICC_NMIAR1_EL1. Add the definition for this register as per IHI0069H.

---
 arch/arm64/tools/sysreg | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/tools/sysreg +5 -0
index 384757a7eda9..5d0d2498c635 100644
@@ -1078,3 +1078,8 @@ Field	23:16	LD
 Res0	15:8
 Field	7:0	LR
 EndSysreg
+
+Sysreg	ICC_NMIAR1_EL1	3	0	12	9	5
+Res0	63:24
+Field	23:0	INTID
+EndSysreg
Signature · 1 line
2.30.2
author
#7 lore raw

PATCH 2/3 arm64/sysreg: Add definition of ISR_EL1

In reply to Mark Brown

Add a definition of ISR_EL1 as per DDI0487I.a. This register was not previously defined in sysreg.h, no functional changes.

---
 arch/arm64/tools/sysreg | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/tools/sysreg +10 -0
index 5d0d2498c635..3660e680b7f5 100644
@@ -1079,6 +1079,16 @@ Res0	15:8
 Field	7:0	LR
 EndSysreg
 
+Sysreg	ISR_EL1	3	0	12	1	0
+Res0	63:11
+Field	10	IS
+Field	9	FS
+Field	8	A
+Field	7	I
+Field	6	F
+Res0	5:0
+EndSysreg
+
 Sysreg	ICC_NMIAR1_EL1	3	0	12	9	5
 Res0	63:24
 Field	23:0	INTID
Signature · 1 line
2.30.2
author
#9 lore raw

PATCH 3/3 KVM: arm64: Use symbolic definition for ISR_EL1.A

In reply to Mark Brown

Now that we are generating ISR_EL1 we have acquired a constant for ISR_EL1.A, use it rather than the magic number we had been using in the KVM entry code.

---
 arch/arm64/kvm/hyp/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/hyp/entry.S +1 -1
index 435346ea1504..f3aa7738b477 100644
@@ -171,7 +171,7 @@ alternative_else
 	dsb	sy		// Synchronize against in-flight ld/st
 	isb			// Prevent an early read of side-effect free ISR
 	mrs	x2, isr_el1
-	tbnz	x2, #8, 2f	// ISR_EL1.A
+	tbnz	x2, #ISR_EL1_A_SHIFT, 2f
 	ret
 	nop
 2:
Signature · 1 line
2.30.2
maintainer
#2 lore raw

Re: [PATCH v1 1/3] arm64/sysreg: Add definition for ICC_NMIAR1_EL1

In reply to Mark Brown
Quoted 14 lines · Mark Brown

FEAT_NMI adds a new interrupt status register for NMIs, ICC_NMIAR1_EL1. Add the definition for this register as per IHI0069H.

---
 arch/arm64/tools/sysreg | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/tools/sysreg +0 -0
index 384757a7eda9..5d0d2498c635 100644

arch/arm64/tools/sysreg Field 23:16 LD · line 1085

Quoted 8 lines
arch/arm64/tools/sysreg +5 -0
@@ -1078,3 +1078,8 @@ Field	23:16	LD
 Res0	15:8
 Field	7:0	LR
 EndSysreg
+
+Sysreg	ICC_NMIAR1_EL1	3	0	12	9	5
+Res0	63:24
+Field	23:0	INTID
+EndSysreg

This patch should stay with the GIC patch adding NMIs, really.

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
maintainer Acked-by on v1 2/3
#8 lore raw

Re: [PATCH v1 2/3] arm64/sysreg: Add definition of ISR_EL1

In reply to Mark Brown
Quoted 20 lines · Mark Brown

Add a definition of ISR_EL1 as per DDI0487I.a. This register was not previously defined in sysreg.h, no functional changes.

---
 arch/arm64/tools/sysreg | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/tools/sysreg +3 -0
index 5d0d2498c635..3660e680b7f5 100644
@@ -1079,6 +1079,16 @@ Res0	15:8
 Field	7:0	LR
 EndSysreg
 
+Sysreg	ISR_EL1	3	0	12	1	0
+Res0	63:11
+Field	10	IS

arch/arm64/tools/sysreg Res0 15:8 · line 1094

Quoted 10 lines
arch/arm64/tools/sysreg +7 -0
+Field	9	FS
+Field	8	A
+Field	7	I
+Field	6	F
+Res0	5:0
+EndSysreg
+
 Sysreg	ICC_NMIAR1_EL1	3	0	12	9	5
 Res0	63:24
 Field	23:0	INTID
	  M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
maintainer Acked-by on v1 3/3
#10 lore raw

Re: [PATCH v1 3/3] KVM: arm64: Use symbolic definition for ISR_EL1.A

In reply to Mark Brown
Quoted 16 lines · Mark Brown

Now that we are generating ISR_EL1 we have acquired a constant for ISR_EL1.A, use it rather than the magic number we had been using in the KVM entry code.

---
 arch/arm64/kvm/hyp/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/hyp/entry.S +0 -0
index 435346ea1504..f3aa7738b477 100644

arch/arm64/kvm/hyp/entry.S alternative_else · line 177

Quoted 8 lines
arch/arm64/kvm/hyp/entry.S +1 -1
@@ -171,7 +171,7 @@ alternative_else
 	dsb	sy		// Synchronize against in-flight ld/st
 	isb			// Prevent an early read of side-effect free ISR
 	mrs	x2, isr_el1
-	tbnz	x2, #8, 2f	// ISR_EL1.A
+	tbnz	x2, #ISR_EL1_A_SHIFT, 2f
 	ret
 	nop
 2:
	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
author
#3 lore raw

Re: [PATCH v1 1/3] arm64/sysreg: Add definition for ICC_NMIAR1_EL1

In reply to Marc Zyngier
Quoted 8 lines · Marc Zyngier

arch/arm64/tools/sysreg Field 23:16 LD · line 1085

Quoted 4 lines · Mark Brown
arch/arm64/tools/sysreg +4 -0
+Sysreg	ICC_NMIAR1_EL1	3	0	12	9	5
+Res0	63:24
+Field	23:0	INTID
+EndSysreg

This patch should stay with the GIC patch adding NMIs, really.

Given the textual conflict with the ISR patch and the fact that the NMI series needs both anyway it seemed more productive to just carry them both in the cleanup series even if this one isn't immediately used.

maintainer
#4 lore raw

Re: [PATCH v1 1/3] arm64/sysreg: Add definition for ICC_NMIAR1_EL1

Quoted 11 lines · Mark Brown
Quoted 8 lines · Marc Zyngier

arch/arm64/tools/sysreg Field 23:16 LD · line 1085

Quoted 4 lines · Mark Brown
arch/arm64/tools/sysreg +4 -0
+Sysreg	ICC_NMIAR1_EL1	3	0	12	9	5
+Res0	63:24
+Field	23:0	INTID
+EndSysreg

This patch should stay with the GIC patch adding NMIs, really.

Quoted 3 lines

Given the textual conflict with the ISR patch and the fact that the NMI series needs both anyway it seemed more productive to just carry them both in the cleanup series even if this one isn't immediately used.

I thought the point of this series was to extract stuff that was otherwise useful, independently of the NMI series.

I must have misunderstood its purpose. This is instead making things harder to follow. Oh well.

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
author
#5 lore raw

Re: [PATCH v1 1/3] arm64/sysreg: Add definition for ICC_NMIAR1_EL1

Quoted 8 lines · Marc Zyngier
Quoted 3 lines · Mark Brown

Given the textual conflict with the ISR patch and the fact that the NMI series needs both anyway it seemed more productive to just carry them both in the cleanup series even if this one isn't immediately used.

I thought the point of this series was to extract stuff that was otherwise useful, independently of the NMI series.

I tend to view the system register definitions as just generally useful, this being system register definitions plus a cleanup that could be done on top.

Quoted 2 lines

I must have misunderstood its purpose. This is instead making things harder to follow. Oh well.

I am hopeful that the extra cognative load of an additional register definition will be managable.

maintainer
#6 lore raw

Re: [PATCH v1 1/3] arm64/sysreg: Add definition for ICC_NMIAR1_EL1

Quoted 9 lines · Mark Brown

[1 <text/plain; us-ascii (7bit)>]

Quoted 5 lines · Marc Zyngier
Quoted 3 lines · Mark Brown

Given the textual conflict with the ISR patch and the fact that the NMI series needs both anyway it seemed more productive to just carry them both in the cleanup series even if this one isn't immediately used.

Quoted 6 lines
Quoted 2 lines

I thought the point of this series was to extract stuff that was otherwise useful, independently of the NMI series.

I tend to view the system register definitions as just generally useful, this being system register definitions plus a cleanup that could be done on top.

I tend to view the *unused* system register definition as pointless churn. We'll have to agree to disagree on that one.

Quoted 6 lines
Quoted 3 lines

I must have misunderstood its purpose. This is instead making things harder to follow. Oh well.

I am hopeful that the extra cognative load of an additional register definition will be managable.

You never know.

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.