* [Qemu-devel] [v4 PATCH 1/2] pc: add compat_props placeholder for 2.0 machine type
2014-05-02 18:02 [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14 Gabriel L. Somlo
@ 2014-05-02 18:02 ` Gabriel L. Somlo
2014-05-02 18:02 ` [Qemu-devel] [v4 PATCH 2/2] apic: use emulated lapic version 0x14 on pc machines >= 2.1 Gabriel L. Somlo
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Gabriel L. Somlo @ 2014-05-02 18:02 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, agraf, afaerber, dslutz, mst
Add the "boilerplate" necessary for subsequent patches to
simply drop in compat_props for pc machines 2.0 and older.
This patch contains no functional changes.
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
---
hw/i386/pc_piix.c | 4 ++++
hw/i386/pc_q35.c | 4 ++++
include/hw/i386/pc.h | 9 +++++++++
3 files changed, 17 insertions(+)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 5b3594b..7c672d7 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -415,6 +415,10 @@ static QEMUMachine pc_i440fx_machine_v2_0 = {
PC_I440FX_2_0_MACHINE_OPTIONS,
.name = "pc-i440fx-2.0",
.init = pc_init_pci_2_0,
+ .compat_props = (GlobalProperty[]) {
+ PC_COMPAT_2_0,
+ { /* end of list */ }
+ },
};
#define PC_I440FX_1_7_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 5b48231..1fe2213 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -328,6 +328,10 @@ static QEMUMachine pc_q35_machine_v2_0 = {
PC_Q35_2_0_MACHINE_OPTIONS,
.name = "pc-q35-2.0",
.init = pc_q35_init_2_0,
+ .compat_props = (GlobalProperty[]) {
+ PC_Q35_COMPAT_2_0,
+ { /* end of list */ }
+ },
};
#define PC_Q35_1_7_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 9f26e14..0ade0f1 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -242,8 +242,12 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);
int e820_get_num_entries(void);
bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
+#define PC_Q35_COMPAT_2_0 \
+ PC_COMPAT_2_0
+
#define PC_Q35_COMPAT_1_7 \
PC_COMPAT_1_7, \
+ PC_Q35_COMPAT_2_0, \
{\
.driver = "hpet",\
.property = HPET_INTCAP,\
@@ -262,7 +266,12 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
PC_COMPAT_1_4, \
PC_Q35_COMPAT_1_5
+#define PC_COMPAT_2_0 \
+ {\
+ }
+
#define PC_COMPAT_1_7 \
+ PC_COMPAT_2_0, \
{\
.driver = TYPE_USB_DEVICE,\
.property = "msos-desc",\
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [v4 PATCH 2/2] apic: use emulated lapic version 0x14 on pc machines >= 2.1
2014-05-02 18:02 [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14 Gabriel L. Somlo
2014-05-02 18:02 ` [Qemu-devel] [v4 PATCH 1/2] pc: add compat_props placeholder for 2.0 machine type Gabriel L. Somlo
@ 2014-05-02 18:02 ` Gabriel L. Somlo
2014-05-02 18:23 ` [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14 Gabriel L. Somlo
2014-05-05 11:42 ` Alexander Graf
3 siblings, 0 replies; 5+ messages in thread
From: Gabriel L. Somlo @ 2014-05-02 18:02 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, agraf, afaerber, dslutz, mst
Add "version" property to local apic, and have it default to
0x14 for pc machines starting at 2.1. For compatibility with
previous releases, pc machines up to 2.0 will have their local
apic version set to 0x11.
Signed-off-by: Gabriel L. Somlo <somlo@cmu.edu>
---
hw/intc/apic.c | 2 +-
hw/intc/apic_common.c | 1 +
include/hw/i386/apic_internal.h | 1 +
include/hw/i386/pc.h | 3 +++
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index 2f40cba..ef19e55 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -675,7 +675,7 @@ static uint32_t apic_mem_readl(void *opaque, hwaddr addr)
val = s->id << 24;
break;
case 0x03: /* version */
- val = 0x11 | ((APIC_LVT_NB - 1) << 16); /* version 0x11 */
+ val = s->version | ((APIC_LVT_NB - 1) << 16);
break;
case 0x08:
apic_sync_vapic(s, SYNC_FROM_VAPIC);
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 7ecce2d..9cb418f 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -380,6 +380,7 @@ static const VMStateDescription vmstate_apic_common = {
static Property apic_properties_common[] = {
DEFINE_PROP_UINT8("id", APICCommonState, id, -1),
+ DEFINE_PROP_UINT32("version", APICCommonState, version, 0x14),
DEFINE_PROP_BIT("vapic", APICCommonState, vapic_control, VAPIC_ENABLE_BIT,
true),
DEFINE_PROP_END_OF_LIST(),
diff --git a/include/hw/i386/apic_internal.h b/include/hw/i386/apic_internal.h
index 70542a6..0ac1462 100644
--- a/include/hw/i386/apic_internal.h
+++ b/include/hw/i386/apic_internal.h
@@ -98,6 +98,7 @@ struct APICCommonState {
X86CPU *cpu;
uint32_t apicbase;
uint8_t id;
+ uint32_t version;
uint8_t arb_id;
uint8_t tpr;
uint32_t spurious_vec;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 0ade0f1..32a7687 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -268,6 +268,9 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
#define PC_COMPAT_2_0 \
{\
+ .driver = "apic",\
+ .property = "version",\
+ .value = stringify(0x11),\
}
#define PC_COMPAT_1_7 \
--
1.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14
2014-05-02 18:02 [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14 Gabriel L. Somlo
2014-05-02 18:02 ` [Qemu-devel] [v4 PATCH 1/2] pc: add compat_props placeholder for 2.0 machine type Gabriel L. Somlo
2014-05-02 18:02 ` [Qemu-devel] [v4 PATCH 2/2] apic: use emulated lapic version 0x14 on pc machines >= 2.1 Gabriel L. Somlo
@ 2014-05-02 18:23 ` Gabriel L. Somlo
2014-05-05 11:42 ` Alexander Graf
3 siblings, 0 replies; 5+ messages in thread
From: Gabriel L. Somlo @ 2014-05-02 18:23 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, agraf, afaerber, dslutz, mst
On Fri, May 02, 2014 at 02:02:11PM -0400, Gabriel L. Somlo wrote:
> I decided to split the patch into the boilerplate compat_props for v2.0
> and older (1/2) and the actual lapic-version "payload" (2/2).
BTW, I plan on using uint8_t instead of uint32_t for "version" in a
future (v5) revision, since only bits 7:0 of the apic version register
are actually dedicated to the "implementation version".
But I'm waiting for any additional feedback before I blast out another
update :)
Thanks,
--Gabriel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14
2014-05-02 18:02 [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14 Gabriel L. Somlo
` (2 preceding siblings ...)
2014-05-02 18:23 ` [Qemu-devel] [v4 PATCH 0/2] apic: bump emulated lapic version to 0x14 Gabriel L. Somlo
@ 2014-05-05 11:42 ` Alexander Graf
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2014-05-05 11:42 UTC (permalink / raw)
To: Gabriel L. Somlo; +Cc: pbonzini, dslutz, qemu-devel, afaerber, mst
On 05/02/2014 08:02 PM, Gabriel L. Somlo wrote:
> I decided to split the patch into the boilerplate compat_props for v2.0
> and older (1/2) and the actual lapic-version "payload" (2/2).
>
> The first (boilerplate) patch depends on another patch for which a pull
> request is already pending:
>
> http://lists.nongnu.org/archive/html/qemu-devel/2014-04/msg04728.html,
>
> Please let me know what you all think.
From what I understand about the compat bits (which is little) this
makes a lot of sense. And the version is a proper property now, which is
great :).
Acked-by: Alexander Graf <agraf@suse.de>
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread