[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN v6 11/12] xen/arm: p2m: Use the pa_range_info table to support ARM_32 and ARM_64
- To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Ayan Kumar Halder <ayankuma@xxxxxxx>
- Date: Mon, 15 May 2023 12:49:29 +0100
- 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=arcselector9901; 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=RBuC+mIGtuzRqq+fDjuvUsQpxfVFb0bpcAkdk/fMXKc=; b=kFYtckE2N9dZFtvNriLSDIno8oBLO1BMyyWVDESB/ZULJ3ECiGARbILF+Y/TyX9PRlTF+pZeBO6nZkjHKoH8Ec+DaBNhn0UMr3N0DU2+XrNPGy9xwWOW5Svu6GvSoHYUxnKRocUFlduaOb2ZeZve0e0X5eneFgH37mxICr1F/ZIV+geS88eg1c/W2HQKbqS3VW/zEnEb/98vxm+V3SWTbEdR6o3cco+JXy3DN07lxRUMnEgCV9KuHzQfpnTjyCa6mXmyQSHdz3Em/NrQOJ/lDAkJyfa00Of3gdPrNc5Xzz5VGbYhRhTyXygpnkW1Ir1zMlTTWZjtXTyAWlJQn0ISzQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NaAn4IX4e79lBj90V47STYE0t/9tHDHKXtfm05FbGkrRyCl41SCsM+VKuRnK5Xg64la3mZtB7cnAOGtUNUrXdgC0hUNv2R9mDFZhQcCZ4KolkNJttHOtroRGUTTTF4xs6MzfDLVQyB+3NpzFwYL9Z+fWVIu8SB4Ns+MXjukWUt6GHtKglV39UigABs4e6IbzaDfN42Yb/jZYxyT4mBf2DeGXN0RmZ/BVRkQOIgtEqnEEphLVUPmQvX0juWXtkPR8UKSurMqXzIJ3/LnufbHyhKpiNroKtODgE87TxzcgzXxbfVzR2ymD5UPi4cU4YqibthpUamb4WleNvrqaDK6tYw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: sstabellini@xxxxxxxxxx, stefano.stabellini@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, bertrand.marquis@xxxxxxx, andrew.cooper3@xxxxxxxxxx, george.dunlap@xxxxxxxxxx, jbeulich@xxxxxxxx, wl@xxxxxxx, rahul.singh@xxxxxxx
- Delivery-date: Mon, 15 May 2023 11:49:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Julien
On 15/05/2023 11:43, Julien Grall wrote:
On 15/05/2023 11:30, Ayan Kumar Halder wrote:
AFAICT, this approach would be incorrect because we wouldn't take
into account any restriction from the SMMU susbystem (it may support
less than what the processor support).
By the restriction from SMMU subsystem, I think you mean
p2m_restrict_ipa_bits().
Yes.
As I can see, p2m_restrict_ipa_bits() gets invoked much later than
setup_virt_paging().
I am afraid this is not correct. If you look at setup.c, you will
notice that iommu_setup() is called before setup_virt_paging(). There
is a comment on top of the former call explaining the ordering.
Yes, you are correct.
WRT to your comment
>> You are correct that the line is not correct for Arm32. But my point
was more for that fact you don't update p2m_ipa_bits based on the PA
range selected.
Do you mean that I should update "p2m_ipa_bits" in setup_virt_paging() [
similar to what is now being done for CONFIG_ARM_64 ] ?
This will then override "p2m_ipa_bits"value set by p2m_restrict_ipa_bits().
But still it does not make sense to update "p2m_ipa_bits" in
setup_virt_paging() for ARM_32 as
/* Choose suitable "pa_range" according to the resulted
"p2m_ipa_bits". */
for ( i = 0; i < ARRAY_SIZE(pa_range_info); i++ )
{
if ( p2m_ipa_bits == pa_range_info[i].pabits )
{
pa_range = i;
break;
}
}
p2m_ipa_bits will be same as pa_range_info[i].pabits.
- Ayan
Cheers,
|