From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web11.6331.1678882762719923709 for ; Wed, 15 Mar 2023 05:19:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=KJLiRWxC; spf=pass (domain: rivosinc.com, ip: 209.85.214.179, mailfrom: dhaval@rivosinc.com) Received: by mail-pl1-f179.google.com with SMTP id c18so1198677ple.11 for ; Wed, 15 Mar 2023 05:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1678882762; 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=V3ZDw0DxMamf6aDWO+Hu9YRpuccxwjJsbb7bQXULvSY=; b=KJLiRWxCRTXwqvXphRBCoxwv14n49z0SoQXROPjKvPZMTeZUXO3XWxddT07uJKRpTN PETiMTNl8+q+s+mPE+lM5y/KTK3p5x14n9MxL7DnKqu9ZHAkryrU13fNs8njywhnRsAq N6dKp/AIjR9TvIZaj0EgiLDI8iOYtSb1WL24UzYLyeshRooi4cIThgNnCf2IwHyKfIl7 KhrSQy8nv8SSC4j8jxKJcWotdtyPdCCr5c8kbfT/noq/MNT/oum1dBjcWzv9YHnZijXO scPVO/O6hUfKoctc42unTV1Yi1JmQ3upLc32kXY74KLK8hHKgaavGJHQj9bLXC4sYDIi ZdUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678882762; 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=V3ZDw0DxMamf6aDWO+Hu9YRpuccxwjJsbb7bQXULvSY=; b=5CTenmX+jbKpf2xRAfulGZET7zpJvmrlJuGIEziOM5B+Mu1KSU7UYAtEpm3ZTsYBBF KrdikLWOHfIMRAqmRijel8M899JY+wVPghgnar8IEGra1P11+2BLBzMRO+Vvx9dEEFws BHyxqSgp6Y75M8ma4Pvq1dxFWDEpNzZRXgu8nk+nmjN3t7fanaYBl77yl5mYtWqRrdc6 hqdYz9u5w7nMXsgf3GhnbsaAXyvD11w2XjlLMc2wSrfpOyIchLe/BO9QR+0g7WZf9j2b YT+7OBROC569EG/WQVBu2LAmbCm2tFyaBOSF3XQua3/HC6jUn/gO5Wj8pS9M31rA54A3 8ifA== X-Gm-Message-State: AO0yUKWvTSK2BXUfxQDpc1nG9T6NFItCfD6eKfC0s2Q/hNoxIb6Q9Wj4 Kyy4/2N+qNzZerdP4ZWseR6PMy7FJnUgFjvpQRyFDQpY X-Google-Smtp-Source: AK7set+iOEhGfqe7zU2R1nHE7yzy4jknk8y7NuGHpQGdaJBfsFrXHohW377BD6x8TrnexXijqoTCdg== X-Received: by 2002:a05:6a20:3954:b0:cb:af96:ace7 with SMTP id r20-20020a056a20395400b000cbaf96ace7mr50188872pzg.46.1678882762101; Wed, 15 Mar 2023 05:19:22 -0700 (PDT) Return-Path: Received: from dhaval.ba.rivosinc.com ([171.76.81.12]) by smtp.gmail.com with ESMTPSA id d13-20020aa7814d000000b005dd98927cc5sm3382239pfn.76.2023.03.15.05.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 05:19:21 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [PATCH v4 2/2] UefiPayloadPkg: Move INT prog outside common flow Date: Wed, 15 Mar 2023 17:49:13 +0530 Message-Id: <20230315121913.119025-3-dhaval@rivosinc.com> X-Mailer: git-send-email 2.40.0.rc0.57.g454dfcbddf In-Reply-To: <20230315121913.119025-1-dhaval@rivosinc.com> References: <20230315121913.119025-1-dhaval@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c index 9d2bfb2fa654..d41e5024b4a1 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. InitializeFloatingPointUnits (); + // + // Mask off all legacy 8259 interrupt sources + // + IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); + IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF); + // // Clear page 0 and mark it as allocated if NULL pointer detection is enabled. // diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c index 07f4c1d29686..45127689a24b 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -478,12 +478,6 @@ _ModuleEntryPoint ( Status = UniversalLoadDxeCore (DxeFv, &DxeCoreEntryPoint); ASSERT_EFI_ERROR (Status); - // - // Mask off all legacy 8259 interrupt sources - // - IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); - IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF); - Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *)GetFirstHob (EFI_HOB_TYPE_HANDOFF); HandOffToDxeCore (DxeCoreEntryPoint, Hob); diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c b/UefiPayloadPkg/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. InitializeFloatingPointUnits (); + // + // Mask off all legacy 8259 interrupt sources + // + IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); + IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF); + // // Clear page 0 and mark it as allocated if NULL pointer detection is enabled. // -- 2.40.0.rc0.57.g454dfcbddf