[PATCH] x86/hyperv/vtl: Add noop for realmode pointers

Saurabh Sengar posted 1 patch 2 years, 9 months ago
arch/x86/hyperv/hv_vtl.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] x86/hyperv/vtl: Add noop for realmode pointers
Posted by Saurabh Sengar 2 years, 9 months ago
Assign the realmode pointers to noop, instead of NULL to fix kernel panic.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
---
 arch/x86/hyperv/hv_vtl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
index 1ba5d3b99b16..85d38b9f3586 100644
--- a/arch/x86/hyperv/hv_vtl.c
+++ b/arch/x86/hyperv/hv_vtl.c
@@ -20,6 +20,8 @@ void __init hv_vtl_init_platform(void)
 {
 	pr_info("Linux runs in Hyper-V Virtual Trust Level\n");
 
+	x86_platform.realmode_reserve = x86_init_noop;
+	x86_platform.realmode_init = x86_init_noop;
 	x86_init.irqs.pre_vector_init = x86_init_noop;
 	x86_init.timers.timer_init = x86_init_noop;
 
-- 
2.34.1
RE: [PATCH] x86/hyperv/vtl: Add noop for realmode pointers
Posted by Michael Kelley (LINUX) 2 years, 9 months ago
From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Monday, April 24, 2023 3:10 AM
> 
> Assign the realmode pointers to noop, instead of NULL to fix kernel panic.
> 
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> ---
>  arch/x86/hyperv/hv_vtl.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
> index 1ba5d3b99b16..85d38b9f3586 100644
> --- a/arch/x86/hyperv/hv_vtl.c
> +++ b/arch/x86/hyperv/hv_vtl.c
> @@ -20,6 +20,8 @@ void __init hv_vtl_init_platform(void)
>  {
>  	pr_info("Linux runs in Hyper-V Virtual Trust Level\n");
> 
> +	x86_platform.realmode_reserve = x86_init_noop;
> +	x86_platform.realmode_init = x86_init_noop;
>  	x86_init.irqs.pre_vector_init = x86_init_noop;
>  	x86_init.timers.timer_init = x86_init_noop;
> 
> --
> 2.34.1

Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Re: [PATCH] x86/hyperv/vtl: Add noop for realmode pointers
Posted by Wei Liu 2 years, 9 months ago
On Mon, May 01, 2023 at 04:57:56PM +0000, Michael Kelley (LINUX) wrote:
> From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Monday, April 24, 2023 3:10 AM
> > 
> > Assign the realmode pointers to noop, instead of NULL to fix kernel panic.
> > 
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> >  arch/x86/hyperv/hv_vtl.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
> > index 1ba5d3b99b16..85d38b9f3586 100644
> > --- a/arch/x86/hyperv/hv_vtl.c
> > +++ b/arch/x86/hyperv/hv_vtl.c
> > @@ -20,6 +20,8 @@ void __init hv_vtl_init_platform(void)
> >  {
> >  	pr_info("Linux runs in Hyper-V Virtual Trust Level\n");
> > 
> > +	x86_platform.realmode_reserve = x86_init_noop;
> > +	x86_platform.realmode_init = x86_init_noop;
> >  	x86_init.irqs.pre_vector_init = x86_init_noop;
> >  	x86_init.timers.timer_init = x86_init_noop;
> > 
> > --
> > 2.34.1
> 
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> 

Applied to hyperv-fixes. Thanks.