From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LDRap-0000Rp-2B for qemu-devel@nongnu.org; Thu, 18 Dec 2008 17:43:43 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LDRao-0000RW-HO for qemu-devel@nongnu.org; Thu, 18 Dec 2008 17:43:42 -0500 Received: from [199.232.76.173] (port=59876 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDRao-0000RO-AR for qemu-devel@nongnu.org; Thu, 18 Dec 2008 17:43:42 -0500 Received: from savannah.gnu.org ([199.232.41.3]:43681 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LDRao-000855-0M for qemu-devel@nongnu.org; Thu, 18 Dec 2008 17:43:42 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LDRan-0002RY-Ej for qemu-devel@nongnu.org; Thu, 18 Dec 2008 22:43:41 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LDRan-0002RT-8N for qemu-devel@nongnu.org; Thu, 18 Dec 2008 22:43:41 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Thu, 18 Dec 2008 22:43:41 +0000 Subject: [Qemu-devel] [6092] PCI: Mask writes to RO bits in the command reg of PCI config space Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Aurelien Jarno 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];