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: <202312270830.t3f9Plc5-lkp@intel.com>
Date: Wed, 27 Dec 2023 08:52:23 +0800
From: kernel test robot <lkp@...el.com>
To: Jordan Niethe <jniethe5@...il.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Michael Ellerman <mpe@...erman.id.au>
Subject: arch/powerpc/kvm/test-guest-state-buffer.c:70:25: sparse: sparse:
 restricted __be64 degrades to integer

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fbafc3e621c3f4ded43720fdb1d6ce1728ec664e
commit: 6ccbbc33f06adaf79acde18571c6543ad1cb4be6 KVM: PPC: Add helper library for Guest State Buffers
date:   3 months ago
config: powerpc64-randconfig-r131-20231227 (https://download.01.org/0day-ci/archive/20231227/202312270830.t3f9Plc5-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231227/202312270830.t3f9Plc5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312270830.t3f9Plc5-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/powerpc/kvm/test-guest-state-buffer.c:70:25: sparse: sparse: restricted __be64 degrades to integer
>> arch/powerpc/kvm/test-guest-state-buffer.c:70:25: sparse: sparse: incorrect type in initializer (different base types) @@     expected long long left_value @@     got restricted __be64 const __left @@
   arch/powerpc/kvm/test-guest-state-buffer.c:70:25: sparse:     expected long long left_value
   arch/powerpc/kvm/test-guest-state-buffer.c:70:25: sparse:     got restricted __be64 const __left
   arch/powerpc/kvm/test-guest-state-buffer.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/umh.h, include/linux/kmod.h, ...):
   include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false

vim +70 arch/powerpc/kvm/test-guest-state-buffer.c

    24	
    25	static void test_adding_element(struct kunit *test)
    26	{
    27		const struct kvmppc_gs_elem *head, *curr;
    28		union {
    29			__vector128 v;
    30			u64 dw[2];
    31		} u;
    32		int rem;
    33		struct kvmppc_gs_buff *gsb;
    34		size_t size = 0x1000;
    35		int i, rc;
    36		u64 data;
    37	
    38		gsb = kvmppc_gsb_new(size, 0, 0, GFP_KERNEL);
    39		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, gsb);
    40	
    41		/* Single elements, direct use of __kvmppc_gse_put() */
    42		data = 0xdeadbeef;
    43		rc = __kvmppc_gse_put(gsb, KVMPPC_GSID_GPR(0), 8, &data);
    44		KUNIT_EXPECT_GE(test, rc, 0);
    45	
    46		head = kvmppc_gsb_data(gsb);
    47		KUNIT_EXPECT_EQ(test, kvmppc_gse_iden(head), KVMPPC_GSID_GPR(0));
    48		KUNIT_EXPECT_EQ(test, kvmppc_gse_len(head), 8);
    49		data = 0;
    50		memcpy(&data, kvmppc_gse_data(head), 8);
    51		KUNIT_EXPECT_EQ(test, data, 0xdeadbeef);
    52	
    53		/* Multiple elements, simple wrapper */
    54		rc = kvmppc_gse_put_u64(gsb, KVMPPC_GSID_GPR(1), 0xcafef00d);
    55		KUNIT_EXPECT_GE(test, rc, 0);
    56	
    57		u.dw[0] = 0x1;
    58		u.dw[1] = 0x2;
    59		rc = kvmppc_gse_put_vector128(gsb, KVMPPC_GSID_VSRS(0), &u.v);
    60		KUNIT_EXPECT_GE(test, rc, 0);
    61		u.dw[0] = 0x0;
    62		u.dw[1] = 0x0;
    63	
    64		kvmppc_gsb_for_each_elem(i, curr, gsb, rem) {
    65			switch (i) {
    66			case 0:
    67				KUNIT_EXPECT_EQ(test, kvmppc_gse_iden(curr),
    68						KVMPPC_GSID_GPR(0));
    69				KUNIT_EXPECT_EQ(test, kvmppc_gse_len(curr), 8);
  > 70				KUNIT_EXPECT_EQ(test, kvmppc_gse_get_be64(curr),
    71						0xdeadbeef);
    72				break;
    73			case 1:
    74				KUNIT_EXPECT_EQ(test, kvmppc_gse_iden(curr),
    75						KVMPPC_GSID_GPR(1));
    76				KUNIT_EXPECT_EQ(test, kvmppc_gse_len(curr), 8);
    77				KUNIT_EXPECT_EQ(test, kvmppc_gse_get_u64(curr),
    78						0xcafef00d);
    79				break;
    80			case 2:
    81				KUNIT_EXPECT_EQ(test, kvmppc_gse_iden(curr),
    82						KVMPPC_GSID_VSRS(0));
    83				KUNIT_EXPECT_EQ(test, kvmppc_gse_len(curr), 16);
    84				kvmppc_gse_get_vector128(curr, &u.v);
    85				KUNIT_EXPECT_EQ(test, u.dw[0], 0x1);
    86				KUNIT_EXPECT_EQ(test, u.dw[1], 0x2);
    87				break;
    88			}
    89		}
    90		KUNIT_EXPECT_EQ(test, i, 3);
    91	
    92		kvmppc_gsb_reset(gsb);
    93		KUNIT_EXPECT_EQ(test, kvmppc_gsb_nelems(gsb), 0);
    94		KUNIT_EXPECT_EQ(test, kvmppc_gsb_len(gsb),
    95				sizeof(struct kvmppc_gs_header));
    96	
    97		kvmppc_gsb_free(gsb);
    98	}
    99	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists