Skip to contentSkip to conversation

ppc patch queue 2017-08-09

GIT PULL Applied David Gibson 4 participants 14 messages Aug 9, 2017 – Aug 15, 2017

lore
Share & tools
lore
#0 lore raw

The following changes since commit 54affb3a3623b1d36c95e34faa722a5831323a74:

Update version for v2.10.0-rc2 release (2017-08-08 19:07:46 +0100)

are available in the git repository at:

git://github.com/dgibson/qemu.git tags/ppc-for-2.10-20170809

for you to fetch changes up to f57467e3b326c7736f8e481fd6b680f30e575c87:

spapr: Fix bug in h_signal_sys_reset() (2017-08-09 14:04:28 +1000)

----------------------------------------------------------------
ppc patch queue 2017-08-09

This series contains a number of bugfixes for ppc and related machines, for the qemu-2.10.release. Some are true regressions, others are serious enough and non-invasive enough to fix that it's worth putting in 2.10 this late.

----------------------------------------------------------------

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

David Gibson (2):
target/ppc: Implement TIDR
target/ppc: Add stub implementation of the PSSCR

Greg Kurz (2):
ppc: fix double-free in cpu_post_load()
spapr_drc: abort if object_property_add_child() fails

KONRAD Frederic (1):
booke206: fix MAS update on tlb miss

Sam Bobroff (1):
spapr: Fix bug in h_signal_sys_reset()

 hw/ppc/spapr_drc.c          |  2 +-
 hw/ppc/spapr_hcall.c        |  9 ++++-----
 target/ppc/cpu.h            |  2 ++
 target/ppc/machine.c        |  1 -
 target/ppc/mmu_helper.c     |  2 +-
 target/ppc/translate_init.c | 10 ++++++++++
 6 files changed, 18 insertions(+), 8 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 2/6] ppc: fix double-free in cpu_post_load()

From: Greg Kurz <[email protected]>

When running nested with KVM PR, ppc_set_compat() fails and QEMU crashes because of "double free or corruption (!prev)". The crash happens because error_report_err() has already called error_free().

---
 target/ppc/machine.c | 1 -
 1 file changed, 1 deletion(-)
target/ppc/machine.c +0 -1
index f578156dd4..abe0a1cdf0 100644
@@ -239,7 +239,6 @@ static int cpu_post_load(void *opaque, int version_id)
         ppc_set_compat(cpu, cpu->compat_pvr, &local_err);
         if (local_err) {
             error_report_err(local_err);
-            error_free(local_err);
             return -1;
         }
     } else
Signature · 1 line
2.13.4
#2 lore raw

[Qemu-devel] [PULL 3/6] target/ppc: Implement TIDR

In reply to David Gibson

This adds a trivial implementation of the TIDR register added in POWER9. This isn't particularly important to qemu directly - it's used by accelerator modules that we don't emulate.

However, since qemu isn't aware of it, its state is not synchronized with KVM and therefore not migrated, which can be a problem.

---
 target/ppc/cpu.h            | 1 +
 target/ppc/translate_init.c | 5 +++++
 2 files changed, 6 insertions(+)
target/ppc/cpu.h +1 -0
index 6ee2a26a96..f6e5413fad 100644
@@ -1451,6 +1451,7 @@ void ppc_compat_add_property(Object *obj, const char *name,
 #define SPR_TEXASR            (0x082)
 #define SPR_TEXASRU           (0x083)
 #define SPR_UCTRL             (0x088)
+#define SPR_TIDR              (0x090)
 #define SPR_MPC_CMPA          (0x090)
 #define SPR_MPC_CMPB          (0x091)
 #define SPR_MPC_CMPC          (0x092)
target/ppc/translate_init.c +5 -0
index 01723bdfec..94800cd29d 100644
@@ -8841,6 +8841,11 @@ static void init_proc_POWER9(CPUPPCState *env)
     gen_spr_power8_book4(env);
     gen_spr_power8_rpr(env);
 
+    /* POWER9 Specific registers */
+    spr_register_kvm(env, SPR_TIDR, "TIDR", NULL, NULL,
+                     spr_read_generic, spr_write_generic,
+                     KVM_REG_PPC_TIDR, 0);
+
     /* env variables */
 #if !defined(CONFIG_USER_ONLY)
     env->slb_nr = 32;
Signature · 1 line
2.13.4
#3 lore raw

[Qemu-devel] [PULL 1/6] booke206: fix MAS update on tlb miss

In reply to David Gibson

From: KONRAD Frederic <[email protected]>

When a tlb instruction miss happen, rw is set to 0 at the bottom of cpu_ppc_handle_mmu_fault which cause the MAS update function to miss the SAS and TS bit in MAS6, MAS1 in booke206_update_mas_tlb_miss.

Just calling booke206_update_mas_tlb_miss with rw = 2 solve the issue.

---
 target/ppc/mmu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/mmu_helper.c +1 -1
index b7b9088842..f06b9382b4 100644
@@ -1551,7 +1551,7 @@ static int cpu_ppc_handle_mmu_fault(CPUPPCState *env, target_ulong address,
                     env->spr[SPR_40x_ESR] = 0x00000000;
                     break;
                 case POWERPC_MMU_BOOKE206:
-                    booke206_update_mas_tlb_miss(env, address, rw);
+                    booke206_update_mas_tlb_miss(env, address, 2);
                     /* fall through */
                 case POWERPC_MMU_BOOKE:
                     cs->exception_index = POWERPC_EXCP_ITLB;
Signature · 1 line
2.13.4
#4 lore raw

[Qemu-devel] [PULL 4/6] target/ppc: Add stub implementation of the PSSCR

In reply to David Gibson

The PSSCR register added in POWER9 controls certain power saving mode behaviours. Mostly, it's not relevant to TCG, however because qemu doesn't know about it yet, it doesn't synchronize the state with KVM, and thus it doesn't get migrated.

To fix that, this adds a minimal stub implementation of the register. This isn't complete, even to the extent that an implementation is possible in TCG, just enough to get migration working. We need to come back later and at least properly filter the various fields in the register based on privilege level.

---
 target/ppc/cpu.h            | 1 +
 target/ppc/translate_init.c | 5 +++++
 2 files changed, 6 insertions(+)
target/ppc/cpu.h +1 -0
index f6e5413fad..46d3dd88f6 100644
@@ -1771,6 +1771,7 @@ void ppc_compat_add_property(Object *obj, const char *name,
 #define SPR_IC                (0x350)
 #define SPR_VTB               (0x351)
 #define SPR_MMCRC             (0x353)
+#define SPR_PSSCR             (0x357)
 #define SPR_440_INV0          (0x370)
 #define SPR_440_INV1          (0x371)
 #define SPR_440_INV2          (0x372)
target/ppc/translate_init.c +5 -0
index 94800cd29d..8fb407ed73 100644
@@ -8846,6 +8846,11 @@ static void init_proc_POWER9(CPUPPCState *env)
                      spr_read_generic, spr_write_generic,
                      KVM_REG_PPC_TIDR, 0);
 
+    /* FIXME: Filter fields properly based on privilege level */
+    spr_register_kvm_hv(env, SPR_PSSCR, "PSSCR", NULL, NULL, NULL, NULL,
+                        spr_read_generic, spr_write_generic,
+                        KVM_REG_PPC_PSSCR, 0);
+
     /* env variables */
 #if !defined(CONFIG_USER_ONLY)
     env->slb_nr = 32;
Signature · 1 line
2.13.4
#5 lore raw

[Qemu-devel] [PULL 5/6] spapr_drc: abort if object_property_add_child() fails

In reply to David Gibson

From: Greg Kurz <[email protected]>

object_property_add_child() can only fail in two cases:
- the child already has a parent, which shouldn't happen since the DRC was allocated a few lines above
- the parent already has a child with the same name, which would mean the caller tries to create a DRC that already exists

In both case, this is a QEMU bug and we should abort.

---
 hw/ppc/spapr_drc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_drc.c +1 -1
index 47d94e782a..5260b5d363 100644
@@ -541,7 +541,7 @@ sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type,
     drc->owner = owner;
     prop_name = g_strdup_printf("dr-connector[%"PRIu32"]",
                                 spapr_drc_index(drc));
-    object_property_add_child(owner, prop_name, OBJECT(drc), NULL);
+    object_property_add_child(owner, prop_name, OBJECT(drc), &error_abort);
     object_property_set_bool(OBJECT(drc), true, "realized", NULL);
     g_free(prop_name);
 
Signature · 1 line
2.13.4
#6 lore raw

[Qemu-devel] [PULL 6/6] spapr: Fix bug in h_signal_sys_reset()

In reply to David Gibson

From: Sam Bobroff <[email protected]>

The unicast case in h_signal_sys_reset() seems to be broken:
rather than selecting the target CPU, it looks like it will pick either the first CPU or fail to find one at all.

Fix it by using the search function rather than open coding the search.

This was found by inspection; the code appears to be unused because the Linux kernel only uses the broadcast target.

---
 hw/ppc/spapr_hcall.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
hw/ppc/spapr_hcall.c +4 -5
index 72ea5a8247..07b3da8dc4 100644
@@ -1431,11 +1431,10 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cpu,
 
     } else {
         /* Unicast */
-        CPU_FOREACH(cs) {
-            if (cpu->cpu_dt_id == target) {
-                run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL);
-                return H_SUCCESS;
-            }
+        cs = CPU(ppc_get_vcpu_by_dt_id(target));
+        if (cs) {
+            run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL);
+            return H_SUCCESS;
         }
         return H_PARAMETER;
     }
Signature · 1 line
2.13.4
#7 lore raw
In reply to David Gibson
Quoted 15 lines · David Gibson

The following changes since commit 54affb3a3623b1d36c95e34faa722a5831323a74:

Update version for v2.10.0-rc2 release (2017-08-08 19:07:46 +0100)

are available in the git repository at:

git://github.com/dgibson/qemu.git tags/ppc-for-2.10-20170809

for you to fetch changes up to f57467e3b326c7736f8e481fd6b680f30e575c87:

spapr: Fix bug in h_signal_sys_reset() (2017-08-09 14:04:28 +1000)

----------------------------------------------------------------
ppc patch queue 2017-08-09

Quoted 6 lines

This series contains a number of bugfixes for ppc and related machines, for the qemu-2.10.release. Some are true regressions, others are serious enough and non-invasive enough to fix that it's worth putting in 2.10 this late.

----------------------------------------------------------------

Applied, thanks.

Quoted 4 lines

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

Doesn't look much worse than usual to me -- of the last 24 travis builds for master 4 failed and 20 passed.

thanks
-- PMM

#8 lore raw
Quoted 25 lines · Peter Maydell
Quoted 15 lines · David Gibson

The following changes since commit 54affb3a3623b1d36c95e34faa722a5831323a74:

Update version for v2.10.0-rc2 release (2017-08-08 19:07:46 +0100)

are available in the git repository at:

git://github.com/dgibson/qemu.git tags/ppc-for-2.10-20170809

for you to fetch changes up to f57467e3b326c7736f8e481fd6b680f30e575c87:

spapr: Fix bug in h_signal_sys_reset() (2017-08-09 14:04:28 +1000)

----------------------------------------------------------------
ppc patch queue 2017-08-09

Quoted 6 lines

This series contains a number of bugfixes for ppc and related machines, for the qemu-2.10.release. Some are true regressions, others are serious enough and non-invasive enough to fix that it's worth putting in 2.10 this late.

----------------------------------------------------------------

Applied, thanks.

Quoted 7 lines
Quoted 4 lines

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

Doesn't look much worse than usual to me -- of the last 24 travis builds for master 4 failed and 20 passed.

Uh.. that's not been my experience. I was a bit unclear in my description, though. Until maybe a week and a half ago I found the Travis build was fairly reliable, though there were occasional transien failures. Now, essentially every Travis build is failing for me. Specifically most of the first dozen or so of the batch of build configurations on Travis fail (that's "X" not "!"). These seem to be transient failures in the sense that if I rebuild enough times they'll eventually pass, but unlike earlier when the builds would suceed most of the time, they now seem to succeed at best around 1/3 of the time (that's ~1/3 of the time for each configuration sub-build, so with a dozen or so apparently affected that means a complete passing build essentially never).

See for example https://travis-ci.org/dgibson/qemu/builds/263312174
where 5 subbuilds have failed (which is relatively few). In each case the failing error seems to be something like:

ERROR:tests/vhost-user-test.c:807:test_connect_fail: child process (/i386/vhost-user/connect-fail/subprocess [55883]) failed unexpectedly

Seems to be i386 in some cases and x86_64 in others.

Signature · 4 lines
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
#9 lore raw
Quoted 23 lines · David Gibson
Quoted 8 lines · Peter Maydell
Quoted 4 lines · David Gibson

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

Doesn't look much worse than usual to me -- of the last 24 travis builds for master 4 failed and 20 passed.

Uh.. that's not been my experience. I was a bit unclear in my description, though. Until maybe a week and a half ago I found the Travis build was fairly reliable, though there were occasional transien failures. Now, essentially every Travis build is failing for me. Specifically most of the first dozen or so of the batch of build configurations on Travis fail (that's "X" not "!"). These seem to be transient failures in the sense that if I rebuild enough times they'll eventually pass, but unlike earlier when the builds would suceed most of the time, they now seem to succeed at best around 1/3 of the time (that's ~1/3 of the time for each configuration sub-build, so with a dozen or so apparently affected that means a complete passing build essentially never).

Quoted 7 lines

See for example https://travis-ci.org/dgibson/qemu/builds/263312174
where 5 subbuilds have failed (which is relatively few). In each case the failing error seems to be something like:

ERROR:tests/vhost-user-test.c:807:test_connect_fail: child process (/i386/vhost-user/connect-fail/subprocess [55883]) failed unexpectedly

Seems to be i386 in some cases and x86_64 in others.

Weird. https://travis-ci.org/qemu/qemu/builds is the master build history and as you can see it's mostly greens. Not sure why your setup would be significantly worse:
maybe one of the travis submaintainers has an idea. It could just be our vhost-user-test is flaky but I don't know why that should hit you much more than master...

thanks
-- PMM

#10 lore raw

Hi David, Peter,

Quoted 24 lines · Peter Maydell
Quoted 23 lines · David Gibson
Quoted 8 lines · Peter Maydell
Quoted 4 lines · David Gibson

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

Doesn't look much worse than usual to me -- of the last 24 travis builds for master 4 failed and 20 passed.

Uh.. that's not been my experience. I was a bit unclear in my description, though. Until maybe a week and a half ago I found the Travis build was fairly reliable, though there were occasional transien failures. Now, essentially every Travis build is failing for me. Specifically most of the first dozen or so of the batch of build configurations on Travis fail (that's "X" not "!"). These seem to be transient failures in the sense that if I rebuild enough times they'll eventually pass, but unlike earlier when the builds would suceed most of the time, they now seem to succeed at best around 1/3 of the time (that's ~1/3 of the time for each configuration sub-build, so with a dozen or so apparently affected that means a complete passing build essentially never).

Quoted 7 lines
Quoted 7 lines

See for example https://travis-ci.org/dgibson/qemu/builds/263312174
where 5 subbuilds have failed (which is relatively few). In each case the failing error seems to be something like:

ERROR:tests/vhost-user-test.c:807:test_connect_fail: child process (/i386/vhost-user/connect-fail/subprocess [55883]) failed unexpectedly

Seems to be i386 in some cases and x86_64 in others.

Yes, I'm experiencing the same (but a bit more frequent with i386 than x86_64).

Quoted 6 lines

Weird. https://travis-ci.org/qemu/qemu/builds is the master build history and as you can see it's mostly greens. Not sure why your setup would be significantly worse:
maybe one of the travis submaintainers has an idea. It could just be our vhost-user-test is flaky but I don't know why that should hit you much more than master...

No clue, I started to think repositories with less frequent builds are deployed on faster hardware.

Will keep the list informed if there are some improvements.

Regards,

Phil.

#11 lore raw
In reply to Peter Maydell
Quoted 30 lines · Peter Maydell
Quoted 29 lines · David Gibson
Quoted 8 lines · Peter Maydell
Quoted 4 lines · David Gibson

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

Doesn't look much worse than usual to me -- of the last 24 travis builds for master 4 failed and 20 passed.

Uh.. that's not been my experience. I was a bit unclear in my description, though. Until maybe a week and a half ago I found the Travis build was fairly reliable, though there were occasional transien failures. Now, essentially every Travis build is failing for me. Specifically most of the first dozen or so of the batch of build configurations on Travis fail (that's "X" not "!"). These seem to be transient failures in the sense that if I rebuild enough times they'll eventually pass, but unlike earlier when the builds would suceed most of the time, they now seem to succeed at best around 1/3 of the time (that's ~1/3 of the time for each configuration sub-build, so with a dozen or so apparently affected that means a complete passing build essentially never).

See for example https://travis-ci.org/dgibson/qemu/builds/263312174
where 5 subbuilds have failed (which is relatively few). In each case the failing error seems to be something like:

ERROR:tests/vhost-user-test.c:807:test_connect_fail: child process (/i386/vhost-user/connect-fail/subprocess [55883]) failed unexpectedly

Quoted 8 lines
Quoted 1 line

Seems to be i386 in some cases and x86_64 in others.

Weird. https://travis-ci.org/qemu/qemu/builds is the master build history and as you can see it's mostly greens. Not sure why your setup would be significantly worse:
maybe one of the travis submaintainers has an idea. It could just be our vhost-user-test is flaky but I don't know why that should hit you much more than master...

So, Travis is telling me my builds are being done on a trusty environment (even the sub-builds which don't specify a distro explicitly). That doesn't seem to be the case for the master tree builds. Then again, the sub-builds which do specifically ask for trusty seem to be working, so I'm not sure why implicity choosing trusty would break things.

Signature · 4 lines
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
#12 lore raw
In reply to Peter Maydell
Quoted 24 lines · Peter Maydell
Quoted 23 lines · David Gibson
Quoted 8 lines · Peter Maydell
Quoted 4 lines · David Gibson

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

Doesn't look much worse than usual to me -- of the last 24 travis builds for master 4 failed and 20 passed.

Uh.. that's not been my experience. I was a bit unclear in my description, though. Until maybe a week and a half ago I found the Travis build was fairly reliable, though there were occasional transien failures. Now, essentially every Travis build is failing for me. Specifically most of the first dozen or so of the batch of build configurations on Travis fail (that's "X" not "!"). These seem to be transient failures in the sense that if I rebuild enough times they'll eventually pass, but unlike earlier when the builds would suceed most of the time, they now seem to succeed at best around 1/3 of the time (that's ~1/3 of the time for each configuration sub-build, so with a dozen or so apparently affected that means a complete passing build essentially never).

Quoted 7 lines
Quoted 7 lines

See for example https://travis-ci.org/dgibson/qemu/builds/263312174
where 5 subbuilds have failed (which is relatively few). In each case the failing error seems to be something like:

ERROR:tests/vhost-user-test.c:807:test_connect_fail: child process (/i386/vhost-user/connect-fail/subprocess [55883]) failed unexpectedly

Seems to be i386 in some cases and x86_64 in others.

And is it always the connect-fail test?

Quoted 10 lines

Weird. https://travis-ci.org/qemu/qemu/builds is the master build history and as you can see it's mostly greens. Not sure why your setup would be significantly worse:
maybe one of the travis submaintainers has an idea. It could just be our vhost-user-test is flaky but I don't know why that should hit you much more than master...

thanks
-- PMM

#13 lore raw
Quoted 29 lines · Michael S. Tsirkin
Quoted 28 lines · Peter Maydell
Quoted 27 lines · David Gibson
Quoted 8 lines · Peter Maydell
Quoted 4 lines · David Gibson

I haven't completed a Travis build for this, which is part of my usual test regime, since the first dozen or so Travis builds are failing more often than not on master as well. I don't know why this is - seems to be failing some of the x86 tests.

Doesn't look much worse than usual to me -- of the last 24 travis builds for master 4 failed and 20 passed.

Uh.. that's not been my experience. I was a bit unclear in my description, though. Until maybe a week and a half ago I found the Travis build was fairly reliable, though there were occasional transien failures. Now, essentially every Travis build is failing for me. Specifically most of the first dozen or so of the batch of build configurations on Travis fail (that's "X" not "!"). These seem to be transient failures in the sense that if I rebuild enough times they'll eventually pass, but unlike earlier when the builds would suceed most of the time, they now seem to succeed at best around 1/3 of the time (that's ~1/3 of the time for each configuration sub-build, so with a dozen or so apparently affected that means a complete passing build essentially never).

See for example https://travis-ci.org/dgibson/qemu/builds/263312174
where 5 subbuilds have failed (which is relatively few). In each case the failing error seems to be something like:

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

ERROR:tests/vhost-user-test.c:807:test_connect_fail: child process (/i386/vhost-user/connect-fail/subprocess [55883]) failed unexpectedly

Seems to be i386 in some cases and x86_64 in others.

And is it always the connect-fail test?

I think so, though I haven't checked every single failing output to make sure.

Quoted 12 lines
Quoted 11 lines

Weird. https://travis-ci.org/qemu/qemu/builds is the master build history and as you can see it's mostly greens. Not sure why your setup would be significantly worse:
maybe one of the travis submaintainers has an idea. It could just be our vhost-user-test is flaky but I don't know why that should hit you much more than master...

thanks
-- PMM

Signature · 4 lines
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