From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 00/17] pci: switch a ton of drivers to symbolic names
Date: Fri, 11 Dec 2009 12:26:01 +0200 [thread overview]
Message-ID: <20091211102601.GA29972@redhat.com> (raw)
In-Reply-To: <200912101828.39821.paul@codesourcery.com>
On Thu, Dec 10, 2009 at 06:28:39PM +0000, Paul Brook wrote:
> On Thursday 10 December 2009, Michael S. Tsirkin wrote:
> > The recent e1000 bug made the important of using
> > symbolic macros for pci config access clear for me.
> > So I started going over drivers and converting
> > to symbolic constants instead of hard-coded ones.
> > I did a large part until I run out of steam.
> > Maybe some brave soul will take up converting
> > the rest of them, or maybe I will: note that
> > when converting bridges one should be careful
> > to use bridge macros where appropriate.
>
> Seeing as you're introducing a huge amount of churn,
> wouldn't it be
> better to come up with a sane abstraction for initializing the the PCI
> config data
Yes, I am looking at a larger cleanup, but just decoding the magic
numbers is a necesary intermediate step to make that one safe.
Patch removing
- /* TODO: no need to do this, BAR registration does it already */
- d->config[PCI_BASE_ADDRESS_0] = PCI_BASE_ADDRESS_SPACE_IO;
will be much clearer than if it just killed this line outright:
- d->config[0x10] = 0x0001;
And the recent bug introduced in e1000 made it clear to me that it is
better to submit this one meanwhile, so that one can use grep to find
code affecting a register.
> (c.f. pci_config_set_vendor_id)?
>
> Paul
I'm not sure pci_config_set_vendor_id is an example of
a good abstraction. I think good abstractions would
be higher level, c.f. pci_add_capability()
I also have no idea when will a larger cleanup be done.
--
MST
next prev parent reply other threads:[~2009-12-11 10:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 18:09 [Qemu-devel] [PATCH 00/17] pci: switch a ton of drivers to symbolic names Michael S. Tsirkin
2009-12-10 18:17 ` Glauber Costa
2009-12-10 18:28 ` Paul Brook
2009-12-11 10:26 ` Michael S. Tsirkin [this message]
2009-12-12 15:46 ` [Qemu-devel] " Juan Quintela
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=20091211102601.GA29972@redhat.com \
--to=mst@redhat.com \
--cc=paul@codesourcery.com \
--cc=qemu-devel@nongnu.org \
/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).