Skip to contentSkip to conversation

arm64: kernel: hyp-stub: drop unneeded including files

PATCH NAK Peng Fan 4 participants 6 messages Nov 15, 2019 arm64

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/2 arm64: kernel: hyp-stub: drop unneeded including files

From: Peng Fan <[email protected]>

These files are not needed to be included, so remove them.

---
 arch/arm64/kernel/hyp-stub.S | 4 ----
 1 file changed, 4 deletions(-)
arch/arm64/kernel/hyp-stub.S +0 -4
index 73d46070b315..f17af9a39562 100644
@@ -8,12 +8,8 @@
 
 #include <linux/init.h>
 #include <linux/linkage.h>
-#include <linux/irqchip/arm-gic-v3.h>
 
 #include <asm/assembler.h>
-#include <asm/kvm_arm.h>
-#include <asm/kvm_asm.h>
-#include <asm/ptrace.h>
 #include <asm/virt.h>
 
 	.text
Signature · 1 line
2.16.4
author
#1 lore raw

PATCH 2/2 arm64: export __hyp_stub_vectors

From: Peng Fan <[email protected]>

External hypervisors, like Jailhouse, need this address when they are deactivated, in order to restore original state.

---
 arch/arm64/include/asm/virt.h | 2 ++
 arch/arm64/kernel/hyp-stub.S  | 1 +
 2 files changed, 3 insertions(+)
arch/arm64/include/asm/virt.h +2 -0
index 0958ed6191aa..b1b48353e3b3 100644
@@ -62,6 +62,8 @@
  */
 extern u32 __boot_cpu_mode[2];
 
+extern char __hyp_stub_vectors[];
+
 void __hyp_set_vectors(phys_addr_t phys_vector_base);
 void __hyp_reset_vectors(void);
 
arch/arm64/kernel/hyp-stub.S +1 -0
index f17af9a39562..22b728fb14bd 100644
@@ -38,6 +38,7 @@ ENTRY(__hyp_stub_vectors)
 	ventry	el1_fiq_invalid			// FIQ 32-bit EL1
 	ventry	el1_error_invalid		// Error 32-bit EL1
 ENDPROC(__hyp_stub_vectors)
+EXPORT_SYMBOL(__hyp_stub_vectors);
 
 	.align 11
 
Signature · 1 line
2.16.4
#2 lore raw

Re: [PATCH 2/2] arm64: export __hyp_stub_vectors

Quoted 30 lines · Peng Fan

From: Peng Fan <[email protected]>

External hypervisors, like Jailhouse, need this address when they are deactivated, in order to restore original state.

---
  arch/arm64/include/asm/virt.h | 2 ++
  arch/arm64/kernel/hyp-stub.S  | 1 +
  2 files changed, 3 insertions(+)
arch/arm64/include/asm/virt.h +2 -0
index 0958ed6191aa..b1b48353e3b3 100644
@@ -62,6 +62,8 @@
   */
  extern u32 __boot_cpu_mode[2];
 
+extern char __hyp_stub_vectors[];
+
  void __hyp_set_vectors(phys_addr_t phys_vector_base);
  void __hyp_reset_vectors(void);
 
arch/arm64/kernel/hyp-stub.S +0 -0
index f17af9a39562..22b728fb14bd 100644

arch/arm64/kernel/hyp-stub.S ENTRY(__hyp_stub_vectors) · line 44

Quoted 7 lines
arch/arm64/kernel/hyp-stub.S +1 -0
@@ -38,6 +38,7 @@ ENTRY(__hyp_stub_vectors)
  	ventry	el1_fiq_invalid			// FIQ 32-bit EL1
  	ventry	el1_error_invalid		// Error 32-bit EL1
  ENDPROC(__hyp_stub_vectors)
+EXPORT_SYMBOL(__hyp_stub_vectors);
 
  	.align 11
 

While I would not dislike to have patch-free access in Jailhouse, I'm not sure if an out-of-tree use case justifies this an export.

Also, this lacks the arm equivalent to be complete.

Jan

Signature · 7 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#3 lore raw

RE: [PATCH 2/2] arm64: export __hyp_stub_vectors

Quoted 39 lines

Subject: Re: [PATCH 2/2] arm64: export __hyp_stub_vectors

Quoted 26 lines · Peng Fan

From: Peng Fan <[email protected]>

External hypervisors, like Jailhouse, need this address when they are deactivated, in order to restore original state.

---
  arch/arm64/include/asm/virt.h | 2 ++
  arch/arm64/kernel/hyp-stub.S  | 1 +
  2 files changed, 3 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/include/asm/virt.h index 0958ed6191aa..b1b48353e3b3 100644

arch/arm64/include/asm/virt.h +2 -0
@@ -62,6 +62,8 @@
   */
  extern u32 __boot_cpu_mode[2];
 
+extern char __hyp_stub_vectors[];
+
  void __hyp_set_vectors(phys_addr_t phys_vector_base);
  void __hyp_reset_vectors(void);
 
(quoted diff) +0 -0
Quoted 1 line

b/arch/arm64/kernel/hyp-stub.S index f17af9a39562..22b728fb14bd

100644

Quoted 8 lines
arch/arm64/kernel/hyp-stub.S +1 -0
@@ -38,6 +38,7 @@ ENTRY(__hyp_stub_vectors)
  	ventry	el1_fiq_invalid			// FIQ 32-bit EL1
  	ventry	el1_error_invalid		// Error 32-bit EL1
  ENDPROC(__hyp_stub_vectors)
+EXPORT_SYMBOL(__hyp_stub_vectors);
 
Quoted 8 lines

arch/arm64/kernel/hyp-stub.S ENTRY(__hyp_stub_vectors) · line 44

Quoted 3 lines
arch/arm64/kernel/hyp-stub.S +0 -0
  	.align 11
 

While I would not dislike to have patch-free access in Jailhouse, I'm not sure if an out-of-tree use case justifies this an export.

Also, this lacks the arm equivalent to be complete.

arm and arm64 has different maintainers. If this arm64 is acceptable, I'll create arm patch and send out.

Thanks,
Peng.

Quoted 6 lines

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux

#4 lore raw

Re: [PATCH 2/2] arm64: export __hyp_stub_vectors

In reply to Peng Fan

Hi Peng,

Quoted 16 lines · Peng Fan

From: Peng Fan <[email protected]>

External hypervisors, like Jailhouse, need this address when they are deactivated, in order to restore original state.

---
 arch/arm64/include/asm/virt.h | 2 ++
 arch/arm64/kernel/hyp-stub.S  | 1 +
 2 files changed, 3 insertions(+)
arch/arm64/include/asm/virt.h +0 -0
index 0958ed6191aa..b1b48353e3b3 100644

arch/arm64/include/asm/virt.h line 66

Quoted 5 lines
arch/arm64/include/asm/virt.h +2 -0
@@ -62,6 +62,8 @@
  */
 extern u32 __boot_cpu_mode[2];
 
+extern char __hyp_stub_vectors[];
+

In jailhouse, we call it:

driver/main.c:extern unsigned int __hyp_stub_vectors[];

arch/arm64/kernel/hyp-stub.S ENTRY(__hyp_stub_vectors) · line 41

Quoted 12 lines
arch/arm64/include/asm/virt.h +0 -0
 void __hyp_set_vectors(phys_addr_t phys_vector_base);
 void __hyp_reset_vectors(void);
 
arch/arm64/kernel/hyp-stub.S +1 -0
index f17af9a39562..22b728fb14bd 100644
@@ -38,6 +38,7 @@ ENTRY(__hyp_stub_vectors)
 	ventry	el1_fiq_invalid			// FIQ 32-bit EL1
 	ventry	el1_error_invalid		// Error 32-bit EL1
 ENDPROC(__hyp_stub_vectors)
+EXPORT_SYMBOL(__hyp_stub_vectors);

_GPL?

I wrote, with the same motivation, almost the same patch a while ago:

https://github.com/siemens/linux/commit/15b46bf77bdb5c6b1889f729efc3bf424ddfad9c

Back then, I had to import asm-generic/export.h. Is it now indirectly included?

Thanks
Ralf

Quoted 4 lines
arch/arm64/kernel/hyp-stub.S +0 -0
 	.align 11
 
 
#5 lore raw

Re: [PATCH 2/2] arm64: export __hyp_stub_vectors

In reply to Peng Fan
Quoted 29 lines · Peng Fan

From: Peng Fan <[email protected]>

External hypervisors, like Jailhouse, need this address when they are deactivated, in order to restore original state.

---
 arch/arm64/include/asm/virt.h | 2 ++
 arch/arm64/kernel/hyp-stub.S  | 1 +
 2 files changed, 3 insertions(+)
arch/arm64/include/asm/virt.h +2 -0
index 0958ed6191aa..b1b48353e3b3 100644
@@ -62,6 +62,8 @@
  */
 extern u32 __boot_cpu_mode[2];
 
+extern char __hyp_stub_vectors[];
+
 void __hyp_set_vectors(phys_addr_t phys_vector_base);
 void __hyp_reset_vectors(void);
 
arch/arm64/kernel/hyp-stub.S +0 -0
index f17af9a39562..22b728fb14bd 100644

arch/arm64/kernel/hyp-stub.S ENTRY(__hyp_stub_vectors) · line 41

Quoted 4 lines
arch/arm64/kernel/hyp-stub.S +1 -0
@@ -38,6 +38,7 @@ ENTRY(__hyp_stub_vectors)
 	ventry	el1_fiq_invalid			// FIQ 32-bit EL1
 	ventry	el1_error_invalid		// Error 32-bit EL1
 ENDPROC(__hyp_stub_vectors)
+EXPORT_SYMBOL(__hyp_stub_vectors);

NAK.

There is no in-tree users of this. If you're using jailhouse, you're already patching your kernel, and you can carry this. Mainline doesn't need this at all.

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...