From patchwork Thu Jul 15 21:22:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 1505909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=kUdRHcI7; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4GQnR602p7z9sWc for ; Fri, 16 Jul 2021 07:23:13 +1000 (AEST) Received: from localhost ([::1]:41586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m48p5-0004Jt-Lr for incoming@patchwork.ozlabs.org; Thu, 15 Jul 2021 17:23:11 -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 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=; 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 X-QCInternal: smtphost 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) 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 @@ #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) void HELPER(commit_store)(CPUHexagonState *env, int slot_num) { - switch (env->mem_log_stores[slot_num].width) { + uintptr_t ra = GETPC(); + uint8_t width = env->mem_log_stores[slot_num].width; + target_ulong va = 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 = GETPC(); check_noshuf(env, slot); - get_user_u8(retval, vaddr); - return retval; + return cpu_ldub_data_ra(env, vaddr, ra); } static uint16_t mem_load2(CPUHexagonState *env, uint32_t slot, target_ulong vaddr) { - uint16_t retval; + uintptr_t ra = GETPC(); check_noshuf(env, slot); - get_user_u16(retval, vaddr); - return retval; + return cpu_lduw_data_ra(env, vaddr, ra); } static uint32_t mem_load4(CPUHexagonState *env, uint32_t slot, target_ulong vaddr) { - uint32_t retval; + uintptr_t ra = GETPC(); check_noshuf(env, slot); - get_user_u32(retval, vaddr); - return retval; + return cpu_ldl_data_ra(env, vaddr, ra); } static uint64_t mem_load8(CPUHexagonState *env, uint32_t slot, target_ulong vaddr) { - uint64_t retval; + uintptr_t ra = GETPC(); check_noshuf(env, slot); - get_user_u64(retval, vaddr); - return retval; + return cpu_ldq_data_ra(env, vaddr, ra); } /* Floating point */ From patchwork Thu Jul 15 21:22:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 1505908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=G8AqimxX; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4GQnR32czlz9sWc for ; Fri, 16 Jul 2021 07:23:11 +1000 (AEST) Received: from localhost ([::1]:41438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m48p3-0004De-3w for incoming@patchwork.ozlabs.org; Thu, 15 Jul 2021 17:23:09 -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 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=; 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 X-QCInternal: smtphost 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) 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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-test.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++; } +/* 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 != SIGSEGV) error("signal"); + sig_segv_called++; longjmp(jmp_env, 1); } @@ -492,6 +496,10 @@ static void test_signal(void) *(volatile uint8_t *)0 = 0; } + if (sig_segv_called == 0) { + error("SIGSEGV handler not called"); + } + act.sa_handler = SIG_DFL; sigemptyset(&act.sa_mask); act.sa_flags = 0;