From patchwork Sun Aug 22 03:55:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 501395 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1058344jab; Sat, 21 Aug 2021 20:56:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMuOOYC0qQIJ0nRYmUWAC273AGcGFt1KIJld+8HveqFxQxGp8/KrmI54jxgK8UsxzRFop1 X-Received: by 2002:a02:aa96:: with SMTP id u22mr24084719jai.9.1629604612322; Sat, 21 Aug 2021 20:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629604612; cv=none; d=google.com; s=arc-20160816; b=Fn58gXXl3Zi4APIFWDJ/iZCvH67DULOl6mRosdf6FtqjOdWpeRtSrp8Z7fwLBsB5EY 8uatTzF87Y5VTXwx2Bt/1m9ORH9NVYNbrYIvBAMCieVpzpUSw0JGT+AH37YQhFM/CyEY uZrZeVl91gneIgIy7JfMewfTWupw8OgGXR2XtQ5MtpCtDt7zFmAtAhxgQIE9dM0y1JKG NTfy7CrdIuCIXg0G6w+CInb3LsjueYU1aDavFjxp1AJ7dV2HsPxcoreSaB535blY8z5G PmDg8Ur9sSLIhn3jIDyzFQU4JQCWH7O/3+MAunmkUSEFWfQL0jLVKnvs66E49Fm8vdq4 fp5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+WaIHji4UVCfbzWSWYeif0ORIYit2XTMtjCt7U1K6k4=; b=f5RLkeFecK12ZmIHRS9CQW9I6mNJSinxAdIueadj5pF/qoANSgnbzxBsy2pPylgmps Rpl8h4+sPtPda4HUrvzRp5Fn9SGvNfdsQabBJh4kU3+ObSAjc+Vic7Z0KBQYugbK7djs 9XiLsxMnWsMCzpy/6thY6gAJskUAcaaOJDG4v1wPrLORw4bfRF9Xwbm4WlzS33L1bIlY ES+hCmOTRxR9K0mFyeD9r+Ae/6N4TkCd/sIk52dSaiUJwkDvFJ/k1b8mnyHP52gGF8RG fXnTeZScYyiIek5+WcOWQUSygML4sruxbiEKwmEGMayb+nzy7N7DwdT8P8zvbG0JYAwE RHKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h4FuiIBN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t7si10919235jah.88.2021.08.21.20.56.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Aug 2021 20:56:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h4FuiIBN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHebL-0007hL-PM for patch@linaro.org; Sat, 21 Aug 2021 23:56:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHeaF-0007fb-MB for qemu-devel@nongnu.org; Sat, 21 Aug 2021 23:55:43 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:40545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHeaD-0000Xn-35 for qemu-devel@nongnu.org; Sat, 21 Aug 2021 23:55:43 -0400 Received: by mail-pj1-x1032.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso16420573pjh.5 for ; Sat, 21 Aug 2021 20:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+WaIHji4UVCfbzWSWYeif0ORIYit2XTMtjCt7U1K6k4=; b=h4FuiIBNN6iHZAQYRGRklNXnq+teFHvidRu7A6p5WHDv9N/ZrS4GUP2+W6fkGm5T9y b+Rn52UN61F4k4QC8cvqGjF/nVYZU/kUJbZOIQZkwne6BkzQOzZw/xwTfQ8/E3Belh0n XIryIhYA8RyksYzfb3T/Z0W0M48DvcFKyKB+nfat83HbSaDm75zXiVdz0UsmQ0ZFPzO9 9v+adFTg0Fq2PSSilbAt1S1fka1cvBNCPlgU6fP5ccNlTkFMW5X/HA6pGW03071jEbMZ Ipb8MLvI55GzY3tjnW8i68XPon8agyP28e0q0Qwmsw7rhgBI6nlQDz2wb9gM8sbzHN4w +Z2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+WaIHji4UVCfbzWSWYeif0ORIYit2XTMtjCt7U1K6k4=; b=qG/5kQ2kAY26KbEUsBwJdJywAkGRy+0+OEaH2jxK8IZaEovJCAr6deufCBWWrqh4pj GgKQ0fMI0RwkBHwaWpBXy52MVdDLQYlo2md5nb2ybA7Azd4lTJW9yqHvmY8D8gTMjzBz o6+tlKO7TrvEZHWRNE6yc/KrD3pMcu6JASG/FYVHBSRxYcMkl+B47Ua3v0yepbkVeGcN rbuF3dDd6roEceFhDNQXAyCjenN6dpYR8B3Xc5TQN1DsDLVVA57hD74j21N3pGyh5xv7 Ub6AbZB8yuEueUgdpMwI9uLZ6a1OPs3sUle+XtWQvRuXzqDaVgatCqNGHgn8vwYWwl1u Ye5Q== X-Gm-Message-State: AOAM533asicm6HMG0+YFSpl07y0YjHoKVn1ly1NvyQHi+dsT7aqfHX4u qyJ2AE4lVJDYPbs3485nTZC/nv6R/n69jQ== X-Received: by 2002:a17:90a:404a:: with SMTP id k10mr12982277pjg.145.1629604539504; Sat, 21 Aug 2021 20:55:39 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id x12sm11560533pfu.21.2021.08.21.20.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Aug 2021 20:55:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 01/30] linux-user/aarch64: Set siginfo_t addr field for SIGTRAP signals Date: Sat, 21 Aug 2021 20:55:08 -0700 Message-Id: <20210822035537.283193-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210822035537.283193-1-richard.henderson@linaro.org> References: <20210822035537.283193-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, 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: peter.maydell@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell When generating a TRAP_BRKPT SIGTRAP, set the siginfo_t addr field to the PC where the breakpoint/singlestep trap occurred; this is what the kernel does for this signal for this architecture. Fixes: Coverity 1459154 Signed-off-by: Peter Maydell Message-Id: <20210813131809.28655-2-peter.maydell@linaro.org> Signed-off-by: Richard Henderson --- linux-user/aarch64/cpu_loop.c | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index ee72a1c20f..5d8675944d 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/linux-user/aarch64/cpu_loop.c @@ -148,6 +148,7 @@ void cpu_loop(CPUARMState *env) info.si_signo = TARGET_SIGTRAP; info.si_errno = 0; info.si_code = TARGET_TRAP_BRKPT; + info._sifields._sigfault._addr = env->pc; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; case EXCP_SEMIHOST: