CC: [email protected] CC: [email protected] TO: Thomas Gleixner <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/fpu-kvm head: e16d6eec3c9e60abfb29d0d77f08411d326142dd commit: 8a4ae8c80ec211646b5824b7c89d64cf7d286625 [1/6] x86/fpu: Extend fpu_xstate_prctl() with guest permissions :::::: branch date: 14 hours ago :::::: commit date: 14 hours ago config: x86_64-randconfig-m001-20211214 (https://download.01.org/0day-ci/archive/20211215/[email protected]/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> New smatch warnings: arch/x86/kernel/fpu/xstate.c:1637 __xstate_request_perm() error: uninitialized symbol 'ret'. Old smatch warnings: arch/x86/kernel/fpu/xstate.c:375 os_xrstor_booting() warn: mask and shift to zero vim +/ret +1637 arch/x86/kernel/fpu/xstate.c db8268df0983adc Chang S. Bae 2021-10-21 1597 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1598 static int __xstate_request_perm(u64 permitted, u64 requested, bool guest) db8268df0983adc Chang S. Bae 2021-10-21 1599 { db8268df0983adc Chang S. Bae 2021-10-21 1600 /* db8268df0983adc Chang S. Bae 2021-10-21 1601 * This deliberately does not exclude !XSAVES as we still might db8268df0983adc Chang S. Bae 2021-10-21 1602 * decide to optionally context switch XCR0 or talk the silicon 500afbf645a040a Chang S. Bae 2021-10-21 1603 * vendors into extending XFD for the pre AMX states, especially 500afbf645a040a Chang S. Bae 2021-10-21 1604 * AVX512. db8268df0983adc Chang S. Bae 2021-10-21 1605 */ db8268df0983adc Chang S. Bae 2021-10-21 1606 bool compacted = cpu_feature_enabled(X86_FEATURE_XSAVES); db8268df0983adc Chang S. Bae 2021-10-21 1607 struct fpu *fpu = ¤t->group_leader->thread.fpu; 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1608 struct fpu_state_perm *perm; db8268df0983adc Chang S. Bae 2021-10-21 1609 unsigned int ksize, usize; db8268df0983adc Chang S. Bae 2021-10-21 1610 u64 mask; db8268df0983adc Chang S. Bae 2021-10-21 1611 int ret; db8268df0983adc Chang S. Bae 2021-10-21 1612 db8268df0983adc Chang S. Bae 2021-10-21 1613 /* Check whether fully enabled */ db8268df0983adc Chang S. Bae 2021-10-21 1614 if ((permitted & requested) == requested) db8268df0983adc Chang S. Bae 2021-10-21 1615 return 0; db8268df0983adc Chang S. Bae 2021-10-21 1616 db8268df0983adc Chang S. Bae 2021-10-21 1617 /* Calculate the resulting kernel state size */ db8268df0983adc Chang S. Bae 2021-10-21 1618 mask = permitted | requested; db8268df0983adc Chang S. Bae 2021-10-21 1619 ksize = xstate_calculate_size(mask, compacted); db8268df0983adc Chang S. Bae 2021-10-21 1620 db8268df0983adc Chang S. Bae 2021-10-21 1621 /* Calculate the resulting user state size */ db8268df0983adc Chang S. Bae 2021-10-21 1622 mask &= XFEATURE_MASK_USER_SUPPORTED; db8268df0983adc Chang S. Bae 2021-10-21 1623 usize = xstate_calculate_size(mask, false); db8268df0983adc Chang S. Bae 2021-10-21 1624 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1625 if (!guest) { db8268df0983adc Chang S. Bae 2021-10-21 1626 ret = validate_sigaltstack(usize); db8268df0983adc Chang S. Bae 2021-10-21 1627 if (ret) db8268df0983adc Chang S. Bae 2021-10-21 1628 return ret; 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1629 } db8268df0983adc Chang S. Bae 2021-10-21 1630 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1631 perm = guest ? &fpu->guest_perm : &fpu->perm; db8268df0983adc Chang S. Bae 2021-10-21 1632 /* Pairs with the READ_ONCE() in xstate_get_group_perm() */ 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1633 WRITE_ONCE(perm->__state_perm, requested); db8268df0983adc Chang S. Bae 2021-10-21 1634 /* Protected by sighand lock */ 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1635 perm->__state_size = ksize; 8a4ae8c80ec2116 Thomas Gleixner 2021-12-07 1636 perm->__user_state_size = usize; db8268df0983adc Chang S. Bae 2021-10-21 @1637 return ret; db8268df0983adc Chang S. Bae 2021-10-21 1638 } db8268df0983adc Chang S. Bae 2021-10-21 1639 :::::: The code at line 1637 was first introduced by commit :::::: db8268df0983adc2bb1fb48c9e5f7bfbb5f617f3 x86/arch_prctl: Add controls for dynamic XSTATE components :::::: TO: Chang S. Bae <[email protected]> :::::: CC: Borislav Petkov <[email protected]> --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/[email protected] _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
