Re: [PATCH 2/2] KVM: do not assume PTE is writable after follow_pfn

From: kernel test robot
Date: Fri Feb 05 2021 - 12:49:29 EST


Hi Paolo,

I love your patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.11-rc6 next-20210125]
[cannot apply to kvm/linux-next hnaz-linux-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Paolo-Bonzini/KVM-do-not-assume-PTE-is-writable-after-follow_pfn/20210205-183434
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2ab38c17aac10bf55ab3efde4c4db3893d8691d2
config: i386-randconfig-a011-20210205 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/c2a981899d009fddc691f2edf5ad54e9e5a57401
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Paolo-Bonzini/KVM-do-not-assume-PTE-is-writable-after-follow_pfn/20210205-183434
git checkout c2a981899d009fddc691f2edf5ad54e9e5a57401
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from arch/x86/kvm/../../../virt/kvm/kvm_main.c:18:
arch/x86/kvm/../../../virt/kvm/kvm_main.c: In function 'hva_to_pfn_remapped':
>> include/linux/kvm_host.h:89:30: error: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '9218868437227405314' to '2' [-Werror=overflow]
89 | #define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 2)
| ^
arch/x86/kvm/../../../virt/kvm/kvm_main.c:1932:9: note: in expansion of macro 'KVM_PFN_ERR_RO_FAULT'
1932 | pfn = KVM_PFN_ERR_RO_FAULT;
| ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


vim +89 include/linux/kvm_host.h

9c5b11728344e1 Xiao Guangrong 2012-08-03 86
9c5b11728344e1 Xiao Guangrong 2012-08-03 87 #define KVM_PFN_ERR_FAULT (KVM_PFN_ERR_MASK)
9c5b11728344e1 Xiao Guangrong 2012-08-03 88 #define KVM_PFN_ERR_HWPOISON (KVM_PFN_ERR_MASK + 1)
81c52c56e2b435 Xiao Guangrong 2012-10-16 @89 #define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 2)
6c8ee57be9350c Xiao Guangrong 2012-08-03 90

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip