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>,
	rkrcmar@redhat.com, Jan Kiszka <jan.kiszka@web.de>,
	Valentine Sinitsyn <valentine.sinitsyn@gmail.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [V15 3/4] hw/i386: Introduce AMD IOMMU
Date: Wed, 10 Aug 2016 10:08:20 +0800	[thread overview]
Message-ID: <20160810020820.GD4201@pxdev.xzpeter.org> (raw)
In-Reply-To: <CABdVeABixc_FLDdNpKDKRXAgiqJ6wxC1Uf32=mPF+61RjyJtpA@mail.gmail.com>

On Tue, Aug 09, 2016 at 03:52:07PM +0300, David Kiarie wrote:

[...]

> > > +    if (dma_memory_write(&address_space_memory, s->evtlog_len +
> > s->evtlog_tail,
> > > +        &evt, AMDVI_EVENT_LEN)) {
> >
> > Check with MEMTX_OK?
> >
> 
> I'm not sure what exactly you mean here.

I mean we have return code macros for these memory operations, like
MEMTX_OK/MEMTX_ERROR/... However please feel free to ignore this
comment since I see merely no place in current QEMU code that is doing
the checking at all. Your call.

> 
> 
> >
> > [...]
> >
> > > +/*
> > > + * AMDVi event structure
> > > + *    0:15   -> DeviceID
> > > + *    55:63  -> event type + miscellaneous info
> > > + *    64:127 -> related address
> > > + */
> > > +static void amdvi_encode_event(uint64_t *evt, uint16_t devid, uint64_t
> > addr,
> > > +                               uint16_t info)
> > > +{
> > > +    amdvi_setevent_bits(evt, devid, 0, 16);
> > > +    amdvi_setevent_bits(evt, info, 55, 8);
> > > +    amdvi_setevent_bits(evt, addr, 63, 64);
> >                                       ^^
> >                                 should here be 64?
> >
> > Also, I am not sure whether we need this amdvi_setevent_bits() if it's
> > only used in this function. Though not a big problem for me.
> >
> 
> It's only used in this function but I actually wrote his mainly for future
> use. The idea is that various events encode totally different information
> while the above is an over-simplified version to encode information common
> to most events. In case an event wants to encode more information it would
> turn out much more easier.

Yes my above comment is "Nit" for sure. :) Please have it if you like.

> 
> 
> >
> > > +}
> > > +/* log an error encountered page-walking
> >
> > "during page-walking"
> >
> 
> "encountered page-walking"  sounds right to me. "page-walking" is a verb,
> in continuous tense, right ? how about I say "during hacking" ;-)

I am not that good at English. I pointed that out since I "suspect"
that is wrong (in case that would help). But if you are confident
enough, please just ignore. I'm mostly ok with all comments as long as
they are "understandable".

> 
> 
> > > + *
> > > + * @addr: virtual address in translation request
> > > + */
> > > +static void amdvi_page_fault(AMDVIState *s, uint16_t devid,
> > > +                             hwaddr addr, uint16_t info)
> > > +{
> > > +    uint64_t evt[4];
> > > +
> > > +    info |= AMDVI_EVENT_IOPF_I | AMDVI_EVENT_IOPF;
> > > +    amdvi_encode_event(evt, devid, addr, info);
> > > +    amdvi_log_event(s, evt);
> > > +    pci_word_test_and_set_mask(s->pci.dev.config + PCI_STATUS,
> > > +            PCI_STATUS_SIG_TARGET_ABORT);
> >
> > Nit: maybe we can provide a function for setting this bit.
> >
> 
> I've actually being ignoring these since Qemu doesn't seem to care about
> them.
> 

Sorry I failed to understand your sentence.

-- peterx

  parent reply	other threads:[~2016-08-10  2:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02  8:39 [Qemu-devel] [V15 0/4] AMD IOMMU David Kiarie
2016-08-02  8:39 ` [Qemu-devel] [V15 1/4] hw/pci: Prepare for " David Kiarie
2016-08-08  9:01   ` Peter Xu
2016-08-08  9:25     ` David Kiarie
2016-08-02  8:39 ` [Qemu-devel] [V15 2/4] hw/i386/trace-events: Add AMD IOMMU trace events David Kiarie
2016-08-02  8:39 ` [Qemu-devel] [V15 3/4] hw/i386: Introduce AMD IOMMU David Kiarie
2016-08-09  5:44   ` Peter Xu
2016-08-09 12:07     ` David Kiarie
2016-08-09 12:21       ` Peter Xu
2016-08-09 12:52     ` David Kiarie
2016-08-09 13:01       ` Valentine Sinitsyn
2016-08-09 13:17         ` David Kiarie
2016-08-10  2:08       ` Peter Xu [this message]
2016-08-10  6:30         ` David Kiarie
2016-08-09 17:46     ` David Kiarie
2016-08-10  1:49       ` Peter Xu
2016-08-11  8:23   ` Valentine Sinitsyn
2016-08-11  8:32     ` David Kiarie
2016-08-11  8:35       ` Valentine Sinitsyn
2016-08-12 19:10   ` Valentine Sinitsyn
2016-08-12 19:40     ` David Kiarie
2016-08-12 19:41       ` Valentine Sinitsyn
2016-08-02  8:39 ` [Qemu-devel] [V15 4/4] hw/i386: AMD IOMMU IVRS table David Kiarie
2016-08-02 13:32   ` Igor Mammedov
  -- strict thread matches above, loose matches on Subject: below --
2016-08-09 20:27 [Qemu-devel] [V15 0/4] AMD IOMMU David Kiarie
2016-08-09 20:27 ` [Qemu-devel] [V15 3/4] hw/i386: Introduce " David Kiarie

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=20160810020820.GD4201@pxdev.xzpeter.org \
    --to=peterx@redhat.com \
    --cc=davidkiarie4@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkrcmar@redhat.com \
    --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.