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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 CE8DAC4743D for ; Tue, 8 Jun 2021 15:22:20 +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 9A9DD61108 for ; Tue, 8 Jun 2021 15:22:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A9DD61108 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=aCuBWME3GzP913DP5ERCN1/fa0BTuNQh4qvxAfZzwNE=; b=K4pPNXLPs/YE/H w/tKnTAYgpTQXNYAjeCDUx+jW9Ks6FVp0Rc+sDyC7dYqkD+wMGgY3LDlHVv3YzBPDcHKGYgkfhJEq MHUqIac07c9+eHwQrWM+fNyaao3tpHfycs/jCWPAUskWxxGbgLswCs+bhg/I4uFOCNag71wCIb06Z gz1I9fHqONA15BlvrgGVygmNVlmAAvEp4uZNvOa5fFtkLyBhdtJAgV9n83QgQKpGGqG7zmCDac5io mWoV8wQdMYLDdFEgg43ubhuyK3Njd9nV54t6Kq5DZKEngdqx55G7kD4zLGhyI5Y73Vrxzpb5weSLq xKgyK1Z3en/Fdy16Taag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqdX9-0099zj-1x; Tue, 08 Jun 2021 15:20:51 +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 1lqdX4-0099yf-Jr for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 15:20:47 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8CAA261246; Tue, 8 Jun 2021 15:20:45 +0000 (UTC) Date: Tue, 8 Jun 2021 16:20:43 +0100 From: Catalin Marinas To: Rob Herring Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, Raphael Gault Subject: Re: [PATCH v2] arm64: Restrict undef hook for cpufeature registers Message-ID: <20210608152042.GG17957@arm.com> References: <20210517180256.2881891-1-robh@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210517180256.2881891-1-robh@kernel.org> 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_082046_705706_762719D9 X-CRM114-Status: GOOD ( 19.32 ) 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 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. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel