All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [android-goldfish:android-3.18 396/1051] arch/arm64/xen/../../arm/xen/enlighten.c:228:55: sparse: sparse: Using plain integer as NULL pointer
Date: Thu, 20 May 2021 01:33:48 +0800	[thread overview]
Message-ID: <202105200142.ihckKmLb-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 12757 bytes --]

tree:   https://android.googlesource.com/kernel/goldfish android-3.18
head:   dd54b61f1458c03f68fc019b4874d98f2f0ae3a5
commit: 8214bf079208b146e63cd0a3ce0ed335a87ce7b3 [396/1051] scripts/dtc: Export YYLOC global declaration
config: arm64-randconfig-s032-20210519 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 5.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        git remote add android-goldfish https://android.googlesource.com/kernel/goldfish
        git fetch --no-tags android-goldfish android-3.18
        git checkout 8214bf079208b146e63cd0a3ce0ed335a87ce7b3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-5.5.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   arch/arm64/xen/../../arm/xen/enlighten.c:30:19: sparse: sparse: symbol '_xen_start_info' was not declared. Should it be static?
   arch/arm64/xen/../../arm/xen/enlighten.c:51:5: sparse: sparse: symbol 'xen_platform_pci_unplug' was not declared. Should it be static?
>> arch/arm64/xen/../../arm/xen/enlighten.c:228:55: sparse: sparse: Using plain integer as NULL pointer
   In file included from arch/arm64/xen/../../arm/xen/enlighten.c:4:0:
   include/xen/hvm.h: In function 'param_name':
   include/xen/hvm.h:30:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (op >= ARRAY_SIZE(names))
            ^
   In file included from arch/arm64/include/asm/mmu.h:24:0,
                    from include/linux/mm_types.h:18,
                    from include/asm-generic/pgtable.h:7,
                    from arch/arm64/include/asm/pgtable.h:525,
                    from arch/arm64/include/../../arm/include/asm/xen/page.h:5,
                    from arch/arm64/include/asm/xen/page.h:1,
                    from include/xen/page.h:4,
                    from arch/arm64/xen/../../arm/xen/enlighten.c:12:
   arch/arm64/include/asm/cpufeature.h: In function 'arm64_ftr_value':
   arch/arm64/include/asm/cpufeature.h:153:68: warning: signed and unsigned type in conditional expression [-Wsign-compare]
      cpuid_feature_extract_field_width(val, ftrp->shift, ftrp->width) :
                                                                       ^
   arch/arm64/xen/../../arm/xen/enlighten.c: In function 'xen_guest_init':
   arch/arm64/xen/../../arm/xen/enlighten.c:243:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (strlen(xen_prefix) + 3  < len &&
                                 ^

vim +228 arch/arm64/xen/../../arm/xen/enlighten.c

8b271d57b57585 Julien Grall          2014-01-30  219  
2e01f16601d892 Stefano Stabellini    2012-09-14  220  /*
2e01f16601d892 Stefano Stabellini    2012-09-14  221   * see Documentation/devicetree/bindings/arm/xen.txt for the
2e01f16601d892 Stefano Stabellini    2012-09-14  222   * documentation of the Xen Device Tree format.
2e01f16601d892 Stefano Stabellini    2012-09-14  223   */
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  224  #define GRANT_TABLE_PHYSADDR 0
2e01f16601d892 Stefano Stabellini    2012-09-14  225  static int __init xen_guest_init(void)
2e01f16601d892 Stefano Stabellini    2012-09-14  226  {
2e01f16601d892 Stefano Stabellini    2012-09-14  227  	struct xen_add_to_physmap xatp;
2e01f16601d892 Stefano Stabellini    2012-09-14 @228  	static struct shared_info *shared_info_page = 0;
2e01f16601d892 Stefano Stabellini    2012-09-14  229  	struct device_node *node;
2e01f16601d892 Stefano Stabellini    2012-09-14  230  	int len;
2e01f16601d892 Stefano Stabellini    2012-09-14  231  	const char *s = NULL;
2e01f16601d892 Stefano Stabellini    2012-09-14  232  	const char *version = NULL;
2e01f16601d892 Stefano Stabellini    2012-09-14  233  	const char *xen_prefix = "xen,xen-";
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  234  	struct resource res;
47c542050d306e Julien Grall          2014-01-30  235  	phys_addr_t grant_frames;
2e01f16601d892 Stefano Stabellini    2012-09-14  236  
2e01f16601d892 Stefano Stabellini    2012-09-14  237  	node = of_find_compatible_node(NULL, NULL, "xen,xen");
2e01f16601d892 Stefano Stabellini    2012-09-14  238  	if (!node) {
2e01f16601d892 Stefano Stabellini    2012-09-14  239  		pr_debug("No Xen support\n");
2e01f16601d892 Stefano Stabellini    2012-09-14  240  		return 0;
2e01f16601d892 Stefano Stabellini    2012-09-14  241  	}
2e01f16601d892 Stefano Stabellini    2012-09-14  242  	s = of_get_property(node, "compatible", &len);
2e01f16601d892 Stefano Stabellini    2012-09-14  243  	if (strlen(xen_prefix) + 3  < len &&
2e01f16601d892 Stefano Stabellini    2012-09-14  244  			!strncmp(xen_prefix, s, strlen(xen_prefix)))
2e01f16601d892 Stefano Stabellini    2012-09-14  245  		version = s + strlen(xen_prefix);
2e01f16601d892 Stefano Stabellini    2012-09-14  246  	if (version == NULL) {
2e01f16601d892 Stefano Stabellini    2012-09-14  247  		pr_debug("Xen version not found\n");
2e01f16601d892 Stefano Stabellini    2012-09-14  248  		return 0;
2e01f16601d892 Stefano Stabellini    2012-09-14  249  	}
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  250  	if (of_address_to_resource(node, GRANT_TABLE_PHYSADDR, &res))
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  251  		return 0;
efaf30a3357872 Konrad Rzeszutek Wilk 2014-01-06  252  	grant_frames = res.start;
0ec53ecf38bcbf Stefano Stabellini    2012-09-14  253  	xen_events_irq = irq_of_parse_and_map(node, 0);
47c542050d306e Julien Grall          2014-01-30  254  	pr_info("Xen %s support found, events_irq=%d gnttab_frame=%pa\n",
47c542050d306e Julien Grall          2014-01-30  255  			version, xen_events_irq, &grant_frames);
8b271d57b57585 Julien Grall          2014-01-30  256  
8b271d57b57585 Julien Grall          2014-01-30  257  	if (xen_events_irq < 0)
8b271d57b57585 Julien Grall          2014-01-30  258  		return -ENODEV;
8b271d57b57585 Julien Grall          2014-01-30  259  
2e01f16601d892 Stefano Stabellini    2012-09-14  260  	xen_domain_type = XEN_HVM_DOMAIN;
2e01f16601d892 Stefano Stabellini    2012-09-14  261  
ef61ee0dc7ba04 Stefano Stabellini    2012-08-08  262  	xen_setup_features();
5ebc77de83c7b7 Stefano Stabellini    2014-09-10  263  
5ebc77de83c7b7 Stefano Stabellini    2014-09-10  264  	if (!xen_feature(XENFEAT_grant_map_identity)) {
5ebc77de83c7b7 Stefano Stabellini    2014-09-10  265  		pr_warn("Please upgrade your Xen.\n"
5ebc77de83c7b7 Stefano Stabellini    2014-09-10  266  				"If your platform has any non-coherent DMA devices, they won't work properly.\n");
5ebc77de83c7b7 Stefano Stabellini    2014-09-10  267  	}
5ebc77de83c7b7 Stefano Stabellini    2014-09-10  268  
ef61ee0dc7ba04 Stefano Stabellini    2012-08-08  269  	if (xen_feature(XENFEAT_dom0))
ef61ee0dc7ba04 Stefano Stabellini    2012-08-08  270  		xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
ef61ee0dc7ba04 Stefano Stabellini    2012-08-08  271  	else
ef61ee0dc7ba04 Stefano Stabellini    2012-08-08  272  		xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED);
ef61ee0dc7ba04 Stefano Stabellini    2012-08-08  273  
2e01f16601d892 Stefano Stabellini    2012-09-14  274  	if (!shared_info_page)
2e01f16601d892 Stefano Stabellini    2012-09-14  275  		shared_info_page = (struct shared_info *)
2e01f16601d892 Stefano Stabellini    2012-09-14  276  			get_zeroed_page(GFP_KERNEL);
2e01f16601d892 Stefano Stabellini    2012-09-14  277  	if (!shared_info_page) {
2e01f16601d892 Stefano Stabellini    2012-09-14  278  		pr_err("not enough memory\n");
2e01f16601d892 Stefano Stabellini    2012-09-14  279  		return -ENOMEM;
2e01f16601d892 Stefano Stabellini    2012-09-14  280  	}
2e01f16601d892 Stefano Stabellini    2012-09-14  281  	xatp.domid = DOMID_SELF;
2e01f16601d892 Stefano Stabellini    2012-09-14  282  	xatp.idx = 0;
2e01f16601d892 Stefano Stabellini    2012-09-14  283  	xatp.space = XENMAPSPACE_shared_info;
2e01f16601d892 Stefano Stabellini    2012-09-14  284  	xatp.gpfn = __pa(shared_info_page) >> PAGE_SHIFT;
2e01f16601d892 Stefano Stabellini    2012-09-14  285  	if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
2e01f16601d892 Stefano Stabellini    2012-09-14  286  		BUG();
2e01f16601d892 Stefano Stabellini    2012-09-14  287  
2e01f16601d892 Stefano Stabellini    2012-09-14  288  	HYPERVISOR_shared_info = (struct shared_info *)shared_info_page;
2e01f16601d892 Stefano Stabellini    2012-09-14  289  
2e01f16601d892 Stefano Stabellini    2012-09-14  290  	/* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
2e01f16601d892 Stefano Stabellini    2012-09-14  291  	 * page, we use it in the event channel upcall and in some pvclock
9a9ab3cc00dc0c Stefano Stabellini    2013-04-25  292  	 * related functions. 
2e01f16601d892 Stefano Stabellini    2012-09-14  293  	 * The shared info contains exactly 1 CPU (the boot CPU). The guest
2e01f16601d892 Stefano Stabellini    2012-09-14  294  	 * is required to use VCPUOP_register_vcpu_info to place vcpu info
9a9ab3cc00dc0c Stefano Stabellini    2013-04-25  295  	 * for secondary CPUs as they are brought up.
9a9ab3cc00dc0c Stefano Stabellini    2013-04-25  296  	 * For uniformity we use VCPUOP_register_vcpu_info even on cpu0.
9a9ab3cc00dc0c Stefano Stabellini    2013-04-25  297  	 */
16691059c77a6a Julien Grall          2016-12-07  298  	xen_vcpu_info = alloc_percpu(struct vcpu_info);
9a9ab3cc00dc0c Stefano Stabellini    2013-04-25  299  	if (xen_vcpu_info == NULL)
9a9ab3cc00dc0c Stefano Stabellini    2013-04-25  300  		return -ENOMEM;
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  301  
efaf30a3357872 Konrad Rzeszutek Wilk 2014-01-06  302  	if (gnttab_setup_auto_xlat_frames(grant_frames)) {
efaf30a3357872 Konrad Rzeszutek Wilk 2014-01-06  303  		free_percpu(xen_vcpu_info);
efaf30a3357872 Konrad Rzeszutek Wilk 2014-01-06  304  		return -ENOMEM;
efaf30a3357872 Konrad Rzeszutek Wilk 2014-01-06  305  	}
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  306  	gnttab_init();
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  307  	if (!xen_initial_domain())
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  308  		xenbus_probe(NULL);
b3b52fd87e8f75 Stefano Stabellini    2012-09-13  309  
e1a9c16b303725 Julien Grall          2013-09-09  310  	/*
e1a9c16b303725 Julien Grall          2013-09-09  311  	 * Making sure board specific code will not set up ops for
e1a9c16b303725 Julien Grall          2013-09-09  312  	 * cpu idle and cpu freq.
e1a9c16b303725 Julien Grall          2013-09-09  313  	 */
e1a9c16b303725 Julien Grall          2013-09-09  314  	disable_cpuidle();
e1a9c16b303725 Julien Grall          2013-09-09  315  	disable_cpufreq();
e1a9c16b303725 Julien Grall          2013-09-09  316  
8b271d57b57585 Julien Grall          2014-01-30  317  	xen_init_IRQ();
8b271d57b57585 Julien Grall          2014-01-30  318  
8b271d57b57585 Julien Grall          2014-01-30  319  	if (request_percpu_irq(xen_events_irq, xen_arm_callback,
8b271d57b57585 Julien Grall          2014-01-30  320  			       "events", &xen_vcpu)) {
8b271d57b57585 Julien Grall          2014-01-30  321  		pr_err("Error request IRQ %d\n", xen_events_irq);
8b271d57b57585 Julien Grall          2014-01-30  322  		return -EINVAL;
8b271d57b57585 Julien Grall          2014-01-30  323  	}
8b271d57b57585 Julien Grall          2014-01-30  324  
8b271d57b57585 Julien Grall          2014-01-30  325  	xen_percpu_init();
8b271d57b57585 Julien Grall          2014-01-30  326  
8b271d57b57585 Julien Grall          2014-01-30  327  	register_cpu_notifier(&xen_cpu_notifier);
8b271d57b57585 Julien Grall          2014-01-30  328  
1aa3d8d9935dfb Stefano Stabellini    2013-05-08  329  	return 0;
1aa3d8d9935dfb Stefano Stabellini    2013-05-08  330  }
8b271d57b57585 Julien Grall          2014-01-30  331  early_initcall(xen_guest_init);
1aa3d8d9935dfb Stefano Stabellini    2013-05-08  332  

:::::: The code at line 228 was first introduced by commit
:::::: 2e01f16601d8924b12b1acf1cdc49a0d1cc1cfb2 xen/arm: Xen detection and shared_info page mapping

:::::: TO: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
:::::: CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 20033 bytes --]

                 reply	other threads:[~2021-05-19 17:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202105200142.ihckKmLb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.