All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: David Kiarie <davidkiarie4@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Peter Maydell <peter.maydell@linaro.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"J. Kiszka" <jan.kiszka@siemens.com>,
	Valentine Sinitsyn <valentine.sinitsyn@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [RFC 2/2] hw/i386: enforce SID verification
Date: Wed, 10 Aug 2016 15:09:04 +0800	[thread overview]
Message-ID: <20160810070904.GJ4201@pxdev.xzpeter.org> (raw)
In-Reply-To: <CABdVeAAf60xxz+KVWuJ4jFmUvX_hcLhXc1vR+PTRk_k6nXYrKg@mail.gmail.com>

On Wed, Aug 10, 2016 at 09:30:52AM +0300, David Kiarie wrote:
> On Wed, Aug 10, 2016 at 8:49 AM, Peter Xu <peterx@redhat.com> wrote:
> 
> > On Tue, Aug 09, 2016 at 05:32:17PM +0300, David Kiarie wrote:
> >
> > [...]
> >
> > > @@ -2252,14 +2250,17 @@ static MemTxResult vtd_mem_ir_write(void
> > *opaque, hwaddr addr,
> > >  {
> > >      int ret = 0;
> > >      MSIMessage from = {}, to = {};
> > > -    uint16_t sid = X86_IOMMU_SID_INVALID;
> > > +    VTDAddressSpace *as = opaque;
> > > +    uint16_t sid = pci_bus_num(as->bus) << 8 | as->devfn;
> >
> > SID can be something not equals to BDF. E.g., when there are PCI
> > bridges. See pci_requester_id(). However...
> >
> > >
> > >      from.address = (uint64_t) addr + VTD_INTERRUPT_ADDR_FIRST;
> > >      from.data = (uint32_t) value;
> > >
> > > -    if (!attrs.unspecified) {
> > > -        /* We have explicit Source ID */
> > > -        sid = attrs.requester_id;
> > > +    if (attrs.requester_id != sid) {
> > > +        VTD_DPRINTF(GENERAL, "int remap request for sid 0x%04x"
> > > +                    " requester_id 0x%04x couldn't be verified",
> > > +                    sid, attrs.requester_id);
> > > +        return MEMTX_ERROR;
> >
> > ...I am not sure whether we need extra check here. In what case will
> > attrs.requester_id != sid ?
> >
> 
> Meaning I should remove this check ?

No, that's a question I asked. I thought this if() would never trigger.

-- peterx

  reply	other threads:[~2016-08-10  7:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 14:32 [Qemu-devel] [RFC 0/2] Explicit SID for IOAPIC David Kiarie
2016-08-09 14:32 ` [Qemu-devel] [RFC 1/2] hw/msi: Allow platform devices to use explicit SID David Kiarie
2016-08-10  5:41   ` Peter Xu
2016-08-10  6:35     ` David Kiarie
2016-08-10  7:23       ` Peter Xu
2016-08-09 14:32 ` [Qemu-devel] [RFC 2/2] hw/i386: enforce SID verification David Kiarie
2016-08-09 18:41   ` Valentine Sinitsyn
2016-08-09 18:46     ` David Kiarie
2016-08-10  5:49   ` Peter Xu
2016-08-10  6:30     ` David Kiarie
2016-08-10  7:09       ` Peter Xu [this message]
2016-08-09 14:39 ` [Qemu-devel] [RFC 0/2] Explicit SID for IOAPIC no-reply
2016-08-09 14:39 ` no-reply

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=20160810070904.GJ4201@pxdev.xzpeter.org \
    --to=peterx@redhat.com \
    --cc=davidkiarie4@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=valentine.sinitsyn@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.