All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/6] ppc queue
@ 2023-05-05 16:34 Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 1/6] hw/display/sm501: Remove unneeded increment from loop Daniel Henrique Barboza
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Daniel Henrique Barboza @ 2023-05-05 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, danielhb413, peter.maydell

The following changes since commit a9fe9e191b4305b88c356a1ed9ac3baf89eb18aa:

  Merge tag 'pull-riscv-to-apply-20230505-1' of https://github.com/alistair23/qemu into staging (2023-05-05 09:25:13 +0100)

are available in the Git repository at:

  https://gitlab.com/danielhb/qemu.git tags/pull-ppc-20230505

for you to fetch changes up to b35261b1a6c2729fa7e7a6ca34b9489eda62b744:

  hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine (2023-05-05 12:34:22 -0300)

----------------------------------------------------------------
ppc patch queue for 2023-05-05:

This queue includes fixes for ppc and spapr emulation, a build fix for
the pseries machine and a new reviewer for ppc/spapr.

We're also carrying a Coverity fix for the sm501 display.

----------------------------------------------------------------
BALATON Zoltan (1):
      hw/display/sm501: Remove unneeded increment from loop

Harsh Prateek Bora (2):
      ppc: spapr: cleanup cr get/set with helpers.
      MAINTAINERS: Adding myself in the list for ppc/spapr

Shivaprasad G Bhat (2):
      tcg: ppc64: Fix mask generation for vextractdm
      tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions

Thomas Huth (1):
      hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine

 MAINTAINERS                         |  1 +
 hw/display/sm501.c                  |  2 +-
 hw/ppc/Kconfig                      |  2 +-
 hw/ppc/spapr_hcall.c                | 18 ++-----------
 linux-user/elfload.c                |  4 +--
 linux-user/ppc/signal.c             |  9 ++-----
 target/ppc/cpu.c                    | 17 +++++++++++++
 target/ppc/cpu.h                    |  2 ++
 target/ppc/gdbstub.c                | 22 +++-------------
 target/ppc/kvm.c                    | 13 ++--------
 target/ppc/ppc-qmp-cmds.c           |  6 +----
 target/ppc/translate/vmx-impl.c.inc |  2 +-
 tests/tcg/ppc64/Makefile.target     |  5 +++-
 tests/tcg/ppc64/vector.c            | 51 +++++++++++++++++++++++++++++++++++++
 14 files changed, 90 insertions(+), 64 deletions(-)
 create mode 100644 tests/tcg/ppc64/vector.c


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PULL 1/6] hw/display/sm501: Remove unneeded increment from loop
  2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
@ 2023-05-05 16:34 ` Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 2/6] ppc: spapr: cleanup cr get/set with helpers Daniel Henrique Barboza
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Daniel Henrique Barboza @ 2023-05-05 16:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-ppc, danielhb413, peter.maydell, BALATON Zoltan,
	Philippe Mathieu-Daudé

From: BALATON Zoltan <balaton@eik.bme.hu>

As Coverity points out (CID 1508621) the calculation to increment i in
the fill fallback loop is ineffective as it is overwritten in next
statement. This was left there by mistake from a previous version but
is not needed in the current approach so remove the superfluous
increment statement.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230405161234.6EF0A74633D@zero.eik.bme.hu>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/display/sm501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index dbabbc4339..0eecd00701 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -901,7 +901,7 @@ static void sm501_2d_operation(SM501State *s)
             /* fallback when pixman failed or we don't want to call it */
             uint8_t *d = s->local_mem + dst_base;
             unsigned int x, y, i;
-            for (y = 0; y < height; y++, i += dst_pitch * bypp) {
+            for (y = 0; y < height; y++) {
                 i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
                 for (x = 0; x < width; x++, i += bypp) {
                     stn_he_p(&d[i], bypp, color);
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 2/6] ppc: spapr: cleanup cr get/set with helpers.
  2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 1/6] hw/display/sm501: Remove unneeded increment from loop Daniel Henrique Barboza
@ 2023-05-05 16:34 ` Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 3/6] MAINTAINERS: Adding myself in the list for ppc/spapr Daniel Henrique Barboza
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Daniel Henrique Barboza @ 2023-05-05 16:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-ppc, danielhb413, peter.maydell, Harsh Prateek Bora,
	Fabiano Rosas, Richard Henderson

From: Harsh Prateek Bora <harshpb@linux.ibm.com>

The bits in cr reg are grouped into eight 4-bit fields represented
by env->crf[8] and the related calculations should be abstracted to
keep the calling routines simpler to read. This is a step towards
cleaning up the related/calling code for better readability.

Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230503093619.2530487-2-harshpb@linux.ibm.com>
[danielhb: add 'const' modifier to fix linux-user build]
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/ppc/spapr_hcall.c      | 18 ++----------------
 linux-user/elfload.c      |  4 +---
 linux-user/ppc/signal.c   |  9 ++-------
 target/ppc/cpu.c          | 17 +++++++++++++++++
 target/ppc/cpu.h          |  2 ++
 target/ppc/gdbstub.c      | 22 ++++------------------
 target/ppc/kvm.c          | 13 ++-----------
 target/ppc/ppc-qmp-cmds.c |  6 +-----
 8 files changed, 31 insertions(+), 60 deletions(-)

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index ec4def62f8..1c102c8c0d 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1566,8 +1566,6 @@ static target_ulong h_enter_nested(PowerPCCPU *cpu,
     struct kvmppc_hv_guest_state hv_state;
     struct kvmppc_pt_regs *regs;
     hwaddr len;
-    uint64_t cr;
-    int i;
 
     if (spapr->nested_ptcr == 0) {
         return H_NOT_AVAILABLE;
@@ -1616,12 +1614,7 @@ static target_ulong h_enter_nested(PowerPCCPU *cpu,
     env->lr = regs->link;
     env->ctr = regs->ctr;
     cpu_write_xer(env, regs->xer);
-
-    cr = regs->ccr;
-    for (i = 7; i >= 0; i--) {
-        env->crf[i] = cr & 15;
-        cr >>= 4;
-    }
+    ppc_set_cr(env, regs->ccr);
 
     env->msr = regs->msr;
     env->nip = regs->nip;
@@ -1698,8 +1691,6 @@ void spapr_exit_nested(PowerPCCPU *cpu, int excp)
     struct kvmppc_hv_guest_state *hvstate;
     struct kvmppc_pt_regs *regs;
     hwaddr len;
-    uint64_t cr;
-    int i;
 
     assert(spapr_cpu->in_nested);
 
@@ -1757,12 +1748,7 @@ void spapr_exit_nested(PowerPCCPU *cpu, int excp)
     regs->link = env->lr;
     regs->ctr = env->ctr;
     regs->xer = cpu_read_xer(env);
-
-    cr = 0;
-    for (i = 0; i < 8; i++) {
-        cr |= (env->crf[i] & 15) << (4 * (7 - i));
-    }
-    regs->ccr = cr;
+    regs->ccr = ppc_get_cr(env);
 
     if (excp == POWERPC_EXCP_MCHECK ||
         excp == POWERPC_EXCP_RESET ||
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index f1370a7a8b..703f7434a0 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -961,9 +961,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *en
     (*regs)[36] = tswapreg(env->lr);
     (*regs)[37] = tswapreg(cpu_read_xer(env));
 
-    for (i = 0; i < ARRAY_SIZE(env->crf); i++) {
-        ccr |= env->crf[i] << (32 - ((i + 1) * 4));
-    }
+    ccr = ppc_get_cr(env);
     (*regs)[38] = tswapreg(ccr);
 }
 
diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c
index 07729c1653..a616f20efb 100644
--- a/linux-user/ppc/signal.c
+++ b/linux-user/ppc/signal.c
@@ -243,9 +243,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame)
     __put_user(env->lr, &frame->mc_gregs[TARGET_PT_LNK]);
     __put_user(cpu_read_xer(env), &frame->mc_gregs[TARGET_PT_XER]);
 
-    for (i = 0; i < ARRAY_SIZE(env->crf); i++) {
-        ccr |= env->crf[i] << (32 - ((i + 1) * 4));
-    }
+    ccr = ppc_get_cr(env);
     __put_user(ccr, &frame->mc_gregs[TARGET_PT_CCR]);
 
     /* Save Altivec registers if necessary.  */
@@ -335,10 +333,7 @@ static void restore_user_regs(CPUPPCState *env,
     cpu_write_xer(env, xer);
 
     __get_user(ccr, &frame->mc_gregs[TARGET_PT_CCR]);
-    for (i = 0; i < ARRAY_SIZE(env->crf); i++) {
-        env->crf[i] = (ccr >> (32 - ((i + 1) * 4))) & 0xf;
-    }
-
+    ppc_set_cr(env, ccr);
     if (!sig) {
         env->gpr[2] = save_r2;
     }
diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c
index 1a97b41c6b..424f2e1741 100644
--- a/target/ppc/cpu.c
+++ b/target/ppc/cpu.c
@@ -67,6 +67,23 @@ uint32_t ppc_get_vscr(CPUPPCState *env)
     return env->vscr | (sat << VSCR_SAT);
 }
 
+void ppc_set_cr(CPUPPCState *env, uint64_t cr)
+{
+    for (int i = 7; i >= 0; i--) {
+        env->crf[i] = cr & 0xf;
+        cr >>= 4;
+    }
+}
+
+uint64_t ppc_get_cr(const CPUPPCState *env)
+{
+    uint64_t cr = 0;
+    for (int i = 0; i < 8; i++) {
+        cr |= (env->crf[i] & 0xf) << (4 * (7 - i));
+    }
+    return cr;
+}
+
 /* GDBstub can read and write MSR... */
 void ppc_store_msr(CPUPPCState *env, target_ulong value)
 {
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 557d736dab..1c02596d9f 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -2773,6 +2773,8 @@ void dump_mmu(CPUPPCState *env);
 void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len);
 void ppc_store_vscr(CPUPPCState *env, uint32_t vscr);
 uint32_t ppc_get_vscr(CPUPPCState *env);
+void ppc_set_cr(CPUPPCState *env, uint64_t cr);
+uint64_t ppc_get_cr(const CPUPPCState *env);
 
 /*****************************************************************************/
 /* Power management enable checks                                            */
diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c
index d2bc1d7c53..63c9abe4f1 100644
--- a/target/ppc/gdbstub.c
+++ b/target/ppc/gdbstub.c
@@ -145,11 +145,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n)
             break;
         case 66:
             {
-                uint32_t cr = 0;
-                int i;
-                for (i = 0; i < 8; i++) {
-                    cr |= env->crf[i] << (32 - ((i + 1) * 4));
-                }
+                uint32_t cr = ppc_get_cr(env);
                 gdb_get_reg32(buf, cr);
                 break;
             }
@@ -203,11 +199,7 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, GByteArray *buf, int n)
             break;
         case 66 + 32:
             {
-                uint32_t cr = 0;
-                int i;
-                for (i = 0; i < 8; i++) {
-                    cr |= env->crf[i] << (32 - ((i + 1) * 4));
-                }
+                uint32_t cr = ppc_get_cr(env);
                 gdb_get_reg32(buf, cr);
                 break;
             }
@@ -257,10 +249,7 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
         case 66:
             {
                 uint32_t cr = ldl_p(mem_buf);
-                int i;
-                for (i = 0; i < 8; i++) {
-                    env->crf[i] = (cr >> (32 - ((i + 1) * 4))) & 0xF;
-                }
+                ppc_set_cr(env, cr);
                 break;
             }
         case 67:
@@ -307,10 +296,7 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
         case 66 + 32:
             {
                 uint32_t cr = ldl_p(mem_buf);
-                int i;
-                for (i = 0; i < 8; i++) {
-                    env->crf[i] = (cr >> (32 - ((i + 1) * 4))) & 0xF;
-                }
+                ppc_set_cr(env, cr);
                 break;
             }
         case 67 + 32:
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 78f6fc50cd..336e663bc3 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -927,10 +927,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
         regs.gpr[i] = env->gpr[i];
     }
 
-    regs.cr = 0;
-    for (i = 0; i < 8; i++) {
-        regs.cr |= (env->crf[i] & 15) << (4 * (7 - i));
-    }
+    regs.cr = ppc_get_cr(env);
 
     ret = kvm_vcpu_ioctl(cs, KVM_SET_REGS, &regs);
     if (ret < 0) {
@@ -1205,7 +1202,6 @@ int kvm_arch_get_registers(CPUState *cs)
     PowerPCCPU *cpu = POWERPC_CPU(cs);
     CPUPPCState *env = &cpu->env;
     struct kvm_regs regs;
-    uint32_t cr;
     int i, ret;
 
     ret = kvm_vcpu_ioctl(cs, KVM_GET_REGS, &regs);
@@ -1213,12 +1209,7 @@ int kvm_arch_get_registers(CPUState *cs)
         return ret;
     }
 
-    cr = regs.cr;
-    for (i = 7; i >= 0; i--) {
-        env->crf[i] = cr & 15;
-        cr >>= 4;
-    }
-
+    ppc_set_cr(env, regs.cr);
     env->ctr = regs.ctr;
     env->lr = regs.lr;
     cpu_write_xer(env, regs.xer);
diff --git a/target/ppc/ppc-qmp-cmds.c b/target/ppc/ppc-qmp-cmds.c
index 36e5b5eff8..f9acc21056 100644
--- a/target/ppc/ppc-qmp-cmds.c
+++ b/target/ppc/ppc-qmp-cmds.c
@@ -37,12 +37,8 @@ static target_long monitor_get_ccr(Monitor *mon, const struct MonitorDef *md,
 {
     CPUArchState *env = mon_get_cpu_env(mon);
     unsigned int u;
-    int i;
 
-    u = 0;
-    for (i = 0; i < 8; i++) {
-        u |= env->crf[i] << (32 - (4 * (i + 1)));
-    }
+    u = ppc_get_cr(env);
 
     return u;
 }
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 3/6] MAINTAINERS: Adding myself in the list for ppc/spapr
  2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 1/6] hw/display/sm501: Remove unneeded increment from loop Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 2/6] ppc: spapr: cleanup cr get/set with helpers Daniel Henrique Barboza
@ 2023-05-05 16:34 ` Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 4/6] tcg: ppc64: Fix mask generation for vextractdm Daniel Henrique Barboza
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Daniel Henrique Barboza @ 2023-05-05 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, danielhb413, peter.maydell, Harsh Prateek Bora

From: Harsh Prateek Bora <harshpb@linux.ibm.com>

Would like to get notified of changes in this area and review them.

Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20230503093619.2530487-3-harshpb@linux.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 431556c217..55102f4761 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1422,6 +1422,7 @@ M: Daniel Henrique Barboza <danielhb413@gmail.com>
 R: Cédric Le Goater <clg@kaod.org>
 R: David Gibson <david@gibson.dropbear.id.au>
 R: Greg Kurz <groug@kaod.org>
+R: Harsh Prateek Bora <harshpb@linux.ibm.com>
 L: qemu-ppc@nongnu.org
 S: Odd Fixes
 F: hw/*/spapr*
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 4/6] tcg: ppc64: Fix mask generation for vextractdm
  2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
                   ` (2 preceding siblings ...)
  2023-05-05 16:34 ` [PULL 3/6] MAINTAINERS: Adding myself in the list for ppc/spapr Daniel Henrique Barboza
@ 2023-05-05 16:34 ` Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 5/6] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions Daniel Henrique Barboza
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Daniel Henrique Barboza @ 2023-05-05 16:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-ppc, danielhb413, peter.maydell, Shivaprasad G Bhat,
	Alex Bennée, Lucas Mateus Castro, Richard Henderson,
	Cédric Le Goater

From: Shivaprasad G Bhat <sbhat@linux.ibm.com>

In function do_extractm() the mask is calculated as
dup_const(1 << (element_width - 1)). '1' being signed int
works fine for MO_8,16,32. For MO_64, on PPC64 host
this ends up becoming 0 on compilation. The vextractdm
uses MO_64, and it ends up having mask as 0.

Explicitly use 1ULL instead of signed int 1 like its
used everywhere else.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1536
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Lucas Mateus Castro <lucas.araujo@eldorado.org.br>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <168319292809.1159309.5817546227121323288.stgit@ltc-boston1.aus.stglabs.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 target/ppc/translate/vmx-impl.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
index 112233b541..c8712dd7d8 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -2058,7 +2058,7 @@ static bool trans_VEXPANDQM(DisasContext *ctx, arg_VX_tb *a)
 static bool do_vextractm(DisasContext *ctx, arg_VX_tb *a, unsigned vece)
 {
     const uint64_t elem_width = 8 << vece, elem_count_half = 8 >> vece,
-                   mask = dup_const(vece, 1 << (elem_width - 1));
+                   mask = dup_const(vece, 1ULL << (elem_width - 1));
     uint64_t i, j;
     TCGv_i64 lo, hi, t0, t1;
 
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 5/6] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions
  2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
                   ` (3 preceding siblings ...)
  2023-05-05 16:34 ` [PULL 4/6] tcg: ppc64: Fix mask generation for vextractdm Daniel Henrique Barboza
@ 2023-05-05 16:34 ` Daniel Henrique Barboza
  2023-05-05 16:34 ` [PULL 6/6] hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine Daniel Henrique Barboza
  2023-05-06  7:10 ` [PULL 0/6] ppc queue Richard Henderson
  6 siblings, 0 replies; 8+ messages in thread
From: Daniel Henrique Barboza @ 2023-05-05 16:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-ppc, danielhb413, peter.maydell, Shivaprasad G Bhat,
	John Platts, Lucas Mateus Castro, Cédric Le Goater

From: Shivaprasad G Bhat <sbhat@linux.ibm.com>

Add test for vextractbm, vextractwm, vextractdm and vextractqm
instructions. Test works for both qemu-ppc64 and qemu-ppc64le.

Based on the test case written by John Platts posted at [1]

References:
[1] - https://gitlab.com/qemu-project/qemu/-/issues/1536

Signed-off-by: John Platts <john_platts@hotmail.com>
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reviewed-by: Lucas Mateus Castro <lucas.araujo@eldorado.org.br>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <168319294881.1159309.17060400720026083557.stgit@ltc-boston1.aus.stglabs.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 tests/tcg/ppc64/Makefile.target |  5 +++-
 tests/tcg/ppc64/vector.c        | 51 +++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/ppc64/vector.c

diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.target
index 6d47d3cae6..b084963b9a 100644
--- a/tests/tcg/ppc64/Makefile.target
+++ b/tests/tcg/ppc64/Makefile.target
@@ -20,7 +20,7 @@ PPC64_TESTS += mtfsf
 PPC64_TESTS += mffsce
 
 ifneq ($(CROSS_CC_HAS_POWER10),)
-PPC64_TESTS += byte_reverse sha512-vector
+PPC64_TESTS += byte_reverse sha512-vector vector
 endif
 byte_reverse: CFLAGS += -mcpu=power10
 run-byte_reverse: QEMU_OPTS+=-cpu POWER10
@@ -31,6 +31,9 @@ sha512-vector: sha512.c
 
 run-sha512-vector: QEMU_OPTS+=-cpu POWER10
 
+vector: CFLAGS += -mcpu=power10 -I$(SRC_PATH)/include
+run-vector: QEMU_OPTS += -cpu POWER10
+
 PPC64_TESTS += signal_save_restore_xer
 PPC64_TESTS += xxspltw
 
diff --git a/tests/tcg/ppc64/vector.c b/tests/tcg/ppc64/vector.c
new file mode 100644
index 0000000000..cbf4ae9332
--- /dev/null
+++ b/tests/tcg/ppc64/vector.c
@@ -0,0 +1,51 @@
+#include <assert.h>
+#include <stdint.h>
+#include "qemu/compiler.h"
+
+int main(void)
+{
+    unsigned int result_wi;
+    vector unsigned char vbc_bi_src = { 0xFF, 0xFF, 0, 0xFF, 0xFF, 0xFF,
+                                        0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0,
+                                        0, 0xFF, 0xFF};
+    vector unsigned short vbc_hi_src = { 0xFFFF, 0, 0, 0xFFFF,
+                                         0, 0, 0xFFFF, 0xFFFF};
+    vector unsigned int vbc_wi_src = {0, 0, 0xFFFFFFFF, 0xFFFFFFFF};
+    vector unsigned long long vbc_di_src = {0xFFFFFFFFFFFFFFFF, 0};
+    vector __uint128_t vbc_qi_src;
+
+    asm("vextractbm %0, %1" : "=r" (result_wi) : "v" (vbc_bi_src));
+#if HOST_BIG_ENDIAN
+    assert(result_wi == 0b1101111111000011);
+#else
+    assert(result_wi == 0b1100001111111011);
+#endif
+
+    asm("vextracthm %0, %1" : "=r" (result_wi) : "v" (vbc_hi_src));
+#if HOST_BIG_ENDIAN
+    assert(result_wi == 0b10010011);
+#else
+    assert(result_wi == 0b11001001);
+#endif
+
+    asm("vextractwm %0, %1" : "=r" (result_wi) : "v" (vbc_wi_src));
+#if HOST_BIG_ENDIAN
+    assert(result_wi == 0b0011);
+#else
+    assert(result_wi == 0b1100);
+#endif
+
+    asm("vextractdm %0, %1" : "=r" (result_wi) : "v" (vbc_di_src));
+#if HOST_BIG_ENDIAN
+    assert(result_wi == 0b10);
+#else
+    assert(result_wi == 0b01);
+#endif
+
+    vbc_qi_src[0] = 0x1;
+    vbc_qi_src[0] = vbc_qi_src[0] << 127;
+    asm("vextractqm %0, %1" : "=r" (result_wi) : "v" (vbc_qi_src));
+    assert(result_wi == 0b1);
+
+    return 0;
+}
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PULL 6/6] hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine
  2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
                   ` (4 preceding siblings ...)
  2023-05-05 16:34 ` [PULL 5/6] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions Daniel Henrique Barboza
@ 2023-05-05 16:34 ` Daniel Henrique Barboza
  2023-05-06  7:10 ` [PULL 0/6] ppc queue Richard Henderson
  6 siblings, 0 replies; 8+ messages in thread
From: Daniel Henrique Barboza @ 2023-05-05 16:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, danielhb413, peter.maydell, Thomas Huth

From: Thomas Huth <thuth@redhat.com>

When building QEMU with "--without-default-devices", the pseries
machine fails to start even when running with the --nodefaults option:

 $ ./qemu-system-ppc64 --nodefaults -M pseries
 Type 'spapr-nvdimm' is missing its parent 'nvdimm'
 Aborted (core dumped)

Looks like NVDIMM is a hard requirement for this machine nowadays.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20230504180521.220404-1-thuth@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/ppc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index c898021b5f..a689d9b219 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -3,7 +3,7 @@ config PSERIES
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply VIRTIO_VGA
-    imply NVDIMM
+    select NVDIMM
     select DIMM
     select PCI
     select SPAPR_VSCSI
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PULL 0/6] ppc queue
  2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
                   ` (5 preceding siblings ...)
  2023-05-05 16:34 ` [PULL 6/6] hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine Daniel Henrique Barboza
@ 2023-05-06  7:10 ` Richard Henderson
  6 siblings, 0 replies; 8+ messages in thread
From: Richard Henderson @ 2023-05-06  7:10 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel; +Cc: qemu-ppc, peter.maydell

On 5/5/23 17:34, Daniel Henrique Barboza wrote:
> The following changes since commit a9fe9e191b4305b88c356a1ed9ac3baf89eb18aa:
> 
>    Merge tag 'pull-riscv-to-apply-20230505-1' ofhttps://github.com/alistair23/qemu  into staging (2023-05-05 09:25:13 +0100)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/danielhb/qemu.git  tags/pull-ppc-20230505
> 
> for you to fetch changes up to b35261b1a6c2729fa7e7a6ca34b9489eda62b744:
> 
>    hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine (2023-05-05 12:34:22 -0300)
> 
> ----------------------------------------------------------------
> ppc patch queue for 2023-05-05:
> 
> This queue includes fixes for ppc and spapr emulation, a build fix for
> the pseries machine and a new reviewer for ppc/spapr.
> 
> We're also carrying a Coverity fix for the sm501 display.

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.


r~



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-06  7:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-05 16:34 [PULL 0/6] ppc queue Daniel Henrique Barboza
2023-05-05 16:34 ` [PULL 1/6] hw/display/sm501: Remove unneeded increment from loop Daniel Henrique Barboza
2023-05-05 16:34 ` [PULL 2/6] ppc: spapr: cleanup cr get/set with helpers Daniel Henrique Barboza
2023-05-05 16:34 ` [PULL 3/6] MAINTAINERS: Adding myself in the list for ppc/spapr Daniel Henrique Barboza
2023-05-05 16:34 ` [PULL 4/6] tcg: ppc64: Fix mask generation for vextractdm Daniel Henrique Barboza
2023-05-05 16:34 ` [PULL 5/6] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions Daniel Henrique Barboza
2023-05-05 16:34 ` [PULL 6/6] hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine Daniel Henrique Barboza
2023-05-06  7:10 ` [PULL 0/6] ppc queue Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.