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 v8 01/11] pci: revise pci command register initialization
Date: Mon, 15 Nov 2010 10:09:56 +0200 [thread overview]
Message-ID: <20101115080956.GF22248@redhat.com> (raw)
In-Reply-To: <7e4c6573d912e9a45c8515b86c39c348002aa701.1289805831.git.yamahata@valinux.co.jp>
On Mon, Nov 15, 2010 at 04:30:37PM +0900, Isaku Yamahata wrote:
> This patch cleans up command register initialization with
> comments.
>
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Probably just fold with the next patch.
> ---
> hw/pci.c | 42 ++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 42 insertions(+), 0 deletions(-)
>
> diff --git a/hw/pci.c b/hw/pci.c
> index 962886e..b70a568 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -544,8 +544,50 @@ static void pci_init_wmask(PCIDevice *dev)
>
> dev->wmask[PCI_CACHE_LINE_SIZE] = 0xff;
> dev->wmask[PCI_INTERRUPT_LINE] = 0xff;
> +
> + /*
> + * bit 0: PCI_COMMAND_IO
> + * type 0: if IO BAR is used, RW
> + * type 1: RW
> + * bit 1: PCI_COMMAND_MEMORY
> + * type 0: if IO BAR is used, RW
> + * type 1: RW
> + * bit 2: PCI_COMMAND_MASTER
> + * type 0: RW if bus master
> + * type 1: RW
> + * bit 3: PCI_COMMAND_SPECIAL
> + * RO=0, optionally RW: Such device should set this bit itself
> + * bit 4: PCI_COMMAND_INVALIDATE
> + * RO=0, optionally RW: Such device should set this bit itself
> + * bit 5: PCI_COMMAND_VGA_PALETTE
> + * RO=0, optionally RW: Such device should set this bit itself
> + * bit 6: PCI_COMMAND_PARITY
> + * RW with exceptions: Such device should clear this bit itself
> + * Given that qemu doesn't emulate pci bus cycles, so that there
> + * is no place to generate parity error. So just making this
> + * register RW is okay because there is no place which refers
> + * this bit.
> + * TODO: When device assignment tried to inject PERR# into qemu,
> + * some extra work would be needed.
> + * bit 7: PCI_COMMAND_WAIT: reserved (PCI 3.0)
> + * RO=0
> + * bit 8: PCI_COMMAND_SERR
> + * RW with exceptions: Such device should clear this bit itself
> + * Given that qemu doesn't emulate pci bus cycles, so that there
> + * is no place to generate system error. So just making this
> + * register RW is okay because there is no place which refers
> + * this bit.
> + * TODO: When device assignment tried to inject SERR# into qemu,
> + * some extra work would be needed.
> + * bit 9: PCI_COMMAND_FAST_BACK
> + * RO=0, optionally RW: Such device should set this bit itself
> + * bit 10: PCI_COMMAND_INTX_DISABLE
> + * RW
> + * bit 11-15: reserved
> + */
> pci_set_word(dev->wmask + PCI_COMMAND,
> PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
> + PCI_COMMAND_PARITY | PCI_COMMAND_SERR |
> PCI_COMMAND_INTX_DISABLE);
>
> memset(dev->wmask + PCI_CONFIG_HEADER_SIZE, 0xff,
> --
> 1.7.1.1
next prev parent reply other threads:[~2010-11-15 8:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 7:30 [Qemu-devel] [PATCH v8 00/11] pcie port switch emulators Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 01/11] pci: revise pci command register initialization Isaku Yamahata
2010-11-15 8:09 ` Michael S. Tsirkin [this message]
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 02/11] pci: clean up pci command register io/memory bit initialization Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 03/11] pci: fix accesses to pci status register Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 04/11] pci: clean up of " Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 05/11] pcie_regs.h: more constants Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 06/11] pcie/aer: helper functions for pcie aer capability Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 07/11] pci: introduce a parser for pci device path Isaku Yamahata
2010-11-15 8:06 ` [Qemu-devel] " Michael S. Tsirkin
2010-11-15 8:57 ` Isaku Yamahata
2010-11-15 9:03 ` Gleb Natapov
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 08/11] pcie/aer: glue aer error injection into qemu monitor Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 09/11] ioh3420: support aer Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 10/11] x3130/upstream: " Isaku Yamahata
2010-11-15 7:30 ` [Qemu-devel] [PATCH v8 11/11] x3130/downstream: " Isaku Yamahata
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=20101115080956.GF22248@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 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.