From nobody Thu Nov 14 05:50:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1562252392; cv=none; d=zoho.com; s=zohoarc; b=cjOr6GpyGHzMpFMEY7Yo1bFqAmIaKOx6OIcRCAUvSUeBvB6/yYpF3+XXLLHFG9RVuM8W+xkrqOdkl2NELyh2NZ/Foiy0Q8dXb45uOZhBsbPVswVLnSewI/zvRtlTtNHxqdSZEf1lOpoR3BVnFw4HYEJsIwdfxP5TFhB9BstvI2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562252392; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=h+jVECw4l8yGYxARn3Bp97saeOS37W844yScoCp391s=; b=gzwSucfZ3FLC+9D7UX2kytM9m+XKW6L12tiBEqOAS/Ja7n1yUOdo7nU6T6ef/c0HPMCESXs63/+Chl8Vm0m1YGnXTJUohvmloTVFH330L/nxdhoAFbRYxO+zPgiOQUvEJN0e6xeEI3zYPzCIsJn8W/o7VtG8hOEytpAV8xR1yms= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1562252392293458.6101117531982; Thu, 4 Jul 2019 07:59:52 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hj3CB-0006lJ-Hc; Thu, 04 Jul 2019 14:58:47 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hj3C9-0006iP-Sc for xen-devel@lists.xenproject.org; Thu, 04 Jul 2019 14:58:45 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 367a7e4e-9e6c-11e9-b51b-97b70c203816; Thu, 04 Jul 2019 14:58:42 +0000 (UTC) X-Inumbo-ID: 367a7e4e-9e6c-11e9-b51b-97b70c203816 Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: r9FwiRVwyiNuVwGckpLDiYkRTu+u8eVktrQjLscGfacuQVqlny5F60pJrvtzSKklIf2qrBCabj dLETNo5//5FuSuHA/RhyKoEzmVhIJ3D6mLPEBh876PP/UAISbHHH4ZNtw26WXOnP5h6qC69YvI eM8Ck5I8y1qPsgSsBm9PJw61pfP+Q2VZLTaBKGkG9dBaVI9Hf78A09b54ytMgFCod5EFAuGsxb pa8q23Wf5V0i8s9jRW5cjtal3PuUJcUbYAjADrRLFQ3+igTA1vMlr42OG+ywJI1wPY9mFywNvI OSo= X-SBRS: 2.7 X-MesageID: 2602754 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,451,1557201600"; d="scan'208";a="2602754" From: Anthony PERARD To: Date: Thu, 4 Jul 2019 15:42:23 +0100 Message-ID: <20190704144233.27968-26-anthony.perard@citrix.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190704144233.27968-1-anthony.perard@citrix.com> References: <20190704144233.27968-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 25/35] OvmfPkg/XenPlatformPei: Reserve VGA memory region, to boot Linux X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Jordan Justen , Julien Grall , Anthony PERARD , xen-devel@lists.xenproject.org, Laszlo Ersek Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Linux panic if the VGA region isn't reserved. When Linux is booted on EFI system, it expects the memory at 0xa0000 to _not_ be conventional memory. Otherwise a variable isn't initialised properly and Linux panic when a virtual console/terminal is asked to be created. See for more detail: https://lists.xenproject.org/archives/html/xen-devel/2019-03/msg02139.html Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1689 Signed-off-by: Anthony PERARD Acked-by: Laszlo Ersek --- Notes: v3: - fix commit message OvmfPkg/XenPlatformPei/Xen.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c index 62a2c3ed93..9866b7c212 100644 --- a/OvmfPkg/XenPlatformPei/Xen.c +++ b/OvmfPkg/XenPlatformPei/Xen.c @@ -291,6 +291,12 @@ XenPublishRamRegions ( Status =3D XenGetE820Map (&E820Map, &E820EntriesCount); ASSERT_EFI_ERROR (Status); =20 + AddMemoryBaseSizeHob (0, 0xA0000); + // + // Video memory + Legacy BIOS region, to allow Linux to boot. + // + AddReservedMemoryBaseSizeHob (0xA0000, BASE_1MB - 0xA0000, TRUE); + for (Index =3D 0; Index < E820EntriesCount; Index++) { UINT64 Base; UINT64 End; @@ -304,6 +310,16 @@ XenPublishRamRegions ( Base =3D ALIGN_VALUE (Entry->BaseAddr, (UINT64)EFI_PAGE_SIZE); End =3D (Entry->BaseAddr + Entry->Length) & ~(UINT64)EFI_PAGE_MASK; =20 + // + // Ignore the first 1MB, this is handled before the loop. + // + if (Base < BASE_1MB) { + Base =3D BASE_1MB; + } + if (Base >=3D End) { + continue; + } + switch (Entry->Type) { case EfiAcpiAddressRangeMemory: AddMemoryRangeHob (Base, End); --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel