From nobody Tue Feb 10 03:39:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547123211090809.6460949611815; Thu, 10 Jan 2019 04:26:51 -0800 (PST) Received: from localhost ([127.0.0.1]:58335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghZQ9-00035E-P2 for importer@patchew.org; Thu, 10 Jan 2019 07:26:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghZI2-0004nh-3S for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:18:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghZHu-0007nY-I2 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:18:22 -0500 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:38951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghZHo-0007kU-6W for qemu-devel@nongnu.org; Thu, 10 Jan 2019 07:18:13 -0500 Received: by mail-pl1-x641.google.com with SMTP id 101so5114634pld.6 for ; Thu, 10 Jan 2019 04:18:09 -0800 (PST) Received: from cloudburst.twiddle.net (c220-239-117-135.belrs4.nsw.optusnet.com.au. [220.239.117.135]) by smtp.gmail.com with ESMTPSA id h74sm140934699pfd.35.2019.01.10.04.18.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 04:18:08 -0800 (PST) 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=p2TU+6xewpFPfZjXVs3cgyi3ohvpda2DuzV/stCY8oE=; b=AJuLh51mCjv+PuR7LJlWLy0+bBdGQxM2YHVFZgU8IqRAy9ye5EVa2UVVT7/OQnnMlZ JIajoHJVxnWpRvchgc2UYuoVn4+TQecYAZ7ltNTJogNVDA/rpZTnzm9tt8gAh9Sm3c8l w3pYWSdzUSO25Vr66BKyqwPHBEUA5YJJRW59s= 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=p2TU+6xewpFPfZjXVs3cgyi3ohvpda2DuzV/stCY8oE=; b=LeFGlfl9i0qjXJ73bVbDP9GSDxmwFE0eK7yhT+he+kG314GNjq7FJw5Yc/IFYXoF0T 89vIGF/yoTgO0C4gv4Dm1KJ8bBLUEiwazqbGY3+pbfxchrfnjaHUNHWwghKFBX4bJLY+ AYUPeoTtxrqa00WkSq0xY/P7cvSHesrcWh4L/2Ml85Rtj5C6B9kyQN/8sQxPjUnkXuZA YamXgchPgN0Ay/mkIcwqMuEDDMCDzXRBHEx0VepAZHxj3D9uckxAa6KmXeWiAb0kjw1V myqPxDuK8F/8kJ4P3QwWzbxWfC7R8D3UCr85EWNzQAAlBTyCrch19n3DCM6T+azlKBgy BCkA== X-Gm-Message-State: AJcUukftJz2TDyrAPDDlRgkKNV99fUAXSWot9zq+aXoHWkcbBj9KFdpy gQmGPCrluHwkxCUYk7VDL0XhKh8axAr3eg== X-Google-Smtp-Source: ALg8bN7+V7BJZ0gQIli00YoRfM6cX3fWJGBkyilbUuVYD4aWNjjV+IvOj8RX98Jr4vuK9SMYz6UDhw== X-Received: by 2002:a17:902:ba89:: with SMTP id k9mr10262428pls.189.1547122688704; Thu, 10 Jan 2019 04:18:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 23:17:35 +1100 Message-Id: <20190110121736.23448-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190110121736.23448-1-richard.henderson@linaro.org> References: <20190110121736.23448-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::641 Subject: [Qemu-devel] [PATCH 10/11] linux-user/aarch64: Reset btype for signal handlers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It does not make sense for a SIGILL handler to enter with the btype set as for the indirect branch that caused the SIGILL. Nor does it make sense to return from a handler with BTYPE set. This could be argued to be the handler's job, setting BTYPE within ucontext->uc_mcontext.pstate, but handling this here while the ABI is undiscussed. Signed-off-by: Richard Henderson --- linux-user/aarch64/signal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c index f84a9cf28a..1fb229e696 100644 --- a/linux-user/aarch64/signal.c +++ b/linux-user/aarch64/signal.c @@ -218,6 +218,8 @@ static void target_restore_general_frame(CPUARMState *e= nv, __get_user(env->pc, &sf->uc.tuc_mcontext.pc); __get_user(pstate, &sf->uc.tuc_mcontext.pstate); pstate_write(env, pstate); + /* Reset btype that might have been there going into the frame. */ + env->btype =3D 0; } =20 static void target_restore_fpsimd_record(CPUARMState *env, @@ -510,6 +512,8 @@ static void target_setup_frame(int usig, struct target_= sigaction *ka, env->xregs[29] =3D frame_addr + fr_ofs; env->pc =3D ka->_sa_handler; env->xregs[30] =3D return_addr; + /* Reset btype going into the signal handler. */ + env->btype =3D 0; if (info) { tswap_siginfo(&frame->info, info); env->xregs[1] =3D frame_addr + offsetof(struct target_rt_sigframe,= info); --=20 2.17.2