lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <324a1c52-359c-44c4-9872-0ad712d9f610@oracle.com>
Date: Fri, 9 Feb 2024 10:36:24 +0000
From: Joao Martins <joao.m.martins@...cle.com>
To: Yi Liu <yi.l.liu@...el.com>
Cc: alex.williamson@...hat.com, robin.murphy@....com, eric.auger@...hat.com,
        nicolinc@...dia.com, kvm@...r.kernel.org, chao.p.peng@...ux.intel.com,
        yi.y.sun@...ux.intel.com, iommu@...ts.linux.dev,
        linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        zhenzhong.duan@...el.com, jgg@...dia.com, joro@...tes.org,
        kevin.tian@...el.com, baolu.lu@...ux.intel.com
Subject: Re: [PATCH] iommu/vt-d: Set SSADE when attaching to a parent with
 dirty tracking

On 08/02/2024 10:31, Joao Martins wrote:
> On 08/02/2024 09:14, Yi Liu wrote:
>> Should set the SSADE (Second Stage Access/Dirty bit Enable) bit of the
>> pasid entry when attaching a device to a nested domain if its parent
>> has already enabled dirty tracking.
>>
>> Fixes: 111bf85c68f6 ("iommu/vt-d: Add helper to setup pasid nested translation")
>> Signed-off-by: Yi Liu <yi.l.liu@...el.com>
> 
> Reviewed-by: Joao Martins <joao.m.martins@...cle.com>
> 
On a second thought, while the patch looks fine if this is what we wanna do,
just a quick clarification on the why (that's also applicable to the last patch
of your other series[0]). I am sure I am missing something :)

Shouldn't the nested domain be subdued to whatever features guest idea of
ecap/cap instead of host's view? Or is this because guest first-stage page table
on Intel is supposed to be always-enabled dirty tracking (per SDM) ? If it's the
latter, it probably should be sprinkled in the commit message(s).

[0] https://lore.kernel.org/linux-iommu/20240208082307.15759-9-yi.l.liu@intel.com/

>> ---
>> base commit: 547ab8fc4cb04a1a6b34377dd8fad34cd2c8a8e3
>> ---
>>  drivers/iommu/intel/pasid.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c
>> index 3239cefa4c33..9be24bb762cf 100644
>> --- a/drivers/iommu/intel/pasid.c
>> +++ b/drivers/iommu/intel/pasid.c
>> @@ -658,6 +658,8 @@ int intel_pasid_setup_nested(struct intel_iommu *iommu, struct device *dev,
>>  	pasid_set_domain_id(pte, did);
>>  	pasid_set_address_width(pte, s2_domain->agaw);
>>  	pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
>> +	if (s2_domain->dirty_tracking)
>> +		pasid_set_ssade(pte);
>>  	pasid_set_translation_type(pte, PASID_ENTRY_PGTT_NESTED);
>>  	pasid_set_present(pte);
>>  	spin_unlock(&iommu->lock);
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ