[PATCH v2 5/6] x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef

Sean Christopherson posted 6 patches 1 year, 8 months ago
There is a newer version of this series
[PATCH v2 5/6] x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef
Posted by Sean Christopherson 1 year, 8 months ago
Define cpu_emergency_virt_cb even if the kernel is being built without KVM
support so that KVM can reference the typedef in asm/kvm_host.h without
needing yet more #ifdefs.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/reboot.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h
index 6536873f8fc0..d0ef2a678d66 100644
--- a/arch/x86/include/asm/reboot.h
+++ b/arch/x86/include/asm/reboot.h
@@ -25,8 +25,8 @@ void __noreturn machine_real_restart(unsigned int type);
 #define MRR_BIOS	0
 #define MRR_APM		1
 
-#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
 typedef void (cpu_emergency_virt_cb)(void);
+#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
 void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback);
 void cpu_emergency_unregister_virt_callback(cpu_emergency_virt_cb *callback);
 void cpu_emergency_disable_virtualization(void);
-- 
2.45.0.215.g3402c0e53f-goog
Re: [PATCH v2 5/6] x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef
Posted by Chao Gao 1 year, 8 months ago
On Tue, May 21, 2024 at 07:28:26PM -0700, Sean Christopherson wrote:
>Define cpu_emergency_virt_cb even if the kernel is being built without KVM
>support so that KVM can reference the typedef in asm/kvm_host.h without
>needing yet more #ifdefs.
>
>No functional change intended.
>
>Signed-off-by: Sean Christopherson <seanjc@google.com>

Reviewed-by: Chao Gao <chao.gao@intel.com>

Perhaps x86 maintainers need to be CC'ed.

>---
> arch/x86/include/asm/reboot.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h
>index 6536873f8fc0..d0ef2a678d66 100644
>--- a/arch/x86/include/asm/reboot.h
>+++ b/arch/x86/include/asm/reboot.h
>@@ -25,8 +25,8 @@ void __noreturn machine_real_restart(unsigned int type);
> #define MRR_BIOS	0
> #define MRR_APM		1
> 
>-#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
> typedef void (cpu_emergency_virt_cb)(void);
>+#if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
> void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback);
> void cpu_emergency_unregister_virt_callback(cpu_emergency_virt_cb *callback);
> void cpu_emergency_disable_virtualization(void);
>-- 
>2.45.0.215.g3402c0e53f-goog
>
Re: [PATCH v2 5/6] x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef
Posted by Huang, Kai 1 year, 8 months ago

On 22/05/2024 2:28 pm, Sean Christopherson wrote:
> Define cpu_emergency_virt_cb even if the kernel is being built without KVM
> support so that KVM can reference the typedef in asm/kvm_host.h without
> needing yet more #ifdefs.
> 
> No functional change intended.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>
Acked-by: Kai Huang <kai.huang@intel.com>