From patchwork Fri Oct 15 04:10:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515839 Delivered-To: patch@linaro.org Received: by 2002:ac0:da11:0:0:0:0:0 with SMTP id d17csp152841imi; Thu, 14 Oct 2021 21:50:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1NVKnTMyxxjb58AiisD3b6EqvFvnjt9b5XYW6nDzVzE9IzlYniJSLbsggV3WlIxGq4stU X-Received: by 2002:a92:c261:: with SMTP id h1mr2287171ild.284.1634273459288; Thu, 14 Oct 2021 21:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634273459; cv=none; d=google.com; s=arc-20160816; b=TI5eKYR2aWq4XH72RxAaBIqcoS1THGtI2f7oiKgBo+jER+nOEUPvl3MUxXmVT2ehfM wgDaozjc9AqGAHsaBTUZg+abrldxmW6J6svbru9/62yhyocnDjEidNkgVzrVHVmQPO61 ZVTaIPOR/Dr3mHQyF/RfLLvzvltMqi/o6xTEqUtRLt9Y2tqQksS8YWiRoF8hq59KBf76 R72RXQHC3cKKS4LNTkWK1BVOVFzBthBJCTrB4ZVlhjyiSOD+uhLiwcXAsL8XZ1QfsvE7 8K+UWolyy6hLsTzo55oaoYmvVchUNYoGf4ToYMN+EHeBDkk/Lf6siUuBDTTpOvgrXoih 4BsA== 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=9im4CvhbPoyQ1RG+uvEuwMG0n0qsYjZQphEGRSBJSzY=; b=vABft32C45SWqPciIyNEiJgbqnhjCu5V8E46s63CcF1/jOn6hUwF+0y5JRBllHpqDd 4AmuNMvRj+b3tEDW3hG1oNauBsThixVgixYbLpKMLpJDHewIoB6xE8/mbCuct9Mz4rLg Y9ee8nqJ0H1waNwi3D+wuY+HVT6Y9gyL+nJGjEvlpJR44vrQTTm/HPVE0gUC+f0jEA2j kBkO2NX5EJs9VeiGlkWM5MnkStTOVtMHXc7SM051zSwduPrFWvN4AJ1Gaq7uAqjA0F58 fD4wc2lMi8kKVgeJCuCD1juntrofyknpQmk+uDEB3ggvLir1uB/Ta1/wBb6Bm/f84VIh uBaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EThQgfXV; 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=fail (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 p16si9744012iov.22.2021.10.14.21.50.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Oct 2021 21:50:59 -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=fail header.i=@linaro.org header.s=google header.b=EThQgfXV; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbFBK-0000Ib-Io for patch@linaro.org; Fri, 15 Oct 2021 00:50:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbEcJ-00070N-Nj for qemu-devel@nongnu.org; Fri, 15 Oct 2021 00:14:49 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:34744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbEcH-0002yj-6s for qemu-devel@nongnu.org; Fri, 15 Oct 2021 00:14:47 -0400 Received: by mail-pj1-x102a.google.com with SMTP id q2-20020a17090a2e0200b001a0fd4efd49so2155715pjd.1 for ; Thu, 14 Oct 2021 21:14:43 -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=9im4CvhbPoyQ1RG+uvEuwMG0n0qsYjZQphEGRSBJSzY=; b=EThQgfXVM3+gTYBP9riZDdoy7+261/jK33Yl47MmSU3iZ5wuNAQhHQ1LyE8ousV8iH 1AjrG+9rCqBtcryjB1w0B3O6wHWejaW2rlvS0pKjP8jr/WtTvMkugxPr3sADthjBjCls B4ylcrg9BnnlXZyZyvOQ4ZuWnlsZD866jOv1Y0T4cIjsvQqpTfDpz1WlDaN6GO1QKQTl uG+4Xh+32n+YeUZzBDfzEruvVQrqnrnCVEgay2gso4Udk86qLTQCkQj3yvbx1W5MoLbX +3ru5fDt7DSamH5Dv/fbh3xeIkL1nGYBROkdt0DdZULC1rI4TjQ67w5USrW/awd7kEHA iTsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9im4CvhbPoyQ1RG+uvEuwMG0n0qsYjZQphEGRSBJSzY=; b=JTPMjfef1fVec1BRQ+Ts+J3knvehYXY6rgpYnY1V6n47PgLlKmV5gh7ArkyaUH+E5V jqUnXv643pNih2ywG8YNmfRcovP5DcLUaPAAtU9S8dOREzLcSLPj4jZrUY4hnEqPVLzK 87XfDUwpbu185/3Yu+u5N66ERSYYtffZpLBsQ6b+k9zL9qWqH0Jn0fy7LMIRJdO5iayu be78/E/FhxBhHbQquoT4jj3egUnXAe5ryc2E1YA26r/yLTNTzp2RLiIg6S0arVZFyuVV AwcQH9uiu1N4b7lEhnpSEccaD/oNM3tzK1rHluUpKQnPe/jb2eqJbosWA0X4V+IrOa/2 lLUQ== X-Gm-Message-State: AOAM531lmD+tS54dJsEk7mmuNbydDx1TuIZyfF6YietG7oNCIMUXM/FX peWzqG7Ns3LiOkf43VTjCpbcPM1DWTrnog== X-Received: by 2002:a17:90a:1507:: with SMTP id l7mr10750149pja.141.1634271282818; Thu, 14 Oct 2021 21:14:42 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id q8sm10236885pja.52.2021.10.14.21.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 21:14:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 61/67] linux-user: Handle BUS_ADRALN in host_signal_handler Date: Thu, 14 Oct 2021 21:10:47 -0700 Message-Id: <20211015041053.2769193-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015041053.2769193-1-richard.henderson@linaro.org> References: <20211015041053.2769193-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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: alex.bennee@linaro.org, laurent@vivier.eu, imp@bsdimp.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Handle BUS_ADRALN via cpu_loop_exit_sigbus, but allow other SIGBUS si_codes to continue into the host-to-guest signal coversion code. Signed-off-by: Richard Henderson --- linux-user/signal.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/linux-user/signal.c b/linux-user/signal.c index df2c8678d0..81c45bfce9 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -860,6 +860,9 @@ static void host_signal_handler(int host_sig, siginfo_t *info, void *puc) cpu_loop_exit_sigsegv(cpu, guest_addr, access_type, maperr, pc); } else { sigprocmask(SIG_SETMASK, &uc->uc_sigmask, NULL); + if (info->si_code == BUS_ADRALN) { + cpu_loop_exit_sigbus(cpu, guest_addr, access_type, pc); + } } sync_sig = true;