linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Gavin Shan <gshan@redhat.com>,
	kvm@vger.kernel.org, kvmarm@lists.linux.dev
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>,
	James Morse <james.morse@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Joey Gouly <joey.gouly@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Christoffer Dall <christoffer.dall@arm.com>,
	Fuad Tabba <tabba@google.com>,
	linux-coco@lists.linux.dev,
	Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>,
	Shanker Donthineni <sdonthineni@nvidia.com>,
	Alper Gun <alpergun@google.com>,
	"Aneesh Kumar K . V" <aneesh.kumar@kernel.org>
Subject: Re: [PATCH v6 03/11] arm64: realm: Query IPA size from the RMM
Date: Tue, 15 Oct 2024 10:08:24 +0100	[thread overview]
Message-ID: <e69536dd-aab2-49de-a026-506e09359207@arm.com> (raw)
In-Reply-To: <2352629a-3742-45e9-a38f-196989918c9b@redhat.com>

On 15/10/2024 04:55, Gavin Shan wrote:
> On 10/5/24 12:42 AM, Steven Price wrote:
>> The top bit of the configured IPA size is used as an attribute to
>> control whether the address is protected or shared. Query the
>> configuration from the RMM to assertain which bit this is.
>>
>> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
>> Reviewed-by: Gavin Shan <gshan@redhat.com>
>> Co-developed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> Signed-off-by: Steven Price <steven.price@arm.com>
>> ---
>> Changes since v4:
>>   * Make PROT_NS_SHARED check is_realm_world() to reduce impact on
>>     non-CCA systems.
>> Changes since v2:
>>   * Drop unneeded extra brackets from PROT_NS_SHARED.
>>   * Drop the explicit alignment from 'config' as struct realm_config now
>>     specifies the alignment.
>> ---
>>   arch/arm64/include/asm/pgtable-prot.h | 4 ++++
>>   arch/arm64/include/asm/rsi.h          | 2 +-
>>   arch/arm64/kernel/rsi.c               | 8 ++++++++
>>   3 files changed, 13 insertions(+), 1 deletion(-)
>>
> 
> [...]
> 
>> diff --git a/arch/arm64/kernel/rsi.c b/arch/arm64/kernel/rsi.c
>> index 9bf757b4b00c..a6495a64d9bb 100644
>> --- a/arch/arm64/kernel/rsi.c
>> +++ b/arch/arm64/kernel/rsi.c
>> @@ -8,6 +8,11 @@
>>   #include <linux/psci.h>
>>   #include <asm/rsi.h>
>>   +struct realm_config config;
>> +
> 
> Nit: I think this variable is file-scoped since it has a generic name.
> In this case, 'static' is needed to match with the scope.

Good spot - it should definitely be static.

Thanks,
Steve

>> +unsigned long prot_ns_shared;
>> +EXPORT_SYMBOL(prot_ns_shared);
>> +
>>   DEFINE_STATIC_KEY_FALSE_RO(rsi_present);
>>   EXPORT_SYMBOL(rsi_present);
>>   @@ -67,6 +72,9 @@ void __init arm64_rsi_init(void)
>>           return;
>>       if (!rsi_version_matches())
>>           return;
>> +    if (WARN_ON(rsi_get_realm_config(&config)))
>> +        return;
>> +    prot_ns_shared = BIT(config.ipa_bits - 1);
>>         arm64_rsi_setup_memory();
>>   
> 
> Thanks,
> Gavin
> 


  reply	other threads:[~2024-10-15  9:08 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 14:42 [PATCH v6 00/11] arm64: Support for running as a guest in Arm CCA Steven Price
2024-10-04 14:42 ` [PATCH v6 01/11] arm64: rsi: Add RSI definitions Steven Price
2024-10-07 23:08   ` Gavin Shan
2024-10-11 14:14     ` Steven Price
2024-10-04 14:42 ` [PATCH v6 02/11] arm64: Detect if in a realm and set RIPAS RAM Steven Price
2024-10-04 15:05   ` Steven Price
2024-10-11 13:12     ` Catalin Marinas
2024-10-07 23:31   ` Gavin Shan
2024-10-11 14:14     ` Steven Price
2024-10-04 14:42 ` [PATCH v6 03/11] arm64: realm: Query IPA size from the RMM Steven Price
2024-10-07 23:33   ` Gavin Shan
2024-10-15  3:55   ` Gavin Shan
2024-10-15  9:08     ` Steven Price [this message]
2024-10-04 14:42 ` [PATCH v6 04/11] arm64: rsi: Add support for checking whether an MMIO is protected Steven Price
2024-10-08  0:24   ` Gavin Shan
2024-10-11 14:14     ` Steven Price
2024-10-04 14:43 ` [PATCH v6 05/11] arm64: rsi: Map unprotected MMIO as decrypted Steven Price
2024-10-08  0:31   ` Gavin Shan
2024-10-11 13:19     ` Catalin Marinas
2024-10-12  5:22       ` Gavin Shan
2024-10-11 13:20   ` Catalin Marinas
2024-10-04 14:43 ` [PATCH v6 06/11] efi: arm64: Map Device with Prot Shared Steven Price
2024-10-08  0:31   ` Gavin Shan
2024-10-11 13:23   ` Catalin Marinas
2024-10-04 14:43 ` [PATCH v6 07/11] arm64: Enforce bounce buffers for realm DMA Steven Price
2024-10-08  2:51   ` Gavin Shan
2024-10-04 14:43 ` [PATCH v6 08/11] arm64: mm: Avoid TLBI when marking pages as valid Steven Price
2024-10-08  2:52   ` Gavin Shan
2024-10-15  9:50   ` Suzuki K Poulose
2024-10-04 14:43 ` [PATCH v6 09/11] arm64: Enable memory encrypt for Realms Steven Price
2024-10-08  2:56   ` Gavin Shan
2024-10-04 14:43 ` [PATCH v6 10/11] virt: arm-cca-guest: TSM_REPORT support for realms Steven Price
2024-10-05 15:42   ` kernel test robot
2024-10-08  4:12   ` Gavin Shan
2024-10-11 14:14     ` Steven Price
2024-10-11 16:22       ` Suzuki K Poulose
2024-10-12  6:06         ` Gavin Shan
2024-10-14  8:56           ` Suzuki K Poulose
2024-10-14 14:41             ` Steven Price
2024-10-14 14:46               ` Suzuki K Poulose
2024-10-15  0:01                 ` Gavin Shan
2024-10-04 14:43 ` [PATCH v6 11/11] arm64: Document Arm Confidential Compute Steven Price
2024-10-08  4:17   ` Gavin Shan
2024-10-08 11:05   ` Jean-Philippe Brucker
2024-10-11 14:14     ` Steven Price
2024-10-15  9:55       ` Suzuki K Poulose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e69536dd-aab2-49de-a026-506e09359207@arm.com \
    --to=steven.price@arm.com \
    --cc=alexandru.elisei@arm.com \
    --cc=alpergun@google.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@arm.com \
    --cc=gankulkarni@os.amperecomputing.com \
    --cc=gshan@redhat.com \
    --cc=james.morse@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=sdonthineni@nvidia.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).