linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/hyperv/vtl: Stop kernel from probing VTL0 low memory
@ 2025-01-16  6:12 Naman Jain
  2025-01-17 17:01 ` Roman Kisel
  0 siblings, 1 reply; 3+ messages in thread
From: Naman Jain @ 2025-01-16  6:12 UTC (permalink / raw)
  To: K . Y . Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: linux-hyperv, linux-kernel, Saurabh Sengar

For Linux, running in Hyper-V VTL (Virtual Trust Level), kernel in VTL2
tries to access VTL0 low memory in probe_roms. This memory is not
described in the e820 map. Initialize probe_roms call to no-ops
during boot for VTL2 kernel to avoid this. The issue got identified
in OpenVMM which detects invalid accesses initiated from kernel running
in VTL2.

Co-developed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
---
 arch/x86/hyperv/hv_vtl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
index 4e1b1e3b5658..3f4e20d7b724 100644
--- a/arch/x86/hyperv/hv_vtl.c
+++ b/arch/x86/hyperv/hv_vtl.c
@@ -30,6 +30,7 @@ void __init hv_vtl_init_platform(void)
 	x86_platform.realmode_init = x86_init_noop;
 	x86_init.irqs.pre_vector_init = x86_init_noop;
 	x86_init.timers.timer_init = x86_init_noop;
+	x86_init.resources.probe_roms = x86_init_noop;
 
 	/* Avoid searching for BIOS MP tables */
 	x86_init.mpparse.find_mptable = x86_init_noop;

base-commit: 37136bf5c3a6f6b686d74f41837a6406bec6b7bc
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] x86/hyperv/vtl: Stop kernel from probing VTL0 low memory
  2025-01-16  6:12 [PATCH] x86/hyperv/vtl: Stop kernel from probing VTL0 low memory Naman Jain
@ 2025-01-17 17:01 ` Roman Kisel
  2025-02-12  2:17   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Kisel @ 2025-01-17 17:01 UTC (permalink / raw)
  To: namjain
  Cc: bp, dave.hansen, decui, haiyangz, kys, linux-hyperv, linux-kernel,
	mingo, ssengar, tglx, wei.liu, x86

> For Linux, running in Hyper-V VTL (Virtual Trust Level), kernel in VTL2
> tries to access VTL0 low memory in probe_roms. This memory is not
> described in the e820 map. Initialize probe_roms call to no-ops
> during boot for VTL2 kernel to avoid this. The issue got identified
> in OpenVMM which detects invalid accesses initiated from kernel running
> in VTL2.
> 
> Co-developed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> ---
>  arch/x86/hyperv/hv_vtl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
> index 4e1b1e3b5658..3f4e20d7b724 100644
> --- a/arch/x86/hyperv/hv_vtl.c
> +++ b/arch/x86/hyperv/hv_vtl.c
> @@ -30,6 +30,7 @@ void __init hv_vtl_init_platform(void)
>	x86_platform.realmode_init = x86_init_noop;
>	x86_init.irqs.pre_vector_init = x86_init_noop;
>	x86_init.timers.timer_init = x86_init_noop;
> +	x86_init.resources.probe_roms = x86_init_noop;
>  
>	/* Avoid searching for BIOS MP tables */
>	x86_init.mpparse.find_mptable = x86_init_noop;
> 
> base-commit: 37136bf5c3a6f6b686d74f41837a6406bec6b7bc
> -- 
> 2.43.0

Thanks, Naman!

Tested-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/hyperv/vtl: Stop kernel from probing VTL0 low memory
  2025-01-17 17:01 ` Roman Kisel
@ 2025-02-12  2:17   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2025-02-12  2:17 UTC (permalink / raw)
  To: Roman Kisel
  Cc: namjain, bp, dave.hansen, decui, haiyangz, kys, linux-hyperv,
	linux-kernel, mingo, ssengar, tglx, wei.liu, x86

On Fri, Jan 17, 2025 at 09:01:41AM -0800, Roman Kisel wrote:
> > For Linux, running in Hyper-V VTL (Virtual Trust Level), kernel in VTL2
> > tries to access VTL0 low memory in probe_roms. This memory is not
> > described in the e820 map. Initialize probe_roms call to no-ops
> > during boot for VTL2 kernel to avoid this. The issue got identified
> > in OpenVMM which detects invalid accesses initiated from kernel running
> > in VTL2.
> > 
> > Co-developed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> > ---
> >  arch/x86/hyperv/hv_vtl.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
> > index 4e1b1e3b5658..3f4e20d7b724 100644
> > --- a/arch/x86/hyperv/hv_vtl.c
> > +++ b/arch/x86/hyperv/hv_vtl.c
> > @@ -30,6 +30,7 @@ void __init hv_vtl_init_platform(void)
> >	x86_platform.realmode_init = x86_init_noop;
> >	x86_init.irqs.pre_vector_init = x86_init_noop;
> >	x86_init.timers.timer_init = x86_init_noop;
> > +	x86_init.resources.probe_roms = x86_init_noop;
> >  
> >	/* Avoid searching for BIOS MP tables */
> >	x86_init.mpparse.find_mptable = x86_init_noop;
> > 
> > base-commit: 37136bf5c3a6f6b686d74f41837a6406bec6b7bc
> > -- 
> > 2.43.0
> 
> Thanks, Naman!
> 
> Tested-by: Roman Kisel <romank@linux.microsoft.com>
> Reviewed-by: Roman Kisel <romank@linux.microsoft.com>

Applied to hyperv-fixes. Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-12  2:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16  6:12 [PATCH] x86/hyperv/vtl: Stop kernel from probing VTL0 low memory Naman Jain
2025-01-17 17:01 ` Roman Kisel
2025-02-12  2:17   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).