From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web11.10128.1678358252291688826 for ; Thu, 09 Mar 2023 02:37:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=xkJFTPer; spf=pass (domain: rivosinc.com, ip: 209.85.214.182, mailfrom: dhaval@rivosinc.com) Received: by mail-pl1-f182.google.com with SMTP id i10so1482463plr.9 for ; Thu, 09 Mar 2023 02:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1678358251; 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=s3NgGQQqLD023cQkGZ69Z3GP4f4TSS3Rjh1OojuQnfY=; b=xkJFTPeroQeP0fOZi4kFON34xuv4giISq8eJ6E/dFnPm+4hoJZkiu3fSQBumCAeyx6 Xt7za/Uo3zc0T54wQANgAlHo7lGudMC27Yw2+g/IpjjMqsKWFagRgSH7Nx3bHQNxigSa SKSMrMevil4oAuni8bKZjLY3KkUYOSoUVIVdxo6SHwdYOl7GbfQb8HVRAyiv0ibGEGpW 9FIZWx5FuhtQ6ZXJIc83x0yMfzp+nlg1p2VaJLdcAiCpRTBfFR1zZLScWEJRTqrFb+If k5zJ7aVLgojP+7+r5YAZ5p+OUaeVp19CrSkrnbLHikT0BYvanqGA4qQMjRwXo7Tx0IIL +yFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678358251; 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=s3NgGQQqLD023cQkGZ69Z3GP4f4TSS3Rjh1OojuQnfY=; b=izrhIga3JVp3QK9vbMkC9XxKorT5c6rDYV9vrmpOBtE4zHSP7FjAJcsJcJa5oMz3yp XTM/KrjcYAkk0NEhzn1Tnx4fpdkdznvWeTMitf+O+jQXBSSerA+kkA6qhQjsxWTyR9EU Vfo9+eeXUTJMYgUf0H8yieYskHeL9+reU421NnxvFJSGXZOBe1Z9ws0t4rcIu9mOVXLF n3+WZOKHLCk9S/pWTTBj4O/9ifFVmxIleDIjtTlf39JGAotRHeujIiwM3SpLjwJO+zsH W+A2Ci4bp1Rbfch75C+9Y126PBaTWCwx5gIM2eIzIici58VFyHsGghKgo+Dj6shY3Zjh HZpQ== X-Gm-Message-State: AO0yUKUb96LxP3m1ZH23xdV1GBRV1kmlY+ry5VNK3mupcXO9yQhKnONU GITSitpJDcTr+Nj0yV2U+xnORf60Kwk0Y4WNSQ/4R36o X-Google-Smtp-Source: AK7set/Ol88BDhtiR0J7I4c2dAtYomDzCIAqDA/hUYfCNKQH45FFUdHZWTWtJ0mbvNrm0O902tZvuQ== X-Received: by 2002:a17:90a:190f:b0:237:d867:2260 with SMTP id 15-20020a17090a190f00b00237d8672260mr26340167pjg.4.1678358251581; Thu, 09 Mar 2023 02:37:31 -0800 (PST) Return-Path: Received: from dhaval.. ([171.76.81.12]) by smtp.gmail.com with ESMTPSA id nm19-20020a17090b19d300b002340f58e19bsm1293374pjb.45.2023.03.09.02.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 02:37:31 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [PATCH v3 2/2] UefiPayloadPkg: Move INT prog outside common flow Date: Thu, 9 Mar 2023 16:07:21 +0530 Message-Id: <20230309103721.1869468-3-dhaval@rivosinc.com> X-Mailer: git-send-email 2.40.0.rc0.57.g454dfcbddf In-Reply-To: <20230309103721.1869468-1-dhaval@rivosinc.com> References: <20230309103721.1869468-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 --- Notes: v3: - Added legacy INT intialization to X64 path as well 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 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.=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 07f4c1d29686..45127689a24b 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -478,12 +478,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.40.0.rc0.57.g454dfcbddf