From patchwork Sat Aug 3 21:07:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 170510 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp2429458ile; Sat, 3 Aug 2019 14:08:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJn/dwGS/3MlUhjN5or1w7YucIZsLqslJlPb7BMZsHgwy0LcURCQIaabmlVgMGGBTj3GEs X-Received: by 2002:aa7:c0cf:: with SMTP id j15mr27986604edp.138.1564866513255; Sat, 03 Aug 2019 14:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564866513; cv=none; d=google.com; s=arc-20160816; b=FxyAdO7B7Y8c1v68dInz+OuaW54GyOk947udHGOUw+K2DhHdte8aCH8BltNP7Nr9iv P8WCb5x+bz/rRas/xk9d8z6SXIuXF5qKLlurwlX8gpydM5xJrBQe5Taoq1ksEmU+z2Mz 73zsGdFkOHYJHL0CTpXviQd9tzNkc1Bkb9n+uKid/BhZ226BdPEKVjlRTAqut3quHCq3 q0JF7XTZa6gAhUJRLiGJ3Q8yVmvm8q502o+lwDtWfSA9b+BOqi2g+JwTDmjq8EJXrEue Boo5yiLTQwJhbUEXFaPkiwdZ+7NczEQFH8I5kY4joCkL1amVcdH/TdjOAxvhmgOU2ID/ psAQ== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=+x0WGSWw36fXqg8sJBr/e/px4PQ5p89CEe43iMHBL7I=; b=JV+uxdZY/HvEBCGVoGQaI4tNAGKSUc0LyHzYnRi9UmDvIRcPLcnlF9yjywDBki9iFx kYyO/6ZUzPAPfSmUcSIgEQOHs/6C/KwYkWn8yTV7s7+3Xcc3lJ+gkKzIjoEtJGVTDxtw IWK1Ib0UWy4OEzzI00z8o0kqVxvEN3zLlNW/ZAMl68O3OKcNZsr4OA+ubc1MPrwFhMTq +YyOkWv1JlTaGEy0nQeUPwbVfzkBMycQQyPQ1ktFe7KB/Z5YfMlir4gC41k3tp9Pu5sZ QKSd9YeP8WyWijcJ0h3sRxuRnTh3igoVsjqcq+s8Lm/WoOiGeCIbsXF9ecEX7w2BT6g5 krAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cwcnxi5L; 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 c18si24379421ejf.196.2019.08.03.14.08.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Aug 2019 14:08:33 -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=Cwcnxi5L; 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]:41988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hu1GS-0000yl-8F for patch@linaro.org; Sat, 03 Aug 2019 17:08:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51917) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hu1GC-0000xW-9Y for qemu-devel@nongnu.org; Sat, 03 Aug 2019 17:08:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hu1G6-0005Mk-5H for qemu-devel@nongnu.org; Sat, 03 Aug 2019 17:08:12 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:45611) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hu1G5-0005Ly-J7 for qemu-devel@nongnu.org; Sat, 03 Aug 2019 17:08:10 -0400 Received: by mail-pf1-x443.google.com with SMTP id r1so37694468pfq.12 for ; Sat, 03 Aug 2019 14:08:09 -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; bh=+x0WGSWw36fXqg8sJBr/e/px4PQ5p89CEe43iMHBL7I=; b=Cwcnxi5Ll9OoC5PykIu9TfQLHldwMsAvoEc5GYdHrv0oEpkGdUvSWDZOHssZzXVhSA ZwhC9Gh7AdPJde9++OK0GnIhE3yzaWgrAI7Z/Re9IIvsMm8PwOIpoO9qBU8sSy4S0nMS 4jPbOD05A/lQ116UAkRA1qAe042pCBEOa9ey7y8RWftADpaZ+XcVZqCVXeKbsIEcfUib lsZv8Itprsc/qgMfYyBtYJmWuS9G9zMCLYm+f5GdXhfnNlRFsYX50Ok+lxHfjdZaL2Yg GvvXTJ+6V3nBSG29NGko2nj08Yn7bI6B7mGob9evEDVkRrrHMkUCEsNRR7JaB9ESvqNL CSwA== 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; bh=+x0WGSWw36fXqg8sJBr/e/px4PQ5p89CEe43iMHBL7I=; b=b5k+UQBZt3ZlFMkyN5ROThO7Hqia2fzRDDkpx64yBHhIT35S9Medb85Zfc/rfQE12J qmSBX9vhvB4F2NV3VGeCWvKhyR8E0l4fe4s+f7Vc94DxLaN4QiBkkIVRT5/S/DEhBu2k S9LtZe4HxLWc5+uMbKstYD11/WoY29rji7u/3vdLR2TplNC4Ez8GUxspbEUqP/HL+q23 kI6zZIbgkDacBrlgWu73vFpY83YNn8SIOWidq00irTVQDd7JbXMVTPA8UWX7WYjFtB4c chGH7ahme/yXKd/G7HTneSDZvx+h9l5pCaku6x/mMuH3fAZAddbi+wQAhIj0t3/RkBbq 2ZNQ== X-Gm-Message-State: APjAAAVm1ARYbmRStOUaWIAq2FeBgrWNuwVB4gD8jkOmcNajN81tXHfd bmwpNM74kk5G79EGS2rqYTSWF/MDdqA= X-Received: by 2002:a17:90a:5884:: with SMTP id j4mr11266253pji.142.1564866488176; Sat, 03 Aug 2019 14:08:08 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id x25sm110129644pfa.90.2019.08.03.14.08.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 03 Aug 2019 14:08:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 3 Aug 2019 14:07:58 -0700 Message-Id: <20190803210803.5701-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190803210803.5701-1-richard.henderson@linaro.org> References: <20190803210803.5701-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 Subject: [Qemu-devel] [PATCH v7 1/6] linux-user/aarch64: Reset btype for signals 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, qemu-arm@nongnu.org, alex.bennee@linaro.org, Dave.Martin@arm.com 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.17.1 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);