qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SeaBIOS] [PATCH v5] limit physical address space size


From: Kevin O'Connor
Subject: Re: [SeaBIOS] [PATCH v5] limit physical address space size
Date: Wed, 8 Nov 2023 13:35:52 -0500

On Tue, Nov 07, 2023 at 02:03:09PM +0100, Gerd Hoffmann wrote:
> For better compatibility with old linux kernels,
> see source code comment.
> 
> Related (same problem in ovmf):
> https://github.com/tianocore/edk2/commit/c1e853769046

Thanks.  I'll defer to your judgement on this.  It does seem a little
odd to alter the CPUPhysBits variable itself instead of adding
additional checking to the pciinit.c code that uses CPUPhysBits.
(That is, if there are old Linux kernels that can't handle a very high
PCI space, then a workaround in the PCI code might make it more clear
what is occurring.)

Cheers,
-Kevin


> 
> Cc: Claudio Fontana <cfontana@suse.de>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  src/fw/paravirt.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
> index e5d4eca0cb5a..a2c9c64d5e78 100644
> --- a/src/fw/paravirt.c
> +++ b/src/fw/paravirt.c
> @@ -182,6 +182,14 @@ static void physbits(int qemu_quirk)
>              __func__, signature, pae ? "yes" : "no", CPULongMode ? "yes" : 
> "no",
>              physbits, valid ? "yes" : "no");
>  
> +    if (valid && physbits > 46) {
> +        // Old linux kernels have trouble dealing with more than 46
> +        // phys-bits, so avoid that for now.  Seems to be a bug in the
> +        // virtio-pci driver.  Reported: centos-7, ubuntu-18.04
> +        dprintf(1, "%s: using phys-bits=46 (old linux kernel 
> compatibility)\n", __func__);
> +        physbits = 46;
> +    }
> +
>      if (valid)
>          CPUPhysBits = physbits;
>  }
> -- 
> 2.41.0
> 
> _______________________________________________
> SeaBIOS mailing list -- seabios@seabios.org
> To unsubscribe send an email to seabios-leave@seabios.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]