From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mx.groups.io with SMTP id smtpd.web12.2593.1649471133404133967 for ; Fri, 08 Apr 2022 19:25:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XDnr2r3s; spf=pass (domain: gmail.com, ip: 209.85.210.174, mailfrom: akihiko.odaki@gmail.com) Received: by mail-pf1-f174.google.com with SMTP id p8so9963422pfh.8 for ; Fri, 08 Apr 2022 19:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lSkz2EdH+QxauMaAUzIW096u1nE37cFVOPFebVP6Rtk=; b=XDnr2r3s7YsuTj11DeieiSDZQYpVsZDsFY8QSvXGyd7l1GRDaK7M+eEaz/oVIBJ7nY T36XiBktSMWBhr3nyq4knjuuKaOWGiV8wY4Fv+KJDmYj9/uONtBgz9/dHtqT4ts+tSIN wUsHQu0ajtBvqT4JsBXx/Bj2up8Cq2qiFzr4V8hGeQ3Py41IfzrnkF0GYs9nZmIOC29P 8ULvD473N7m8q8LE/UtPbVCZ5B9O6oQraCp2iZ3UbS/JUPYDya7Arrs2FcOK70d0+Gi+ 325KX4VvPQ0HBMewYPUEtVudW/5tgAazyFyRkSRxdanvqDiBJ+Bmuz6fV/3pacxkAYf+ Kxlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lSkz2EdH+QxauMaAUzIW096u1nE37cFVOPFebVP6Rtk=; b=NGqefapi+mGGUwJ2lVTQ25aBNEX9JZgxsaA+7Ge6uJyx9bT3+y/W5oSkCyAssJJaKa sUjVI6PqFaw8LP0VyCz4fptb1p9QNpqKm/Dpj36yowSOLWEedzVQtE3wb3vU43Pu9le6 Xgs254TOI1xF8rDY91ameo93YA0xEzX0Cyd3MqlxXoCMSzSrllWUU3q0brI4W2hhyktj NOXlHdaGX6Fn9bRBZxow5GqxL12CY7ErVvrXKwbm+NRvAJp9BEG1w7wvtU7ZRE0blGZY q3Pu/knnjkBBupgtDW1IBJYAUIsK+sC5Jj9gAjmXC0tOa3Ra6W4HxsHwRAtAl9cdEPjh QoBw== X-Gm-Message-State: AOAM533iOXBPn0U0icfP9RWo8MINGBqwZ3I9Jy/aTgcEMSqTh1rvqjY7 JXhJdFPDZ2FC/31tdJrLF1aFYOrsyrk= X-Google-Smtp-Source: ABdhPJwrPrX2fCc5ShiP8lzVgxsFfiK6WVNcxO3fkuNP+zdKUO+93Ymrtz+c1QRbv1nGeKbhzYXaiA== X-Received: by 2002:a63:4e26:0:b0:386:1839:3bde with SMTP id c38-20020a634e26000000b0038618393bdemr18105535pgb.603.1649471132397; Fri, 08 Apr 2022 19:25:32 -0700 (PDT) Return-Path: Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id f30-20020a63755e000000b00381f6b7ef30sm22925174pgn.54.2022.04.08.19.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 19:25:31 -0700 (PDT) From: Akihiko Odaki To: Cc: devel@edk2.groups.io, Jian J Wang , Liming Gao , Dandan Bi , Michael D Kinney , Zhiguang Liu , Guo Dong , Ray Ni , Maurice Ma , Benjamin You , Akihiko Odaki Subject: [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime Date: Sat, 9 Apr 2022 11:25:21 +0900 Message-Id: <20220409022521.3913-1-akihiko.odaki@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Signed-off-by: Akihiko Odaki --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 9 +++++++++ MdePkg/Include/Pi/PiHob.h | 2 ++ UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gc= d.c index 3763467bdb..623b316c61 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -2628,6 +2628,15 @@ CoreInitializeGcdServices ( ResourceHob->ResourceLength,=0D Capabilities=0D );=0D +=0D + if (!EFI_ERROR (Status) &&=0D + (ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_RUNTI= ME) =3D=3D EFI_RESOURCE_ATTRIBUTE_RUNTIME) {=0D + Status =3D CoreSetMemorySpaceAttributes(=0D + ResourceHob->PhysicalStart,=0D + ResourceHob->ResourceLength,=0D + EFI_MEMORY_RUNTIME=0D + );=0D + }=0D }=0D =0D if (GcdIoType !=3D EfiGcdIoTypeNonExistent) {=0D diff --git a/MdePkg/Include/Pi/PiHob.h b/MdePkg/Include/Pi/PiHob.h index e9f0ab4309..92bacbe62c 100644 --- a/MdePkg/Include/Pi/PiHob.h +++ b/MdePkg/Include/Pi/PiHob.h @@ -296,6 +296,8 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE; //=0D #define EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE 0x02000000=0D =0D +#define EFI_RESOURCE_ATTRIBUTE_RUNTIME 0x04000000=0D +=0D ///=0D /// Describes the resource properties of all fixed,=0D /// nonrelocatable resource ranges found on the processor=0D diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPaylo= adPkg/UefiPayloadEntry/UefiPayloadEntry.c index 0fed1e3691..a50f1c0271 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c @@ -74,7 +74,8 @@ MemInfoCallbackMmio ( EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |=0D EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |=0D EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |=0D - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;=0D + EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |=0D + EFI_RESOURCE_ATTRIBUTE_RUNTIME;=0D =0D BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Base, = Size);=0D DEBUG ((DEBUG_INFO, "buildhob: base =3D 0x%lx, size =3D 0x%lx, type =3D = 0x%x\n", Base, Size, Type));=0D --=20 2.35.1