mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiaofei Tan <tanxiaofei@huawei.com>
To: <catalin.marinas@arm.com>, <will@kernel.org>,
	<julien.grall@arm.com>, <Dave.Martin@arm.com>,
	<broonie@kernel.org>, <maz@kernel.org>
Cc: Xiaofei Tan <tanxiaofei@huawei.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linuxarm@openeuler.org>
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	[thread overview]
Message-ID: <1617183879-48748-1-git-send-email-tanxiaofei@huawei.com> (raw)

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 <tanxiaofei@huawei.com>
---
 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; }
-- 
2.8.1


             reply	other threads:[~2021-03-31  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31  9:44 Xiaofei Tan [this message]
2021-03-31 10:09 ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1617183879-48748-1-git-send-email-tanxiaofei@huawei.com \
    --to=tanxiaofei@huawei.com \
    --cc=Dave.Martin@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=julien.grall@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=maz@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®