From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mx.groups.io with SMTP id smtpd.web09.8115.1667136561521405714 for ; Sun, 30 Oct 2022 06:29:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=E9/cS4wy; spf=pass (domain: ventanamicro.com, ip: 209.85.214.170, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pl1-f170.google.com with SMTP id d24so8666434pls.4 for ; Sun, 30 Oct 2022 06:29:21 -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=dLaOAHpYqyQ3SaFtedPgg4ib7GY5nk16cIbFE3/ke/k=; b=E9/cS4wyzAiFLA1lqkQkh03m0nbhDx8gyBRnvcUakDFT6Cg1HtTm8N2n1atDGs8wRF F0IvAcr0tab23LTRSAsAk97eI+/laf5VPZMijLLP629Odgt5oRIvmktwf1EVaUXvRrP/ EP+NKi8FfoNkSXbfwc6tUBQwfLUhe9Mr44cnHCgF8nK7rRWTw/+iFqSoCqN4Yd8rXawE Tur+uHVDe9QmwWMZxkls2UEDu6soeUWDmBrM8WLYd4dT3rTHBMURZWz62bkyb9LSkLfw /57BwBBi8zPItZn8iySFIkx21pa/7+KJutlqBALMALFUfb8DSG77bttlelPMAs8hD+Ic 9GaQ== 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=dLaOAHpYqyQ3SaFtedPgg4ib7GY5nk16cIbFE3/ke/k=; b=3fV+PYklf+TqNsYbPPWfFz/02WWk9xFrZK3TbRHrYGIHl7WfEFZ56zNSZAgshuQ2ZC SuvVGvjQNfgUwF1UbIYGRmvztd18WnkR+pNrCNmDoNeFjsGHrsYykTI0oDtwQ9OSazVm SYW3QzptpBZZG+zbgDmlkb/Ik17mYmL+aYY644PKsWWHztNZ3g2ZN9R1fWJFJjG6dexy xpauBCRTrrbIOEk05r8ba0jfa7Kp7olydEGe64oZtHbou3rNokw0UGxlo4yNblNjG210 YvFcuEr5utSAd4ZdL+kpBeS3kBOfME9NQ+2ff3xbv3HLJ4giztKOHmA/diMdKqINs87J GjQA== X-Gm-Message-State: ACrzQf1Ge9m6rvV4znXTgH/bVAo+rAEsqnvm0uYzqbI5AX7z7OMQdUf1 q/aqS9AjU4uLlD3G9VbDiYKpRp5zaCpfdQ== X-Google-Smtp-Source: AMsMyM7WcxYCYo8lDXfFjW/KaHS3fvNCPsabJl0qm+kDbDCk/QNBlpmqOfXTkq6GRYK7sfnI0u5ePQ== X-Received: by 2002:a17:902:bd47:b0:17f:685b:27ee with SMTP id b7-20020a170902bd4700b0017f685b27eemr8890130plx.22.1667136560849; Sun, 30 Oct 2022 06:29:20 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([49.206.12.236]) by smtp.gmail.com with ESMTPSA id r10-20020aa79eca000000b0056b6a22d6c9sm2612330pfq.212.2022.10.30.06.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 06:29:20 -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 V5 11/30] OvmfPkg/PlatformPei: Refactor to allow other architectures Date: Sun, 30 Oct 2022 18:58:23 +0530 Message-Id: <20221030132842.54077-12-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221030132842.54077-1-sunilvl@ventanamicro.com> References: <20221030132842.54077-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/{ => Ia32X64}/Platform.h | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/AmdSev.c | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/ClearCache.c | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/FeatureControl.c | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/Fv.c | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/IntelTdx.c | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/MemDetect.c | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/MemTypeInfo.c | 0 OvmfPkg/PlatformPei/{ => Ia32X64}/Platform.c | 0 10 files changed, 19 insertions(+), 15 deletions(-) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf index 3cd83e6ec3e5..c637f621cb1f 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] + Ia32X64/AmdSev.c + Ia32X64/ClearCache.c + Ia32X64/FeatureControl.c + Ia32X64/Fv.c + Ia32X64/MemDetect.c + Ia32X64/MemTypeInfo.c + Ia32X64/Platform.c + Ia32X64/Platform.h + Ia32X64/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/Ia32X64/Platform.h similarity index 100% rename from OvmfPkg/PlatformPei/Platform.h rename to OvmfPkg/PlatformPei/Ia32X64/Platform.h diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/Ia32X64/AmdSev.c similarity index 100% rename from OvmfPkg/PlatformPei/AmdSev.c rename to OvmfPkg/PlatformPei/Ia32X64/AmdSev.c diff --git a/OvmfPkg/PlatformPei/ClearCache.c b/OvmfPkg/PlatformPei/Ia32X64/ClearCache.c similarity index 100% rename from OvmfPkg/PlatformPei/ClearCache.c rename to OvmfPkg/PlatformPei/Ia32X64/ClearCache.c diff --git a/OvmfPkg/PlatformPei/FeatureControl.c b/OvmfPkg/PlatformPei/Ia32X64/FeatureControl.c similarity index 100% rename from OvmfPkg/PlatformPei/FeatureControl.c rename to OvmfPkg/PlatformPei/Ia32X64/FeatureControl.c diff --git a/OvmfPkg/PlatformPei/Fv.c b/OvmfPkg/PlatformPei/Ia32X64/Fv.c similarity index 100% rename from OvmfPkg/PlatformPei/Fv.c rename to OvmfPkg/PlatformPei/Ia32X64/Fv.c diff --git a/OvmfPkg/PlatformPei/IntelTdx.c b/OvmfPkg/PlatformPei/Ia32X64/IntelTdx.c similarity index 100% rename from OvmfPkg/PlatformPei/IntelTdx.c rename to OvmfPkg/PlatformPei/Ia32X64/IntelTdx.c diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/Ia32X64/MemDetect.c similarity index 100% rename from OvmfPkg/PlatformPei/MemDetect.c rename to OvmfPkg/PlatformPei/Ia32X64/MemDetect.c diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/Ia32X64/MemTypeInfo.c similarity index 100% rename from OvmfPkg/PlatformPei/MemTypeInfo.c rename to OvmfPkg/PlatformPei/Ia32X64/MemTypeInfo.c diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Ia32X64/Platform.c similarity index 100% rename from OvmfPkg/PlatformPei/Platform.c rename to OvmfPkg/PlatformPei/Ia32X64/Platform.c -- 2.38.0