mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
ppc patch queue for 2017-05-11
This pull request supersedes the one from yesterday (20170510), fixing an important style bug in one patch, and adding an extra couple of simple patches. Highlights of this set: * Some fixes for POWER9 * TCG support for POWER9 radix MMU * VGA rom for Mac machine types * Fixes for the XICS interrupt controller * MTTCG support for ppc targets As suggested by Paolo, I've tried to add the Docker tests to my standard pre-pull-request tests. I haven't wholly suceeded; this has been tested with some of the Docker images, but others I haven't managed due to problems that as best I can tell are not due to problems in this patch series. I'll continue working on this for future pull requests. Specifically, 'travis', 'fedora', and 'centos6' seem to work. 'min-glib' jammed while gtesting moxie, which seems very unlikely to be caused by this series. 'ubuntu', 'debian' and 'debian-bootstrap' hit build errors almost immediately that look like problems with the container configuration, and 'debian-*-cross' hit build errors later on which also look like missing dependencies from the container. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJZE+T6AAoJEGw4ysog2bOSgSYQAMszDZ+HCYlp6iVlJqDoy55S u8krYwkS9MnzrmbMjPVzGiFmH6IEuOd3zAx0aM1wZtcXjprUKsr6jHZOEtk7Frv5 vzIwzcP85vkVegPX+fNUAo+1+T3OHix9RAI3BF5rHdyCC2OmJriPyvyOQ76uVORJ 9ouSAeG/dCyjkVRYAlTQPidGqc/OQUaMFwZdLvhTJHeDqcdlqziCzP1YnDjN78UQ BRpsYOYFnGSzaqjNj16edF/yM4NiW/4tLd700mvGkvPUHrFEiyQur0Lm0bc1iZs5 JZwcgAxhivI6CiWt57y/OpC6pWsasVhlBY00aWBcEExAh6j+Kp20g0C6MYB4JdwX jVJUOzWGWuMFkS65S/nHmdngUWvrSpn1xzPr0KQihLRFpoYK3btaS2TcekQocnZc mF3NFvKXeS/F6ZYLDWkLF/9VVEjz2mJNRvimhMWljuFyLmxlQxQSvzNXZ7Lt/maj D4nFaOWf5eG0O0Em54hLizM6r6vnt2qkLVSjPmOFO2gQvDsu10G/5ociqkYNRYvz srJUfo2xMjzaM0lvJTJT3VOWfbX1Wq4A8zyjLuoi1xpqI1Yb95zEycFvc0Eszzh1 OByIuHLNynu+W2w08dAA8vU1tlh+Yf0yld2LOgY3Cn2gjgHQRFtmyrIsPgYsptC1 63Y0PbTnGdbaEdlAJu8I =D0Hk -----END PGP SIGNATURE----- Merge remote-tracking branch 'dgibson/tags/ppc-for-2.10-20170511' into staging ppc patch queue for 2017-05-11 This pull request supersedes the one from yesterday (20170510), fixing an important style bug in one patch, and adding an extra couple of simple patches. Highlights of this set: * Some fixes for POWER9 * TCG support for POWER9 radix MMU * VGA rom for Mac machine types * Fixes for the XICS interrupt controller * MTTCG support for ppc targets As suggested by Paolo, I've tried to add the Docker tests to my standard pre-pull-request tests. I haven't wholly suceeded; this has been tested with some of the Docker images, but others I haven't managed due to problems that as best I can tell are not due to problems in this patch series. I'll continue working on this for future pull requests. Specifically, 'travis', 'fedora', and 'centos6' seem to work. 'min-glib' jammed while gtesting moxie, which seems very unlikely to be caused by this series. 'ubuntu', 'debian' and 'debian-bootstrap' hit build errors almost immediately that look like problems with the container configuration, and 'debian-*-cross' hit build errors later on which also look like missing dependencies from the container. # gpg: Signature made Thu 11 May 2017 05:13:46 AM BST # gpg: using RSA key 0x6C38CACA20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" # gpg: aka "David Gibson (kernel.org) <dwg@kernel.org>" # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * dgibson/tags/ppc-for-2.10-20170511: (23 commits) target/ppc: Avoid printing wrong aliases in CPU help text pnv: Fix build failures on some host platforms target/ppc: Allow workarounds for POWER9 DD1 spapr: Don't accidentally advertise HTM support on POWER9 ppc: xics: fix compilation with CentOS 6 target/ppc: Enable RADIX mmu mode for pseries TCG guest target/ppc: Implement ISA V3.00 radix page fault handler target/ppc: Change tlbie invalid fields for POWER9 support target/ppc: Update tlbie to check privilege level based on GTSE target/ppc: Set UPRT and GTSE on all cpus in H_REGISTER_PROCESS_TABLE ppc: add qemu_vga.ndrv ROM to fw_cfg interface for NewWorld Macs ppc: add qemu_vga.ndrv ROM to fw_cfg interface for OldWorld Macs Add QemuMacDrivers qemu_vga.ndrv revision d4e7d7a built as submodule Add QemuMacDrivers as submodule ppc/xics: preserve P and Q bits for KVM IRQs ppc/xics: Fix stale irq->status bits after get target/ppc: do not reset reserve_addr in exec_enter tcg: enable MTTCG by default for PPC64 on x86 cpus: Fix CPU unplug for MTTCG target/ppc: Generate fence operations ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
commit
2f77ec7390
29 changed files with 525 additions and 63 deletions
|
@ -80,6 +80,8 @@
|
|||
#define CLOCKFREQ (266UL * 1000UL * 1000UL)
|
||||
#define BUSFREQ (100UL * 1000UL * 1000UL)
|
||||
|
||||
#define NDRV_VGA_FILENAME "qemu_vga.ndrv"
|
||||
|
||||
/* UniN device */
|
||||
static void unin_write(void *opaque, hwaddr addr, uint64_t value,
|
||||
unsigned size)
|
||||
|
@ -160,7 +162,8 @@ static void ppc_core99_init(MachineState *machine)
|
|||
MACIOIDEState *macio_ide;
|
||||
BusState *adb_bus;
|
||||
MacIONVRAMState *nvr;
|
||||
int bios_size;
|
||||
int bios_size, ndrv_size;
|
||||
uint8_t *ndrv_file;
|
||||
MemoryRegion *pic_mem, *escc_mem;
|
||||
MemoryRegion *escc_bar = g_new(MemoryRegion, 1);
|
||||
int ppc_boot_device;
|
||||
|
@ -494,6 +497,19 @@ static void ppc_core99_init(MachineState *machine)
|
|||
fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ);
|
||||
fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_NVRAM_ADDR, nvram_addr);
|
||||
|
||||
/* MacOS NDRV VGA driver */
|
||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, NDRV_VGA_FILENAME);
|
||||
if (filename) {
|
||||
ndrv_size = get_image_size(filename);
|
||||
if (ndrv_size != -1) {
|
||||
ndrv_file = g_malloc(ndrv_size);
|
||||
ndrv_size = load_image(filename, ndrv_file);
|
||||
|
||||
fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size);
|
||||
}
|
||||
g_free(filename);
|
||||
}
|
||||
|
||||
qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,8 @@
|
|||
#define CLOCKFREQ 266000000UL
|
||||
#define BUSFREQ 66000000UL
|
||||
|
||||
#define NDRV_VGA_FILENAME "qemu_vga.ndrv"
|
||||
|
||||
static void fw_cfg_boot_set(void *opaque, const char *boot_device,
|
||||
Error **errp)
|
||||
{
|
||||
|
@ -99,7 +101,8 @@ static void ppc_heathrow_init(MachineState *machine)
|
|||
MACIOIDEState *macio_ide;
|
||||
DeviceState *dev;
|
||||
BusState *adb_bus;
|
||||
int bios_size;
|
||||
int bios_size, ndrv_size;
|
||||
uint8_t *ndrv_file;
|
||||
MemoryRegion *pic_mem;
|
||||
MemoryRegion *escc_mem, *escc_bar = g_new(MemoryRegion, 1);
|
||||
uint16_t ppc_boot_device;
|
||||
|
@ -355,6 +358,19 @@ static void ppc_heathrow_init(MachineState *machine)
|
|||
fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_CLOCKFREQ, CLOCKFREQ);
|
||||
fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_BUSFREQ, BUSFREQ);
|
||||
|
||||
/* MacOS NDRV VGA driver */
|
||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, NDRV_VGA_FILENAME);
|
||||
if (filename) {
|
||||
ndrv_size = get_image_size(filename);
|
||||
if (ndrv_size != -1) {
|
||||
ndrv_file = g_malloc(ndrv_size);
|
||||
ndrv_size = load_image(filename, ndrv_file);
|
||||
|
||||
fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size);
|
||||
}
|
||||
g_free(filename);
|
||||
}
|
||||
|
||||
qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
|
||||
}
|
||||
|
||||
|
|
|
@ -511,7 +511,7 @@ static void ppc_powernv_reset(void)
|
|||
* This is the internal simulator but it could also be an external
|
||||
* BMC.
|
||||
*/
|
||||
obj = object_resolve_path_type("", TYPE_IPMI_BMC, NULL);
|
||||
obj = object_resolve_path_type("", "ipmi-bmc-sim", NULL);
|
||||
if (obj) {
|
||||
pnv->bmc = IPMI_BMC(obj);
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset,
|
|||
/* 16: Vector */
|
||||
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* 12 - 17 */
|
||||
/* 18: Vec. Scalar, 20: Vec. XOR, 22: HTM */
|
||||
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 18 - 23 */
|
||||
0x80, 0x00, 0x80, 0x00, 0x00, 0x00, /* 18 - 23 */
|
||||
/* 24: Ext. Dec, 26: 64 bit ftrs, 28: PM ftrs */
|
||||
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 24 - 29 */
|
||||
/* 30: MMR, 32: LE atomic, 34: EBB + ext EBB */
|
||||
|
@ -855,6 +855,8 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
|
|||
* option vector 5: */
|
||||
static void spapr_dt_ov5_platform_support(void *fdt, int chosen)
|
||||
{
|
||||
PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu);
|
||||
|
||||
char val[2 * 3] = {
|
||||
24, 0x00, /* Hash/Radix, filled in below. */
|
||||
25, 0x00, /* Hash options: Segment Tables == no, GTSE == no. */
|
||||
|
@ -870,8 +872,13 @@ static void spapr_dt_ov5_platform_support(void *fdt, int chosen)
|
|||
val[1] = 0x00; /* Hash */
|
||||
}
|
||||
} else {
|
||||
/* TODO: TCG case, hash */
|
||||
val[1] = 0x00;
|
||||
if (first_ppc_cpu->env.mmu_model & POWERPC_MMU_V3) {
|
||||
/* V3 MMU supports both hash and radix (with dynamic switching) */
|
||||
val[1] = 0xC0;
|
||||
} else {
|
||||
/* Otherwise we can only do hash */
|
||||
val[1] = 0x00;
|
||||
}
|
||||
}
|
||||
_FDT(fdt_setprop(fdt, chosen, "ibm,arch-vec-5-platform-support",
|
||||
val, sizeof(val)));
|
||||
|
@ -2101,8 +2108,8 @@ static void ppc_spapr_init(MachineState *machine)
|
|||
}
|
||||
|
||||
spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY);
|
||||
if (kvmppc_has_cap_mmu_radix()) {
|
||||
/* KVM always allows GTSE with radix... */
|
||||
if (!kvm_enabled() || kvmppc_has_cap_mmu_radix()) {
|
||||
/* KVM and TCG always allow GTSE with radix... */
|
||||
spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_GTSE);
|
||||
}
|
||||
/* ... but not with hash (currently). */
|
||||
|
|
|
@ -936,7 +936,7 @@ static target_ulong h_register_process_table(PowerPCCPU *cpu,
|
|||
target_ulong opcode,
|
||||
target_ulong *args)
|
||||
{
|
||||
CPUPPCState *env = &cpu->env;
|
||||
CPUState *cs;
|
||||
target_ulong flags = args[0];
|
||||
target_ulong proc_tbl = args[1];
|
||||
target_ulong page_size = args[2];
|
||||
|
@ -992,16 +992,12 @@ static target_ulong h_register_process_table(PowerPCCPU *cpu,
|
|||
spapr_check_setup_free_hpt(spapr, spapr->patb_entry, cproc);
|
||||
|
||||
spapr->patb_entry = cproc; /* Save new process table */
|
||||
if ((flags & FLAG_RADIX) || (flags & FLAG_HASH_PROC_TBL)) {
|
||||
/* Use Process TBL */
|
||||
env->spr[SPR_LPCR] |= LPCR_UPRT;
|
||||
} else {
|
||||
env->spr[SPR_LPCR] &= ~LPCR_UPRT;
|
||||
}
|
||||
if (flags & FLAG_GTSE) { /* Partition Uses Guest Translation Shootdwn */
|
||||
env->spr[SPR_LPCR] |= LPCR_GTSE;
|
||||
} else {
|
||||
env->spr[SPR_LPCR] &= ~LPCR_GTSE;
|
||||
|
||||
/* Update the UPRT and GTSE bits in the LPCR for all cpus */
|
||||
CPU_FOREACH(cs) {
|
||||
set_spr(cs, SPR_LPCR, LPCR_UPRT | LPCR_GTSE,
|
||||
((flags & (FLAG_RADIX | FLAG_HASH_PROC_TBL)) ? LPCR_UPRT : 0) |
|
||||
((flags & FLAG_GTSE) ? LPCR_GTSE : 0));
|
||||
}
|
||||
|
||||
if (kvm_enabled()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue