From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.26307.1685610451276205440 for ; Thu, 01 Jun 2023 02:07:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uTmtwQII; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D1E5460B8A for ; Thu, 1 Jun 2023 09:07:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44AB8C4339B for ; Thu, 1 Jun 2023 09:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685610450; bh=7V8v+g+fQQupJbdJZwUX1a2nNhSYsZCQG9PiDFE8N1U=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uTmtwQIIUrOTiS9tJ9BWuqhgujKFfBIzo7hEOcQMtr7x/IzpLhwf043UeRxd6M4AW 3puj7wkKkkh/eERU1yLcznD8yVUHwZAbi+BnsV+Cb1pyxKzjXiTCIuapINCj7wdcR5 T35lbI42BRlgU9XR9akiDB2KArUmMDyhDJQkTkG0RBcRRO2elT10US/xAbKzX/ydqH iQiaifG3b46qIfCQUMGB2wNr04fmKzeo70Hvqxev6TvtZmWm7sRKXT4WZQQTddKirx dc6dwLRhVGPpVu5U+Zko04vXbS7Kbe8Wf+90oWnDWehbc+ENbEaW5LWkuHoptifCbP Y1sRx1XC7/f/g== Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2af2958db45so8206541fa.1 for ; Thu, 01 Jun 2023 02:07:30 -0700 (PDT) X-Gm-Message-State: AC+VfDyuEEmSsiude6QxSZ6lmtGy2fmlRDCLz69G3+/oqJDlOT9h5T35 LyYG/zRMqax6NuBhDKZuu++aGOtfgKdJbKY5jqM= X-Google-Smtp-Source: ACHHUZ7eCxKEhxGOIPZ/ym6YS4TE4QKmf/nKG+TdKJNWiY3aSfBDuaKqjrq4aWMxWqN9i4Eb/MMmKJiOLvzQmkiyLOw= X-Received: by 2002:a2e:9405:0:b0:2a8:a5b8:185a with SMTP id i5-20020a2e9405000000b002a8a5b8185amr3792846ljh.10.1685610448334; Thu, 01 Jun 2023 02:07:28 -0700 (PDT) MIME-Version: 1.0 References: <20230601075731.531384-1-kraxel@redhat.com> In-Reply-To: From: "Ard Biesheuvel" Date: Thu, 1 Jun 2023 11:07:17 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] OvmfPkg/PlatformInitLib: limit phys-bits to 46. To: Gerd Hoffmann Cc: devel@edk2.groups.io, Jordan Justen , Oliver Steffen , Pawel Polawski , Ard Biesheuvel , Jiewen Yao , Fiona Ebner Content-Type: text/plain; charset="UTF-8" On Thu, 1 Jun 2023 at 10:13, Ard Biesheuvel wrote: > > On Thu, 1 Jun 2023 at 09:57, Gerd Hoffmann wrote: > > > > Older linux kernels have problems with phys-bits larger than 46, > > ubuntu 18.04 (kernel 4.15) has been reported to be affected. > > > > Reduce phys-bits limit from 47 to 46. > > > > Reported-by: Fiona Ebner > > Signed-off-by: Gerd Hoffmann > > Thanks I'll queue this up > Merged as #4461 > > --- > > OvmfPkg/Library/PlatformInitLib/MemDetect.c | 9 ++++++--- > > 1 file changed, 6 insertions(+), 3 deletions(-) > > > > diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > > index 1102b00ecbf0..662e7e85bbc5 100644 > > --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c > > +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c > > @@ -646,16 +646,19 @@ PlatformAddressWidthFromCpuid ( > > )); > > > > if (Valid) { > > - if (PhysBits > 47) { > > + if (PhysBits > 46) { > > /* > > * Avoid 5-level paging altogether for now, which limits > > * PhysBits to 48. Also avoid using address bit 48, due to sign > > * extension we can't identity-map these addresses (and lots of > > * places in edk2 assume we have everything identity-mapped). > > * So the actual limit is 47. > > + * > > + * Also some older linux kernels apparently have problems handling > > + * phys-bits > 46 correctly, so use that as limit. > > */ > > - DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 47 (avoid 5-level paging)\n", __func__)); > > - PhysBits = 47; > > + DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 46 (avoid 5-level paging)\n", __func__)); > > + PhysBits = 46; > > } > > > > if (!Page1GSupport && (PhysBits > 40)) { > > -- > > 2.40.1 > >