qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6092] PCI: Mask writes to RO bits in the command reg of PCI config space
Date: Thu, 18 Dec 2008 22:43:41 +0000	[thread overview]
Message-ID: <E1LDRan-0002RT-8N@cvs.savannah.gnu.org> (raw)

Revision: 6092
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6092
Author:   aurel32
Date:     2008-12-18 22:43:40 +0000 (Thu, 18 Dec 2008)

Log Message:
-----------
PCI: Mask writes to RO bits in the command reg of PCI config space

The Command register in the PCI config space has some read-only bits.
Any writes to those bits should be masked out.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Modified Paths:
--------------
    trunk/hw/pci.c
    trunk/hw/pci.h

Modified: trunk/hw/pci.c
===================================================================
--- trunk/hw/pci.c	2008-12-18 22:43:33 UTC (rev 6091)
+++ trunk/hw/pci.c	2008-12-18 22:43:40 UTC (rev 6092)
@@ -417,6 +417,9 @@
         if (can_write) {
             /* Mask out writes to reserved bits in registers */
             switch (addr) {
+	    case 0x05:
+                val &= ~PCI_COMMAND_RESERVED_MASK_HI;
+                break;
             case 0x06:
                 val &= ~PCI_STATUS_RESERVED_MASK_LO;
                 break;

Modified: trunk/hw/pci.h
===================================================================
--- trunk/hw/pci.h	2008-12-18 22:43:33 UTC (rev 6091)
+++ trunk/hw/pci.h	2008-12-18 22:43:40 UTC (rev 6092)
@@ -69,6 +69,11 @@
 
 #define PCI_STATUS_RESERVED_MASK_HI (PCI_STATUS_DEVSEL >> 8)
 
+/* Bits in the PCI Command Register (PCI 2.3 spec) */
+#define PCI_COMMAND_RESERVED	0xf800
+
+#define PCI_COMMAND_RESERVED_MASK_HI (PCI_COMMAND_RESERVED >> 8)
+
 struct PCIDevice {
     /* PCI config space */
     uint8_t config[256];

                 reply	other threads:[~2008-12-18 22:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=E1LDRan-0002RT-8N@cvs.savannah.gnu.org \
    --to=aurelien@aurel32.net \
    --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).