From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Phil Dennis-Jordan <phil@philjordan.eu>
Subject: [Qemu-devel] [PULL 02/21] hw/i386: Build-time assertion on pc/q35 reset register being identical.
Date: Fri, 5 May 2017 12:13:18 +0200 [thread overview]
Message-ID: <20170505101337.4650-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20170505101337.4650-1-pbonzini@redhat.com>
From: Phil Dennis-Jordan <phil@philjordan.eu>
This adds a clarifying comment and build time assert to the FADT reset register field initialisation: the reset register is the same on both machine types.
Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
Message-Id: <1489558827-28971-3-git-send-email-phil@philjordan.eu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/acpi-build.c | 3 +++
hw/pci-host/piix.c | 6 ------
include/hw/i386/pc.h | 6 ++++++
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 7997f06823..1d8c645ed3 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -310,6 +310,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)
fadt->reset_register.space_id = AML_SYSTEM_IO;
fadt->reset_register.bit_width = 8;
fadt->reset_register.address = cpu_to_le64(ICH9_RST_CNT_IOPORT);
+ /* The above need not be conditional on machine type because the reset port
+ * happens to be the same on PIIX (pc) and ICH9 (q35). */
+ QEMU_BUILD_BUG_ON(ICH9_RST_CNT_IOPORT != RCR_IOPORT);
fadt->xpm1a_event_block.space_id = AML_SYSTEM_IO;
fadt->xpm1a_event_block.bit_width = fadt->pm1_evt_len * 8;
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index f9218aa952..bf4221d4bf 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -58,12 +58,6 @@ typedef struct I440FXState {
#define XEN_PIIX_NUM_PIRQS 128ULL
#define PIIX_PIRQC 0x60
-/*
- * Reset Control Register: PCI-accessible ISA-Compatible Register at address
- * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000).
- */
-#define RCR_IOPORT 0xcf9
-
typedef struct PIIX3State {
PCIDevice dev;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index f278b3ae89..416aaa56ea 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -303,6 +303,12 @@ typedef struct PCII440FXState PCII440FXState;
#define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX"
+/*
+ * Reset Control Register: PCI-accessible ISA-Compatible Register at address
+ * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000).
+ */
+#define RCR_IOPORT 0xcf9
+
PCIBus *i440fx_init(const char *host_type, const char *pci_type,
PCII440FXState **pi440fx_state, int *piix_devfn,
ISABus **isa_bus, qemu_irq *pic,
--
2.12.2
next prev parent reply other threads:[~2017-05-05 10:13 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-05 10:13 [Qemu-devel] [PULL 00/21] Misc patches for 2017-05-05 Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 01/21] hw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support Paolo Bonzini
2017-05-05 10:13 ` Paolo Bonzini [this message]
2017-05-05 10:13 ` [Qemu-devel] [PULL 03/21] char: Fix removing wrong GSource that be found by fd_in_tag Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 04/21] target/i386: Add GDB XML register description support Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 05/21] use _Static_assert in QEMU_BUILD_BUG_ON Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 06/21] vl: deprecate the "-hdachs" option Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 07/21] scsi: avoid an off-by-one error in megasas_mmio_write Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 08/21] sgabios: update for "fix wrong video attrs for int 10h, ah==13h" Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 09/21] vmw_pvscsi: check message ring page count at initialisation Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 10/21] trace: add qemu mutex lock and unlock trace events Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 11/21] checkpatch: Disallow glib asserts in main code Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 12/21] hax: Fix memory mapping de-duplication logic Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 13/21] dump: Acquire BQL around vm_start() in dump thread Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 14/21] Fix the -accel parameter and the documentation for 'hax' Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 15/21] MAINTAINERS: Add "R:" tag for self-appointed reviewers Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 16/21] get_maintainer: Teach get_maintainer.pl about the new "R:" tag Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 17/21] get_maintainer: it's '--pattern-depth', not '-pattern-depth' Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 18/21] get_maintainer: --r (list reviewer) is on by default Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 19/21] get_maintainer: add subsystem to reviewer output Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 20/21] libvhost-user: replace vasprintf() to fix build Paolo Bonzini
2017-05-05 10:13 ` [Qemu-devel] [PULL 21/21] vhost-scsi: create a vhost-scsi-common abstraction Paolo Bonzini
2017-05-30 13:11 ` Stefan Hajnoczi
2017-05-30 14:06 ` Felipe Franciosi
2017-05-30 14:16 ` Paolo Bonzini
2017-05-30 14:21 ` Felipe Franciosi
2017-05-30 14:29 ` Paolo Bonzini
2017-05-30 14:34 ` Felipe Franciosi
2017-05-08 17:02 ` [Qemu-devel] [PULL 00/21] Misc patches for 2017-05-05 Stefan Hajnoczi
2017-05-30 13:13 ` Stefan Hajnoczi
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=20170505101337.4650-3-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=phil@philjordan.eu \
--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).