From nobody Mon May 13 07:57:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626384233155675.2106938176779; Thu, 15 Jul 2021 14:23:53 -0700 (PDT) Received: from localhost ([::1]:44420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m48pk-0006CK-2U for importer@patchew.org; Thu, 15 Jul 2021 17:23:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m48oj-0004Gd-75 for qemu-devel@nongnu.org; Thu, 15 Jul 2021 17:22:49 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:55897) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1m48oh-0000h5-B5 for qemu-devel@nongnu.org; Thu, 15 Jul 2021 17:22:48 -0400 Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 15 Jul 2021 14:22:41 -0700 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg04-sd.qualcomm.com with ESMTP; 15 Jul 2021 14:22:41 -0700 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id D0F46FA6; Thu, 15 Jul 2021 16:22:40 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1626384167; x=1657920167; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FqzCIsQOLsmvpaVhsZY/uTtd8uuoptSQtwznbvaiggU=; b=kUdRHcI7LNfiMKh+sArFxQg0bB0lh/8QB3XlP2j76L4OEw6tZ8TMsdNu jO9OrEis5kNGAK3Z/lRFT/VjhX9ExF30cgtgAMJTzjOar9J4LbAPL13G9 jCNMVqRWkQtgF2kH+3VS/5AXaMFYlZpbToI99fbMqGR6VSh21JkRdB7QM Q=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH v3 1/2] Hexagon (target/hexagon) remove put_user_*/get_user_* Date: Thu, 15 Jul 2021 16:22:35 -0500 Message-Id: <1626384156-6248-2-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626384156-6248-1-git-send-email-tsimpson@quicinc.com> References: <1626384156-6248-1-git-send-email-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=199.106.114.39; envelope-from=tsimpson@qualcomm.com; helo=alexa-out-sd-02.qualcomm.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ale@rev.ng, bcain@quicinc.com, alex.bennee@linaro.org, richard.henderson@linaro.org, tsimpson@quicinc.com, philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626384234871100003 Replace put_user_* with cpu_st*_data_ra Replace get_user_* with cpu_ld*_data_ra Suggested-by: Richard Henderson Signed-off-by: Taylor Simpson Reviewed-by: Richard Henderson --- target/hexagon/op_helper.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 4595559..a959dba 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -17,6 +17,7 @@ =20 #include "qemu/osdep.h" #include "qemu.h" +#include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "cpu.h" @@ -140,22 +141,22 @@ void HELPER(debug_check_store_width)(CPUHexagonState = *env, int slot, int check) =20 void HELPER(commit_store)(CPUHexagonState *env, int slot_num) { - switch (env->mem_log_stores[slot_num].width) { + uintptr_t ra =3D GETPC(); + uint8_t width =3D env->mem_log_stores[slot_num].width; + target_ulong va =3D env->mem_log_stores[slot_num].va; + + switch (width) { case 1: - put_user_u8(env->mem_log_stores[slot_num].data32, - env->mem_log_stores[slot_num].va); + cpu_stb_data_ra(env, va, env->mem_log_stores[slot_num].data32, ra); break; case 2: - put_user_u16(env->mem_log_stores[slot_num].data32, - env->mem_log_stores[slot_num].va); + cpu_stw_data_ra(env, va, env->mem_log_stores[slot_num].data32, ra); break; case 4: - put_user_u32(env->mem_log_stores[slot_num].data32, - env->mem_log_stores[slot_num].va); + cpu_stl_data_ra(env, va, env->mem_log_stores[slot_num].data32, ra); break; case 8: - put_user_u64(env->mem_log_stores[slot_num].data64, - env->mem_log_stores[slot_num].va); + cpu_stq_data_ra(env, va, env->mem_log_stores[slot_num].data64, ra); break; default: g_assert_not_reached(); @@ -393,37 +394,33 @@ static void check_noshuf(CPUHexagonState *env, uint32= _t slot) static uint8_t mem_load1(CPUHexagonState *env, uint32_t slot, target_ulong vaddr) { - uint8_t retval; + uintptr_t ra =3D GETPC(); check_noshuf(env, slot); - get_user_u8(retval, vaddr); - return retval; + return cpu_ldub_data_ra(env, vaddr, ra); } =20 static uint16_t mem_load2(CPUHexagonState *env, uint32_t slot, target_ulong vaddr) { - uint16_t retval; + uintptr_t ra =3D GETPC(); check_noshuf(env, slot); - get_user_u16(retval, vaddr); - return retval; + return cpu_lduw_data_ra(env, vaddr, ra); } =20 static uint32_t mem_load4(CPUHexagonState *env, uint32_t slot, target_ulong vaddr) { - uint32_t retval; + uintptr_t ra =3D GETPC(); check_noshuf(env, slot); - get_user_u32(retval, vaddr); - return retval; + return cpu_ldl_data_ra(env, vaddr, ra); } =20 static uint64_t mem_load8(CPUHexagonState *env, uint32_t slot, target_ulong vaddr) { - uint64_t retval; + uintptr_t ra =3D GETPC(); check_noshuf(env, slot); - get_user_u64(retval, vaddr); - return retval; + return cpu_ldq_data_ra(env, vaddr, ra); } =20 /* Floating point */ --=20 2.7.4 From nobody Mon May 13 07:57:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626384229047275.1929515809321; Thu, 15 Jul 2021 14:23:49 -0700 (PDT) Received: from localhost ([::1]:44270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m48pg-00066T-38 for importer@patchew.org; Thu, 15 Jul 2021 17:23:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m48oh-0004Bo-88 for qemu-devel@nongnu.org; Thu, 15 Jul 2021 17:22:47 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:55897) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1m48oe-0000h5-MI for qemu-devel@nongnu.org; Thu, 15 Jul 2021 17:22:46 -0400 Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 15 Jul 2021 14:22:41 -0700 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg02-sd.qualcomm.com with ESMTP; 15 Jul 2021 14:22:41 -0700 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id D3943FFD; Thu, 15 Jul 2021 16:22:40 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1626384164; x=1657920164; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OD1OD6POPBTd8z08uayN2Tkv4UvAaQ0VAfNXqf1Peu0=; b=G8AqimxXmPQbh89w5fTIh7odEz95j4N4XAUWuVn9B6qDv2Ij3slnJyQz mRsgWmJ0NBh+cA7SBIbktVl0APmx1rdQhHAy5eysqy4ast/7cMfsHvIMI /g81d5Y8P+rVhflqxdQ4dIhIFKz9rHBLYBclN+/Lk4+SMcqNpRhPrX5j1 A=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PATCH v3 2/2] linux-test (tests/tcg/multiarch/linux-test.c) add check Date: Thu, 15 Jul 2021 16:22:36 -0500 Message-Id: <1626384156-6248-3-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626384156-6248-1-git-send-email-tsimpson@quicinc.com> References: <1626384156-6248-1-git-send-email-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=199.106.114.39; envelope-from=tsimpson@qualcomm.com; helo=alexa-out-sd-02.qualcomm.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ale@rev.ng, bcain@quicinc.com, alex.bennee@linaro.org, richard.henderson@linaro.org, tsimpson@quicinc.com, philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626384230995100001 Add a check that the SIGSEGV handler is called Reviewed-by: Richard Henderson Signed-off-by: Taylor Simpson --- tests/tcg/multiarch/linux-test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-t= est.c index c8c6aed..e2d88f8 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -439,10 +439,14 @@ static void sig_alarm(int sig) alarm_count++; } =20 +/* Count the number of times handler is called */ +static int sig_segv_called; + static void sig_segv(int sig, siginfo_t *info, void *puc) { if (sig !=3D SIGSEGV) error("signal"); + sig_segv_called++; longjmp(jmp_env, 1); } =20 @@ -492,6 +496,10 @@ static void test_signal(void) *(volatile uint8_t *)0 =3D 0; } =20 + if (sig_segv_called =3D=3D 0) { + error("SIGSEGV handler not called"); + } + act.sa_handler =3D SIG_DFL; sigemptyset(&act.sa_mask); act.sa_flags =3D 0; --=20 2.7.4