From nobody Fri Mar 29 10:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89656+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89656+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1652187074; cv=none; d=zohomail.com; s=zohoarc; b=h4bP0KdlEspDG7j0C7k7te3pBpv70kKdThUYRjXA+NMzSjW9F4NXoBIulT47MXJsknfH+S5EW+e96Xtx1BaRCTYzPRs1/Jue+f6NGqsOBwpkFWDb1wU+RNWVnE7UK63vqILcB7qNi0qHukmySKO6vOKO+Q0jdC8Qsmwt+9PLJsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652187074; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9ARbWKnPO22yRrcEoCqHPpDmOv+Bd8IBNVKACCfbFqc=; b=FbuU4gLkz1ltPoHvlogNKqzrmlyHYMC0pTMisRZbjstxSG4WsIMXt6Torjo0tbqqAq70tIQ/u3Ql50cGdkh8av2xLt3hugXPrQY2zv2X7519/tGTochVW2pDr0mkXA+TJfKEsF5zHEyDI2f5BJA+vgpZuWPWE6zJTLno6DOJQlc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89656+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165218707487279.7346746374152; Tue, 10 May 2022 05:51:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iyNlYY1788612x27cwRc1ffM; Tue, 10 May 2022 05:51:14 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.9335.1652187068864256248 for ; Tue, 10 May 2022 05:51:13 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10342"; a="269499096" X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="269499096" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:12 -0700 X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="593493431" X-Received: from amrutaya-mobl1.gar.corp.intel.com (HELO sboeuf-mobl.intel.com) ([10.251.220.13]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:11 -0700 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH 1/4] OvmfPkg: CloudHv: Fix FW_BASE_ADDRESS Date: Tue, 10 May 2022 14:50:43 +0200 Message-Id: <6568b41858f6d8259286dd4b5400d9ddcf80a9ea.1652186234.git.sebastien.boeuf@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sebastien.boeuf@intel.com X-Gm-Message-State: xVMTp0lOia9ahPFgzEV2au7ox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1652187074; bh=AXYtTOOk3M4LPsVd86HqRezGFEj6kXKWw42oyM4Osxo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=w+rkKJD3hbO8EucrUM7Ur3WvFJCE85S5okCSsD+261ugmbWP4oMl1B0aVhufv+2RwVO tA1n8v6pC8G32l4c7zO+/RVkYOP7E0PR1gOou7+fC31Qn0N3NfpnFE/dINuATEgLRg0GW eZpDrfFoMkCuOQzDBnnv15K+SfHOnpLeuOE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1652187076064100007 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf The FW_BASE_ADDRESS value provided by OvmfPkgDefines.fdf.inc is incorrect for the CloudHv target. We know the generated firmware contains a PVH ELF header, meaning it will be loaded according to the address provided through this header. And since we know this address isn't going to change as it's part of CloudHvElfHeader.fdf.inc, we can hardcode it through a new include file CloudHvDefines.fdf.inc, which replaces the generic one OvmfPkgDefines.fdf.inc. With this change, we prevent the firmware from accessing MMIO addresses from the address range 0xffc00000-0xffffffff since we know the firmware hasn't been loaded on this address range. Signed-off-by: Sebastien Boeuf Acked-by: Jiewen Yao --- OvmfPkg/CloudHv/CloudHvDefines.fdf.inc | 65 ++++++++++++++++++++++++++ OvmfPkg/CloudHv/CloudHvX64.fdf | 2 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 OvmfPkg/CloudHv/CloudHvDefines.fdf.inc diff --git a/OvmfPkg/CloudHv/CloudHvDefines.fdf.inc b/OvmfPkg/CloudHv/Cloud= HvDefines.fdf.inc new file mode 100644 index 0000000000..2198cbcd87 --- /dev/null +++ b/OvmfPkg/CloudHv/CloudHvDefines.fdf.inc @@ -0,0 +1,65 @@ +## @file +# FDF include file that defines the main macros and sets the dependent PC= Ds. +# +# Copyright (C) 2014, Red Hat, Inc. +# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +DEFINE BLOCK_SIZE =3D 0x1000 +DEFINE VARS_OFFSET =3D 0 + +DEFINE VARS_SIZE =3D 0x84000 +DEFINE VARS_BLOCKS =3D 0x84 +DEFINE VARS_LIVE_SIZE =3D 0x40000 +DEFINE VARS_SPARE_SIZE =3D 0x42000 + +DEFINE FW_BASE_ADDRESS =3D 0x004FFFD0 +DEFINE FW_SIZE =3D 0x00400000 +DEFINE FW_BLOCKS =3D 0x400 +DEFINE CODE_BASE_ADDRESS =3D 0x00583FD0 +DEFINE CODE_SIZE =3D 0x0037C000 +DEFINE CODE_BLOCKS =3D 0x37C +DEFINE FVMAIN_SIZE =3D 0x00348000 +DEFINE SECFV_OFFSET =3D 0x003CC000 +DEFINE SECFV_SIZE =3D 0x34000 + +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress =3D $(FW_BASE_ADDR= ESS) +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize =3D $(FW_SIZE) +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize =3D $(BLOCK_SIZE) + +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase =3D $(FW_= BASE_ADDRESS) +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize =3D $(VAR= S_LIVE_SIZE) + +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase =3D gUefi= OvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase + gEfiMdeModulePkgT= okenSpaceGuid.PcdFlashNvStorageVariableSize +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogSize =3D $(BLO= CK_SIZE) + +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase =3D gUe= fiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageEventLogBase + gUefiOvmfPkgTok= enSpaceGuid.PcdOvmfFlashNvStorageEventLogSize +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize =3D $(B= LOCK_SIZE) + +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase =3D gUefi= OvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePk= gTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize =3D $(VAR= S_SPARE_SIZE) + +# The OVMF WorkArea contains a fixed size header followed by the actual da= ta. +# The size of header is accessed through a fixed PCD in the reset vector c= ode. +# The value need to be kept in sync with the any changes to the Confidenti= al +# Computing Work Area header defined in the Include/WorkArea.h +SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader = =3D 4 + +SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvBase =3D $(FW_BASE_ADDRESS) +SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataOffset =3D $(VARS_OFFSET) +SET gUefiOvmfPkgTokenSpaceGuid.PcdCfvRawDataSize =3D $(VARS_SIZE) + +SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvBase =3D $(CODE_BASE_ADDRES= S) +SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataOffset =3D $(VARS_SIZE) +SET gUefiOvmfPkgTokenSpaceGuid.PcdBfvRawDataSize =3D $(CODE_SIZE) + +!if $(SMM_REQUIRE) =3D=3D TRUE +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 =3D gUe= fiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase =3D gUe= fiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase +SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase =3D gUe= fiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase +!endif + +DEFINE MEMFD_BASE_ADDRESS =3D 0x800000 diff --git a/OvmfPkg/CloudHv/CloudHvX64.fdf b/OvmfPkg/CloudHv/CloudHvX64.fdf index de64a3a709..a41a553693 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.fdf +++ b/OvmfPkg/CloudHv/CloudHvX64.fdf @@ -11,7 +11,7 @@ ##########################################################################= ###### =20 [Defines] -!include OvmfPkg/OvmfPkgDefines.fdf.inc +!include CloudHvDefines.fdf.inc =20 # # This will allow the flash device image to be recognize as an ELF, with f= irst --=20 2.32.0 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 5 208 026.16 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89656): https://edk2.groups.io/g/devel/message/89656 Mute This Topic: https://groups.io/mt/91011838/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Mar 29 10:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89659+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89659+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1652187137; cv=none; d=zohomail.com; s=zohoarc; b=LI2tp6b12XAsiYG8OcxIv6CirxbPgR2/PCGbFe1WuU3RjOM/AoIcinGdAfh3wfdSSExPT9If4jBR4Ic3viSZKl5D0zCTDmeZWpd1dyAJRPR+zUfJbE7JmHELVFENQPUjyr6cfRfaM2IBJOISvVJU+wVVd+uRm+ZcgSO2/vPvjKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652187137; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=6fuxoDAbuJzrN4ioBlTu2E/Ru0GBHwnumMnyolFqnqo=; b=gPty04O1NIJhpu+QaPg9wgJZvSbm7ceDXBWOUvR7r1aaJXLCoJEfscUXbfBU7DuSUowVMeVP3a9JI0xgiVy28nVUGux/BDldrVG+SlgYdjPRgTMvPyz0zDFroa9GbaaeWi30qBY4nOHbfc5Yz+46DavcWGTpdE6UzoAKjqidkHY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89659+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1652187137226246.2256428105619; Tue, 10 May 2022 05:52:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RAQIYY1788612xLbBSt8D0Vt; Tue, 10 May 2022 05:52:16 -0700 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.9310.1652187135776857658 for ; Tue, 10 May 2022 05:52:16 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10342"; a="269299212" X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="269299212" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:22 -0700 X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="593493510" X-Received: from amrutaya-mobl1.gar.corp.intel.com (HELO sboeuf-mobl.intel.com) ([10.251.220.13]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:21 -0700 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH 2/4] OvmfPkg: Check for QemuFwCfg availability before accessing it Date: Tue, 10 May 2022 14:50:44 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sebastien.boeuf@intel.com X-Gm-Message-State: AE7ivVk5szrqCog9Nwvm4Lfzx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1652187136; bh=8tJyqmbl6iKUA0w9zujA6I6zgfwFox+oKqiqa7dFz6Y=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=CgisAzUxyLN+hUXZ8F7DE+QPXkd66mVYh+zxrJbpQ3DS6iaO4w1z81pYOY2rC2wpA09 GbRSB+XWg5ZNf7RFI/Tn/HyIKCb/M9tGT3c2RCHtv1qgZpnt6q/i9nMDt+ZLMZppYpdW0 3zA0s1S4Gl7p3Q4IEAJgIGuLEKqXzv6W0yY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1652187138568100002 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf There are few places in the codebase assuming QemuFwCfg will be present and supported, which can cause some issues when trying to rely on the QemuFwCfgLibNull implementation of QemuFwCfgLib. Signed-off-by: Sebastien Boeuf Acked-by: Jiewen Yao --- OvmfPkg/Library/PlatformInitLib/Platform.c | 9 ++++++--- OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/P= latformInitLib/Platform.c index 101074f610..cb1a893aef 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -410,14 +410,17 @@ PlatformMaxCpuCountInitialization ( IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { - UINT16 BootCpuCount; + UINT16 BootCpuCount =3D 0; UINT32 MaxCpuCount; =20 // // Try to fetch the boot CPU count. // - QemuFwCfgSelectItem (QemuFwCfgItemSmpCpuCount); - BootCpuCount =3D QemuFwCfgRead16 (); + if (QemuFwCfgIsAvailable ()) { + QemuFwCfgSelectItem (QemuFwCfgItemSmpCpuCount); + BootCpuCount =3D QemuFwCfgRead16 (); + } + if (BootCpuCount =3D=3D 0) { // // QEMU doesn't report the boot CPU count. (BootCpuCount =3D=3D 0) wil= l let diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c b/OvmfPkg/= Library/QemuBootOrderLib/QemuBootOrderLib.c index b5768285d8..67d29ac642 100644 --- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c +++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c @@ -2233,6 +2233,11 @@ GetFrontPageTimeoutFromQemu ( { FIRMWARE_CONFIG_ITEM BootMenuWaitItem; UINTN BootMenuWaitSize; + UINT16 Timeout =3D PcdGet16 (PcdPlatformBootTimeOut); + + if (!QemuFwCfgIsAvailable ()) { + return Timeout; + } =20 QemuFwCfgSelectItem (QemuFwCfgItemBootMenu); if (QemuFwCfgRead16 () =3D=3D 0) { @@ -2257,9 +2262,6 @@ GetFrontPageTimeoutFromQemu ( // return three seconds if the platform default would cause us to skip= the // front page, and return the platform default otherwise. // - UINT16 Timeout; - - Timeout =3D PcdGet16 (PcdPlatformBootTimeOut); if (Timeout =3D=3D 0) { Timeout =3D 3; } --=20 2.32.0 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 5 208 026.16 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89659): https://edk2.groups.io/g/devel/message/89659 Mute This Topic: https://groups.io/mt/91011865/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Mar 29 10:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89657+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89657+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1652187091; cv=none; d=zohomail.com; s=zohoarc; b=helglcsFjW0V6xctqxta5TMPPNgTlk9NuVVdNPSuvOMgw8L6A36/DyIepppUOd1ghCdX5v16++Q4wgYju5mf8GfK43TaeCk7yk4p9sFaZN26u6P5CEqtF7yAcwjklutm77S9npq2iprUYOTo2BrlMPI10WtN6QkLQOOV8pjjW/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652187091; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=tUUBAgwn0NColsym3AhBn1dKnPQly6AO3/ph/H0tLNM=; b=bMxIkQSYw7ITE0aAdeNQCmXc8vd+OO+pLUAE8wENG/fNfvcignwuB+mIMkd+rL3Pctu7LIbOYwkB7GuZLS7Zgfxfz9TtVWw5es0NizDVsRxy/h+MQUEJ5uYW43Xg8EmxgCdrCOCLS1tkQdO1LIjQB5WMOsG6f3goheEd/d6FoMk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89657+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1652187091916306.3367737553806; Tue, 10 May 2022 05:51:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id nWqNYY1788612x8o1opaAaZs; Tue, 10 May 2022 05:51:31 -0700 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.9378.1652187090861440772 for ; Tue, 10 May 2022 05:51:31 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10342"; a="329959285" X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="329959285" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:29 -0700 X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="593493547" X-Received: from amrutaya-mobl1.gar.corp.intel.com (HELO sboeuf-mobl.intel.com) ([10.251.220.13]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:27 -0700 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH 3/4] OvmfPkg: CloudHv: Rely on QemuFwCfgLibNull implementation Date: Tue, 10 May 2022 14:50:45 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sebastien.boeuf@intel.com X-Gm-Message-State: rrp3ugWzZIPGSE6X1YPTbjlkx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1652187091; bh=D2mK7KYMnbvU04FKvA608mxtNQTJNy4rUVhfPx8KG+c=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=FCl3Cr1SZkmGoYXdhNz10PBRfZk4l93MH05w/d/ZcMznP6bc1P47hVOoGzb+vazS1k9 FM2X0rBpW5fiun1Bx9pV+z1Xxd/vPedi1HST+jJvBj4aR/NIv82LMWV8zjvr0Kijrpisa 5jJDjcG4+QuyidHVYwiDERaPxZtz1N+DXrI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1652187092184100001 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Since Cloud Hypervisor doesn't support the fw_cfg mechanism, it's more appropriate to rely on QemuFwCfgLibNull implementation of QemuFwCfgLib since it provides a null implementation that will not issue any PIO accesses to ports 0x510 and 0x511. Signed-off-by: Sebastien Boeuf Acked-by: Jiewen Yao --- OvmfPkg/CloudHv/CloudHvX64.dsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index d1c85f60c7..4d6bc2a84d 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -175,7 +175,7 @@ UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeS= ecurityManagementLib.inf SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVar= iablesLib.inf - QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxeLib.inf + QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibNull.inf QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFw= CfgSimpleParserLib.inf VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf LoadLinuxLib|OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf @@ -305,7 +305,7 @@ MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf + QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibNull.inf =20 !include OvmfPkg/OvmfTpmLibsPeim.dsc.inc =20 --=20 2.32.0 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 5 208 026.16 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89657): https://edk2.groups.io/g/devel/message/89657 Mute This Topic: https://groups.io/mt/91011848/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Mar 29 10:02:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89658+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89658+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1652187104; cv=none; d=zohomail.com; s=zohoarc; b=fa6HHYy9ur08ZLpvpitA5g5yfuqKVhr6gbiFQ5pfJ4sDk3gb905pocY2mVagv4YC0snAxEo4zrTbvwNIUUSkbjc9T1d6+oufJHIjRc5g4AS/plC9LZO539qtfDRM7ujC3RFyyeuOZ88k0PoJaqKLt3OOfnv76IesNImvO5R48T4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652187104; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=PZYDcPd2fiFw1iWDMw7V3cO7RwrmZAex2xzQfA5kVh0=; b=K7/6XjIVoEJ4jKXG9Fd+EtDOmsL26BHTAsj+J1aX4nRfDezfGP9nlOkWN3Lq0hFggJr660CHB8suT+k2ksX7jECJXKxCGLpr8YPYXWfU2P1raUVMQdqXB9/913lQlAz5weiTWo/9kzgVdN6pSeRKRuXIanwxnthLn3dCHQ6I4Xw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89658+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1652187104615478.58918762648784; Tue, 10 May 2022 05:51:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8bUmYY1788612xa7q07pFMB3; Tue, 10 May 2022 05:51:44 -0700 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.9343.1652187103690111753 for ; Tue, 10 May 2022 05:51:43 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10342"; a="251411633" X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="251411633" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:41 -0700 X-IronPort-AV: E=Sophos;i="5.91,214,1647327600"; d="scan'208";a="593493593" X-Received: from amrutaya-mobl1.gar.corp.intel.com (HELO sboeuf-mobl.intel.com) ([10.251.220.13]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2022 05:51:39 -0700 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH 4/4] OvmfPkg: Don't access A20 gate register on Cloud Hypervisor Date: Tue, 10 May 2022 14:50:46 +0200 Message-Id: <4e4441639e49bfbca5bf9f36cf26f3933eadf8f0.1652186234.git.sebastien.boeuf@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sebastien.boeuf@intel.com X-Gm-Message-State: JZtDeSO39PVMFN1qLfJXixsyx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1652187104; bh=2AkZuggI4Vw8zH1BC3VjafUotDxPHeCXZO2W+ajp7lM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Vjhy1/rtfLZDzOf0seEVx5tQaXFHmhzo6VU1WQxd6GVhnulS21QRKZKq2xjhbI/YfCA bs0SBPEU9VhZu0JyLmGEvETj+yZPOwlsMbnnEnOoOcmw6d2Jj+0+kZ/4zeNangojS4HZO K4X08+dAoVuvAGsI6n9tM3ClOwMbIm0I7O0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1652187106223100003 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Since Cloud Hypervisor doesn't emulate an A20 gate register on I/O port 0x92, it's better to avoid accessing it when the platform is identified as Cloud Hypervisor. Signed-off-by: Sebastien Boeuf Acked-by: Jiewen Yao --- OvmfPkg/Library/PlatformInitLib/Platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/P= latformInitLib/Platform.c index cb1a893aef..f2b07dc937 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -314,7 +314,9 @@ PlatformMiscInitialization ( // // Disable A20 Mask // - IoOr8 (0x92, BIT1); + if (PlatformInfoHob->HostBridgeDevId !=3D CLOUDHV_DEVICE_ID) { + IoOr8 (0x92, BIT1); + } =20 // // Build the CPU HOB with guest RAM size dependent address width and 16-= bits --=20 2.32.0 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 5 208 026.16 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89658): https://edk2.groups.io/g/devel/message/89658 Mute This Topic: https://groups.io/mt/91011856/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-