[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 6/6] arm/mpu: Provide a constructor for pr_t type
- To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- From: "Orzel, Michal" <michal.orzel@xxxxxxx>
- Date: Thu, 22 May 2025 15:03:45 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Hq5kkqhGKm3VtH2CM+Frn7msdUuj/TqissD2VKZONv4=; b=QvivRcqP+04zH+4FuzeaNvx6IqSg6tzPmUvrJvAcbs8JMFcNztd3TJH30fq2nfQZAdfd+fpb9l+H69GPd6qBg9hhEsWNvzr3sYkOP/9Yo75NVurnXvf6SftLHrt5aXoKVWFUQsjxXOmX1HmIkPB9a38CjZnbg+Jvo9DU5NpoOjw2JSuM/O2U+ghL9gybLlp4V6aKqmxVKaJ/ZVeCO6hvW3yeCHix6hry2kVmTWFnME6UEf8DsfG5LckcVNAWC+Iqk1iiFNYy2vrRb482xnFaEr05vgiid4ajb2GSoTLPPOO5gDK4DvLLKWC2zGW8WvpQZ9zYzgGngt1LUi+LWNzfNg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rgd6Jf30CdURN3NEiUE7Xc5EVm4a2VS41mcRvEgKWtIsl3DvrSDYHvRDGyOpqQGHAeUH2LvV49ScvYxMKu/s8RqueROhTqBVdf9BIxBTg37B51qPjOYAzWfNos7CyowS9s8Vh2JVdlvoHn1aNhcQoOq4JTqkm1o4CQjmCIZSct3WDVvKqRMPDFHCjW8WIIXBjMOJUYP35MVgjKRaDBcrBxCYdujuPwzl4wnKtiwg6qFO94KZUqqKd5It7EQRIiRGPO9d8shtOL/aRJ8Muigr0Rraiw2WH3bOPJhoC5qYtAtD3I+f3C61/030KIGhXh+/NxJrBhlDakBO6HRyTUP/zg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Thu, 22 May 2025 13:04:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 22/05/2025 14:49, Luca Fancellu wrote:
> Hi Michal,
>
>>> +
>>> +pr_t pr_of_addr(paddr_t base, paddr_t limit, unsigned int flags)
>>> +{
>>> + unsigned int attr_idx = PAGE_AI_MASK(flags);
>>> + prbar_t prbar;
>>> + prlar_t prlar;
>>> + pr_t region;
>>> +
>>> + /* Build up value for PRBAR_EL2. */
>>> + prbar = (prbar_t) {
>>> + .reg = {
>>> + .ro = PAGE_RO_MASK(flags),
>>> + .xn = PAGE_XN_MASK(flags),
>> Shouldn't you also initialize .xn_0 and .ap_0 or you rely on compound literal
>> implicit zero initialization of unspecified fields? But then you do
>> initialize
>> .ns to 0 fror prlar...
>
> Yes, because there I would like to specify that value 0 means Hyp in secure
> world,
> but of course if you want I can explicitly initialise also these two
I'd prefer that way (so that it's more clear what are all the fields initialized
to) but I can understand that this is very subjective so you have a freedom of
choice here.
~Michal
|