From: Roman Kagan <rkagan@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
qemu-stable@nongnu.org, Roman Kagan <rkagan@virtuozzo.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Igor Mammedov <imammedo@redhat.com>, John Snow <jsnow@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH v4 2/4] i386/acpi: make floppy controller object dynamic
Date: Fri, 25 Dec 2015 18:04:10 +0300 [thread overview]
Message-ID: <1451055852-30910-3-git-send-email-rkagan@virtuozzo.com> (raw)
In-Reply-To: <1451055852-30910-1-git-send-email-rkagan@virtuozzo.com>
Instead of statically declaring the floppy controller in DSDT, with its
_STA method depending on some obscure bit in the parent ISA bridge, add
the object dynamically to SSDT via AML API only when the controller is
present.
The _STA method is no longer necessary and is therefore dropped. So are
the declarations of the fields indicating whether the contoller is
enabled.
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: qemu-block@nongnu.org
Cc: qemu-stable@nongnu.org
---
changes since v3:
- new patch (note that it conflicts with "[PATCH 50/74] pc: acpi: move
FDC0 device from DSDT to SSDT" from Igor's series)
- include test data updates to maintain bisectability
hw/i386/acpi-build.c | 24 ++++++++++++++++++++++++
hw/i386/acpi-dsdt-isa.dsl | 18 ------------------
hw/i386/acpi-dsdt.dsl | 1 -
hw/i386/q35-acpi-dsdt.dsl | 7 ++-----
tests/acpi-test-data/pc/DSDT | Bin 3028 -> 2946 bytes
tests/acpi-test-data/pc/SSDT | Bin 2486 -> 2554 bytes
tests/acpi-test-data/pc/SSDT.bridge | Bin 4345 -> 4413 bytes
tests/acpi-test-data/q35/DSDT | Bin 7666 -> 7578 bytes
8 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 4cc1440..a01e909 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -113,6 +113,7 @@ typedef struct AcpiMiscInfo {
unsigned dsdt_size;
uint16_t pvpanic_port;
uint16_t applesmc_io_base;
+ bool has_fdc;
} AcpiMiscInfo;
typedef struct AcpiBuildPciBusHotplugState {
@@ -236,10 +237,15 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
static void acpi_get_misc_info(AcpiMiscInfo *info)
{
+ ISADevice *fdc;
+
info->has_hpet = hpet_find();
info->tpm_version = tpm_get_version();
info->pvpanic_port = pvpanic_port();
info->applesmc_io_base = applesmc_port();
+
+ fdc = pc_find_fdc0();
+ info->has_fdc = !!fdc;
}
/*
@@ -1099,6 +1105,24 @@ build_ssdt(GArray *table_data, GArray *linker,
aml_append(scope, aml_name_decl("_S5", pkg));
aml_append(ssdt, scope);
+ if (misc->has_fdc) {
+ scope = aml_scope("\\_SB.PCI0.ISA");
+ dev = aml_device("FDC0");
+
+ aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700")));
+
+ crs = aml_resource_template();
+ aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04));
+ aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01));
+ aml_append(crs, aml_irq_no_flags(6));
+ aml_append(crs, aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER,
+ AML_TRANSFER8, 2));
+ aml_append(dev, aml_name_decl("_CRS", crs));
+
+ aml_append(scope, dev);
+ aml_append(ssdt, scope);
+ }
+
if (misc->applesmc_io_base) {
scope = aml_scope("\\_SB.PCI0.ISA");
dev = aml_device("SMC");
diff --git a/hw/i386/acpi-dsdt-isa.dsl b/hw/i386/acpi-dsdt-isa.dsl
index 89caa16..061507d 100644
--- a/hw/i386/acpi-dsdt-isa.dsl
+++ b/hw/i386/acpi-dsdt-isa.dsl
@@ -47,24 +47,6 @@ Scope(\_SB.PCI0.ISA) {
})
}
- Device(FDC0) {
- Name(_HID, EisaId("PNP0700"))
- Method(_STA, 0, NotSerialized) {
- Store(FDEN, Local0)
- If (LEqual(Local0, 0)) {
- Return (0x00)
- } Else {
- Return (0x0F)
- }
- }
- Name(_CRS, ResourceTemplate() {
- IO(Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
- IO(Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
- IRQNoFlags() { 6 }
- DMA(Compatibility, NotBusMaster, Transfer8) { 2 }
- })
- }
-
Device(LPT) {
Name(_HID, EisaId("PNP0400"))
Method(_STA, 0, NotSerialized) {
diff --git a/hw/i386/acpi-dsdt.dsl b/hw/i386/acpi-dsdt.dsl
index 8dba096..aa50990 100644
--- a/hw/i386/acpi-dsdt.dsl
+++ b/hw/i386/acpi-dsdt.dsl
@@ -80,7 +80,6 @@ DefinitionBlock (
, 3,
CBEN, 1, // COM2
}
- Name(FDEN, 1)
}
}
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index 7be7b37..fcb9915 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -137,16 +137,13 @@ DefinitionBlock (
COMB, 3,
Offset(0x01),
- LPTD, 2,
- , 2,
- FDCD, 2
+ LPTD, 2
}
OperationRegion(LPCE, PCI_Config, 0x82, 0x2)
Field(LPCE, AnyAcc, NoLock, Preserve) {
CAEN, 1,
CBEN, 1,
- LPEN, 1,
- FDEN, 1
+ LPEN, 1
}
}
}
diff --git a/tests/acpi-test-data/pc/DSDT b/tests/acpi-test-data/pc/DSDT
index c658203db94a7e7db7c36fde99a7075a8d75498d..d8ebf12cc0abbbbe9f19d131c7b1d7d1b3e681df 100644
GIT binary patch
delta 51
zcmca2-XzZD66_Mv#Ld9KxML%i4I`fet6qGtQ+$B4r$Ka+^W+dlCuRW$@yYWU7jEuh
H^56sjVdo9@
delta 130
zcmZn?zaq}%66_Lkg`0tav1KEd4I`f$t6qGtQ+$B4r$Ka+=j0GZCr%DG7gs+<0Uznf
zGZ`0pc(J&-I2&-pdw9C=I9_095Rr%v4sm2C04YjXz&1I7VF|-RmL**L9P!RU!Gh9U
h67Gzjm_IQyu(&gRXa3I2z^LTFpvA(l*^J4D69A%9AeI0C
diff --git a/tests/acpi-test-data/pc/SSDT b/tests/acpi-test-data/pc/SSDT
index 210d6a71e58aa34ce8e94121d25bcf58c3bd503c..ffb3fe43970123d0e198328429ee04ebfd0564c9 100644
GIT binary patch
delta 91
zcmdlc{7aZCIM^lR7bgP)<AjY|(Tq;cEHV1b@xe~<0nVNVp23ds(M<+!F3tuV@gANo
vJdPLG893sdgMtO6xg^{fKQVt|W?*q={LcKHnSoKsfkBIfp>lIFV=xB*dq@{?
delta 24
gcmew*yiJ%ZIM^j*8z%z;<MoYP(Ttl{G6r%00Az3ng8%>k
diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge
index 6e6660b1fbe0bdb7fe0b257cb53c31fa9bb21a14..f0f11bec8108eceb696fb854b51faeb97471146c 100644
GIT binary patch
delta 91
zcmeyVxL1iQIM^k`R*->#@y153XhtVzmKc5J_+Y2_0B27F&tS*+=q3X<7iR;Gcn?n(
v9>)vp3>@*!LBWF3ToUe#pO`-}GqAWberNv9%)qGRz@Wv#P`NpoaT-4WWGfeO
delta 24
gcmdn1^iz>5IM^lRrvL*3qryh6XvWPe8K>|A0A#NRg8%>k
diff --git a/tests/acpi-test-data/q35/DSDT b/tests/acpi-test-data/q35/DSDT
index 4723e5954dccb00995ccaf521b7daf6bf15cf1d4..5e03e26323d50dea63d57a36bd902e061e0442d8 100644
GIT binary patch
delta 91
zcmexlJ<FQQCD<iomMjAUqvA%cw~Txa?0WIRPVoWGo(9oP&XZZ0)EOlw>oQ5GMmP8b
qIJ+`&HE}UTH;RJT49<?OevHmeK*A>gNC-HHPcCCxxH*}*UkU(Bo)>-q
delta 176
zcmbPb{mGikCD<k8lPm)R<DrdQZyEV~*!ALro#F$WJq@Cp{3o+AsWU1})@70~WMFc0
zadu&fZtw|kc4gvf;$n(!lmf9CoE=^L7@eJfgiipFaB~3?0zT4{vzQioc(DL=8F0jV
zc)IX7USMYsk%$itabzd}DN0ztHaUS|3By8`C0zU*@y<cPg3??P?u?(9KQS|~xHEod
U{?5$6sN}$)#lo<eoq4hp0M<4v7ytkO
--
2.5.0
next prev parent reply other threads:[~2015-12-25 15:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-25 15:04 [Qemu-devel] [PATCH v4 0/4] i386: expose floppy-related objects in SSDT Roman Kagan
2015-12-25 15:04 ` [Qemu-devel] [PATCH v4 1/4] i386/pc: expose identifying the floppy controller Roman Kagan
2015-12-25 15:04 ` Roman Kagan [this message]
2015-12-25 15:04 ` [Qemu-devel] [PATCH v4 3/4] expose floppy drive geometry and CMOS type Roman Kagan
2015-12-25 15:04 ` [Qemu-devel] [PATCH v4 4/4] i386: populate floppy drive information in SSDT Roman Kagan
2015-12-29 14:09 ` [Qemu-devel] [PATCH v4 0/4] i386: expose floppy-related objects " Igor Mammedov
2015-12-29 16:17 ` Roman Kagan
2015-12-29 16:27 ` Igor Mammedov
2015-12-29 16:42 ` Michael S. Tsirkin
-- strict thread matches above, loose matches on Subject: below --
2015-12-16 7:45 [Qemu-devel] [PATCH v2 1/1] " Denis V. Lunev
2015-12-16 16:46 ` John Snow
2015-12-16 16:46 ` Igor Mammedov
2015-12-16 17:34 ` Roman Kagan
2015-12-16 22:15 ` Igor Mammedov
2015-12-17 13:26 ` Roman Kagan
2015-12-17 17:08 ` Igor Mammedov
2015-12-18 19:32 ` [Qemu-devel] [PATCH v3 0/2] " Roman Kagan
2015-12-18 19:32 ` [Qemu-devel] [PATCH v3 1/2] " Roman Kagan
2015-12-22 15:07 ` Michael S. Tsirkin
2015-12-22 15:13 ` Roman Kagan
2015-12-22 15:56 ` Igor Mammedov
2015-12-18 19:32 ` [Qemu-devel] [PATCH v3 2/2] tests: update expected SSDT for floppy changes Roman Kagan
2015-12-22 16:41 ` Michael S. Tsirkin
2015-12-23 13:08 ` Roman Kagan
2015-12-23 13:45 ` Michael S. Tsirkin
2015-12-23 15:06 ` Roman Kagan
2015-12-23 17:20 ` Roman Kagan
2015-12-23 17:47 ` Igor Mammedov
2015-12-23 17:51 ` Roman Kagan
2015-12-24 6:17 ` Michael S. Tsirkin
2015-12-25 15:25 ` Roman Kagan
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=1451055852-30910-3-git-send-email-rkagan@virtuozzo.com \
--to=rkagan@virtuozzo.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=rth@twiddle.net \
/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).