From patchwork Fri May 5 16:34:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 13232834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19D8AC77B7C for ; Fri, 5 May 2023 16:36:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puyOb-0000Tg-57; Fri, 05 May 2023 12:35:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puyOZ-0000TQ-MF; Fri, 05 May 2023 12:34:59 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puyOY-0004sl-5v; Fri, 05 May 2023 12:34:59 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6a5f21a231eso1238577a34.1; Fri, 05 May 2023 09:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683304493; x=1685896493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MCjxT1AnvWCkgvpc+O4OKxD9lGcf/L6QT+VZL3/jXbc=; b=DykmxVZbdtHOs4Dzlm/skWg18STcCibki2Pj9HW/GpmrKZTfnDJtO227U++NLkylsr nqoU54DcTwERmQXMN/u5I1et27HR5YWLXGVZ76zih6UHLc9oszCBVJ4cp9eB80rUtmz+ EIU6wRPFuuWVt6a3a4bhKYWrF0EDRIQU9SbgA6PAc5KNLrvHDPENZ9Xqo7Nz8GIxkKww 9Vv1ZVWSVVtB3crrrP++0pHEO0U1Zmo0fr+NC5X2Wj3KstWdJ1jV/hiyIuhGrFkF9GwS giGtL7ziXEAFW6A5itOOG8Gp2gnc/DbPTEnIHmVvWUJr3smVTbbSj7SspGeLkwWIcyv9 Xx7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683304493; x=1685896493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MCjxT1AnvWCkgvpc+O4OKxD9lGcf/L6QT+VZL3/jXbc=; b=WKH/Iem6DKydvgbVpur3jPePzs8STCun5TEoo3VyXVUzUWeVBfvEudnvyhcVS9C5te 8OJLGwQUsOrSHun5BiQcTMQqVvR+bvWyLd6wSBtGBlVXfSnXqAbITlDWIBj6bhKezvs+ 3BUHvfnTjNLasMq53p/3/CCupQRI7UYBnbpdZhSZ3c4OXmftT8xXKQhPuRB/FZt3DGeu uo2JGEFhXWDz9Y+lFyosS5Cc/qd7qYNEhwIIzBrvFcPOGRFXkBoXdIpzazqoiIMBHNmk 8Pa6zlLL+HQxASeqKobqE2MH2MLv5Wgc3hZpCqFexnBIzxIDy809R80B3/gx+giIqpOD dTSg== X-Gm-Message-State: AC+VfDy539s7hD4GlxZMiSzKVkv/b2B9RF455Sf3nJSoA2K7/Y1CaRSR xfzXCtKrypJRjZf0ywyLlb2wOWtq/Tw= X-Google-Smtp-Source: ACHHUZ4J4Ji2dVXTmswBpoA+Ghn36cDkZpiyVLhxkatBhoLAgNV6N4NDm22WYCHuSE6PzT7AHE4t3w== X-Received: by 2002:a05:6830:104b:b0:6a6:3a73:95e with SMTP id b11-20020a056830104b00b006a63a73095emr999774otp.35.1683304493161; Fri, 05 May 2023 09:34:53 -0700 (PDT) Received: from grind.. (189-46-207-53.dsl.telesp.net.br. [189.46.207.53]) by smtp.gmail.com with ESMTPSA id z3-20020a9d62c3000000b006a43519523fsm1033475otk.1.2023.05.05.09.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 09:34:52 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, peter.maydell@linaro.org, BALATON Zoltan , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 1/6] hw/display/sm501: Remove unneeded increment from loop Date: Fri, 5 May 2023 13:34:39 -0300 Message-Id: <20230505163444.347006-2-danielhb413@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230505163444.347006-1-danielhb413@gmail.com> References: <20230505163444.347006-1-danielhb413@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32b; envelope-from=danielhb413@gmail.com; helo=mail-ot1-x32b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: BALATON Zoltan 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 Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230405161234.6EF0A74633D@zero.eik.bme.hu> Signed-off-by: Daniel Henrique Barboza --- 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); From patchwork Fri May 5 16:34:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 13232835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D60CC7EE22 for ; Fri, 5 May 2023 16:36:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puyOc-0000V0-Oe; Fri, 05 May 2023 12:35:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puyOb-0000Tm-5k; Fri, 05 May 2023 12:35:01 -0400 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puyOY-0004t3-7M; Fri, 05 May 2023 12:35:00 -0400 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-195c83a9ed8so328740fac.0; Fri, 05 May 2023 09:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683304496; x=1685896496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eHy0HJQ1lV3HX5R5N57n1GwLHd91WYmU4Ru7Dfuq1AI=; b=hsvCSTZQ8JKyN+TwBSdQPH84rtJPCr7cMfzWfK1pqfBB6BLJ+k4X5ImrDu8AD4kEFz TCHveGhFOPNvVY2Ybwt3uX0ujb/mf0Gw4QxhudHt/VVC6/1Y1djIM1ESWW1PfR2G6pIi aYEJH98PmKWrWr08kzu4CC2pgbueUAZWonivIdzxg8nJTveijiuIxp9E7bRg3bvbX/ai zuO5aZMcFGc6CFb6MSfnjCBK8xYVDTQ6+b710lANRSyUHb4awnfBHRTxh8BkfKuNqR3b fzYGDsk50OyVm6qi5ol5Ao+1vNdxnKkBKQOfwY8AL2JD2KPHaSfz5Vp1Y7iO8JKyVthj Y6ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683304496; x=1685896496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eHy0HJQ1lV3HX5R5N57n1GwLHd91WYmU4Ru7Dfuq1AI=; b=EnOtPC8MCqBHuOdMm6GFO8hhxvnAEYtJfsAlmK3GS5CivHA9tSZMeLxNubYLULLV9L 7ENYoFJD+QSIHT+8JIIdtwnRTiuSSa9xAJA9wKvjaahqdFxqa6Aw2IOnicU0JDIr8pKd 617vJOk30ijCezaRhWLiyiuWrEeiSuJyzL9tYr1ZNSU1VvGPslh1H56rlsxhJLDb5p0w BLaWnyTSf3NWCUF7M+PoajZmonSQrFh08m6RQaSVmd7FW91oyxAGBmDQqYc+FGVb3Nia OehMBwPdwaEtqnwxchVQhDxZlafH2+IobPHJFP08/h0p6CCWmWrAjEi972c9jq17aFhY 8IMw== X-Gm-Message-State: AC+VfDzsLkqXlJvf8ttTNuaUocR5HWLaT5cQWb+eg6swXN5jfzQrgT9Y uFRcMhKpDzNyiYcF9D15LCh4gs/gcF0= X-Google-Smtp-Source: ACHHUZ7qKeyf7lhRJ3r+1Ev9gJDLrmAxVYmVwE8JjlNxCP+vncPG5GDjk4QEBslvbx9CNyjyNnCWNQ== X-Received: by 2002:a05:6870:98a7:b0:18c:988a:72dd with SMTP id eg39-20020a05687098a700b0018c988a72ddmr1397530oab.33.1683304495798; Fri, 05 May 2023 09:34:55 -0700 (PDT) Received: from grind.. (189-46-207-53.dsl.telesp.net.br. [189.46.207.53]) by smtp.gmail.com with ESMTPSA id z3-20020a9d62c3000000b006a43519523fsm1033475otk.1.2023.05.05.09.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 09:34:55 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, peter.maydell@linaro.org, Harsh Prateek Bora , Fabiano Rosas , Richard Henderson Subject: [PULL 2/6] ppc: spapr: cleanup cr get/set with helpers. Date: Fri, 5 May 2023 13:34:40 -0300 Message-Id: <20230505163444.347006-3-danielhb413@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230505163444.347006-1-danielhb413@gmail.com> References: <20230505163444.347006-1-danielhb413@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::29; envelope-from=danielhb413@gmail.com; helo=mail-oa1-x29.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Harsh Prateek Bora 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 Reviewed-by: Fabiano Rosas Reviewed-by: Richard Henderson Message-Id: <20230503093619.2530487-2-harshpb@linux.ibm.com> [danielhb: add 'const' modifier to fix linux-user build] Signed-off-by: Daniel Henrique Barboza --- 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, ®s); 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, ®s); @@ -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; } From patchwork Fri May 5 16:34:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 13232838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E077C7EE22 for ; Fri, 5 May 2023 16:36:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puyOc-0000Ub-1q; Fri, 05 May 2023 12:35:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puyOb-0000Te-1H; Fri, 05 May 2023 12:35:01 -0400 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puyOZ-0004tH-Jn; Fri, 05 May 2023 12:35:00 -0400 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-18f4a6d2822so18482296fac.1; Fri, 05 May 2023 09:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683304498; x=1685896498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BvZj1YOrInqqbWuFvor3phNSI1PiHIsDRB+lOfZ4/U8=; b=T/JySgqZyyWmA8aNZS+TBLMB4FLf8CoQ+TfI+X0MuXgTl2HB5D1Hg4Rp5QrEPtYQWM O0Sdel1QC9vREofToxw3vph4Q8o2eZ2RJK9pThsYbpICUdL3ATsfjxt0xu4UkvdbU0Zh 0tnIKIS4WjDigHaNtvZSBwaseTYPpLX8mX/lLApMZBXQG3qozavg/rhxXXiudibCboSQ GdYCozNAU0vdVYuU1IhLzkeOmnjT2YhoHiwV1k41ARBzViMVjT4ZF8121ma8pTcgvEwI VRfLB00ZUOJK3J5diH1E4uJhyg76sqMay7zRq8Eu7WZx6KtRY4oupvHO1OPybzQ71SiO YL8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683304498; x=1685896498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BvZj1YOrInqqbWuFvor3phNSI1PiHIsDRB+lOfZ4/U8=; b=fpwLe3p34HTSc7kK2menXjA0NucFpmbWygyKmJtI0jraiwBT0I0bw6DSY+YUiMDWnx BNwAnv42EtxkojKgtSPy69r4zISqb3YT4ZaGyCO62hRa3fo8NTVci9+3X+U9Grk8INJy vrtiVOxi125tKnqzqMnwkeUoLSok0VscSQydVie8Ph+fQyfWLfPnua+YKfbdRzqsBICL WiQ89F7f0XvaBDph1Q++MlcdlOkHiENbXjrbJeey6ypUQGWuknZaCc9O7Jn6ARVkjHMm 7uwTOI009fKIkZrY9Z13dRI1G1ceRKckvaWJi+jWzxXjtcCJ7zGqJ+Lwk19nVvNxXfFH 3oAw== X-Gm-Message-State: AC+VfDzkDPJM7/I8NwF+dLjbGRVD/sEsUT9KcfAX0i8KhDNbYTWW5dwe sn5k/nO2wMLKdwoW7Rl1fPyx7t/kcq0= X-Google-Smtp-Source: ACHHUZ68YxQZHSzA+Gtp2uiUpxtvohKtn/4IwXI0Ov7R2PV0GEQnJf33r5lc2FRNaC793VlTUmlkKA== X-Received: by 2002:a05:6870:a10b:b0:184:2b9d:2b12 with SMTP id m11-20020a056870a10b00b001842b9d2b12mr3278036oae.13.1683304497960; Fri, 05 May 2023 09:34:57 -0700 (PDT) Received: from grind.. (189-46-207-53.dsl.telesp.net.br. [189.46.207.53]) by smtp.gmail.com with ESMTPSA id z3-20020a9d62c3000000b006a43519523fsm1033475otk.1.2023.05.05.09.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 09:34:57 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, peter.maydell@linaro.org, Harsh Prateek Bora Subject: [PULL 3/6] MAINTAINERS: Adding myself in the list for ppc/spapr Date: Fri, 5 May 2023 13:34:41 -0300 Message-Id: <20230505163444.347006-4-danielhb413@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230505163444.347006-1-danielhb413@gmail.com> References: <20230505163444.347006-1-danielhb413@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::33; envelope-from=danielhb413@gmail.com; helo=mail-oa1-x33.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Harsh Prateek Bora Would like to get notified of changes in this area and review them. Signed-off-by: Harsh Prateek Bora Reviewed-by: Daniel Henrique Barboza Message-Id: <20230503093619.2530487-3-harshpb@linux.ibm.com> Signed-off-by: Daniel Henrique Barboza --- 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 R: Cédric Le Goater R: David Gibson R: Greg Kurz +R: Harsh Prateek Bora L: qemu-ppc@nongnu.org S: Odd Fixes F: hw/*/spapr* From patchwork Fri May 5 16:34:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 13232840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7204C77B7C for ; Fri, 5 May 2023 16:36:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puyOf-0000XB-JF; Fri, 05 May 2023 12:35:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puyOe-0000Vk-Ex; Fri, 05 May 2023 12:35:04 -0400 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puyOc-0004uG-NY; Fri, 05 May 2023 12:35:04 -0400 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6a606135408so1791681a34.0; Fri, 05 May 2023 09:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683304501; x=1685896501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jbx/0so/ks6rJVukEiTYoE7hqjtEvDeuQ+ZtkpBDRKw=; b=c3aLmMLutOoFSznxpEj2InimHOcUSz5Te+9SfeOJWpuI3o5sIU8HDoKcbYLHmKnvfx ifs+s+TVuruB2sXfVpsK05ymVDGbXKO19dXzuckS9PtE38FC1TFWBoIpQ69+UQ+jDBly oeHfuX756ZaiouRuwWDAe6vDjnHiHuDzijbWqUUya5gL7Guh/5bGJp9drQXy50qyr2rL 7QC0SPggBnPLWr9/U4h6f4glb7arYOsuc4IsUkPVYov+8Ejk8fJ7i/rfDCSRSFhGno5V ghn+i99LFZokDDCjUIDxuV/lBI7uV2FNQ9LgaYGZ8BqQRPyQzqiTpvodZ71B5rVT91OA fWXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683304501; x=1685896501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jbx/0so/ks6rJVukEiTYoE7hqjtEvDeuQ+ZtkpBDRKw=; b=HfIkImO6dVBgHR67JpwRMc/aGcHR8m/UhcCdAaKBCEJ7dw3qrprvS3kbPggLOXr6aa DOBS9s+a5MJfZzMcISn1ru5ICdmUmEZjSvM3/7yvMWBLR5nsLLGWqcylqw6yGTDah9/F nUJwhA4kGmwmveNXFECg3o9kgXufEIsJ1Wym8yAbtX12Y6tUsWYD09N3K9IE8qxk0J3e YSBAKIRTA85h9t8b2yQBALP3LM9W4GrwlrF1/vG2GDX4eilxe/ltpOguHjEjzCUUNvsG +50OkVUsz93V3g4CkKGtzrpUO4D7i7+TW3wqhBdXT5HRHdFKVaMGwnyr+Y/OoqbGbPVz qkyg== X-Gm-Message-State: AC+VfDwqC9LUBez7iD+ETY4PsuM6R6ByZ3bFukcuNZ+4zTWp/wUJgdeG rwT15l9x4uMLoQfDGajqb7zWT1cpyX4= X-Google-Smtp-Source: ACHHUZ6B0Kc+KaB7yntZ8GdzGyD0r5QMkyxAVAqoEOfAgoJIU/yLlap1z9Mh2Awf11PXGVupQlxdcQ== X-Received: by 2002:a05:6830:208b:b0:69f:165b:1509 with SMTP id y11-20020a056830208b00b0069f165b1509mr952287otq.35.1683304500956; Fri, 05 May 2023 09:35:00 -0700 (PDT) Received: from grind.. (189-46-207-53.dsl.telesp.net.br. [189.46.207.53]) by smtp.gmail.com with ESMTPSA id z3-20020a9d62c3000000b006a43519523fsm1033475otk.1.2023.05.05.09.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 09:35:00 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, peter.maydell@linaro.org, Shivaprasad G Bhat , =?utf-8?q?Alex_Benn=C3=A9e?= , Lucas Mateus Castro , Richard Henderson , =?utf-8?q?C=C3=A9dric_Le_?= =?utf-8?q?Goater?= Subject: [PULL 4/6] tcg: ppc64: Fix mask generation for vextractdm Date: Fri, 5 May 2023 13:34:42 -0300 Message-Id: <20230505163444.347006-5-danielhb413@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230505163444.347006-1-danielhb413@gmail.com> References: <20230505163444.347006-1-danielhb413@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=danielhb413@gmail.com; helo=mail-ot1-x32d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Shivaprasad G Bhat 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 Reviewed-by: Alex Bennée Reviewed-by: Lucas Mateus Castro Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater Message-Id: <168319292809.1159309.5817546227121323288.stgit@ltc-boston1.aus.stglabs.ibm.com> Signed-off-by: Daniel Henrique Barboza --- 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; From patchwork Fri May 5 16:34:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 13232836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C15CBC77B7F for ; Fri, 5 May 2023 16:36:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puyOp-0000Z6-WD; Fri, 05 May 2023 12:35:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puyOh-0000Ya-G8; Fri, 05 May 2023 12:35:12 -0400 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puyOf-00055M-LD; Fri, 05 May 2023 12:35:07 -0400 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6a5ef766282so1538061a34.0; Fri, 05 May 2023 09:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683304504; x=1685896504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KqvU8//8WYRiuqj0LMjiqtFrHPWBBdy2oZBbIlb2Uak=; b=lJECY7nh8zXY0KmqIJDMWVxaOhZtGiKYnIS6iCdl7Gvskhhggb1EWd5G6Na0Tqo2qe bg6qnOkWn2Emdqay4Z/VL8mZa3NSM/y0/+zHZEKxrDhNcFBNAqWN8lvki4Li6I0GafKP 8FAyZLHCQ0bZWLAlNQmM8EOXOlazhCkgJq4Y/55iq5WOwk9RJtU3X8IxIp93f2jfgMUU fd4JZwqavmKNY5yIlcrbaTWEfdJ3XLNQ2btaaqH+yza3zg31rkK0Dsgr26d+I10RrlMx IiervQe/t/3EPYeFX0XIEpBZU/jgQZdeb7vPBOWsPTuxK8IYB6CFRQYMTfxnRxMSXIGu FOYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683304504; x=1685896504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KqvU8//8WYRiuqj0LMjiqtFrHPWBBdy2oZBbIlb2Uak=; b=gjpTzRtTfbzQgeLFBSU7azpYBS6HUMnTD0vkORbdfQocQDuOkMCuCOstzG0jauH6la YT8TDLblAR3EiRgdJcVJy8NU5/wJijGEXhPPkqr9tfNFiiN+mejvPi/gvmtjv44JKBPB v7xZCBJdBYtMqfYa4aw+Y1S8OmKd+wLaEz+1B2SIOKxgF+4wnDfgCgQbUVwgzgS6AzfG VNOgyX4PhuFY6rMekMrObB1R6ZOw1JnPflvKZXxw3VjGIHETx173zJ/mQnpkaOWiavAD 7x58uvD+yO/pzk2VVH+L2SKbmURTcuy6ewa3NDcBBi2+BXjLz+IAFhWHkG9IWlyWV33h IKPw== X-Gm-Message-State: AC+VfDxx6V7fwQ3KJh1H6QS0V+wjWccWeNJHASVxVdtjyjlKWzkuYaPZ V+3yuR0K2+tI4kUUtkMAhjDnyutocVs= X-Google-Smtp-Source: ACHHUZ6Pnjhm2l4BqRC8m6K6+ChFK7DDnZ0WTTchCJ7bwUWSYjb1X2Ig0czbWQbZ32OZvhxS5f1m0A== X-Received: by 2002:a9d:65d7:0:b0:6a6:767:ed71 with SMTP id z23-20020a9d65d7000000b006a60767ed71mr1152422oth.18.1683304504026; Fri, 05 May 2023 09:35:04 -0700 (PDT) Received: from grind.. (189-46-207-53.dsl.telesp.net.br. [189.46.207.53]) by smtp.gmail.com with ESMTPSA id z3-20020a9d62c3000000b006a43519523fsm1033475otk.1.2023.05.05.09.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 09:35:03 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, peter.maydell@linaro.org, Shivaprasad G Bhat , John Platts , Lucas Mateus Castro , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= Subject: [PULL 5/6] tests: tcg: ppc64: Add tests for Vector Extract Mask Instructions Date: Fri, 5 May 2023 13:34:43 -0300 Message-Id: <20230505163444.347006-6-danielhb413@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230505163444.347006-1-danielhb413@gmail.com> References: <20230505163444.347006-1-danielhb413@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=danielhb413@gmail.com; helo=mail-ot1-x32d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Shivaprasad G Bhat 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 Signed-off-by: Shivaprasad G Bhat Reviewed-by: Lucas Mateus Castro Reviewed-by: Cédric Le Goater Message-Id: <168319294881.1159309.17060400720026083557.stgit@ltc-boston1.aus.stglabs.ibm.com> Signed-off-by: Daniel Henrique Barboza --- 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 +#include +#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; +} From patchwork Fri May 5 16:34:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 13232837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E4FFC77B7F for ; Fri, 5 May 2023 16:36:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puyOx-0000c4-Rd; Fri, 05 May 2023 12:35:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puyOo-0000ZC-MD; Fri, 05 May 2023 12:35:15 -0400 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puyOh-00055p-Vu; Fri, 05 May 2023 12:35:12 -0400 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6a5f7d10dd5so1364167a34.0; Fri, 05 May 2023 09:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683304506; x=1685896506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lYUGzxH80qMCTSOOXwriMGyo86X2j1XLCmtgpmq1JFw=; b=RR5gXuJ5/YThc6rouAYq+yFF8dEf4NGe2QzEi1RxrwVx3Ew07jco0wD0v4akrpS6G8 Xl1mgTQuHx3VWPua3Q4ZoOorSWVtHoQ5WTUljwo6u5NA++NdpwA6FRpWtGgpFsB1AzYQ C2YBTLGSwlhzB8qVU86gKVwx1PvJq8PDPGDJ4GO0Pb3RCmnIpHdpyt1DHR/giO76AAJu CsAekleAh8maYPXslzziCXcMJ02Yj73B3opLdTi9N7KL+Vpz9Hugt+Be883qPsWpvYAT jKY5weAFZet76JWOpL4t+DflUIXR9J+3WJlAkCJvwaizkjA3C6wjk1MGGwKA3k95Te4m +w9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683304506; x=1685896506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lYUGzxH80qMCTSOOXwriMGyo86X2j1XLCmtgpmq1JFw=; b=Ggc0NyBKy1Fvj8ZclQ6WWtVZ6+pDXigSrp6uRK+IHRuRrsxwJWBVfRh2CEVhvsvLdo IERS60im0D++r8uOQxo3gtbq6pKaHfBnyN1U2HWbqLDjKXv+7TfLRiAdOJyMHgfgM3Og oKOPtRfh6q38dJ89nk7UeSTqWwMZa4gxWSplgW6yQp0dk9PD3qKEpeHZ6k7YmnNPAN5W wurJoGH0TPiGU1N1YbQKXj4L/HfBAhA0mZ0KijoooF3jyeFIAiVbXjz9p0gwN+nDXbj6 TlOLNY0aSx97UgOW2TL6UkFyj7oUunQIfjnQYs7qxpIjed4K/zzkJINNCd2/7/v5HyDM ySPQ== X-Gm-Message-State: AC+VfDwSESI+hKsH8EIKLyr43xxNmYSKSfJBVE+znL9J8nwTnj3gUwIo YN/5el2PQ/ygXy2pokQbXOIb/A7GBAY= X-Google-Smtp-Source: ACHHUZ7X1Qi+CtA08psAXiqup4aAtdxY1sAK9+ot3R2XVO95H96VNLFhAgP4xy1IM0IDHHof/DBIjw== X-Received: by 2002:a05:6830:1501:b0:6a7:c44a:ddd6 with SMTP id k1-20020a056830150100b006a7c44addd6mr1004435otp.11.1683304506338; Fri, 05 May 2023 09:35:06 -0700 (PDT) Received: from grind.. (189-46-207-53.dsl.telesp.net.br. [189.46.207.53]) by smtp.gmail.com with ESMTPSA id z3-20020a9d62c3000000b006a43519523fsm1033475otk.1.2023.05.05.09.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 09:35:06 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com, peter.maydell@linaro.org, Thomas Huth Subject: [PULL 6/6] hw/ppc/Kconfig: NVDIMM is a hard requirement for the pseries machine Date: Fri, 5 May 2023 13:34:44 -0300 Message-Id: <20230505163444.347006-7-danielhb413@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230505163444.347006-1-danielhb413@gmail.com> References: <20230505163444.347006-1-danielhb413@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::329; envelope-from=danielhb413@gmail.com; helo=mail-ot1-x329.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Thomas Huth 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 Reviewed-by: Daniel Henrique Barboza Message-Id: <20230504180521.220404-1-thuth@redhat.com> Signed-off-by: Daniel Henrique Barboza --- 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