Skip to contentSkip to conversation

x86: kexec is PV-only

PATCH In review Jan Beulich 3 participants 5 messages Jun 30

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: kexec is PV-only

Kexec is of no use without its hypercall, and that hypercall is wired up only for PV. Allowing that code to be built when !PV therefore results in a lot of unreachable code, violating Misra C:2012 rule 2.1.

xen/arch/x86/Kconfig +1 -1
@@ -22,7 +22,7 @@ config X86
 	select HAS_EX_TABLE
 	select HAS_FAST_MULTIPLY
 	select HAS_IOPORTS
-	select HAS_KEXEC
+	select HAS_KEXEC if PV
 	select HAS_NS16550
 	select HAS_PASSTHROUGH
 	select HAS_PCI
#1 lore raw
Quoted 9 lines · Jan Beulich

Kexec is of no use without its hypercall, and that hypercall is wired up only for PV. Allowing that code to be built when !PV therefore results in a lot of unreachable code, violating Misra C:2012 rule 2.1.

xen/arch/x86/Kconfig config X86 · line 28

Quoted 8 lines
xen/arch/x86/Kconfig +1 -1
@@ -22,7 +22,7 @@ config X86
 	select HAS_EX_TABLE
 	select HAS_FAST_MULTIPLY
 	select HAS_IOPORTS
-	select HAS_KEXEC
+	select HAS_KEXEC if PV
 	select HAS_NS16550
 	select HAS_PASSTHROUGH
 	select HAS_PCI

This might be true, but it's wrong.  kexec should be wired up for PVH too, and I don't see any reason why it can't be.

~Andrew

#2 lore raw
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich

Kexec is of no use without its hypercall, and that hypercall is wired up only for PV. Allowing that code to be built when !PV therefore results in a lot of unreachable code, violating Misra C:2012 rule 2.1.

Quoted 14 lines

xen/arch/x86/Kconfig config X86 · line 28

Quoted 11 lines
xen/arch/x86/Kconfig +1 -1
@@ -22,7 +22,7 @@ config X86
 	select HAS_EX_TABLE
 	select HAS_FAST_MULTIPLY
 	select HAS_IOPORTS
-	select HAS_KEXEC
+	select HAS_KEXEC if PV
 	select HAS_NS16550
 	select HAS_PASSTHROUGH
 	select HAS_PCI

This might be true, but it's wrong.  kexec should be wired up for PVH too, and I don't see any reason why it can't be.

I'm happy to drop this patch if one enabling PVH surfaces. I did point out the issue a little while back, and since nothing really happened, I thought I'd make this patch to at least address the Misra aspect. I just don't see myself audit the affected code paths for validity in the PVH case.

Jan

#3 lore raw
In reply to Jan Beulich
Quoted 3 lines · Jan Beulich

Kexec is of no use without its hypercall, and that hypercall is wired up only for PV. Allowing that code to be built when !PV therefore results in a lot of unreachable code, violating Misra C:2012 rule 2.1.

Do you know what's missing for the hypercall to be functional on HVM environments? We would need that for parity between PVH and PV dom0s.

Thanks, Roger.

#4 lore raw
Quoted 7 lines · Roger Pau Monné
Quoted 3 lines · Jan Beulich

Kexec is of no use without its hypercall, and that hypercall is wired up only for PV. Allowing that code to be built when !PV therefore results in a lot of unreachable code, violating Misra C:2012 rule 2.1.

Do you know what's missing for the hypercall to be functional on HVM environments?

No, and since I don't know I also didn't mean to take on enabling that mode of operation. The Misra aspect, otoh, was simple enough to cover (without introducing much code which later would need undoing).

Jan