[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 13/21] IOMMU/x86: prefill newly allocate page tables
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 20 May 2022 13:11:16 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=dz5rzOLMUT3rMOjAQV0OuVPbZxrRl3+om8PP8fPbGys=; b=YGWV04HXPCTjtaLz2ix83ABix5DKtmvCyMzzu1EerXrnhEFOD8SInZqpjVv/EYaQ+jBPkHyVo3HiXbPPBRRlaoDfIgdGGXXl8nnYCdhKVLq4JELlGR7hm7cM1IHW1JAdrm0li1ZQvvv1U8Wi7PgJv0DTJUBwyqCb8qDUMFj4g7nX2QO9koXTL//9rZ+fz28rAoiXm712iRrTIOyjR9lyrMcELcDw1Iu7OWuRYX2ulitTYNHRzwtuh80w65wdfHWchQFKRs1s3+CXdvdRmCLmfpC9uZ7BV4Q0UQo4MXMFOZ22GZBjnMU6XA6ZaHvZ/Tx3Az0MZgM34nh1uuhoQoC5aw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LZUsHvv1VOBOXqAxcRP428vzAU6QlKmpvP11wFO08aETzwNHNbm9IRgcIJMEGIOSa4xPae9TXXmacXj12QM3n0cLqfkDy1UwHhr4cctiw7fgyx8LABNNTzODJQlM6uyyJ5T9eyw01KU6ae5CJy1m5MsoJ7ANvDamoKhN7SBkj4fHLvN8eWxmzyElOiQCTqxScAl/zRSQLEvfkEgZp55cfzUULA8+n0F2GoA7XVUSWf6b+PjdCHdqt22QnuCVRLFwbGZgKaOniwqa2LELB98p9Ed8Cvz3R4nuX2Bk7Sl5LcoMFTLAZgU250iPFWBKkeXfIKzu84EXBIkuoha3iTkarw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Fri, 20 May 2022 11:11:26 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 20.05.2022 12:47, Roger Pau Monné wrote:
> On Thu, May 19, 2022 at 02:12:04PM +0200, Jan Beulich wrote:
>> On 06.05.2022 13:16, Roger Pau Monné wrote:
>>> On Mon, Apr 25, 2022 at 10:40:55AM +0200, Jan Beulich wrote:
>>>> --- a/xen/drivers/passthrough/amd/iommu_map.c
>>>> +++ b/xen/drivers/passthrough/amd/iommu_map.c
>>>> @@ -115,7 +115,19 @@ static void set_iommu_ptes_present(unsig
>>>>
>>>> while ( nr_ptes-- )
>>>> {
>>>> - set_iommu_pde_present(pde, next_mfn, 0, iw, ir);
>>>> + ASSERT(!pde->next_level);
>>>> + ASSERT(!pde->u);
>>>> +
>>>> + if ( pde > table )
>>>> + ASSERT(pde->ign0 == find_first_set_bit(pde - table));
>>>> + else
>>>> + ASSERT(pde->ign0 == PAGE_SHIFT - 3);
>>>
>>> I think PAGETABLE_ORDER would be clearer here.
>>
>> I disagree - PAGETABLE_ORDER is a CPU-side concept. It's not used anywhere
>> in IOMMU code afaics.
>
> Isn't PAGE_SHIFT also a CPU-side concept in the same way? I'm not
> sure what's the rule for declaring that PAGE_SHIFT is fine to use in
> IOMMU code but not PAGETABLE_ORDER.
Hmm, yes and no. But for consistency with other IOMMU code I may want
to switch to PAGE_SHIFT_4K.
Jan
|