CC: [email protected]
CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Juergen Gross <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   feb9c5e19e913b53cb536a7aa7c9f20107bb51ec
commit: 36c9b5929b7094ea19a78827c0ede20d2e0e6c9c xen: fix usage of pmd_populate 
in mremap for pv guests
date:   8 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 8 months ago
config: x86_64-randconfig-c007-20220509 
(https://download.01.org/0day-ci/archive/20220511/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
a385645b470e2d3a1534aae618ea56b31177639f)
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
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=36c9b5929b7094ea19a78827c0ede20d2e0e6c9c
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 36c9b5929b7094ea19a78827c0ede20d2e0e6c9c
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
                         ^       ~~~~~
   arch/x86/include/asm/xen/hypercall.h:261:9: warning: Assigned value is 
garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           return _hypercall4(int, mmu_update, req, count, success_count, 
domid);
                  ^
   arch/x86/include/asm/xen/hypercall.h:191:2: note: expanded from macro 
'_hypercall4'
           __HYPERCALL_DECLS;                                              \
           ^
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^
   arch/x86/xen/mmu_pv.c:1450:2: note: Calling '__xen_set_pte'
           __xen_set_pte(ptep, pte);
           ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/xen/mmu_pv.c:269:2: note: Taking true branch
           if (!xen_batched_set_pte(ptep, pteval)) {
           ^
   arch/x86/xen/mmu_pv.c:278:3: note: Calling 'HYPERVISOR_mmu_update'
                   HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:261:9: note: Assigned value is garbage 
or undefined
           return _hypercall4(int, mmu_update, req, count, success_count, 
domid);
                  ^
   arch/x86/include/asm/xen/hypercall.h:191:2: note: expanded from macro 
'_hypercall4'
           __HYPERCALL_DECLS;                                              \
           ^~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^                                                        ~~~~~~
   arch/x86/include/asm/xen/hypercall.h:268:9: warning: Assigned value is 
garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           return _hypercall4(int, mmuext_op, op, count, success_count, domid);
                  ^
   arch/x86/include/asm/xen/hypercall.h:191:2: note: expanded from macro 
'_hypercall4'
           __HYPERCALL_DECLS;                                              \
           ^
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^
   arch/x86/xen/mmu_pv.c:1477:2: note: Calling 'pin_pagetable_pfn'
           pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/xen/mmu_pv.c:993:6: note: Calling 'HYPERVISOR_mmuext_op'
           if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:268:9: note: Assigned value is garbage 
or undefined
           return _hypercall4(int, mmuext_op, op, count, success_count, domid);
                  ^
   arch/x86/include/asm/xen/hypercall.h:191:2: note: expanded from macro 
'_hypercall4'
           __HYPERCALL_DECLS;                                              \
           ^~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^                                                        ~~~~~~
   arch/x86/include/asm/xen/hypercall.h:334:9: warning: Assigned value is 
garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           return _hypercall2(long, memory_op, cmd, arg);
                  ^
   arch/x86/include/asm/xen/hypercall.h:169:2: note: expanded from macro 
'_hypercall2'
           __HYPERCALL_DECLS;                                              \
           ^
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^
   arch/x86/xen/mmu_pv.c:1635:6: note: Calling 'HYPERVISOR_memory_op'
           if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:334:9: note: Assigned value is garbage 
or undefined
           return _hypercall2(long, memory_op, cmd, arg);
                  ^
   arch/x86/include/asm/xen/hypercall.h:169:2: note: expanded from macro 
'_hypercall2'
           __HYPERCALL_DECLS;                                              \
           ^~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^                                                        ~~~~~~
   arch/x86/include/asm/xen/hypercall.h:348:10: warning: Assigned value is 
garbage or undefined [clang-analyzer-core.uninitialized.Assign]
                   return _hypercall3(int, update_va_mapping, va,
                          ^
   arch/x86/include/asm/xen/hypercall.h:180:2: note: expanded from macro 
'_hypercall3'
           __HYPERCALL_DECLS;                                              \
           ^
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^
   arch/x86/xen/mmu_pv.c:1628:9: note: Calling 'set_page_prot_flags'
           return set_page_prot_flags(addr, prot, UVMF_NONE);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/xen/mmu_pv.c:1623:6: note: Calling 'HYPERVISOR_update_va_mapping'
           if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, flags))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:347:2: note: Taking true branch
           if (sizeof(new_val) == sizeof(long))
           ^
   arch/x86/include/asm/xen/hypercall.h:348:10: note: Assigned value is garbage 
or undefined
                   return _hypercall3(int, update_va_mapping, va,
                          ^
   arch/x86/include/asm/xen/hypercall.h:180:2: note: expanded from macro 
'_hypercall3'
           __HYPERCALL_DECLS;                                              \
           ^~~~~~~~~~~~~~~~~
   arch/x86/include/asm/xen/hypercall.h:113:2: note: expanded from macro 
'__HYPERCALL_DECLS'
           register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
           ^                                                        ~~~~~~
>> arch/x86/xen/mmu_pv.c:1521:3: warning: Value stored to 'pinned' is never 
>> read [clang-analyzer-deadcode.DeadStores]
                   pinned = false;
                   ^        ~~~~~
   arch/x86/xen/mmu_pv.c:1521:3: note: Value stored to 'pinned' is never read
                   pinned = false;
                   ^        ~~~~~
   arch/x86/xen/mmu_pv.c:1523:4: warning: Value stored to 'pinned' is never 
read [clang-analyzer-deadcode.DeadStores]
                           pinned = PagePinned(page);
                           ^        ~~~~~~~~~~~~~~~~
   arch/x86/xen/mmu_pv.c:1523:4: note: Value stored to 'pinned' is never read
                           pinned = PagePinned(page);
                           ^        ~~~~~~~~~~~~~~~~
   Suppressed 14 warnings (3 in non-user code, 11 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   6 warnings generated.
   fs/udf/super.c:881:2: warning: Value stored to 'ts' is never read 
[clang-analyzer-deadcode.DeadStores]
           ts = &pvoldesc->recordingDateAndTime;
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/udf/super.c:881:2: note: Value stored to 'ts' is never read
           ts = &pvoldesc->recordingDateAndTime;
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/udf/super.c:1769:2: warning: Address of stack memory associated with 
local variable 'data' returned to caller 
[clang-analyzer-core.StackAddressEscape]
           return ret;
           ^
   fs/udf/super.c:1800:8: note: Calling 'udf_process_sequence'
           ret = udf_process_sequence(sb, main_s, main_e, fileset);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/udf/super.c:1679:6: note: Assuming field 'part_descs_loc' is non-null
           if (!data.part_descs_loc)
               ^~~~~~~~~~~~~~~~~~~~
   fs/udf/super.c:1679:2: note: Taking false branch
           if (!data.part_descs_loc)
           ^
   fs/udf/super.c:1686:11: note: 'done' is false
           for (; (!done && block <= lastblock); block++) {
                    ^~~~
   fs/udf/super.c:1686:10: note: Left side of '&&' is true
           for (; (!done && block <= lastblock); block++) {
                   ^
   fs/udf/super.c:1686:19: note: Assuming 'block' is <= 'lastblock'
           for (; (!done && block <= lastblock); block++) {
                            ^~~~~~~~~~~~~~~~~~
   fs/udf/super.c:1686:2: note: Loop condition is true.  Entering loop body
           for (; (!done && block <= lastblock); block++) {
           ^
   fs/udf/super.c:1688:7: note: Assuming 'bh' is non-null
                   if (!bh)
                       ^~~
   fs/udf/super.c:1688:3: note: Taking false branch
                   if (!bh)
                   ^
   fs/udf/super.c:1694:3: note: Control jumps to 'case 7:'  at line 1717
                   switch (ident) {
                   ^
   fs/udf/super.c:1720:8: note: Assuming the condition is true
                           if (IS_ERR(curr)) {
                               ^~~~~~~~~~~~
   fs/udf/super.c:1720:4: note: Taking true branch
                           if (IS_ERR(curr)) {
                           ^
   fs/udf/super.c:1723:5: note: Control jumps to line 1768
                                   goto out;
                                   ^
   fs/udf/super.c:1769:2: note: Address of stack memory associated with local 
variable 'data' returned to caller
           return ret;
           ^      ~~~
   fs/udf/super.c:1769:2: warning: Use of memory after it is freed 
[clang-analyzer-unix.Malloc]
           return ret;
           ^
   fs/udf/super.c:1800:8: note: Calling 'udf_process_sequence'
           ret = udf_process_sequence(sb, main_s, main_e, fileset);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/udf/super.c:1679:6: note: Assuming field 'part_descs_loc' is non-null
           if (!data.part_descs_loc)
               ^~~~~~~~~~~~~~~~~~~~
   fs/udf/super.c:1679:2: note: Taking false branch
           if (!data.part_descs_loc)
           ^
   fs/udf/super.c:1686:11: note: 'done' is false
           for (; (!done && block <= lastblock); block++) {
                    ^~~~
   fs/udf/super.c:1686:10: note: Left side of '&&' is true
           for (; (!done && block <= lastblock); block++) {
                   ^
   fs/udf/super.c:1686:19: note: Assuming 'block' is <= 'lastblock'
           for (; (!done && block <= lastblock); block++) {
                            ^~~~~~~~~~~~~~~~~~
   fs/udf/super.c:1686:2: note: Loop condition is true.  Entering loop body
           for (; (!done && block <= lastblock); block++) {
           ^
   fs/udf/super.c:1688:7: note: Assuming 'bh' is non-null
                   if (!bh)
                       ^~~
   fs/udf/super.c:1688:3: note: Taking false branch
                   if (!bh)
                   ^
   fs/udf/super.c:1694:3: note: Control jumps to 'case 5:'  at line 1718
                   switch (ident) {

vim +/pinned +1521 arch/x86/xen/mmu_pv.c

7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1508  
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1509  /* This needs to make sure 
the new pte page is pinned iff its being
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1510     attached to a pinned 
pagetable. */
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1511  static inline void 
xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn,
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1512                                
    unsigned level)
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1513  {
6f84f8d1587f20 Pavel Tatashin   2018-04-10  1514        bool pinned = 
xen_page_pinned(mm->pgd);
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1515  
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1516        
trace_xen_mmu_alloc_ptpage(mm, pfn, level, pinned);
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1517  
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1518        if (pinned) {
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1519                struct page 
*page = pfn_to_page(pfn);
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1520  
36c9b5929b7094 Juergen Gross    2021-09-08 @1521                pinned = false;
36c9b5929b7094 Juergen Gross    2021-09-08  1522                if 
(static_branch_likely(&xen_struct_pages_ready)) {
36c9b5929b7094 Juergen Gross    2021-09-08  1523                        pinned 
= PagePinned(page);
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1524                        
SetPagePinned(page);
36c9b5929b7094 Juergen Gross    2021-09-08  1525                }
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1526  
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1527                xen_mc_batch();
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1528  
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1529                
__set_pfn_prot(pfn, PAGE_KERNEL_RO);
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1530  
36c9b5929b7094 Juergen Gross    2021-09-08  1531                if (level == 
PT_PTE && USE_SPLIT_PTE_PTLOCKS && !pinned)
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1532                        
__pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn);
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1533  
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1534                
xen_mc_issue(PARAVIRT_LAZY_MMU);
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1535        }
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1536  }
7e0563dea9c4e6 Vitaly Kuznetsov 2017-04-04  1537  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to