From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web09.5313.1645785983947021374 for ; Fri, 25 Feb 2022 02:46:24 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=mggdSrSX; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: sebastien.boeuf@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645785984; x=1677321984; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zQcBaJsUnuswZS6Dm46a41EFPlf0LLQHntzLHSpxoS4=; b=mggdSrSX9O5g3cK3WBOT6GzxUKsXduinybaYTvZ6r+j2oIL8bWtHfP6F qYtROnIqPa/Rr8MePJ3oWNeI/Zcpcqpc0nEw0UMdjjylTV+0DUwdNaWVp 3xZZfN+woeU0n6laH6h/rSZkLH6ORnZ+wjn0bB3rbkbfeiwQBECfpa/Sk xrnj5pvtNKoY8VfD3lnE/uxtDcRtAo01NACOAFk0A7q0uIHv6bMOqhJz/ 3ppzVne7eS2oMJfMMwnITtwPmrQnwizFVMRgml6oJlvTUp8eXmBATvudi io4YL7WdV55YdjxsokuVZ4FxT3bCWGQnye2U0i7MvXQR0EcH2SRlKPYcY Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="235982434" X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="235982434" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 02:46:23 -0800 X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="707822335" Received: from cward2-mobl2.ger.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.25.151]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 02:46:21 -0800 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: [PATCH v4 5/7] OvmfPkg: CloudHv: Retrieve RSDP address from PVH Date: Fri, 25 Feb 2022 11:45:31 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Sebastien Boeuf Instead of hardcoding the address of the RSDP in the firmware, let's rely on the PVH structure hvm_start_info to retrieve this information. Acked-by: Gerd Hoffmann Signed-off-by: Sebastien Boeuf --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 2 ++ OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 39 ++++++++++++++------- OvmfPkg/CloudHv/CloudHvX64.fdf | 3 ++ OvmfPkg/Include/IndustryStandard/CloudHv.h | 5 --- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index b36b8413e0..f22bd7cb6d 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -56,6 +56,8 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr + gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize = [Depex] gEfiAcpiTableProtocolGuid diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDx= e/CloudHvAcpi.c index 44a6bb70fe..ff59600d3e 100644 --- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c @@ -7,9 +7,11 @@ = **/ = -#include // CLOUDHV_RSDP_ADDRESS -#include // CpuDeadLoop() -#include // DEBUG() +#include // CLOUDHV_RSDP_= ADDRESS +#include // hvm_start_info +#include // CpuDeadLoop() +#include // DEBUG() +#include // PcdGet32() = #include "AcpiPlatform.h" = @@ -23,20 +25,33 @@ InstallCloudHvTables ( EFI_STATUS Status; UINTN TableHandle; = - EFI_ACPI_DESCRIPTION_HEADER *Xsdt; - VOID *CurrentTableEntry; - UINTN CurrentTablePointer; - EFI_ACPI_DESCRIPTION_HEADER *CurrentTable; - UINTN Index; - UINTN NumberOfTableEntries; - EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt2Table; - EFI_ACPI_DESCRIPTION_HEADER *DsdtTable; + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; + VOID *CurrentTableEntry; + UINTN CurrentTablePointer; + EFI_ACPI_DESCRIPTION_HEADER *CurrentTable; + UINTN Index; + UINTN NumberOfTableEntries; + EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt2Table; + EFI_ACPI_DESCRIPTION_HEADER *DsdtTable; + EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *AcpiRsdpStructurePtr; + UINT32 *PVHResetVectorData; + struct hvm_start_info *pvh_start_info; = Fadt2Table =3D NULL; DsdtTable =3D NULL; TableHandle =3D 0; NumberOfTableEntries =3D 0; - EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *AcpiRsdpStructurePtr =3D = (VOID *)CLOUDHV_RSDP_ADDRESS; + AcpiRsdpStructurePtr =3D NULL; + PVHResetVectorData =3D NULL; + pvh_start_info =3D NULL; + + PVHResetVectorData =3D (VOID *)(UINTN)PcdGet32 (PcdXenPvhStartOfDayStruc= tPtr); + if (PVHResetVectorData =3D=3D 0) { + return EFI_NOT_FOUND; + } + + pvh_start_info =3D (struct hvm_start_info *)(UINTN)PVHResetVectorD= ata[0]; + AcpiRsdpStructurePtr =3D (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *= )(UINTN)pvh_start_info->rsdp_paddr; = // If XSDT table is found, just install its tables. // Otherwise, try to find and install the RSDT tables. diff --git a/OvmfPkg/CloudHv/CloudHvX64.fdf b/OvmfPkg/CloudHv/CloudHvX64.fdf index f638978730..7c480f1cbc 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.fdf +++ b/OvmfPkg/CloudHv/CloudHvX64.fdf @@ -96,6 +96,9 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSnpSecretsBase|gUefiOvm= fPkgTokenSpaceGuid.PcdO 0x00E000|0x001000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase|gUefiOvmfPkgTokenSpaceGuid.Pcd= OvmfCpuidSize = +0x00F000|0x001000 +gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr|gUefiOvmfPkgTokenS= paceGuid.PcdXenPvhStartOfDayStructPtrSize + 0x010000|0x010000 gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpace= Guid.PcdOvmfSecPeiTempRamSize = diff --git a/OvmfPkg/Include/IndustryStandard/CloudHv.h b/OvmfPkg/Include/I= ndustryStandard/CloudHv.h index 86404cc97e..d31ecc9eec 100644 --- a/OvmfPkg/Include/IndustryStandard/CloudHv.h +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h @@ -38,9 +38,4 @@ // #define CLOUDHV_SMBIOS_ADDRESS 0xf0000 = -// -// RSDP address -// -#define CLOUDHV_RSDP_ADDRESS 0xa0000 - #endif // __CLOUDHV_H__ -- = 2.32.0 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, = 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 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.