lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202103051542.w8jxZblj-lkp@intel.com>
Date:   Fri, 5 Mar 2021 15:44:45 +0800
From:   kernel test robot <lkp@...el.com>
To:     Wang Wensheng <wangwensheng4@...wei.com>
Cc:     kbuild-all@...org, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org, Paul Mackerras <paulus@...abs.org>
Subject: arch/powerpc/kvm/book3s_hv_nested.c:218:6: error: stack frame size
 of 2176 bytes in function 'kvmhv_enter_nested_guest'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   280d542f6ffac0e6d65dc267f92191d509b13b64
commit: cf59eb13e151ef42c37ae31864046c17e481ed8f KVM: PPC: Book3S: Fix symbol undeclared warnings
date:   5 months ago
config: powerpc-randconfig-r006-20210305 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 4d90e460bcc7b3e5ff6c7e2e05e974772489c4b8)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cf59eb13e151ef42c37ae31864046c17e481ed8f
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout cf59eb13e151ef42c37ae31864046c17e481ed8f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

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

All errors (new ones prefixed by >>):

>> arch/powerpc/kvm/book3s_hv_nested.c:218:6: error: stack frame size of 2176 bytes in function 'kvmhv_enter_nested_guest' [-Werror,-Wframe-larger-than=]
   long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
        ^
   1 error generated.


vim +/kvmhv_enter_nested_guest +218 arch/powerpc/kvm/book3s_hv_nested.c

873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14  217  
360cae313702cd Paul Mackerras       2018-10-08 @218  long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
360cae313702cd Paul Mackerras       2018-10-08  219  {
360cae313702cd Paul Mackerras       2018-10-08  220  	long int err, r;
360cae313702cd Paul Mackerras       2018-10-08  221  	struct kvm_nested_guest *l2;
360cae313702cd Paul Mackerras       2018-10-08  222  	struct pt_regs l2_regs, saved_l1_regs;
360cae313702cd Paul Mackerras       2018-10-08  223  	struct hv_guest_state l2_hv, saved_l1_hv;
360cae313702cd Paul Mackerras       2018-10-08  224  	struct kvmppc_vcore *vc = vcpu->arch.vcore;
360cae313702cd Paul Mackerras       2018-10-08  225  	u64 hv_ptr, regs_ptr;
360cae313702cd Paul Mackerras       2018-10-08  226  	u64 hdec_exp;
360cae313702cd Paul Mackerras       2018-10-08  227  	s64 delta_purr, delta_spurr, delta_ic, delta_vtb;
360cae313702cd Paul Mackerras       2018-10-08  228  	u64 mask;
360cae313702cd Paul Mackerras       2018-10-08  229  	unsigned long lpcr;
360cae313702cd Paul Mackerras       2018-10-08  230  
360cae313702cd Paul Mackerras       2018-10-08  231  	if (vcpu->kvm->arch.l1_ptcr == 0)
360cae313702cd Paul Mackerras       2018-10-08  232  		return H_NOT_AVAILABLE;
360cae313702cd Paul Mackerras       2018-10-08  233  
360cae313702cd Paul Mackerras       2018-10-08  234  	/* copy parameters in */
360cae313702cd Paul Mackerras       2018-10-08  235  	hv_ptr = kvmppc_get_gpr(vcpu, 4);
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  236  	regs_ptr = kvmppc_get_gpr(vcpu, 5);
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  237  	vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
360cae313702cd Paul Mackerras       2018-10-08  238  	err = kvm_vcpu_read_guest(vcpu, hv_ptr, &l2_hv,
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  239  				  sizeof(struct hv_guest_state)) ||
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  240  		kvm_vcpu_read_guest(vcpu, regs_ptr, &l2_regs,
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  241  				    sizeof(struct pt_regs));
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  242  	srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
360cae313702cd Paul Mackerras       2018-10-08  243  	if (err)
360cae313702cd Paul Mackerras       2018-10-08  244  		return H_PARAMETER;
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  245  
10b5022db7861a Suraj Jitindar Singh 2018-10-08  246  	if (kvmppc_need_byteswap(vcpu))
10b5022db7861a Suraj Jitindar Singh 2018-10-08  247  		byteswap_hv_regs(&l2_hv);
360cae313702cd Paul Mackerras       2018-10-08  248  	if (l2_hv.version != HV_GUEST_STATE_VERSION)
360cae313702cd Paul Mackerras       2018-10-08  249  		return H_P2;
360cae313702cd Paul Mackerras       2018-10-08  250  
10b5022db7861a Suraj Jitindar Singh 2018-10-08  251  	if (kvmppc_need_byteswap(vcpu))
10b5022db7861a Suraj Jitindar Singh 2018-10-08  252  		byteswap_pt_regs(&l2_regs);
9d0b048da788c1 Suraj Jitindar Singh 2018-10-08  253  	if (l2_hv.vcpu_token >= NR_CPUS)
9d0b048da788c1 Suraj Jitindar Singh 2018-10-08  254  		return H_PARAMETER;
9d0b048da788c1 Suraj Jitindar Singh 2018-10-08  255  
360cae313702cd Paul Mackerras       2018-10-08  256  	/* translate lpid */
360cae313702cd Paul Mackerras       2018-10-08  257  	l2 = kvmhv_get_nested(vcpu->kvm, l2_hv.lpid, true);
360cae313702cd Paul Mackerras       2018-10-08  258  	if (!l2)
360cae313702cd Paul Mackerras       2018-10-08  259  		return H_PARAMETER;
360cae313702cd Paul Mackerras       2018-10-08  260  	if (!l2->l1_gr_to_hr) {
360cae313702cd Paul Mackerras       2018-10-08  261  		mutex_lock(&l2->tlb_lock);
360cae313702cd Paul Mackerras       2018-10-08  262  		kvmhv_update_ptbl_cache(l2);
360cae313702cd Paul Mackerras       2018-10-08  263  		mutex_unlock(&l2->tlb_lock);
360cae313702cd Paul Mackerras       2018-10-08  264  	}
360cae313702cd Paul Mackerras       2018-10-08  265  
360cae313702cd Paul Mackerras       2018-10-08  266  	/* save l1 values of things */
360cae313702cd Paul Mackerras       2018-10-08  267  	vcpu->arch.regs.msr = vcpu->arch.shregs.msr;
360cae313702cd Paul Mackerras       2018-10-08  268  	saved_l1_regs = vcpu->arch.regs;
360cae313702cd Paul Mackerras       2018-10-08  269  	kvmhv_save_hv_regs(vcpu, &saved_l1_hv);
360cae313702cd Paul Mackerras       2018-10-08  270  
360cae313702cd Paul Mackerras       2018-10-08  271  	/* convert TB values/offsets to host (L0) values */
360cae313702cd Paul Mackerras       2018-10-08  272  	hdec_exp = l2_hv.hdec_expiry - vc->tb_offset;
360cae313702cd Paul Mackerras       2018-10-08  273  	vc->tb_offset += l2_hv.tb_offset;
360cae313702cd Paul Mackerras       2018-10-08  274  
360cae313702cd Paul Mackerras       2018-10-08  275  	/* set L1 state to L2 state */
360cae313702cd Paul Mackerras       2018-10-08  276  	vcpu->arch.nested = l2;
360cae313702cd Paul Mackerras       2018-10-08  277  	vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token;
360cae313702cd Paul Mackerras       2018-10-08  278  	vcpu->arch.regs = l2_regs;
360cae313702cd Paul Mackerras       2018-10-08  279  	vcpu->arch.shregs.msr = vcpu->arch.regs.msr;
360cae313702cd Paul Mackerras       2018-10-08  280  	mask = LPCR_DPFD | LPCR_ILE | LPCR_TC | LPCR_AIL | LPCR_LD |
360cae313702cd Paul Mackerras       2018-10-08  281  		LPCR_LPES | LPCR_MER;
360cae313702cd Paul Mackerras       2018-10-08  282  	lpcr = (vc->lpcr & ~mask) | (l2_hv.lpcr & mask);
73937deb4b2d7f Suraj Jitindar Singh 2018-10-08  283  	sanitise_hv_regs(vcpu, &l2_hv);
360cae313702cd Paul Mackerras       2018-10-08  284  	restore_hv_regs(vcpu, &l2_hv);
360cae313702cd Paul Mackerras       2018-10-08  285  
360cae313702cd Paul Mackerras       2018-10-08  286  	vcpu->arch.ret = RESUME_GUEST;
360cae313702cd Paul Mackerras       2018-10-08  287  	vcpu->arch.trap = 0;
360cae313702cd Paul Mackerras       2018-10-08  288  	do {
360cae313702cd Paul Mackerras       2018-10-08  289  		if (mftb() >= hdec_exp) {
360cae313702cd Paul Mackerras       2018-10-08  290  			vcpu->arch.trap = BOOK3S_INTERRUPT_HV_DECREMENTER;
360cae313702cd Paul Mackerras       2018-10-08  291  			r = RESUME_HOST;
360cae313702cd Paul Mackerras       2018-10-08  292  			break;
360cae313702cd Paul Mackerras       2018-10-08  293  		}
8c99d34578628b Tianjia Zhang        2020-04-27  294  		r = kvmhv_run_single_vcpu(vcpu, hdec_exp, lpcr);
360cae313702cd Paul Mackerras       2018-10-08  295  	} while (is_kvmppc_resume_guest(r));
360cae313702cd Paul Mackerras       2018-10-08  296  
360cae313702cd Paul Mackerras       2018-10-08  297  	/* save L2 state for return */
360cae313702cd Paul Mackerras       2018-10-08  298  	l2_regs = vcpu->arch.regs;
360cae313702cd Paul Mackerras       2018-10-08  299  	l2_regs.msr = vcpu->arch.shregs.msr;
360cae313702cd Paul Mackerras       2018-10-08  300  	delta_purr = vcpu->arch.purr - l2_hv.purr;
360cae313702cd Paul Mackerras       2018-10-08  301  	delta_spurr = vcpu->arch.spurr - l2_hv.spurr;
360cae313702cd Paul Mackerras       2018-10-08  302  	delta_ic = vcpu->arch.ic - l2_hv.ic;
360cae313702cd Paul Mackerras       2018-10-08  303  	delta_vtb = vc->vtb - l2_hv.vtb;
360cae313702cd Paul Mackerras       2018-10-08  304  	save_hv_return_state(vcpu, vcpu->arch.trap, &l2_hv);
360cae313702cd Paul Mackerras       2018-10-08  305  
360cae313702cd Paul Mackerras       2018-10-08  306  	/* restore L1 state */
360cae313702cd Paul Mackerras       2018-10-08  307  	vcpu->arch.nested = NULL;
360cae313702cd Paul Mackerras       2018-10-08  308  	vcpu->arch.regs = saved_l1_regs;
360cae313702cd Paul Mackerras       2018-10-08  309  	vcpu->arch.shregs.msr = saved_l1_regs.msr & ~MSR_TS_MASK;
360cae313702cd Paul Mackerras       2018-10-08  310  	/* set L1 MSR TS field according to L2 transaction state */
360cae313702cd Paul Mackerras       2018-10-08  311  	if (l2_regs.msr & MSR_TS_MASK)
360cae313702cd Paul Mackerras       2018-10-08  312  		vcpu->arch.shregs.msr |= MSR_TS_S;
360cae313702cd Paul Mackerras       2018-10-08  313  	vc->tb_offset = saved_l1_hv.tb_offset;
360cae313702cd Paul Mackerras       2018-10-08  314  	restore_hv_regs(vcpu, &saved_l1_hv);
360cae313702cd Paul Mackerras       2018-10-08  315  	vcpu->arch.purr += delta_purr;
360cae313702cd Paul Mackerras       2018-10-08  316  	vcpu->arch.spurr += delta_spurr;
360cae313702cd Paul Mackerras       2018-10-08  317  	vcpu->arch.ic += delta_ic;
360cae313702cd Paul Mackerras       2018-10-08  318  	vc->vtb += delta_vtb;
360cae313702cd Paul Mackerras       2018-10-08  319  
360cae313702cd Paul Mackerras       2018-10-08  320  	kvmhv_put_nested(l2);
360cae313702cd Paul Mackerras       2018-10-08  321  
360cae313702cd Paul Mackerras       2018-10-08  322  	/* copy l2_hv_state and regs back to guest */
10b5022db7861a Suraj Jitindar Singh 2018-10-08  323  	if (kvmppc_need_byteswap(vcpu)) {
10b5022db7861a Suraj Jitindar Singh 2018-10-08  324  		byteswap_hv_regs(&l2_hv);
10b5022db7861a Suraj Jitindar Singh 2018-10-08  325  		byteswap_pt_regs(&l2_regs);
10b5022db7861a Suraj Jitindar Singh 2018-10-08  326  	}
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  327  	vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
360cae313702cd Paul Mackerras       2018-10-08  328  	err = kvm_vcpu_write_guest(vcpu, hv_ptr, &l2_hv,
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  329  				   sizeof(struct hv_guest_state)) ||
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  330  		kvm_vcpu_write_guest(vcpu, regs_ptr, &l2_regs,
360cae313702cd Paul Mackerras       2018-10-08  331  				   sizeof(struct pt_regs));
1508c22f112ce1 Alexey Kardashevskiy 2020-06-09  332  	srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx);
360cae313702cd Paul Mackerras       2018-10-08  333  	if (err)
360cae313702cd Paul Mackerras       2018-10-08  334  		return H_AUTHORITY;
360cae313702cd Paul Mackerras       2018-10-08  335  
360cae313702cd Paul Mackerras       2018-10-08  336  	if (r == -EINTR)
360cae313702cd Paul Mackerras       2018-10-08  337  		return H_INTERRUPT;
360cae313702cd Paul Mackerras       2018-10-08  338  
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14  339  	if (vcpu->mmio_needed) {
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14  340  		kvmhv_nested_mmio_needed(vcpu, regs_ptr);
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14  341  		return H_TOO_HARD;
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14  342  	}
873db2cd9a6d7f Suraj Jitindar Singh 2018-12-14  343  
360cae313702cd Paul Mackerras       2018-10-08  344  	return vcpu->arch.trap;
360cae313702cd Paul Mackerras       2018-10-08  345  }
360cae313702cd Paul Mackerras       2018-10-08  346  

:::::: The code at line 218 was first introduced by commit
:::::: 360cae313702cdd0b90f82c261a8302fecef030a KVM: PPC: Book3S HV: Nested guest entry via hypercall

:::::: TO: Paul Mackerras <paulus@...abs.org>
:::::: CC: Michael Ellerman <mpe@...erman.id.au>

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

Download attachment ".config.gz" of type "application/gzip" (28441 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ