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=-10.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 26540C63777 for ; Thu, 3 Dec 2020 13:27:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A51FB24133 for ; Thu, 3 Dec 2020 13:27:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A51FB24133 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UqrPxHd3vwmH66LCqMuvMkL63LCpHs4xA4VdlEYAF7E=; b=u4q6l299WwSkkq2dLAaqa4sh+ gm/mIgMdheeeUMqni2eGkdLUddB5mK78XLNsRmnNm54cyRFcFyWOJftVVggsYCQ+gp06EQWaZDsIy HPmho4TWKzg9+K0AlZnFnGr6bXG3Ck28uD0C0/nPyeioicIfODSp+H941zVaDFDi3MccB+r0yhddH PM+h+THZLWCRL5zNSXKxK+wdwOjunyOyKXwt1t4QPh9bkgcxal1QtGV6ZK5jM4/xdMY/zEHlKr98f o+TATUR3S/VgGPm0usiSPOTp93eeHxqxjSZiHnRCqBfAvjAFY5MTcpdvJAnz+JQGlAx793QA8Jcij WD/eIMf2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkocw-00011J-8n; Thu, 03 Dec 2020 13:26:30 +0000 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkocO-0000rf-Vm for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2020 13:26:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607001955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T24Ceqsd/9pA7xXQ7KEXVSVXVYUo8wsH3lxm9+wAf3c=; b=CyKxOVcfTYooKwYXGQY6Y+jXXLFtqcN+uTlPGVYT+//sw2PASLIwdPkfb1Uww355Vk7YJ1 g/GppDGuvjE5Rj7MaG6OD2YsCkzYh8zJd0EbzZUm3mkR6prH+8uvVmwFvwvvPVOTVgAXJy PazINYuyWPzbWH35RpcgSvhBz1gX6zY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-516-EBHAz-C-OEei9sSj8v40xg-1; Thu, 03 Dec 2020 08:25:51 -0500 X-MC-Unique: EBHAz-C-OEei9sSj8v40xg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A211781460C; Thu, 3 Dec 2020 13:25:49 +0000 (UTC) Received: from ovpn-66-132.rdu2.redhat.com (unknown [10.10.67.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35E33282C6; Thu, 3 Dec 2020 13:25:47 +0000 (UTC) Message-ID: Subject: Re: [PATCHv5 11/12] arm64: uaccess: remove redundant PAN toggling From: Qian Cai To: Mark Rutland , linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com Date: Thu, 03 Dec 2020 08:25:47 -0500 In-Reply-To: <20201202131558.39270-12-mark.rutland@arm.com> References: <20201202131558.39270-1-mark.rutland@arm.com> <20201202131558.39270-12-mark.rutland@arm.com> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=qcai@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201203_082557_158405_A1836F1C X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: james.morse@arm.com, robin.murphy@arm.com, hch@lst.de, will@kernel.org 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 Wed, 2020-12-02 at 13:15 +0000, Mark Rutland wrote: > Some code (e.g. futex) needs to make privileged accesses to userspace > memory, and uses uaccess_{enable,disable}_privileged() in order to > permit this. All other uaccess primitives use LDTR/STTR, and never need > to toggle PAN. > > Remove the redundant PAN toggling. [] > -static bool __maybe_unused > -cpufeature_pan_not_uao(const struct arm64_cpu_capabilities *entry, int __unused) > -{ > - return (__system_matches_cap(ARM64_HAS_PAN) && > !__system_matches_cap(ARM64_HAS_UAO)); > -} With CONFIG_ARM64_PTR_AUTH=n, we now have, arch/arm64/kernel/cpufeature.c:2649:13: warning: '__system_matches_cap' defined but not used [-Wunused-function] static bool __system_matches_cap(unsigned int n) ^~~~~~~~~~~~~~~~~~~~ Probably just need to transfer __maybe_unused to __system_matches_cap(). diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 6bdb03400581..d4e4d9d388b0 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2646,7 +2646,7 @@ bool this_cpu_has_cap(unsigned int n) * - The SYSTEM_FEATURE cpu_hwcaps may not have been set. * In all other cases cpus_have_{const_}cap() should be used. */ -static bool __system_matches_cap(unsigned int n) +static bool __maybe_unused __system_matches_cap(unsigned int n) { if (n < ARM64_NCAPS) { const struct arm64_cpu_capabilities *cap = cpu_hwcaps_ptrs[n]; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel