From: Auger Eric <eric.auger@redhat.com>
To: Kunkun Jiang <jiangkunkun@huawei.com>
Cc: wanghaibin.wang@huawei.com, qemu-arm@nongnu.org,
zhukeqian1@huawei.com, qemu-devel@nongnu.org
Subject: Re: [RFC v7 09/26] vfio: Force nested if iommu requires it
Date: Tue, 1 Dec 2020 18:40:02 +0100 [thread overview]
Message-ID: <c7681a9d-3e14-a095-e03c-3857cfef02b5@redhat.com> (raw)
In-Reply-To: <c3d0f094-cffe-16c8-69fc-de7bdefc3680@huawei.com>
Hi Kunkun,
On 11/28/20 10:01 AM, Kunkun Jiang wrote:
> Hi Eric,
>> @@ -1668,6 +1679,14 @@ static int vfio_connect_container(VFIOGroup *group,
>> AddressSpace *as,
>> VFIOContainer *container;
>> int ret, fd;
>> VFIOAddressSpace *space;
>> + IOMMUMemoryRegion *iommu_mr;
>> + bool nested = false;
>> +
>> + if (as != &address_space_memory && memory_region_is_iommu(as->root)) {
>> + iommu_mr = IOMMU_MEMORY_REGION(as->root);
>> + memory_region_iommu_get_attr(iommu_mr, IOMMU_ATTR_VFIO_NESTED,
>> + (void *)&nested);
>> + }
>>
>> space = vfio_get_address_space(as);
> Is the condition "as != &address_space_memory" needed to determine whether
> a vIOMMU is in place? I think "memory_region_is_iommu(as->root)" is enough.
>
> Looking forward to your reply.:)
Yes I think so.
Thank you for your report!
Eric
>
> Thanks,
>
> Kunkun Jiang
>
next prev parent reply other threads:[~2020-12-01 18:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-28 9:01 [RFC v7 09/26] vfio: Force nested if iommu requires it Kunkun Jiang
2020-12-01 17:40 ` Auger Eric [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-11-16 18:13 [RFC v7 00/26] vSMMUv3/pSMMUv3 2 stage VFIO integration Eric Auger
2020-11-16 18:13 ` [RFC v7 09/26] vfio: Force nested if iommu requires it Eric Auger
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=c7681a9d-3e14-a095-e03c-3857cfef02b5@redhat.com \
--to=eric.auger@redhat.com \
--cc=jiangkunkun@huawei.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wanghaibin.wang@huawei.com \
--cc=zhukeqian1@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).