From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F281C4338F for ; Fri, 13 Aug 2021 13:23:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 097AF61038 for ; Fri, 13 Aug 2021 13:23:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 097AF61038 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:41886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEX9x-0007SE-6I for qemu-devel@archiver.kernel.org; Fri, 13 Aug 2021 09:23:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEX4i-0005zI-Rk for qemu-devel@nongnu.org; Fri, 13 Aug 2021 09:18:18 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:47078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEX4g-000190-N9 for qemu-devel@nongnu.org; Fri, 13 Aug 2021 09:18:16 -0400 Received: by mail-wr1-x42e.google.com with SMTP id f5so13211352wrm.13 for ; Fri, 13 Aug 2021 06:18:13 -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=5MB/CWOu8y75nxH9S62qSbJCleKrqKA9mDnlY1X/YB4=; b=BeCjYGp55J77YtWl7Rg09vx2yRialAJFAhHOk8THvE1l88imoYWfHWnDLqV3K5Dhom pyMZjh2rWtHuJlUw11+fGCztVWft2UQYph078V//bs5hQHy7CN4eI2C/Y5OduCSZwuwG LJ/SCf0Bp2EXKZO43gVS2leGQ6T0rFuebBfs75x0rk+Wvm72esTVRcfYo/ZKVX3Vqd97 n7XfJqbgzt9E8zvO49jBDsh9qJvFt6UTnDZkSBHuv8lhhA0u+/MRCILHZqVRyo4urYLx jlxeFo4Hi/R4N5Lj2Cvi+DvtMdWb1YoDDkh9T3ZN4jYVqio6bAPMYwMUCU7EM5StjxGg o/Ww== 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=5MB/CWOu8y75nxH9S62qSbJCleKrqKA9mDnlY1X/YB4=; b=k4Zv1KgXz9bTTsuaegeAaC2EGApXCUk2ePBDYHCutl6KdGx05dkrkqYKG4KX7U5+Vp iaqp6PE4TAL7T//JNUHAqYJCf2G73Hp0vo4zYC94EFZGOCcc/CT3AkOq/BFMzD8j9mfI 0hmL6/w9Mf5xiajpWIgrFwoUZ9lRzPcuz9GglDEF4qtLqQZyu30a+tryqFznFOBkRmlU kJhTNwRhMHbU25cK7u1WLhbAMC20HlpNcFLfYkRCSd5B46Dz6yUhv1gnhWtFNAhAGKhz vaaNZxLA5QVS+fYhqwmle4/aGJjW00sFQnffYoUOi3VTrfY/WuGcEP1JM437EKhWeqlD PGsg== X-Gm-Message-State: AOAM5310kUtNOmD3FDVNd8WBN7LCkKaswSzI5X92Ggo/cnRv8BNTzlad PvDZJf0URzbQe3FKA95dh8BkfsE4s1gCCQ== X-Google-Smtp-Source: ABdhPJzdJtfLMDCsm4xosVNbD543Q26QRHkOPRZgABxq7KFwPcP7jquVFM6W3spyDFwtgIL+phCvSQ== X-Received: by 2002:a5d:574d:: with SMTP id q13mr3169796wrw.425.1628860692396; Fri, 13 Aug 2021 06:18:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id q75sm1585705wme.40.2021.08.13.06.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 06:18:12 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-6.2 1/7] linux-user/aarch64: Set siginfo_t addr field for SIGTRAP signals Date: Fri, 13 Aug 2021 14:18:03 +0100 Message-Id: <20210813131809.28655-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210813131809.28655-1-peter.maydell@linaro.org> References: <20210813131809.28655-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.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: Laurent Vivier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 --- linux-user/aarch64/cpu_loop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index ee72a1c20f0..5d8675944d9 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: -- 2.20.1