From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E1842E4271 for ; Fri, 25 Jul 2025 11:09:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753441754; cv=none; b=IInxY3oMBKZ1gMOQbbtP/ltaF8o4iqVXTjR6kpbz6ATMWNqskvnNhsbJECa7zMlfsr+dqEpzvPmzIMKUlAwOtNptFtmMKTvAyDLbMTIMIGtD3Eh8PRb6K9qOoQFwxPZCHBlm3q6UpQmJqZ+XyEfTO1KNCZinHltO66kF8/DJoCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753441754; c=relaxed/simple; bh=41qyMRFeDX/9ZjBOVyEdbFVyEI6JUauBcTIF4RaSXv0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AglEz4MLcxn5YZz/vlTrPYlply8v44swmZP8m5YvEZhXuIC7TwNlHZCHSxcdLm+cBHkgPba+kBDsI0pJxrUV3lAxMCvouxi0KO+vLkOooI17Xe9Nwd0Wekig4naEnsNtD0C8qfjwgC6To5egqrAzHO+ABSWgqmebZuafGLrddUw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F389C1756; Fri, 25 Jul 2025 04:08:59 -0700 (PDT) Received: from [10.57.31.179] (unknown [10.57.31.179]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2E0053F66E; Fri, 25 Jul 2025 04:09:05 -0700 (PDT) Message-ID: <9765ba29-91e1-42bd-bb46-14fdce7284fe@arm.com> Date: Fri, 25 Jul 2025 12:09:04 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] arm64: acpi: Enable ACPI CCEL support Content-Language: en-GB To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, sami.mujawar@arm.com, aneesh.kumar@kernel.org, steven.price@arm.com, linux-kernel@vger.kernel.org, sudeep.holla@arm.com References: <20250613111153.1548928-1-suzuki.poulose@arm.com> <20250613111153.1548928-4-suzuki.poulose@arm.com> From: Suzuki K Poulose In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Will On 15/07/2025 15:58, Will Deacon wrote: > On Tue, Jul 15, 2025 at 03:38:41PM +0100, Suzuki K Poulose wrote: >> On 15/07/2025 14:56, Will Deacon wrote: >>> On Fri, Jun 13, 2025 at 12:11:53PM +0100, Suzuki K Poulose wrote: >>>> ACPI CCEL memory area is reported as Non-Volatile storage area. Map it as >>>> PAGE_KERNEL. >>> >>> It would be helpful to have a citation for that. I've tried digging it >>> out of the ACPI spec, but that pointed me to the Intel TDX site and I >>> got lost in whitepapers :/ >>> >> >> https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#cc-event-log-acpi-table > > Thanks, but I still can't spot where it specifies the memory attributes. > I think we should be able to refer to that as justification for ignoring > the attributes specified by EFI. Here is the description for the Efi memory types. https://uefi.org/specs/UEFI/2.10/07_Services_Boot_Services.html#memory-type-usage-before-exitbootservices From that I gather that OS must map the area as read only. > >>>> Cc: Sami Mujawar >>>> Cc: Will Deacon >>>> Cc: Catalin Marinas >>>> Cc: "Aneesh Kumar K.V" >>>> Cc: Steven Price >>>> Cc: Sudeep Holla >>>> Signed-off-by: Suzuki K Poulose >>>> --- >>>> arch/arm64/kernel/acpi.c | 5 +++++ >>>> 1 file changed, 5 insertions(+) >>>> >>>> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c >>>> index b9a66fc146c9..f52439d411a0 100644 >>>> --- a/arch/arm64/kernel/acpi.c >>>> +++ b/arch/arm64/kernel/acpi.c >>>> @@ -356,6 +356,11 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) >>>> prot = PAGE_KERNEL_RO; >>>> break; >>>> + case EFI_ACPI_MEMORY_NVS: >>>> + /* Non-volatile storage, required for CCEL */ >>>> + prot = PAGE_KERNEL; >>> >>> By "storage" you just mean memory, right? >> >> Yep, it is just memory. I will drop the "NV storage" and simply mention, >> CCEL. > > Thanks. Also, why don't we check against memblock_is_map_memory() for > this, like we do for all the other types apart from > EFI_RUNTIME_SERVICES_CODE? As per the spec, the NVS type must be reserved and we do that in the kernel. For the other types, you mentioned, they are usable by general OS and in Linux we only reserve them, if they are have WB attribute (See is_usable_memory()). Thus we do extra checks to make sure, if it is in use and mark them as RO. So, NVS is by default reserved and doesn't have to do extra checks. That said, I will fix the prot to PAGE_KERNEL_RO to make sure the OS doesn't write to it. Thanks Suzuki > > Will