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: skandasa@cisco.com, adnan@khaleel.us, etmartin@cisco.com,
	qemu-devel@nongnu.org, wexu2@cisco.com
Subject: [Qemu-devel] Re: [PATCH v9 1/8] pci: revise pci command register initialization
Date: Thu, 18 Nov 2010 08:42:26 +0200	[thread overview]
Message-ID: <20101118064226.GC8731@redhat.com> (raw)
In-Reply-To: <20101118020840.GA26489@valinux.co.jp>

On Thu, Nov 18, 2010 at 11:08:40AM +0900, Isaku Yamahata wrote:
> On Wed, Nov 17, 2010 at 02:02:00PM +0200, Michael S. Tsirkin wrote:
> > > > Another bug is that migrating from qemu where a bit is writeable to one
> > > > where it's RO creates a situation where a RW bit becomes RO, or the
> > > > reverse, which might confuse guests.  So we will need a compatibility
> > > > flag and set it for old machine types.
> > > 
> > > We needs to keep compatibility. Which way do you prefer?
> > > 
> > > - don't care: no way
> > > 
> > > - introduce global property to indicate compat qemu version or flags
> > >   something like if (compat version <= 0.13) old behaviour...
> > >   or if (flags & ...)
> > > 
> > > - introduce global-pci property
> > > 
> > > - introduce pci bus property
> > >   Users needs to specify this property for all pci devices.
> > > 
> > > - Don't change common code(pci.c), and provide a helper function.
> > >   Each device which needs new behavior like pcie calls it.
> > >   Probably each device may provide property to specify compat behavior
> > > 
> > > - any other?
> > 
> > - Don't change behaviour at all.
> > 
> > 	What is the motivation for the change?  Why do we bother? What we have
> > 	is spec compliant, I think, so it's hard for me to believe pcie *needs*
> > 	the new behaviour.
> 
> AER wants SERR bit to be writable and you requested it as below.
> I thought, you wanted me to revise PCI_COMMAND and PCI_STATUS initialization.
> If I misunderstood, can you please elaborate on it?
> If you accept the following PCI_COMMAND line,
> I'm fine with dropping this clean up patch.
> 
> http://lists.nongnu.org/archive/html/qemu-devel/2010-11/msg00131.html
> > > +void pcie_aer_init(PCIDevice *dev, uint16_t offset)
> > > +{
> > > +    PCIExpressDevice *exp;
> > > +
> > > +    pci_word_test_and_set_mask(dev->wmask + PCI_COMMAND, PCI_COMMAND_SERR);
> > > +    pci_word_test_and_set_mask(dev->w1cmask + PCI_STATUS,
> > > +                               PCI_STATUS_SIG_SYSTEM_ERROR);
> > > +
> > 
> > I would say we should just set these for all devices.
> > But if we do my concern is that guest might write 1 to this register,
> > then we migrate to an old guest and that one can not clear this bit.
> > Thoughts? Let's add a flag so old machine types can disable this?
> > 
> > 
> > Also - what about other bits in the status register?

I think what you did for PCI_STATUS addressed this comment. Thanks!

Yes, for AER we need to enable SERR, and just for SERR, I think
a global property or a bus property will be the simplest (I think
properties are inherited from bus to device, right?)
Something like pci_command_serr_enable, should be a bit property.
Default to on and disable for 0.13 and back. Hmm?

Also, need to check this and fail aer initialization if not
there. Maybe simply don't add aer capability if aer_init fails?
Or make it yet another property ...

-- 
MST

  reply	other threads:[~2010-11-18  6:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16  8:26 [Qemu-devel] [PATCH v9 0/8] pcie port switch emulators Isaku Yamahata
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 1/8] pci: revise pci command register initialization Isaku Yamahata
2010-11-16 10:50   ` [Qemu-devel] " Michael S. Tsirkin
2010-11-17  2:03     ` Isaku Yamahata
2010-11-17 12:02       ` Michael S. Tsirkin
2010-11-18  2:08         ` Isaku Yamahata
2010-11-18  6:42           ` Michael S. Tsirkin [this message]
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 2/8] pci: fix accesses to pci status register Isaku Yamahata
2010-11-16 10:52   ` [Qemu-devel] " Michael S. Tsirkin
2010-11-17  4:17     ` Isaku Yamahata
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 3/8] pci: clean up of " Isaku Yamahata
2010-11-16 14:01   ` [Qemu-devel] " Michael S. Tsirkin
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 4/8] pcie_regs.h: more constants Isaku Yamahata
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 5/8] pcie/aer: helper functions for pcie aer capability Isaku Yamahata
2010-11-17 14:06   ` [Qemu-devel] [PATCH 0/2] " Michael S. Tsirkin
2010-11-17 14:06     ` [Qemu-devel] [PATCH 1/2] pcie_aer: get rid of recursion Michael S. Tsirkin
2010-11-17 14:06     ` [Qemu-devel] [PATCH 2/2] pcie_aer: complete unwinding recursion Michael S. Tsirkin
2010-11-18  8:11     ` [Qemu-devel] Re: [PATCH 0/2] Re: [PATCH v9 5/8] pcie/aer: helper functions for pcie aer capability Isaku Yamahata
2010-11-18  8:52       ` Michael S. Tsirkin
2010-11-19  9:42     ` Isaku Yamahata
2010-11-19 12:03       ` Michael S. Tsirkin
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 6/8] ioh3420: support aer Isaku Yamahata
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 7/8] x3130/upstream: " Isaku Yamahata
2010-11-16  8:26 ` [Qemu-devel] [PATCH v9 8/8] x3130/downstream: " Isaku Yamahata
     [not found] ` <1289930315.27724.18.camel@etmartin-lnx>
2010-11-16 18:57   ` [Qemu-devel] " Etienne Martineau
2010-11-17  4:07     ` Isaku Yamahata
2010-11-17  5:31       ` Etienne Martineau
2010-11-18  2:19         ` Isaku Yamahata
2010-11-17 14:38 ` [Qemu-devel] Re: [PATCH v9 0/8] pcie port switch emulators Michael S. Tsirkin

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=20101118064226.GC8731@redhat.com \
    --to=mst@redhat.com \
    --cc=adnan@khaleel.us \
    --cc=etmartin@cisco.com \
    --cc=qemu-devel@nongnu.org \
    --cc=skandasa@cisco.com \
    --cc=wexu2@cisco.com \
    --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).