From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mx.groups.io with SMTP id smtpd.web12.4577.1665396763122194924 for ; Mon, 10 Oct 2022 03:12:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=LfiDlXT/; spf=pass (domain: ventanamicro.com, ip: 209.85.215.175, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pg1-f175.google.com with SMTP id b5so9927645pgb.6 for ; Mon, 10 Oct 2022 03:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fo4FSohLRwNRa1a9qzgCaY+L/doGRGW7QYtvS3xrbKQ=; b=LfiDlXT/T7oJGTQ1itq7jbGvvR6/oEXhP1QWRH6kCpcydGBwXwwC+f+0vPaVXhSwJ5 S/6LvLcz8SKzTmkGzd6+mUIbMdNLllLv/1RBpsvmVYXpdvgb8jIK8Y/923VLb+4YkrYT 0RnlNDTtqzg1RuxoCe36+Ok0H+EA1Uajcjiss0eM/ci1Y15LDCntpyn+c5FGtgRA+VSJ u/I+cl4NrTe94c3/Mv3zYDYas2X2KHLtsEZ0+oc4oW6hbPkhjWDhzEJJfBJZTV4ZY+BX dIpphtOlIh3tzkYdFGwnQpwgJdOIM68Lca9R1udXKhFXHyggu/xe0EAmJXgaa5ko/OWM AM1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fo4FSohLRwNRa1a9qzgCaY+L/doGRGW7QYtvS3xrbKQ=; b=e66zpZIkKuWgvdvnKScCNy66r31g7oIJLR9OJUDuUe0wIsh5H0rgrm+KEHOOTbNokZ RZ4ekv0R+rqbZ289sJwZJU5gsEa7/MfssiSnPCo/b8TXKqVFpFWwXcHrWL4h7m2YGStn /DrEMtPTAIh7bwbFjtSf0ZzEoFua5jE9HBkLUlmSWetRrJGOP7T5eTbkgVOw3xyth54I mwgG1QD6PYWf2KzGNdd7996+8l7Jnx6mC51Jz58fRAAySZVwz2MpSWmTM+d/UuPI0pU6 jXIaUndT/wNWD/tekBDHma31q+lvXI9TTb9gpYhE+4COQFlu59hNckZBIulG8XcKNgn4 ceCg== X-Gm-Message-State: ACrzQf33p2CBG7tE/jRjTS/HxgO9jG+2vx8vnMw8oym2DtZfumqo4x1u qBBMq+fuuAanGFJ8kGNXbugpD/gGx2w0eg== X-Google-Smtp-Source: AMsMyM660/78hd53nbgFuZYljBGQKuOwqwRNUFalIe4uzSITEUqhQWBSyDsus3SpQWD/PETnBl32/g== X-Received: by 2002:a05:6a00:b85:b0:563:4623:ec40 with SMTP id g5-20020a056a000b8500b005634623ec40mr6072309pfj.56.1665396762309; Mon, 10 Oct 2022 03:12:42 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id h17-20020a170902f55100b001788ccecbf5sm6302138plf.31.2022.10.10.03.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 03:12:41 -0700 (PDT) From: "Sunil V L" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann Subject: [edk2-staging/RiscV64QemuVirt PATCH 11/29] OvmfPkg/PlatformPei: Refactor to allow other architectures Date: Mon, 10 Oct 2022 15:41:44 +0530 Message-Id: <20221010101202.1146624-12-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221010101202.1146624-1-sunilvl@ventanamicro.com> References: <20221010101202.1146624-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4076 Currently, PlatformPei supports only X86 architecture. So, refactor it to allow other CPU architectures. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Sunil V L --- OvmfPkg/PlatformPei/PlatformPei.inf | 34 +++++++++++-------- OvmfPkg/PlatformPei/{ => Ia32_X64}/Platform.h | 0 OvmfPkg/PlatformPei/{ => Ia32_X64}/AmdSev.c | 0 .../PlatformPei/{ => Ia32_X64}/ClearCache.c | 0 .../{ => Ia32_X64}/FeatureControl.c | 0 OvmfPkg/PlatformPei/{ => Ia32_X64}/Fv.c | 0 OvmfPkg/PlatformPei/{ => Ia32_X64}/IntelTdx.c | 0 .../PlatformPei/{ => Ia32_X64}/MemDetect.c | 0 .../PlatformPei/{ => Ia32_X64}/MemTypeInfo.c | 0 OvmfPkg/PlatformPei/{ => Ia32_X64}/Platform.c | 0 10 files changed, 19 insertions(+), 15 deletions(-) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/Platform.h (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/AmdSev.c (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/ClearCache.c (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/FeatureControl.c (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/Fv.c (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/IntelTdx.c (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/MemDetect.c (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/MemTypeInfo.c (100%) rename OvmfPkg/PlatformPei/{ => Ia32_X64}/Platform.c (100%) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf index 3cd83e6ec3e5..683ebf1a440a 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -22,16 +22,16 @@ [Defines] # VALID_ARCHITECTURES = IA32 X64 EBC # -[Sources] - AmdSev.c - ClearCache.c - FeatureControl.c - Fv.c - MemDetect.c - MemTypeInfo.c - Platform.c - Platform.h - IntelTdx.c +[Sources.IA32, Sources.X64] + Ia32_X64/AmdSev.c + Ia32_X64/ClearCache.c + Ia32_X64/FeatureControl.c + Ia32_X64/Fv.c + Ia32_X64/MemDetect.c + Ia32_X64/MemTypeInfo.c + Ia32_X64/Platform.c + Ia32_X64/Platform.h + Ia32_X64/IntelTdx.c [Packages] EmbeddedPkg/EmbeddedPkg.dec @@ -57,14 +57,16 @@ [LibraryClasses] PeiServicesLib PeiServicesTablePointerLib PeimEntryPoint + PcdLib + PlatformInitLib + +[LibraryClasses.IA32, LibraryClasses.X64] + MtrrLib + VmgExitLib QemuFwCfgLib QemuFwCfgS3Lib QemuFwCfgSimpleParserLib - MtrrLib MemEncryptSevLib - PcdLib - VmgExitLib - PlatformInitLib [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase @@ -99,7 +101,6 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable @@ -116,6 +117,9 @@ [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdGhcbHypervisorFeatures gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask +[Pcd.IA32, Pcd.X64] + gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode + [FixedPcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidSize diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Ia32_X64/Platform.h similarity index 100% rename from OvmfPkg/PlatformPei/Platform.h rename to OvmfPkg/PlatformPei/Ia32_X64/Platform.h diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/Ia32_X64/AmdSev.c similarity index 100% rename from OvmfPkg/PlatformPei/AmdSev.c rename to OvmfPkg/PlatformPei/Ia32_X64/AmdSev.c diff --git a/OvmfPkg/PlatformPei/ClearCache.c b/OvmfPkg/PlatformPei/Ia32_X64/ClearCache.c similarity index 100% rename from OvmfPkg/PlatformPei/ClearCache.c rename to OvmfPkg/PlatformPei/Ia32_X64/ClearCache.c diff --git a/OvmfPkg/PlatformPei/FeatureControl.c b/OvmfPkg/PlatformPei/Ia32_X64/FeatureControl.c similarity index 100% rename from OvmfPkg/PlatformPei/FeatureControl.c rename to OvmfPkg/PlatformPei/Ia32_X64/FeatureControl.c diff --git a/OvmfPkg/PlatformPei/Fv.c b/OvmfPkg/PlatformPei/Ia32_X64/Fv.c similarity index 100% rename from OvmfPkg/PlatformPei/Fv.c rename to OvmfPkg/PlatformPei/Ia32_X64/Fv.c diff --git a/OvmfPkg/PlatformPei/IntelTdx.c b/OvmfPkg/PlatformPei/Ia32_X64/IntelTdx.c similarity index 100% rename from OvmfPkg/PlatformPei/IntelTdx.c rename to OvmfPkg/PlatformPei/Ia32_X64/IntelTdx.c diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/Ia32_X64/MemDetect.c similarity index 100% rename from OvmfPkg/PlatformPei/MemDetect.c rename to OvmfPkg/PlatformPei/Ia32_X64/MemDetect.c diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/Ia32_X64/MemTypeInfo.c similarity index 100% rename from OvmfPkg/PlatformPei/MemTypeInfo.c rename to OvmfPkg/PlatformPei/Ia32_X64/MemTypeInfo.c diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Ia32_X64/Platform.c similarity index 100% rename from OvmfPkg/PlatformPei/Platform.c rename to OvmfPkg/PlatformPei/Ia32_X64/Platform.c -- 2.25.1