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.web11.52965.1683789167186734949 for ; Thu, 11 May 2023 00:12:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=r6Nk0xBz; spf=pass (domain: rivosinc.com, ip: 209.85.214.170, mailfrom: dhaval@rivosinc.com) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1aad55244b7so63162825ad.2 for ; Thu, 11 May 2023 00:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1683789166; x=1686381166; 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=/57w5BeqQdRmNa5ahZnmyeFh8Blisi5NvrwdMhOfzS0=; b=r6Nk0xBz8mRmKWg3SJuyIDyXinVnraK8AschRig9JS7w1/l9GtW0xWihFTIc4/0XaI 2qPpHsEEWuIFkwAFRbiXvKok7qr8d7ot1Tn4BNHj0S7bvYMtcgGpeRoPfep+Os76nejy nRBSfJ6++dY29JKdIDdbsnBY9m34KfpOD/gMZMycWKXD2VZIgOuEVRAW+/xaH4wytupl vQmKfx3bmVvUr1/zhbC06Pyjyu4TbuCAQtmdIbbNXkRZW+VrHj7hU/vfuu78TOTot0UP MhPRJ//wh7lRCP5lKAaSLjo92fAGKct3bdBRE6u9GsDkqOUmGhi+yqkH63zvd3pV+x1Z 36Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683789166; x=1686381166; 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=/57w5BeqQdRmNa5ahZnmyeFh8Blisi5NvrwdMhOfzS0=; b=aBBJvnGLQ8bZkUOoD72H8X1kMOk1t3uJb65zOvbKemitRyygU+zykj2uRLuO4MTnKv 3AcZnWkhPeOQRD6nmwHoDgYVQSIi6SQoayfQoHwbEniHCn6H9sLueVBAg/SJn9FtQNtK LLX8X70Paz5/yLzV6MeWfgo9sW+2QIQRlPE/Z/Ffkl66xXAi6J9QvVqICCgZGJRe+vhO 75u0KTYGlB9zGqTQAEy4y8LoANeNqYA6haKzPtHeNIk1qUeySaCm1t/eQSnmYs37vPj1 /5kpX+I5nnEug5Ff283+bf/PPIEnAXUlU3Bkn3RGYHlIc7Bgz7BthuhdiRZAcnc6Fp1c Hrcw== X-Gm-Message-State: AC+VfDz+JivgaxSHD7MvxYWbnkz9QLC+jNms0Z67nFZ+WOPqNqCwly8z tFl0AfDL7z8fY4qQoT8moJESNRcV7w8tza3RRs4= X-Google-Smtp-Source: ACHHUZ6Z84TC63pfPO+Mljns2SeZkRiSFI6COq1j3hw2ktQTVQT/tWQtHigp+DxOtN0GuAd2VAdJ0Q== X-Received: by 2002:a17:903:1247:b0:1ab:afd:903a with SMTP id u7-20020a170903124700b001ab0afd903amr26541789plh.24.1683789166509; Thu, 11 May 2023 00:12:46 -0700 (PDT) Return-Path: Received: from dhaval.. ([42.106.13.180]) by smtp.gmail.com with ESMTPSA id w20-20020a1709029a9400b001a9884c02e3sm5111214plp.10.2023.05.11.00.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 00:12:46 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [PATCH v1 2/8] UefiPayloadPkg: Move INT prog outside common flow Date: Thu, 11 May 2023 12:42:20 +0530 Message-Id: <20230511071226.19726-3-dhaval@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511071226.19726-1-dhaval@rivosinc.com> References: <20230511071226.19726-1-dhaval@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 8259 is very arch specific programming. It needs to be moved out to the respective arch flow. Added in both x64 and x32 paths Test: Able to boot UEFI shell with Coreboot Tianocore payload on x86 qemu Cc: Guo Dong Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Dhaval Sharma Reviewed-by: Gua Guo Reviewed-by: James Lu --- Notes: v3: - Added legacy INT intialization to X64 path as well v4: - Updated reviewed-by tag UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c | 6 ++++++ UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 6 ------ UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c b/UefiPaylo= adPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c index 921a38555e21..695d751bbb50 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c +++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c @@ -271,6 +271,12 @@ HandOffToDxeCore ( // Initialize floating point operating environment to be compliant with = UEFI spec.=0D InitializeFloatingPointUnits ();=0D =0D + //=0D + // Mask off all legacy 8259 interrupt sources=0D + //=0D + IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);=0D + IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);=0D +=0D //=0D // Clear page 0 and mark it as allocated if NULL pointer detection is en= abled.=0D //=0D diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/Uefi= PayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c index 8aff00142971..3f7f72ea7f06 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -481,12 +481,6 @@ _ModuleEntryPoint ( Status =3D UniversalLoadDxeCore (DxeFv, &DxeCoreEntryPoint);=0D ASSERT_EFI_ERROR (Status);=0D =0D - //=0D - // Mask off all legacy 8259 interrupt sources=0D - //=0D - IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);=0D - IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);=0D -=0D Hob.HandoffInformationTable =3D (EFI_HOB_HANDOFF_INFO_TABLE *)GetFirstHo= b (EFI_HOB_TYPE_HANDOFF);=0D HandOffToDxeCore (DxeCoreEntryPoint, Hob);=0D =0D diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c b/UefiPayloa= dPkg/UefiPayloadEntry/X64/DxeLoadFunc.c index 84a6112ce64a..1dfb7459e85a 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c +++ b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c @@ -43,6 +43,12 @@ HandOffToDxeCore ( // Initialize floating point operating environment to be compliant with = UEFI spec.=0D InitializeFloatingPointUnits ();=0D =0D + //=0D + // Mask off all legacy 8259 interrupt sources=0D + //=0D + IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);=0D + IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);=0D +=0D //=0D // Clear page 0 and mark it as allocated if NULL pointer detection is en= abled.=0D //=0D --=20 2.34.1