Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5026214ybl; Tue, 14 Jan 2020 02:12:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzH7uSNL/5M4kKk3PNpMGy5AV2Omd7M8TrP6Qu5CE+5AEEvFZhkauNvEaaVxAWjou177mLv X-Received: by 2002:aca:48d6:: with SMTP id v205mr15531176oia.10.1578996720119; Tue, 14 Jan 2020 02:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578996720; cv=none; d=google.com; s=arc-20160816; b=NgEpk4rkQtm5VnfFkQUvanz9Ob7HE7DaK41pI4y87BbH2LYXrehxX/gKfuCC2+RVH/ nOxkqZ6tL0fhXpdx5mv/4hCuSMHjRqhbLaHA0A86Z0SsmtJWI6uwRhfPI1XyZ8GSTBYr U+dEA9gF5LoMhNRbPdXDiFW4jfZfyfHnLwiDFAl2iiDKF+c2TkbQ8S01hxGDV1VdJYIO +aRzVWMIFSTzlOH2omMQ546Y1mrzoeK+1SAl8pObYz9VWDqbgcHMtUVucr4p/upLJCRw a2a/TF3AF+xO7w9Jg2mDjTG+F39txV6D94qC1tUecIuG8n0H8/Mo4sMTHm6+tqBoeATJ 6GYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y11pNBbz2sPKa8CgLckwNA5h3vcZJa7w404wFDjl9+U=; b=RfLUzrdmVcsVbwR3+jht5zAu9hIZ4krNmusNCBUoQBHz6lu1ZJ9mhf2vHugbCJlCie p23CzNdJ34i+89jSUR3eZUR0wiW6shE3gLYrn+XjL4blYW8PXojLAoE4UKkGs0kwrNm/ q+bBvpOQA9vdbgN1/Jvh7aAFOWPUXPGRKkFFL1pjTeRDCo7dZoTFIUPAaP54QcGi9hAn JmGrj1TDd174Tt+6jBgGDvBs8rtObWQgG5WMotWC4exZn1PRq3MaLHpiCJtui0i3Uuwr CqppGzy9UnU87dwyos3+toouCvJ4BjEHMqqj6qHfjibZkT54hjn4izQQD5/XNtzuaKp5 pEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xxFZEUsn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si9461551otf.66.2020.01.14.02.11.49; Tue, 14 Jan 2020 02:12:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xxFZEUsn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732012AbgANKK4 (ORCPT + 99 others); Tue, 14 Jan 2020 05:10:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:45202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731919AbgANKKt (ORCPT ); Tue, 14 Jan 2020 05:10:49 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B43772467A; Tue, 14 Jan 2020 10:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578996649; bh=IwlnD3gylgsFIjT/sKWm453OL+MT8zvnLChM6b2Fy0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xxFZEUsnjHXQHv87+SItqp6W/6r9guE6eq6eJ0mUsR/o8RMlaREntdiZN0yXjlGQT 9r5vEi6o/QcDDeQATyL/7dPJVCRTu68uuu4ZHP1RRcyrir90oEHY2L9Se+QHa59wND GmvuxSaSUXpkGVzlDnEGE9JCcMegnUKZYck+SWk4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Jisheng Zhang Subject: [PATCH 4.14 33/39] arm64: cpufeature: Avoid warnings due to unused symbols Date: Tue, 14 Jan 2020 11:02:07 +0100 Message-Id: <20200114094345.996008920@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200114094336.210038037@linuxfoundation.org> References: <20200114094336.210038037@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon commit 12eb369125abe92bfc55e9ce198200f5807b63ff upstream. An allnoconfig build complains about unused symbols due to functions that are called via conditional cpufeature and cpu_errata table entries. Annotate these as __maybe_unused if they are likely to be generic, or predicate their compilation on the same option as the table entry if they are specific to a given alternative. Signed-off-by: Will Deacon [Just a portion of the original patch] Signed-off-by: Jisheng Zhang Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/cpufeature.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -799,11 +799,6 @@ static bool has_no_hw_prefetch(const str MIDR_CPU_VAR_REV(1, MIDR_REVISION_MASK)); } -static bool runs_at_el2(const struct arm64_cpu_capabilities *entry, int __unused) -{ - return is_kernel_in_hyp_mode(); -} - static bool hyp_offset_low(const struct arm64_cpu_capabilities *entry, int __unused) { @@ -937,6 +932,12 @@ static int __init parse_kpti(char *str) } early_param("kpti", parse_kpti); +#ifdef CONFIG_ARM64_VHE +static bool runs_at_el2(const struct arm64_cpu_capabilities *entry, int __unused) +{ + return is_kernel_in_hyp_mode(); +} + static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused) { /* @@ -950,6 +951,7 @@ static void cpu_copy_el2regs(const struc if (!alternatives_applied) write_sysreg(read_sysreg(tpidr_el1), tpidr_el2); } +#endif #ifdef CONFIG_ARM64_SSBD static int ssbs_emulation_handler(struct pt_regs *regs, u32 instr)