qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Le Tan <tamlokveer@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] About AddressSpace in intel-iommu emulation
Date: Fri, 27 Jun 2014 11:55:44 +0200	[thread overview]
Message-ID: <53AD3FA0.7070708@web.de> (raw)
In-Reply-To: <CACrq+iJD-vF3yLZnyFDEhra=qMR-QF9yS5T+6RfJefcJ=CAy0A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1811 bytes --]

On 2014-06-27 07:46, Le Tan wrote:
> 2014-06-27 12:55 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
>> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2014-06-27  9:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 14:01 [Qemu-devel] About AddressSpace in intel-iommu emulation Le Tan
2014-06-26 14:05 ` Paolo Bonzini
2014-06-26 14:16   ` Le Tan
2014-06-27  2:08   ` Le Tan
2014-06-27  4:55     ` Paolo Bonzini
2014-06-27  5:46       ` Le Tan
2014-06-27  9:55         ` Jan Kiszka [this message]
2014-06-27 14:15           ` Le Tan

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=53AD3FA0.7070708@web.de \
    --to=jan.kiszka@web.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tamlokveer@gmail.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).