From patchwork Wed May 20 17:27:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186996 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp818176ilb; Wed, 20 May 2020 10:29:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9AWck6dhReBZ8ns66dx18XNhznWkqqR9vPh1dbUt9pgkwaBROtLqPOF/Xb4wV39PqD74e X-Received: by 2002:ac8:46d5:: with SMTP id h21mr6189112qto.91.1589995767504; Wed, 20 May 2020 10:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589995767; cv=none; d=google.com; s=arc-20160816; b=G7nfDluuuBwsuE+/zIJK2HRjKXPOUCQmYDqh3XmpsLhP7YIh7pyKQnPSwyOFgcAeoS nS9Vw0eCm2W7FF65Kaea70ZYfcJ/ewI2ORKsj4umOxzo0xdwVwHFWHA/pqphZ92PThkh /CjnHXtl0QA5cqJkYjaKH64prvWLcHwZjKKHxfDNWSCvb8kb2pUpnymDx96FSAzLlXKB nJ5eV8xm9lGQ01vT6Kg5jW/+wG/T+tUfq1Je4oISv1aCo3Lebeu6ZKUarCXfhf6rExcX GmAXgfM73drn2zLHoe+fWBzcGvcGP5KBYfp0te+fTjwdUeee72DOBnSkcuI5gntKmYr1 o5oA== 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=btSVOHjKygqtDtrb1dFrs4ZFhT9VU5bMtTLVHWgmpDQ=; b=qpwBJXPBSUiRyWpl7LSlB7AP/kQooagISh32i7VCmZzKIaZWQF62It1+UxX4mwQ4f6 pmzZivTJrzzhoiucfTBRf+F8hheiaIyI/2Sfj+AKwcKDxMxYN+08tR+GsxDEy5wSt357 7B3HEHzuhP10lJSwI5pEOLpUvxloAkS7plRVD08uPHVdqOqGRYRcGBgd/ICQ4NVX1RiI jsosnSBBJ9Vbu1OmT1Z8H42ociRg/PyBpxzoMmYYovBZaHNlnSbfwjnQfX5ExT6mbBax Yj2hQ5opk8SwtrYBNdYtCarGvP93UJhVudtX4KH2KHieuztuiCq6VOfe2kFJXwMmLNsM nrJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IEexihwJ; 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 i2si1836726qvo.44.2020.05.20.10.29.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 May 2020 10:29:27 -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=IEexihwJ; 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]:36838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbSX1-0002z3-06 for patch@linaro.org; Wed, 20 May 2020 13:29:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbSVl-0001mD-EY for qemu-devel@nongnu.org; Wed, 20 May 2020 13:28:09 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:44386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbSVj-0004JB-Gq for qemu-devel@nongnu.org; Wed, 20 May 2020 13:28:09 -0400 Received: by mail-pf1-x444.google.com with SMTP id x13so1880900pfn.11 for ; Wed, 20 May 2020 10:28:04 -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=btSVOHjKygqtDtrb1dFrs4ZFhT9VU5bMtTLVHWgmpDQ=; b=IEexihwJhok6sSzixqByIreJXkjn5IhkGZ88k+gM3aw2vVfJKUyExUVNx6v1VW5WM0 nLtYfm1S4DtjJNX6SdfyI8B+6j88A5yR6JDlDxSdGe8iN47zv5K6mU6JPhxwF8YTcz1n oSkbiYceIvrfbUHWzBRQU2ecQxjez3VnSFPhVMXg1/PBuctO5egGfF+r27MSflCm5l+d Bv7gS1RgWLhSr8BdtSGr2fSVxDAoCNxPca9fjhaKKydJG3gewT601AJKgFZfYjh4afVN 7lsQ9uDjLC9+lbXGBEoS1hTapWluNDP8WV6tqe9KfGGxJ1gQEMZ3xWzQhbSqD8iGbYwO pNew== 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=btSVOHjKygqtDtrb1dFrs4ZFhT9VU5bMtTLVHWgmpDQ=; b=OOdVpRcp4Hqft4O21hZuOkwc+o6EJpekqFu9U1o9idbvJ+U0jtqyOsuUasy00g1/n4 q00m4aXCTyKxhNM5rm7lp6Pv6HfWRKBlL0Kos7EnQnn6Ll4ftUBd45Q58hcDJtU3GzgT IIjz4BA+3FLyZR4GzlPBKNCOJjOtyZxbVtAhIBnOwqgulAwPrKGhrswyGukczqE6m7Xt +1QUe968G+oDHiOF++UBxBAR5RAUbMbnhkUgK46bIUYRWCHSUnVvIxGQ1p0gxSWsAo8b 71HssbvBduxVI3YtRx2e+8XvekaRZHSzW1grk7FCW7YP9pluGAKHP8ze8e5pXI9gaFh7 a2oA== X-Gm-Message-State: AOAM531zgXUOnVcasdrjEcCwOTwPvRsMxeXq+3QNVeSUt7iDtnrb4mRp FfiDfwsGs5Dr0aFzPqqNAF4SHC9bb9A= X-Received: by 2002:a62:1681:: with SMTP id 123mr164618pfw.306.1589995683431; Wed, 20 May 2020 10:28:03 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id k18sm2643672pfg.217.2020.05.20.10.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 10:28:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v9 1/5] linux-user/aarch64: Reset btype for signals Date: Wed, 20 May 2020 10:27:56 -0700 Message-Id: <20200520172800.8499-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200520172800.8499-1-richard.henderson@linaro.org> References: <20200520172800.8499-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::444; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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, alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The kernel sets btype for the signal handler as if for a call. Signed-off-by: Richard Henderson --- linux-user/aarch64/signal.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c index cd521ee42d..2c596a7088 100644 --- a/linux-user/aarch64/signal.c +++ b/linux-user/aarch64/signal.c @@ -506,10 +506,16 @@ static void target_setup_frame(int usig, struct target_sigaction *ka, + offsetof(struct target_rt_frame_record, tramp); } env->xregs[0] = usig; - env->xregs[31] = frame_addr; env->xregs[29] = frame_addr + fr_ofs; - env->pc = ka->_sa_handler; env->xregs[30] = return_addr; + env->xregs[31] = frame_addr; + env->pc = ka->_sa_handler; + + /* Invoke the signal handler as if by indirect call. */ + if (cpu_isar_feature(aa64_bti, env_archcpu(env))) { + env->btype = 2; + } + if (info) { tswap_siginfo(&frame->info, info); env->xregs[1] = frame_addr + offsetof(struct target_rt_sigframe, info);