* [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9
@ 2018-01-15 18:04 Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 1/6] ppc/pnv: use POWER9 DD2 processor Cédric Le Goater
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Cédric Le Goater @ 2018-01-15 18:04 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric Le Goater
Hello,
Here are some preliminary and straight forward fixes before adding
POWER9 support to the PowerNV machine.
The full tree can be found here :
https://github.com/legoater/qemu powernv-2.12
Thanks,
C.
Cédric Le Goater (6):
ppc/pnv: use POWER9 DD2 processor
ppc/pnv: change core mask for POWER9
ppc/pnv: introduce pnv*_is_power9() helpers
ppc/pnv: fix XSCOM core addressing on POWER9
ppc/pnv: change initrd address
target/ppc: add support for POWER9 HILE
hw/ppc/pnv.c | 23 ++++++++++++-----------
hw/ppc/pnv_core.c | 2 +-
hw/ppc/pnv_xscom.c | 8 +++-----
include/hw/ppc/pnv.h | 11 ++++++++++-
include/hw/ppc/pnv_xscom.h | 13 +++++++++++--
target/ppc/cpu.h | 1 +
target/ppc/excp_helper.c | 2 +-
tests/pnv-xscom-test.c | 31 +++++++++++++++++++------------
8 files changed, 58 insertions(+), 33 deletions(-)
--
2.13.6
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 1/6] ppc/pnv: use POWER9 DD2 processor
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
@ 2018-01-15 18:04 ` Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 2/6] ppc/pnv: change core mask for POWER9 Cédric Le Goater
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Cédric Le Goater @ 2018-01-15 18:04 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric Le Goater
commit 1ed9c8af501f ("target/ppc: Add POWER9 DD2.0 model information")
deprecated the POWER9 model v1.0.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/pnv.c | 2 +-
tests/pnv-xscom-test.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 9475e8479c37..536162b2747c 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -759,7 +759,7 @@ static void pnv_chip_power9_class_init(ObjectClass *klass, void *data)
PnvChipClass *k = PNV_CHIP_CLASS(klass);
k->chip_type = PNV_CHIP_POWER9;
- k->chip_cfam_id = 0x100d104980000000ull; /* P9 Nimbus DD1.0 */
+ k->chip_cfam_id = 0x220d104900008000ull; /* P9 Nimbus DD2.0 */
k->cores_mask = POWER9_CORE_MASK;
k->core_pir = pnv_chip_core_pir_p9;
k->xscom_base = 0x00603fc00000000ull;
diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c
index 89fa6282d3af..a1a119c0912c 100644
--- a/tests/pnv-xscom-test.c
+++ b/tests/pnv-xscom-test.c
@@ -48,7 +48,7 @@ static const PnvChip pnv_chips[] = {
.cpu_model = "POWER9",
.xscom_base = 0x000603fc00000000ull,
.xscom_core_base = 0x0ull,
- .cfam_id = 0x100d104980000000ull,
+ .cfam_id = 0x220d104900008000ull,
.first_core = 0x20,
},
#endif
--
2.13.6
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/6] ppc/pnv: change core mask for POWER9
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 1/6] ppc/pnv: use POWER9 DD2 processor Cédric Le Goater
@ 2018-01-15 18:04 ` Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 3/6] ppc/pnv: introduce pnv*_is_power9() helpers Cédric Le Goater
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Cédric Le Goater @ 2018-01-15 18:04 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric Le Goater
When addressed by XSCOM, the first core has the 0x20 chiplet ID but
the CPU PIR can start at 0x0.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/pnv.c | 4 ++--
tests/pnv-xscom-test.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 536162b2747c..f9591cd41d36 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -707,9 +707,9 @@ static uint32_t pnv_chip_core_pir_p9(PnvChip *chip, uint32_t core_id)
#define POWER8_CORE_MASK (0x7e7eull)
/*
- * POWER9 has 24 cores, ids starting at 0x20
+ * POWER9 has 24 cores, ids starting at 0x0
*/
-#define POWER9_CORE_MASK (0xffffff00000000ull)
+#define POWER9_CORE_MASK (0xffffffffffffffull)
static void pnv_chip_power8e_class_init(ObjectClass *klass, void *data)
{
diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c
index a1a119c0912c..9d545c471813 100644
--- a/tests/pnv-xscom-test.c
+++ b/tests/pnv-xscom-test.c
@@ -49,7 +49,7 @@ static const PnvChip pnv_chips[] = {
.xscom_base = 0x000603fc00000000ull,
.xscom_core_base = 0x0ull,
.cfam_id = 0x220d104900008000ull,
- .first_core = 0x20,
+ .first_core = 0x0,
},
#endif
};
--
2.13.6
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 3/6] ppc/pnv: introduce pnv*_is_power9() helpers
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 1/6] ppc/pnv: use POWER9 DD2 processor Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 2/6] ppc/pnv: change core mask for POWER9 Cédric Le Goater
@ 2018-01-15 18:04 ` Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 4/6] ppc/pnv: fix XSCOM core addressing on POWER9 Cédric Le Goater
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Cédric Le Goater @ 2018-01-15 18:04 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric Le Goater
These are useful when instantiating device models which are shared
between the POWER8 and the POWER9 processor families.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/pnv_xscom.c | 8 +++-----
include/hw/ppc/pnv.h | 10 ++++++++++
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
index e51d634f4062..99c40efecdf9 100644
--- a/hw/ppc/pnv_xscom.c
+++ b/hw/ppc/pnv_xscom.c
@@ -51,10 +51,9 @@ static void xscom_complete(CPUState *cs, uint64_t hmer_bits)
static uint32_t pnv_xscom_pcba(PnvChip *chip, uint64_t addr)
{
- PnvChipClass *pcc = PNV_CHIP_GET_CLASS(chip);
-
addr &= (PNV_XSCOM_SIZE - 1);
- if (pcc->chip_type == PNV_CHIP_POWER9) {
+
+ if (pnv_chip_is_power9(chip)) {
return addr >> 3;
} else {
return ((addr >> 4) & ~0xfull) | ((addr >> 3) & 0xf);
@@ -231,7 +230,6 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset)
int xscom_offset;
ForeachPopulateArgs args;
char *name;
- PnvChipClass *pcc = PNV_CHIP_GET_CLASS(chip);
name = g_strdup_printf("xscom@%" PRIx64, be64_to_cpu(reg[0]));
xscom_offset = fdt_add_subnode(fdt, root_offset, name);
@@ -242,7 +240,7 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset)
_FDT((fdt_setprop_cell(fdt, xscom_offset, "#size-cells", 1)));
_FDT((fdt_setprop(fdt, xscom_offset, "reg", reg, sizeof(reg))));
- if (pcc->chip_type == PNV_CHIP_POWER9) {
+ if (pnv_chip_is_power9(chip)) {
_FDT((fdt_setprop(fdt, xscom_offset, "compatible", compat_p9,
sizeof(compat_p9))));
} else {
diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
index 61896f9fd767..f023f1ec99c0 100644
--- a/include/hw/ppc/pnv.h
+++ b/include/hw/ppc/pnv.h
@@ -138,6 +138,16 @@ typedef struct PnvMachineState {
Notifier powerdown_notifier;
} PnvMachineState;
+static inline bool pnv_chip_is_power9(const PnvChip *chip)
+{
+ return PNV_CHIP_GET_CLASS(chip)->chip_type == PNV_CHIP_POWER9;
+}
+
+static inline bool pnv_is_power9(PnvMachineState *pnv)
+{
+ return pnv_chip_is_power9(pnv->chips[0]);
+}
+
#define PNV_FDT_ADDR 0x01000000
#define PNV_TIMEBASE_FREQ 512000000ULL
--
2.13.6
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 4/6] ppc/pnv: fix XSCOM core addressing on POWER9
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
` (2 preceding siblings ...)
2018-01-15 18:04 ` [Qemu-devel] [PATCH 3/6] ppc/pnv: introduce pnv*_is_power9() helpers Cédric Le Goater
@ 2018-01-15 18:04 ` Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 5/6] ppc/pnv: change initrd address Cédric Le Goater
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Cédric Le Goater @ 2018-01-15 18:04 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric Le Goater
The XSCOM base address of the core chiplet was wrongly calculated. Use
the OPAL macros to fix that and do a couple of renames.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/pnv.c | 15 ++++++++-------
hw/ppc/pnv_core.c | 2 +-
include/hw/ppc/pnv.h | 1 -
include/hw/ppc/pnv_xscom.h | 13 +++++++++++--
tests/pnv-xscom-test.c | 27 +++++++++++++++++----------
5 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index f9591cd41d36..80245f57f1ae 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -721,7 +721,6 @@ static void pnv_chip_power8e_class_init(ObjectClass *klass, void *data)
k->cores_mask = POWER8E_CORE_MASK;
k->core_pir = pnv_chip_core_pir_p8;
k->xscom_base = 0x003fc0000000000ull;
- k->xscom_core_base = 0x10000000ull;
dc->desc = "PowerNV Chip POWER8E";
}
@@ -735,7 +734,6 @@ static void pnv_chip_power8_class_init(ObjectClass *klass, void *data)
k->cores_mask = POWER8_CORE_MASK;
k->core_pir = pnv_chip_core_pir_p8;
k->xscom_base = 0x003fc0000000000ull;
- k->xscom_core_base = 0x10000000ull;
dc->desc = "PowerNV Chip POWER8";
}
@@ -749,7 +747,6 @@ static void pnv_chip_power8nvl_class_init(ObjectClass *klass, void *data)
k->cores_mask = POWER8_CORE_MASK;
k->core_pir = pnv_chip_core_pir_p8;
k->xscom_base = 0x003fc0000000000ull;
- k->xscom_core_base = 0x10000000ull;
dc->desc = "PowerNV Chip POWER8NVL";
}
@@ -763,7 +760,6 @@ static void pnv_chip_power9_class_init(ObjectClass *klass, void *data)
k->cores_mask = POWER9_CORE_MASK;
k->core_pir = pnv_chip_core_pir_p9;
k->xscom_base = 0x00603fc00000000ull;
- k->xscom_core_base = 0x0ull;
dc->desc = "PowerNV Chip POWER9";
}
@@ -887,6 +883,7 @@ static void pnv_chip_realize(DeviceState *dev, Error **errp)
&& (i < chip->nr_cores); core_hwid++) {
char core_name[32];
void *pnv_core = chip->cores + i * typesize;
+ uint64_t xscom_core_base;
if (!(chip->cores_mask & (1ull << core_hwid))) {
continue;
@@ -910,9 +907,13 @@ static void pnv_chip_realize(DeviceState *dev, Error **errp)
object_unref(OBJECT(pnv_core));
/* Each core has an XSCOM MMIO region */
- pnv_xscom_add_subregion(chip,
- PNV_XSCOM_EX_CORE_BASE(pcc->xscom_core_base,
- core_hwid),
+ if (!pnv_chip_is_power9(chip)) {
+ xscom_core_base = PNV_XSCOM_EX_BASE(core_hwid);
+ } else {
+ xscom_core_base = PNV_XSCOM_P9_EC_BASE(core_hwid);
+ }
+
+ pnv_xscom_add_subregion(chip, xscom_core_base,
&PNV_CORE(pnv_core)->xscom_regs);
i++;
}
diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c
index 7e8a76df4472..cbb64ad9e7e0 100644
--- a/hw/ppc/pnv_core.c
+++ b/hw/ppc/pnv_core.c
@@ -192,7 +192,7 @@ static void pnv_core_realize(DeviceState *dev, Error **errp)
snprintf(name, sizeof(name), "xscom-core.%d", cc->core_id);
pnv_xscom_region_init(&pc->xscom_regs, OBJECT(dev), &pnv_core_xscom_ops,
- pc, name, PNV_XSCOM_EX_CORE_SIZE);
+ pc, name, PNV_XSCOM_EX_SIZE);
return;
err:
diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
index f023f1ec99c0..90759240a7b1 100644
--- a/include/hw/ppc/pnv.h
+++ b/include/hw/ppc/pnv.h
@@ -74,7 +74,6 @@ typedef struct PnvChipClass {
uint64_t cores_mask;
hwaddr xscom_base;
- hwaddr xscom_core_base;
uint32_t (*core_pir)(PnvChip *chip, uint32_t core_id);
} PnvChipClass;
diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
index 7252e219e249..fb1bd5df095a 100644
--- a/include/hw/ppc/pnv_xscom.h
+++ b/include/hw/ppc/pnv_xscom.h
@@ -21,6 +21,8 @@
#include "qom/object.h"
+typedef struct PnvChip PnvChip;
+
typedef struct PnvXScomInterface {
Object parent;
} PnvXScomInterface;
@@ -54,8 +56,15 @@ typedef struct PnvXScomInterfaceClass {
* PCB SLAVE 0x110Fxxxx
*/
-#define PNV_XSCOM_EX_CORE_BASE(base, i) ((base) | ((uint64_t)(i) << 24))
-#define PNV_XSCOM_EX_CORE_SIZE 0x100000
+#define PNV_XSCOM_EX_CORE_BASE 0x10000000ull
+
+#define PNV_XSCOM_EX_BASE(core) \
+ (PNV_XSCOM_EX_CORE_BASE | ((uint64_t)(core) << 24))
+#define PNV_XSCOM_EX_SIZE 0x100000
+
+#define PNV_XSCOM_P9_EC_BASE(core) \
+ ((uint64_t)(((core) & 0x1F) + 0x20) << 24)
+#define PNV_XSCOM_P9_EC_SIZE 0x100000
#define PNV_XSCOM_LPC_BASE 0xb0020
#define PNV_XSCOM_LPC_SIZE 0x4
diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c
index 9d545c471813..efb7c838b5c0 100644
--- a/tests/pnv-xscom-test.c
+++ b/tests/pnv-xscom-test.c
@@ -21,7 +21,6 @@ typedef struct PnvChip {
PnvChipType chip_type;
const char *cpu_model;
uint64_t xscom_base;
- uint64_t xscom_core_base;
uint64_t cfam_id;
uint32_t first_core;
} PnvChip;
@@ -31,14 +30,12 @@ static const PnvChip pnv_chips[] = {
.chip_type = PNV_CHIP_POWER8,
.cpu_model = "POWER8",
.xscom_base = 0x0003fc0000000000ull,
- .xscom_core_base = 0x10000000ull,
.cfam_id = 0x220ea04980000000ull,
.first_core = 0x1,
}, {
.chip_type = PNV_CHIP_POWER8NVL,
.cpu_model = "POWER8NVL",
.xscom_base = 0x0003fc0000000000ull,
- .xscom_core_base = 0x10000000ull,
.cfam_id = 0x120d304980000000ull,
.first_core = 0x1,
},
@@ -47,7 +44,6 @@ static const PnvChip pnv_chips[] = {
.chip_type = PNV_CHIP_POWER9,
.cpu_model = "POWER9",
.xscom_base = 0x000603fc00000000ull,
- .xscom_core_base = 0x0ull,
.cfam_id = 0x220d104900008000ull,
.first_core = 0x0,
},
@@ -89,16 +85,27 @@ static void test_cfam_id(const void *data)
qtest_quit(global_qtest);
}
-#define PNV_XSCOM_EX_CORE_BASE(chip, i) \
- ((chip)->xscom_core_base | (((uint64_t)i) << 24))
+
+#define PNV_XSCOM_EX_CORE_BASE 0x10000000ull
+#define PNV_XSCOM_EX_BASE(core) \
+ (PNV_XSCOM_EX_CORE_BASE | ((uint64_t)(core) << 24))
+#define PNV_XSCOM_P9_EC_BASE(core) \
+ ((uint64_t)(((core) & 0x1F) + 0x20) << 24)
+
#define PNV_XSCOM_EX_DTS_RESULT0 0x50000
static void test_xscom_core(const PnvChip *chip)
{
- uint32_t first_core_dts0 =
- PNV_XSCOM_EX_CORE_BASE(chip, chip->first_core) |
- PNV_XSCOM_EX_DTS_RESULT0;
- uint64_t dts0 = pnv_xscom_read(chip, first_core_dts0);
+ uint32_t first_core_dts0 = PNV_XSCOM_EX_DTS_RESULT0;
+ uint64_t dts0;
+
+ if (chip->chip_type != PNV_CHIP_POWER9) {
+ first_core_dts0 |= PNV_XSCOM_EX_BASE(chip->first_core);
+ } else {
+ first_core_dts0 |= PNV_XSCOM_P9_EC_BASE(chip->first_core);
+ }
+
+ dts0 = pnv_xscom_read(chip, first_core_dts0);
g_assert_cmphex(dts0, ==, 0x26f024f023f0000ull);
}
--
2.13.6
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 5/6] ppc/pnv: change initrd address
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
` (3 preceding siblings ...)
2018-01-15 18:04 ` [Qemu-devel] [PATCH 4/6] ppc/pnv: fix XSCOM core addressing on POWER9 Cédric Le Goater
@ 2018-01-15 18:04 ` Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 6/6] target/ppc: add support for POWER9 HILE Cédric Le Goater
2018-01-16 4:58 ` [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 David Gibson
6 siblings, 0 replies; 8+ messages in thread
From: Cédric Le Goater @ 2018-01-15 18:04 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric Le Goater
When skiboot starts, it first clears the CPU structs for all possible
CPUs on a system :
for (i = 0; i <= cpu_max_pir; i++)
memset(&cpu_stacks[i].cpu, 0, sizeof(struct cpu_thread));
On POWER9, cpu_max_pir is quite big, 0x7fff, and the skiboot cpu_stacks
array overlaps with the memory region in which QEMU maps the initramfs
file. Move it upwards in memory to keep it safe.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/pnv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 80245f57f1ae..98ee3c607ae7 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -53,7 +53,7 @@
#define FW_MAX_SIZE 0x00400000
#define KERNEL_LOAD_ADDR 0x20000000
-#define INITRD_LOAD_ADDR 0x40000000
+#define INITRD_LOAD_ADDR 0x60000000
static const char *pnv_chip_core_typename(const PnvChip *o)
{
--
2.13.6
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 6/6] target/ppc: add support for POWER9 HILE
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
` (4 preceding siblings ...)
2018-01-15 18:04 ` [Qemu-devel] [PATCH 5/6] ppc/pnv: change initrd address Cédric Le Goater
@ 2018-01-15 18:04 ` Cédric Le Goater
2018-01-16 4:58 ` [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 David Gibson
6 siblings, 0 replies; 8+ messages in thread
From: Cédric Le Goater @ 2018-01-15 18:04 UTC (permalink / raw)
To: qemu-ppc, qemu-devel, David Gibson; +Cc: Cédric Le Goater
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/cpu.h | 1 +
target/ppc/excp_helper.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index dc6820c5eb99..14aaa87fe825 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -2012,6 +2012,7 @@ void ppc_compat_add_property(Object *obj, const char *name,
#define HID0_DOZE (1 << 23) /* pre-2.06 */
#define HID0_NAP (1 << 22) /* pre-2.06 */
#define HID0_HILE PPC_BIT(19) /* POWER8 */
+#define HID0_POWER9_HILE PPC_BIT(4)
/*****************************************************************************/
/* PowerPC Instructions types definitions */
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 37d241072685..4e548a448747 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -654,7 +654,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
}
} else if (excp_model == POWERPC_EXCP_POWER8) {
if (new_msr & MSR_HVB) {
- if (env->spr[SPR_HID0] & HID0_HILE) {
+ if (env->spr[SPR_HID0] & (HID0_HILE | HID0_POWER9_HILE)) {
new_msr |= (target_ulong)1 << MSR_LE;
}
} else if (env->spr[SPR_LPCR] & LPCR_ILE) {
--
2.13.6
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
` (5 preceding siblings ...)
2018-01-15 18:04 ` [Qemu-devel] [PATCH 6/6] target/ppc: add support for POWER9 HILE Cédric Le Goater
@ 2018-01-16 4:58 ` David Gibson
6 siblings, 0 replies; 8+ messages in thread
From: David Gibson @ 2018-01-16 4:58 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
On Mon, Jan 15, 2018 at 07:04:00PM +0100, Cédric Le Goater wrote:
> Hello,
>
> Here are some preliminary and straight forward fixes before adding
> POWER9 support to the PowerNV machine.
>
> The full tree can be found here :
>
> https://github.com/legoater/qemu powernv-2.12
>
> Thanks,
Applied to ppc-for-2.12.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-01-16 5:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-15 18:04 [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 1/6] ppc/pnv: use POWER9 DD2 processor Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 2/6] ppc/pnv: change core mask for POWER9 Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 3/6] ppc/pnv: introduce pnv*_is_power9() helpers Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 4/6] ppc/pnv: fix XSCOM core addressing on POWER9 Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 5/6] ppc/pnv: change initrd address Cédric Le Goater
2018-01-15 18:04 ` [Qemu-devel] [PATCH 6/6] target/ppc: add support for POWER9 HILE Cédric Le Goater
2018-01-16 4:58 ` [Qemu-devel] [PATCH 0/6] ppc/pnv: misc fixes and cleanups for POWER9 David Gibson
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).