From patchwork Fri Sep 24 13:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 514572 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1496873jao; Fri, 24 Sep 2021 06:58:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/VUdD+lPqqPCFlAsL+vbnBnhunT7vWKSxOQ1wvAPwz/KtdL+iVIHOY3VvdaTphOYFthJe X-Received: by 2002:ac8:6b07:: with SMTP id w7mr2241093qts.282.1632491906691; Fri, 24 Sep 2021 06:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632491906; cv=none; d=google.com; s=arc-20160816; b=nJfgakcc48SI7BiFzKnr9jHahqlshbfdB79L6gj+W5u9VueiORJJtNzTse/gy/yzoL c/mzv1+Qh9A8MHK/WFVTmuq0g9o2pJfjAl9Ag9E6axEUfePDwBIA6PPPh6w3fmTec2N5 1nDw4DB/04x397so2SWFGe6Gu5CsnLGs3xGuPh6jukAXB7PDonDv+OIkxqMo6tJTA44u udfIkMcIOgriieqFq312AL4L/i9Hu+a3NYBMXkaZIpqD1khzMj9qqZV+hDdn44yqBBTr qIya93yf1RtHc5OSx8Ppw41EjH23gw5lPtvneLnES14/akuu5UbVp6UFdZnkDjdIz/Re PjDg== 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; bh=pQS1Ogr2p3VUzWhBEoXp9pL1EPwJoW6ALRyNamD9xFo=; b=dqZwrrt0tYWULfBTz2RwbmWPvu0pIWPccFuwbe2RDgNaN0O4olz6Q7hOg+uPQh28xV 0IxDvep/sn6//7bUFstIjOXr8brVBD9yrHFwNmRgQofPccVp8hSNkkqqZ7tfszWxTs1p D46I6eD4q4rDpp1S4O6HIBZQTQWL6kr2dk5qX3p4REJq6iQbEyBtXBB0GWGYEtFvq2F0 t2aCVbaLkjSghMEniohdi+Us7yIa1/r1d5J3alStMu5ux0YQsBDHuzgXn/HW24jwDUnf 1xEOMp+z6FMQEYM7QrqcGpa983RZQjgiOjaz2h4weJW2lgkdIj9I9JlYWwUUm5DAnDB2 dnrQ== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f14si6112754qkp.247.2021.09.24.06.58.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Sep 2021 06:58:26 -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; 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" Received: from localhost ([::1]:54428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTlic-0004KK-7q for patch@linaro.org; Fri, 24 Sep 2021 09:58:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTlgr-0002wt-Ua for qemu-devel@nongnu.org; Fri, 24 Sep 2021 09:56:37 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:46103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTlgq-00058l-A3 for qemu-devel@nongnu.org; Fri, 24 Sep 2021 09:56:37 -0400 Received: from quad ([82.142.21.142]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mna0x-1nAI7R3vBl-00jdR4; Fri, 24 Sep 2021 15:56:33 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 1/7] linux-user/aarch64: Set siginfo_t addr field for SIGTRAP signals Date: Fri, 24 Sep 2021 15:56:25 +0200 Message-Id: <20210924135631.2067582-2-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924135631.2067582-1-laurent@vivier.eu> References: <20210924135631.2067582-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:fPR3/8rh0PhPJq2VfS7RHrsnKVH7dIdhp/GFaBpA1tqK4y3ot+B 8ST1s+ikw4k1FRiPsf6ktKNj/Y8cyEf0X5e+HiX/E/GW7uZ0AwpOSwaLDnHEGJNMMokI+rk K0rLBIFVfHzmayg405cbDJuIzimafC5SIAdOQB1HGYZgFsiMWbQS5xkfGWOZTjVpiJHh3V+ 4K0s0ZhVlAoYjjM7IlNug== X-UI-Out-Filterresults: notjunk:1; V03:K0:p4A86pW3S8U=:TcCU6kc/qq7AENANt5n4Q7 o8lHi/dQXumLzwJsAmmY4LcRDSNorcpWARm2oAY12cNprC2N9cW7JNfjEg83wx4uTaBtyQGt6 lLTjZeDkq/bBZYtGYHa8SXpldWwIhLxmp1z+ewQq6ou9/+HsI9Pfv+2Kup5eGM9q03VO0B2By S0G48TPFPrKNIOmDRTzvNdAlHZSriA1X10v0Mq8v0Huo2RnLCrVWWI97bljpRpdLiqn0583Cn la3UNAElZbsP32wqQsFxv/ppeBoJkEhmpmdtplKAEKAe2rXHbTyk21iNwcUl6vwb7Yu/CTQQh NqEOsWepBzyFE6yRW2znLCvIlzWMjZDd3b3CdhmJmkJ2hoJGs4PhJtREaxksFWf3HPGBYSRa4 S3U/yiB+fHMWTjYvX+9JSPTjx7EO0G8762Fbjkx5gsfO3T+r8SPqiId2VkcBHX1gjaUHzwpH6 RQtfe1kSlXvi3iiA+y5Vyw09xUmF1joDhHvwFKubRKL5rCtPPS0bWHJu/CRE8i6RHxZKRPfp8 qFCqd/xRr/l+W4CwroZtsuZowiqWex/I63FBYvi7E4c+Dlg7Sbkga2jdyDjfugCbD3KxSuZVm ySvZZM4CavK75NRDhw8oSXy1Ph8zRGgdL17IDWDQZx6bVZUc833j9tIE1TtpBtFlftDgkGGga Plw9NJwAq7sTrxVPPIFnkuPSKoFYNr4TId5rFkKmZhGa612x1xvXGQ3aorF9PjdLUjOJiIgBF GJUpmww39vkhykzxOOU+jwH2de8eTOYJQwYnQw== Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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 , Richard Henderson , Laurent Vivier 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 Reviewed-by: Richard Henderson Message-Id: <20210813131809.28655-2-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/aarch64/cpu_loop.c | 1 + 1 file changed, 1 insertion(+) -- 2.31.1 diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index 5425b85659a9..980e734e54f3 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/linux-user/aarch64/cpu_loop.c @@ -150,6 +150,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: