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: <202410192244.k4KFmVBy-lkp@intel.com>
Date: Sat, 19 Oct 2024 22:12:01 +0800
From: kernel test robot <lkp@...el.com>
To: Brian Gerst <brgerst@...il.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...nel.org>
Subject: arch/x86/xen/enlighten_pv.c:1407:28: sparse: sparse: incorrect type
 in initializer (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3d5ad2d4eca337e80f38df77de89614aa5aaceb9
commit: 11e36b0f7c2150a6453872b79555767b43c846d0 x86/boot/64: Load the final kernel GDT during early boot directly, remove startup_gdt[]
date:   8 months ago
config: x86_64-randconfig-122-20241019 (https://download.01.org/0day-ci/archive/20241019/202410192244.k4KFmVBy-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241019/202410192244.k4KFmVBy-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/202410192244.k4KFmVBy-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/x86/xen/enlighten_pv.c:1407:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct gdt_page * @@
   arch/x86/xen/enlighten_pv.c:1407:28: sparse:     expected void const [noderef] __percpu *__vpp_verify
   arch/x86/xen/enlighten_pv.c:1407:28: sparse:     got struct gdt_page *
   arch/x86/xen/enlighten_pv.c: note: in included file (through arch/x86/include/asm/stackprotector.h, include/linux/stackprotector.h):
   arch/x86/include/asm/desc.h:54:16: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void const [noderef] __percpu *__vpp_verify @@     got struct gdt_page * @@
   arch/x86/include/asm/desc.h:54:16: sparse:     expected void const [noderef] __percpu *__vpp_verify
   arch/x86/include/asm/desc.h:54:16: sparse:     got struct gdt_page *

vim +1407 arch/x86/xen/enlighten_pv.c

8b87d8cec1b31e Peter Zijlstra   2022-03-08  1311  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1312  /* First C function to be called on Xen boot */
96e8fc5818686d Juergen Gross    2022-06-30  1313  asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1314  {
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1315  	struct physdev_set_iopl set_iopl;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1316  	unsigned long initrd_start = 0;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1317  	int rc;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1318  
96e8fc5818686d Juergen Gross    2022-06-30  1319  	if (!si)
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1320  		return;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1321  
96e8fc5818686d Juergen Gross    2022-06-30  1322  	clear_bss();
96e8fc5818686d Juergen Gross    2022-06-30  1323  
96e8fc5818686d Juergen Gross    2022-06-30  1324  	xen_start_info = si;
96e8fc5818686d Juergen Gross    2022-06-30  1325  
8b87d8cec1b31e Peter Zijlstra   2022-03-08  1326  	__text_gen_insn(&early_xen_iret_patch,
8b87d8cec1b31e Peter Zijlstra   2022-03-08  1327  			JMP32_INSN_OPCODE, &early_xen_iret_patch, &xen_iret,
8b87d8cec1b31e Peter Zijlstra   2022-03-08  1328  			JMP32_INSN_SIZE);
8b87d8cec1b31e Peter Zijlstra   2022-03-08  1329  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1330  	xen_domain_type = XEN_PV_DOMAIN;
1fe83888a2b776 Roger Pau Monne  2018-06-08  1331  	xen_start_flags = xen_start_info->flags;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1332  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1333  	xen_setup_features();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1334  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1335  	/* Install Xen paravirt ops */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1336  	pv_info = xen_info;
1462eb381b4c27 Peter Zijlstra   2021-06-24  1337  	pv_ops.cpu = xen_cpu_ops.cpu;
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1338  	xen_init_irq_ops();
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1339  
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1340  	/*
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1341  	 * Setup xen_vcpu early because it is needed for
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1342  	 * local_irq_disable(), irqs_disabled(), e.g. in printk().
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1343  	 *
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1344  	 * Don't do the full vcpu_info placement stuff until we have
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1345  	 * the cpu_possible_mask and a non-dummy shared_info.
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1346  	 */
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1347  	xen_vcpu_info_reset(0);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1348  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1349  	x86_platform.get_nmi_reason = xen_get_nmi_reason;
f1e525009493cb Juergen Gross    2022-11-23  1350  	x86_platform.realmode_reserve = x86_init_noop;
f1e525009493cb Juergen Gross    2022-11-23  1351  	x86_platform.realmode_init = x86_init_noop;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1352  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1353  	x86_init.resources.memory_setup = xen_memory_setup;
979923871f69a4 Thomas Gleixner  2020-01-23  1354  	x86_init.irqs.intr_mode_select	= x86_init_noop;
3b5244bef15e0e Juergen Gross    2023-08-08  1355  	x86_init.irqs.intr_mode_init	= x86_64_probe_apic;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1356  	x86_init.oem.arch_setup = xen_arch_setup;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1357  	x86_init.oem.banner = xen_banner;
7b25b9cb0dad83 Pavel Tatashin   2018-07-19  1358  	x86_init.hyper.init_platform = xen_pv_init_platform;
7b25b9cb0dad83 Pavel Tatashin   2018-07-19  1359  	x86_init.hyper.guest_late_init = xen_pv_guest_late_init;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1360  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1361  	/*
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1362  	 * Set up some pagetable state before starting to set any ptes.
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1363  	 */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1364  
0ce0bba4e5e0eb Juergen Gross    2018-07-12  1365  	xen_setup_machphys_mapping();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1366  	xen_init_mmu_ops();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1367  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1368  	/* Prevent unwanted bits from being set in PTEs. */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1369  	__supported_pte_mask &= ~_PAGE_GLOBAL;
e69b5d308da72c Juergen Gross    2018-07-02  1370  	__default_kernel_pte_mask &= ~_PAGE_GLOBAL;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1371  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1372  	/* Get mfn list */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1373  	xen_build_dynamic_phys_to_machine();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1374  
ae897fda4f507e Jan Beulich      2021-05-20  1375  	/* Work out if we support NX */
ae897fda4f507e Jan Beulich      2021-05-20  1376  	get_cpu_cap(&boot_cpu_data);
ae897fda4f507e Jan Beulich      2021-05-20  1377  	x86_configure_nx();
ae897fda4f507e Jan Beulich      2021-05-20  1378  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1379  	/*
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1380  	 * Set up kernel GDT and segment registers, mainly so that
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1381  	 * -fstack-protector code can be executed.
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1382  	 */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1383  	xen_setup_gdt(0);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1384  
405c018a25fe46 M. Vefa Bicakci  2018-07-24  1385  	/* Determine virtual and physical address sizes */
405c018a25fe46 M. Vefa Bicakci  2018-07-24  1386  	get_cpu_address_sizes(&boot_cpu_data);
405c018a25fe46 M. Vefa Bicakci  2018-07-24  1387  
42b3a4cb5609de Juergen Gross    2017-11-24  1388  	/* Let's presume PV guests always boot on vCPU with id 0. */
42b3a4cb5609de Juergen Gross    2017-11-24  1389  	per_cpu(xen_vcpu_id, 0) = 0;
42b3a4cb5609de Juergen Gross    2017-11-24  1390  
42b3a4cb5609de Juergen Gross    2017-11-24  1391  	idt_setup_early_handler();
42b3a4cb5609de Juergen Gross    2017-11-24  1392  
0808e80cb760de Juergen Gross    2017-04-13  1393  	xen_init_capabilities();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1394  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1395  	/*
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1396  	 * set up the basic apic ops.
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1397  	 */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1398  	xen_init_apic();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1399  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1400  	machine_ops = xen_machine_ops;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1401  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1402  	/*
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1403  	 * The only reliable way to retain the initial address of the
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1404  	 * percpu gdt_page is to remember it here, so we can go and
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1405  	 * mark it RW later, when the initial percpu area is freed.
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1406  	 */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 @1407  	xen_initial_gdt = &per_cpu(gdt_page, 0);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1408  
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1409  	xen_smp_init();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14  1410  

:::::: The code at line 1407 was first introduced by commit
:::::: e1dab14cf68d1e03950135969af3faf322f0db04 x86/xen: split off enlighten_pv.c

:::::: TO: Vitaly Kuznetsov <vkuznets@...hat.com>
:::::: CC: Juergen Gross <jgross@...e.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ