]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Fix compile error due to sign extension
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 10 Aug 2022 01:34:35 +0000 (09:34 +0800)
committerMarc Zyngier <maz@kernel.org>
Wed, 10 Aug 2022 08:49:16 +0000 (09:49 +0100)
commite5d5695edd38682d8a9a215fe8b2747c75ae9a46
tree994438679afb5430d009248512381ed533934c50
parenta7dc1acd1e53a0952f9f564d4c505410f9136f46
KVM: arm64: Fix compile error due to sign extension

Use GENMASK() to generate the masks of device type and device id,
fixing compilation errors due to the sign extension when using
older versions of GCC (such as is 7.5):

In function ‘kvm_vm_ioctl_set_device_addr.isra.38’,
    inlined from ‘kvm_arch_vm_ioctl’ at arch/arm64/kvm/arm.c:1454:10:
././include/linux/compiler_types.h:354:38: error: call to ‘__compiletime_assert_599’ \
declared with attribute error: FIELD_GET: mask is not constant
  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)

Fixes: 79a554f98d20 ("KVM: arm64: vgic-v2: Add helper for legacy dist/cpuif base address setting")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
[maz: tidy up commit message]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220810013435.1525363-1-yangyingliang@huawei.com
arch/arm64/include/uapi/asm/kvm.h