From patchwork Wed Mar 31 09:44:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xiaofei Tan X-Patchwork-Id: 12174959 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=-16.8 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,USER_AGENT_GIT 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 153E9C433C1 for ; Wed, 31 Mar 2021 09:52:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 9F51D61962 for ; Wed, 31 Mar 2021 09:52:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F51D61962 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=3eKKRo4JvuOiuKMlaOkQcZA0d0bcyJxEKdOC/DOUTMo=; b=Krm+ZrbrGYpDeC7mDu68AWM5+k FvVKs4Gz2WiV9qWc8wONrJF+4ywf6LK3HBqWbMbWxvPEFzXEBUjT+kOglJybUafvT9Q84T2wfiwSu su51HOXbiYL/Giu0GP0fxfY3dG5CGlwnVBZtMHlYe9vnt5z+xoapsPEtvUsQzcp99pFGQLArmu4wP fmA3hDSb/yQa5ICLf6g+em2OolZum6QAnpsU0QOkg1EECZAyfEHppdSce1o8kyOtjgpjTeeKilASX txFUDCR+zlzXvSytiJIluxwrpZBZOlLFpsW3J0sncdy9G2HEuMBaprW5w/7ipbwflEDBWrYGHQ2qb +fKDkvQQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRXTb-006CAx-WD; Wed, 31 Mar 2021 09:49:28 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRXRo-006C69-SR for linux-arm-kernel@lists.infradead.org; Wed, 31 Mar 2021 09:47:44 +0000 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F9Lyn47SwzyNCy; Wed, 31 Mar 2021 17:45:21 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Wed, 31 Mar 2021 17:47:15 +0800 From: Xiaofei Tan To: , , , , , CC: Xiaofei Tan , , , Subject: [PATCH RFC for-next 1/1] arm64: sve: Fix some compile errors about sve_cond_update_zcr_vq Date: Wed, 31 Mar 2021 17:44:39 +0800 Message-ID: <1617183879-48748-1-git-send-email-tanxiaofei@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210331_104739_742488_F87012C0 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are some compile errors of ARM64 KVM when ARM64_SVE is not selected, in the locations of sve_cond_update_zcr_vq used. One error log is as following: CC arch/arm64/kvm/sys_regs.o In file included from arch/arm64/kvm/hyp/vhe/switch.c:8:0: ./arch/arm64/kvm/hyp/include/hyp/switch.h: In function ‘__hyp_sve_restore_guest’: ./arch/arm64/kvm/hyp/include/hyp/switch.h:220:2: error: implicit declaration of function ‘sve_cond_update_zcr_vq’; did you mean ‘kvm_pmu_update_run’? [-Werror=implicit-function-declaration] sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2); ^~~~~~~~~~~~~~~~~~~~~~ kvm_pmu_update_run The root cause is that sve_cond_update_zcr_vq is not defined when ARM64_SVE is not selected. Fix it by adding an empty definition when CONFIG_ARM64_SVE=n. Signed-off-by: Xiaofei Tan --- arch/arm64/include/asm/fpsimd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index 05c9c55..3f93b63 100644 --- a/arch/arm64/include/asm/fpsimd.h +++ b/arch/arm64/include/asm/fpsimd.h @@ -168,6 +168,8 @@ static inline int sve_get_current_vl(void) static inline void sve_user_disable(void) { BUILD_BUG(); } static inline void sve_user_enable(void) { BUILD_BUG(); } +#define sve_cond_update_zcr_vq(val, reg) + static inline void sve_init_vq_map(void) { } static inline void sve_update_vq_map(void) { } static inline int sve_verify_vq_map(void) { return 0; }