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=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 636BCC47082 for ; Tue, 8 Jun 2021 16:36:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2DFCE6054E for ; Tue, 8 Jun 2021 16:36:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DFCE6054E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5l2wvKuBo+nA6i3nauF6ftZlSmMhJimli6JAN3Fg13Q=; b=wZwPy0NVN1m7zs IWMnEcDoKo/UGILtTIqkmlykqxhQlSnguTvme6OBPdK6FFAvXjgnBcG4hKRPDPzM4W2O5deQL+o0/ E9Ry31A/vT6oNVcOX/TYKVpPaT5L1G21FVyef5mig0Mc6OUIBwYPdj1E1PchjA4edVxWdpN+cleEk paKLWj8an8sa6ZsYPteX1/B8CjSc4PUY8v5zWMV2r5dLHvFfcd/3NQYCTxNFp+RAf4feFpC46M8Gm q+xFzgPjLbe+z3rdk+0uxQ5P68kxbRcw8/dt2E5fbsUpZN/Wh9BJhzQlUHau4YssikgAU553jFHiE llNLDamB0NdwWqD2QYCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqeh4-009Xpy-SK; Tue, 08 Jun 2021 16:35:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqegy-009XpA-Eh for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 16:35:05 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3361461184; Tue, 8 Jun 2021 16:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623170104; bh=3bMrpS4QSOB4wJ5JdlFOZr4ro0121iGYB5hfB0uFStA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sA5vfwW0greccJ9QHWBCtD9OxalIuHXGM6HU+MU+1jLw/+BaWd62w6bwV9frksCJP Ftq2aQ5xMHydoYsfOmsk282d3+PuzGA12ceShRqO8in2MB2pXYc5D1riZD7t7sGQLE eSFlcGogfNvWGHsYRuJN9pFnmAzYPsCW7XvU6UlsFQugV7NMj8/OrJvdItJRdeLbKG f4027GMjeocz6DtAh1WkkQtQzrasJbQYB1lkXwfipn02afXTYhaPxZcPHAd0BjwwJG LxSDxzslBMFFLI0ytBxew1cJp4nWoK+/LQMeJORGTHmqFD+mH3jaHD2ei0HpalnOkO P8Z1AVOWG6NJw== Date: Tue, 8 Jun 2021 17:34:59 +0100 From: Will Deacon To: Catalin Marinas Cc: Rob Herring , linux-arm-kernel@lists.infradead.org, Raphael Gault Subject: Re: [PATCH v2] arm64: Restrict undef hook for cpufeature registers Message-ID: <20210608163459.GA10994@willie-the-truck> References: <20210517180256.2881891-1-robh@kernel.org> <20210608152042.GG17957@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210608152042.GG17957@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210608_093504_556513_3EA6134B X-CRM114-Status: GOOD ( 23.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 08, 2021 at 04:20:43PM +0100, Catalin Marinas wrote: > On Mon, May 17, 2021 at 01:02:56PM -0500, Rob Herring wrote: > > From: Raphael Gault > > > > This commit modifies the mask of the mrs_hook declared in > > arch/arm64/kernel/cpufeatures.c which emulates only feature register > > access. This is necessary because this hook's mask was too large and > > thus masking any mrs instruction, even if not related to the emulated > > registers which made the pmu emulation inefficient. > > > > Signed-off-by: Raphael Gault > > Signed-off-by: Rob Herring > > --- > > I don't *think* I'm going to need this for the perf userspace counter > > access, but this patch stands on its own as the PMU registers are not > > emulated. So please apply it. > > > > v2: > > - Fix warning for set but unused sys_reg > > --- > > arch/arm64/kernel/cpufeature.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > > index efed2830d141..c773f7c3c007 100644 > > --- a/arch/arm64/kernel/cpufeature.c > > +++ b/arch/arm64/kernel/cpufeature.c > > @@ -2905,8 +2905,8 @@ static int emulate_mrs(struct pt_regs *regs, u32 insn) > > } > > > > static struct undef_hook mrs_hook = { > > - .instr_mask = 0xfff00000, > > - .instr_val = 0xd5300000, > > + .instr_mask = 0xffff0000, > > + .instr_val = 0xd5380000, > > Acked-by: Catalin Marinas > > and changing Will's email address. Should we update is_emulated() at the same time, or at least try to generate the instr_val value here using the same constants? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel