tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git uaccess.powerpc head: 49e54b17130e74849b76d10c240f2d7c9b4736bc commit: 49e54b17130e74849b76d10c240f2d7c9b4736bc [11/11] powerpc: get rid of zeroing, switch to RAW_COPY_USER config: powerpc-allmodconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 49e54b17130e74849b76d10c240f2d7c9b4736bc # save the attached .config to linux build tree make.cross ARCH=powerpc All warnings (new ones prefixed by >>): arch/powerpc/kvm/book3s_pr_papr.c: In function 'kvmppc_h_pr_enter': >> arch/powerpc/kvm/book3s_pr_papr.c:53:2: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result] copy_from_user(pteg, (void __user *)pteg_addr, sizeof(pteg)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> arch/powerpc/kvm/book3s_pr_papr.c:74:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result] copy_to_user((void __user *)pteg_addr, hpte, HPTE_SIZE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/kvm/book3s_pr_papr.c: In function 'kvmppc_h_pr_remove': arch/powerpc/kvm/book3s_pr_papr.c:96:2: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result] copy_from_user(pte, (void __user *)pteg, sizeof(pte)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/kvm/book3s_pr_papr.c:106:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result] copy_to_user((void __user *)pteg, &v, sizeof(v)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/kvm/book3s_pr_papr.c: In function 'kvmppc_h_pr_protect': arch/powerpc/kvm/book3s_pr_papr.c:214:2: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result] copy_from_user(pte, (void __user *)pteg, sizeof(pte)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/kvm/book3s_pr_papr.c:237:2: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result] copy_to_user((void __user *)pteg, pte, sizeof(pte)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/kvm/book3s_pr_papr.c: In function 'kvmppc_h_pr_bulk_remove': arch/powerpc/kvm/book3s_pr_papr.c:174:3: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Wunused-result] copy_from_user(pte, (void __user *)pteg, sizeof(pte)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/kvm/book3s_pr_papr.c:187:4: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result] copy_to_user((void __user *)pteg, &v, sizeof(v)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/copy_from_user +53 arch/powerpc/kvm/book3s_pr_papr.c 0254f0742 Alexander Graf 2011-08-08 47 5cd92a952 Paul Mackerras 2013-09-20 48 i = pte_index & 7; 0254f0742 Alexander Graf 2011-08-08 49 pte_index &= ~7UL; 0254f0742 Alexander Graf 2011-08-08 50 pteg_addr = get_pteg_addr(vcpu, pte_index); 0254f0742 Alexander Graf 2011-08-08 51 9308ab8e2 Paul Mackerras 2013-09-20 52 mutex_lock(&vcpu->kvm->arch.hpt_mutex); 0254f0742 Alexander Graf 2011-08-08 @53 copy_from_user(pteg, (void __user *)pteg_addr, sizeof(pteg)); 0254f0742 Alexander Graf 2011-08-08 54 hpte = pteg; 0254f0742 Alexander Graf 2011-08-08 55 5cd92a952 Paul Mackerras 2013-09-20 56 ret = H_PTEG_FULL; 0254f0742 Alexander Graf 2011-08-08 57 if (likely((flags & H_EXACT) == 0)) { 0254f0742 Alexander Graf 2011-08-08 58 for (i = 0; ; ++i) { 0254f0742 Alexander Graf 2011-08-08 59 if (i == 8) 5cd92a952 Paul Mackerras 2013-09-20 60 goto done; 1692aa3fa Alexander Graf 2014-04-24 61 if ((be64_to_cpu(*hpte) & HPTE_V_VALID) == 0) 0254f0742 Alexander Graf 2011-08-08 62 break; 0254f0742 Alexander Graf 2011-08-08 63 hpte += 2; 0254f0742 Alexander Graf 2011-08-08 64 } 0254f0742 Alexander Graf 2011-08-08 65 } else { 0254f0742 Alexander Graf 2011-08-08 66 hpte += i * 2; 5cd92a952 Paul Mackerras 2013-09-20 67 if (*hpte & HPTE_V_VALID) 5cd92a952 Paul Mackerras 2013-09-20 68 goto done; 0254f0742 Alexander Graf 2011-08-08 69 } 0254f0742 Alexander Graf 2011-08-08 70 1692aa3fa Alexander Graf 2014-04-24 71 hpte[0] = cpu_to_be64(kvmppc_get_gpr(vcpu, 6)); 1692aa3fa Alexander Graf 2014-04-24 72 hpte[1] = cpu_to_be64(kvmppc_get_gpr(vcpu, 7)); 5cd92a952 Paul Mackerras 2013-09-20 73 pteg_addr += i * HPTE_SIZE; 5cd92a952 Paul Mackerras 2013-09-20 @74 copy_to_user((void __user *)pteg_addr, hpte, HPTE_SIZE); 0254f0742 Alexander Graf 2011-08-08 75 kvmppc_set_gpr(vcpu, 4, pte_index | i); 5cd92a952 Paul Mackerras 2013-09-20 76 ret = H_SUCCESS; 5cd92a952 Paul Mackerras 2013-09-20 77 :::::: The code at line 53 was first introduced by commit :::::: 0254f0742998dc61fcf68a3488e2d93636031263 KVM: PPC: Add PAPR hypercall code for PR mode :::::: TO: Alexander Graf <agraf@xxxxxxx> :::::: CC: Avi Kivity <avi@xxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip