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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 18 Dec 2022 14:55:49 +0800
From:   kernel test robot <lkp@...el.com>
To:     Akihiko Odaki <akihiko.odaki@...nix.com>
Cc:     oe-kbuild-all@...ts.linux.dev, Marc Zyngier <maz@...nel.org>,
        linux-kernel@...r.kernel.org, kvmarm@...ts.linux.dev,
        kvmarm@...ts.cs.columbia.edu, linux-arm-kernel@...ts.infradead.org,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Oliver Upton <oliver.upton@...ux.dev>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Alexandru Elisei <alexandru.elisei@....com>,
        James Morse <james.morse@....com>,
        Will Deacon <will@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        asahi@...ts.linux.dev, Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Sven Peter <sven@...npeter.dev>,
        Hector Martin <marcan@...can.st>,
        Akihiko Odaki <akihiko.odaki@...nix.com>
Subject: Re: [PATCH v3 7/7] KVM: arm64: Normalize cache configuration

Hi Akihiko,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on v6.1]
[also build test WARNING on linus/master next-20221216]
[cannot apply to kvmarm/next arm64/for-next/core]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Akihiko-Odaki/KVM-arm64-Normalize-cache-configuration/20221218-131711
patch link:    https://lore.kernel.org/r/20221218051412.384657-8-akihiko.odaki%40daynix.com
patch subject: [PATCH v3 7/7] KVM: arm64: Normalize cache configuration
config: arm64-randconfig-r021-20221218
compiler: aarch64-linux-gcc (GCC) 12.1.0
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://github.com/intel-lab-lkp/linux/commit/bdbdb090163b6fd99fc43959273525c2d0785734
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Akihiko-Odaki/KVM-arm64-Normalize-cache-configuration/20221218-131711
        git checkout bdbdb090163b6fd99fc43959273525c2d0785734
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kvm/

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

All warnings (new ones prefixed by >>):

   arch/arm64/kvm/sys_regs.c: In function 'get_ccsidr':
>> arch/arm64/kvm/sys_regs.c:103:13: warning: variable 'field' set but not used [-Wunused-but-set-variable]
     103 |         int field;
         |             ^~~~~
>> arch/arm64/kvm/sys_regs.c:102:13: warning: variable 'ctr_el0' set but not used [-Wunused-but-set-variable]
     102 |         u64 ctr_el0;
         |             ^~~~~~~
   arch/arm64/kvm/sys_regs.c: At top level:
   arch/arm64/kvm/sys_regs.c:1722:20: warning: initialized field overwritten [-Woverride-init]
    1722 |           .reset = reset_pmcr, .reg = PMCR_EL0 },
         |                    ^~~~~~~~~~
   arch/arm64/kvm/sys_regs.c:1722:20: note: (near initialization for 'sys_reg_descs[221].reset')
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/kasan-checks.h:5,
                    from include/asm-generic/rwonce.h:26,
                    from arch/arm64/include/asm/rwonce.h:71,
                    from include/linux/compiler.h:246,
                    from include/linux/build_bug.h:5,
                    from include/linux/bitfield.h:10,
                    from arch/arm64/kvm/sys_regs.c:12:
   include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1735:46: note: in expansion of macro 'NULL'
    1735 |           .access = access_pmswinc, .reset = NULL },
         |                                              ^~~~
   include/linux/stddef.h:8:14: note: (near initialization for 'sys_reg_descs[225].reset')
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1735:46: note: in expansion of macro 'NULL'
    1735 |           .access = access_pmswinc, .reset = NULL },
         |                                              ^~~~
   arch/arm64/kvm/sys_regs.c:1737:45: warning: initialized field overwritten [-Woverride-init]
    1737 |           .access = access_pmselr, .reset = reset_pmselr, .reg = PMSELR_EL0 },
         |                                             ^~~~~~~~~~~~
   arch/arm64/kvm/sys_regs.c:1737:45: note: (near initialization for 'sys_reg_descs[226].reset')
   include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1739:45: note: in expansion of macro 'NULL'
    1739 |           .access = access_pmceid, .reset = NULL },
         |                                             ^~~~
   include/linux/stddef.h:8:14: note: (near initialization for 'sys_reg_descs[227].reset')
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1739:45: note: in expansion of macro 'NULL'
    1739 |           .access = access_pmceid, .reset = NULL },
         |                                             ^~~~
   include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1741:45: note: in expansion of macro 'NULL'
    1741 |           .access = access_pmceid, .reset = NULL },
         |                                             ^~~~
   include/linux/stddef.h:8:14: note: (near initialization for 'sys_reg_descs[228].reset')
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1741:45: note: in expansion of macro 'NULL'
    1741 |           .access = access_pmceid, .reset = NULL },
         |                                             ^~~~
   arch/arm64/kvm/sys_regs.c:1743:49: warning: initialized field overwritten [-Woverride-init]
    1743 |           .access = access_pmu_evcntr, .reset = reset_unknown, .reg = PMCCNTR_EL0 },
         |                                                 ^~~~~~~~~~~~~
   arch/arm64/kvm/sys_regs.c:1743:49: note: (near initialization for 'sys_reg_descs[229].reset')
   include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1745:50: note: in expansion of macro 'NULL'
    1745 |           .access = access_pmu_evtyper, .reset = NULL },
         |                                                  ^~~~
   include/linux/stddef.h:8:14: note: (near initialization for 'sys_reg_descs[230].reset')
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1745:50: note: in expansion of macro 'NULL'
    1745 |           .access = access_pmu_evtyper, .reset = NULL },
         |                                                  ^~~~
   include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1747:49: note: in expansion of macro 'NULL'
    1747 |           .access = access_pmu_evcntr, .reset = NULL },
         |                                                 ^~~~
   include/linux/stddef.h:8:14: note: (near initialization for 'sys_reg_descs[231].reset')
       8 | #define NULL ((void *)0)
         |              ^
   arch/arm64/kvm/sys_regs.c:1747:49: note: in expansion of macro 'NULL'
    1747 |           .access = access_pmu_evcntr, .reset = NULL },
         |                                                 ^~~~
   arch/arm64/kvm/sys_regs.c:1753:20: warning: initialized field overwritten [-Woverride-init]
    1753 |           .reset = reset_val, .reg = PMUSERENR_EL0, .val = 0 },
         |                    ^~~~~~~~~
   arch/arm64/kvm/sys_regs.c:1753:20: note: (near initialization for 'sys_reg_descs[232].reset')
   arch/arm64/kvm/sys_regs.c:1043:20: warning: initialized field overwritten [-Woverride-init]
    1043 |           .reset = reset_pmevcntr,                                      \
         |                    ^~~~~~~~~~~~~~
   arch/arm64/kvm/sys_regs.c:1841:9: note: in expansion of macro 'PMU_PMEVCNTR_EL0'
    1841 |         PMU_PMEVCNTR_EL0(0),
         |         ^~~~~~~~~~~~~~~~
   arch/arm64/kvm/sys_regs.c:1043:20: note: (near initialization for 'sys_reg_descs[313].reset')
    1043 |           .reset = reset_pmevcntr,                                      \
         |                    ^~~~~~~~~~~~~~
   arch/arm64/kvm/sys_regs.c:1841:9: note: in expansion of macro 'PMU_PMEVCNTR_EL0'
    1841 |         PMU_PMEVCNTR_EL0(0),


vim +/field +103 arch/arm64/kvm/sys_regs.c

    98	
    99	/* Which cache CCSIDR represents depends on CSSELR value. */
   100	static u32 get_ccsidr(struct kvm_vcpu *vcpu, u32 csselr)
   101	{
 > 102		u64 ctr_el0;
 > 103		int field;
   104	
   105		if (vcpu->arch.ccsidr)
   106			return vcpu->arch.ccsidr[csselr];
   107	
   108		ctr_el0 = read_sanitised_ftr_reg(SYS_CTR_EL0);
   109		field = csselr & CSSELR_EL1_InD ? CTR_EL0_IminLine_SHIFT : CTR_EL0_DminLine_SHIFT;
   110	
   111		/*
   112		 * Fabricate a CCSIDR value as the overriding value does not exist.
   113		 * The real CCSIDR value will not be used as it can vary by the
   114		 * physical CPU which the vcpu currently resides in.
   115		 *
   116		 * The line size is determined with arm64_ftr_reg_ctrel0.sys_val, which
   117		 * should be valid for all CPUs even if they have different cache
   118		 * configuration.
   119		 *
   120		 * The associativity bits are cleared, meaning the geometry of all data
   121		 * and unified caches (which are guaranteed to be PIPT and thus
   122		 * non-aliasing) are 1 set and 1 way.
   123		 * Guests should not be doing cache operations by set/way at all, and
   124		 * for this reason, we trap them and attempt to infer the intent, so
   125		 * that we can flush the entire guest's address space at the appropriate
   126		 * time. The exposed geometry minimizes the number of the traps.
   127		 * [If guests should attempt to infer aliasing properties from the
   128		 * geometry (which is not permitted by the architecture), they would
   129		 * only do so for virtually indexed caches.]
   130		 */
   131		return get_min_cache_line_size(csselr) << CCSIDR_EL1_LineSize_SHIFT;
   132	}
   133	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (167552 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ