qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] About AddressSpace in intel-iommu emulation


From: Jan Kiszka
Subject: Re: [Qemu-devel] About AddressSpace in intel-iommu emulation
Date: Fri, 27 Jun 2014 11:55:44 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2014-06-27 07:46, Le Tan wrote:
> 2014-06-27 12:55 GMT+08:00 Paolo Bonzini <address@hidden>:
>> Il 27/06/2014 04:08, Le Tan ha scritto:
>>
>>> 1. In struct IOMMUTLBEntry, I think the addr_mask field should be the
>>> mask of the page offset, right? But I see different usages of this
>>> field. In spapr_tce_translate_iommu(), the addr_mask field is assigned
>>> with the mask of the page offset. However, in pbm_translate_iommu(),
>>> in the passthrough case, the addr_mask field seems to be assigned the
>>> mask of the page number. Is there any problem here?
>>
>>
>> The intended usage is the one of spapr_tce_translate_iommu().  In practice
>> it doesn't matter, both work.
>>
>>
>>> 2. For q35, how to identify origination of DMA requests? The VT-d
>>> manual says we should use source-id(for PCI-Express devices, it is
>>> requester identifier) to map devices to domains. What is the related
>>> part in QEMU? Where can I get the source-id of a DMA request?
>>
>>
>> You need to create a different AddressSpace for each PCI bus or device.
> 
> How to create a different AddressSpace for each device? I thought a
> AddressSpace just belongs to a PCI bus before. The paging structures
> for different functions of the same device can also be different, too.
> So maybe we should create a different AddressSpace for each function?
> How to achieve it? Could you give me some more hints or is there any
> existing example in QEMU?

I would suggest to study the apb IOMMU implementation Paolo referenced
and the PCI layer functions used by that code. Specifically,
pci_setup_iommu takes a callback that is supposed to return an address
space to be used for a particular device. For apb, it's the same for all
devices on a bus, but that's not required...

Jan


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]