qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH RFC] msi: remove range checks
Date: Mon, 25 Oct 2010 09:29:50 +0200	[thread overview]
Message-ID: <20101025072950.GB4679@redhat.com> (raw)
In-Reply-To: <20101025070713.GX31309@valinux.co.jp>

Hmm, does this simply check that write is within the capability?
Then I think I misunderstood what this does.
Please replace hard-coded length logic with existing function call
that gets the lengths, the range check can stay then.


On Mon, Oct 25, 2010 at 04:07:13PM +0900, Isaku Yamahata wrote:
> Seems good.
> For consistency, the range check in msix_write_config() should
> be also removed.
> 
> On Mon, Oct 25, 2010 at 08:07:25AM +0200, Michael S. Tsirkin wrote:
> > config write handlers should be idempotent.
> > So no need for range checks.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >  hw/msi.c |   29 -----------------------------
> >  1 files changed, 0 insertions(+), 29 deletions(-)
> > 
> > diff --git a/hw/msi.c b/hw/msi.c
> > index a949d82..af8ea44 100644
> > --- a/hw/msi.c
> > +++ b/hw/msi.c
> > @@ -257,35 +257,6 @@ void msi_write_config(PCIDevice *dev, uint32_t addr, uint32_t val, int len)
> >      uint32_t pending;
> >      int i;
> >  
> > -#ifdef MSI_DEBUG
> > -    if (ranges_overlap(addr, len, dev->msi_cap, msi_cap_sizeof(flags))) {
> > -        MSI_DEV_PRINTF(dev, "addr 0x%"PRIx32" val 0x%"PRIx32" len %d\n",
> > -                       addr, val, len);
> > -        MSI_DEV_PRINTF(dev, "ctrl: 0x%"PRIx16" address: 0x%"PRIx32,
> > -                       flags,
> > -                       pci_get_long(dev->config + msi_address_lo_off(dev)));
> > -        if (msi64bit) {
> > -            fprintf(stderr, " addrss-hi: 0x%"PRIx32,
> > -                    pci_get_long(dev->config + msi_address_hi_off(dev)));
> > -        }
> > -        fprintf(stderr, " data: 0x%"PRIx16,
> > -                pci_get_word(dev->config + msi_data_off(dev, msi64bit)));
> > -        if (flags & PCI_MSI_FLAGS_MASKBIT) {
> > -            fprintf(stderr, " mask 0x%"PRIx32" pending 0x%"PRIx32,
> > -                    pci_get_long(dev->config + msi_mask_off(dev, msi64bit)),
> > -                    pci_get_long(dev->config + msi_pending_off(dev, msi64bit)));
> > -        }
> > -        fprintf(stderr, "\n");
> > -    }
> > -#endif
> > -
> > -    /* Are we modified? */
> > -    if (!(ranges_overlap(addr, len, msi_flags_off(dev), 2) ||
> > -          (msi_per_vector_mask &&
> > -           ranges_overlap(addr, len, msi_mask_off(dev, msi64bit), 4)))) {
> > -        return;
> > -    }
> > -
> >      if (!(flags & PCI_MSI_FLAGS_ENABLE)) {
> >          return;
> >      }
> > -- 
> > 1.7.3-rc1
> > 
> 
> -- 
> yamahata

      reply	other threads:[~2010-10-25  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25  6:07 [Qemu-devel] [PATCH RFC] msi: remove range checks Michael S. Tsirkin
2010-10-25  7:07 ` [Qemu-devel] " Isaku Yamahata
2010-10-25  7:29   ` Michael S. Tsirkin [this message]

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=20101025072950.GB4679@redhat.com \
    --to=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yamahata@valinux.co.jp \
    /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).