From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64477C3DA4A for ; Sat, 3 Aug 2024 22:38:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C5FD6B0088; Sat, 3 Aug 2024 18:38:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7770C6B0089; Sat, 3 Aug 2024 18:38:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63D8E6B008C; Sat, 3 Aug 2024 18:38:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 45E3A6B0088 for ; Sat, 3 Aug 2024 18:38:54 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DC8D481723 for ; Sat, 3 Aug 2024 22:38:53 +0000 (UTC) X-FDA: 82412400546.18.4EF6506 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by imf25.hostedemail.com (Postfix) with ESMTP id 1B2FBA0011 for ; Sat, 3 Aug 2024 22:38:49 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=KsKHBryl; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf25.hostedemail.com: domain of lkp@intel.com designates 192.198.163.14 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722724683; a=rsa-sha256; cv=none; b=kwp3uR3EhvWMdyAB8j3DBEvaKED3HJytFz2CS6JiYh4OZfqzrvyiLAsk7YVhEcu3h1ReYp ePZIeTaNK7I/SjRKVBeQEixef0Q5urMWkK8vgWpypvCQOg/EP1Ov3ZrOZdcOgcVAAuByLF 68swxvslz7LIknnOZ1gIVcvCXEUvYk4= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=KsKHBryl; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf25.hostedemail.com: domain of lkp@intel.com designates 192.198.163.14 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722724683; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KyQm7tRkTNjyFtOE2LDoGBrWvYFRtKLct8LQRif6ckM=; b=orEHm4cC95AYqubnTwRr2sIDxFtA9vJWMQrSd29mqUIU5j3n8c3DpWDI9DXAr8cMKOpKAO xhFlV3b0D6j/L52ypNPpB/m4SABUiYvdlg/GpyGmdrbonnTfnvHB6ZLD7XhPyadS5etZgw EMEHdOE57FfdwH0L2BbqIxQR1ruiLek= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722724730; x=1754260730; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=1jAKqZMAnQ2Z/pNG3/2MiYZgzSRttc+ErvQBuIso/Kw=; b=KsKHBrylCFEgDtg7pN8WChHfMN9jOXMHheJCKm2aEEPSp1uC874iv26S L7mfUxacc6wKbNo1Szw+2I8TqPY+DRQgdMUwP/Bp83yy1yVv6jc30gkCT HIRItgwFwHvpjcMDF3WHGC8bnxkdSAeHUF2XK9uuH8vXEuo+YmgNFOC5B anui319esry9Mp8ryUx7qHwOTDux4n47wliPIPe2ZBp++GZU/6QPkfUdF FcRwuBzIxWiwFimhFQSrjMeH7RSR5XOYyvc0Ec/jw5nGLDcc1bFqfPbaw lDSguj1/v2cpX5rxjaO0pVGPA9+3WmAv9fKE2wccNgLGTxJu/M60WIuu9 w==; X-CSE-ConnectionGUID: UQ7CRH5ATyWoy1Hjlc1zgw== X-CSE-MsgGUID: T2h+HMwbSpKz49+5V00HKw== X-IronPort-AV: E=McAfee;i="6700,10204,11153"; a="20892354" X-IronPort-AV: E=Sophos;i="6.09,261,1716274800"; d="scan'208";a="20892354" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2024 15:38:48 -0700 X-CSE-ConnectionGUID: Hjz/bKAjRam0bcsrxrXedg== X-CSE-MsgGUID: e7aXNycDSjKyoCnJWemujw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,261,1716274800"; d="scan'208";a="55995625" Received: from unknown (HELO b6bf6c95bbab) ([10.239.97.151]) by orviesa006.jf.intel.com with ESMTP; 03 Aug 2024 15:38:45 -0700 Received: from kbuild by b6bf6c95bbab with local (Exim 4.96) (envelope-from ) id 1saNOc-0000xC-1O; Sat, 03 Aug 2024 22:38:42 +0000 Date: Sun, 4 Aug 2024 06:37:58 +0800 From: kernel test robot To: Mary Strodl , linux-kernel@vger.kernel.org Cc: oe-kbuild-all@lists.linux.dev, akpm@linux-foundation.org, urezki@gmail.com, hch@infradead.org, linux-mm@kvack.org, lee@kernel.org, andi.shyti@kernel.org, linux-i2c@vger.kernel.org, s.hauer@pengutronix.de, christian.gmeiner@gmail.com, Mary Strodl Subject: Re: [PATCH v2 1/2] x86: Add basic support for the Congatec CGEB BIOS interface Message-ID: <202408040629.HQM8a5ga-lkp@intel.com> References: <20240801160610.101859-2-mstrodl@csh.rit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240801160610.101859-2-mstrodl@csh.rit.edu> X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1B2FBA0011 X-St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vu2Em30UCuXPuOZNU/b+gaOVmzdtLr4itmbM7KYNaX5VsEQyfFno7okbgbqmeapuYYS3HQ8XzG51d6ggI8S+Ixkpb55NQpHQgt1TVszpBRHPoUm3YwCDjRGvgx60fDIzIhCnlo1MCxjTdmcMEv8yDj29lLWaHtewV9nBpDo/oBGL5mWHqZB//4xliZU7BSEY+YzhXDM8lo9hF5bt7JtXdnZx6xgNVm2U2q0JHstOMg60cuZ0US4hE5C/7bOoMptRL/7tIHvfAV53Th2xcM/JwVf0Igkg2giQXzElNq13wfx4OV9ho+EccjBSlTWq2bSUNP6vO8uSkarODrZ9hUzhw5iJhWsGzENA+bOCyC9IqoCNEhjY1cLlzT6L8T28+GoeKnDTU/dhxQmVn1HZ1/Y735XO+tlA27gQTpcoJBwl4Dc6Mmu9XelyBpUkmFjgwkx721eQ3gj03tZRtKqWJXz5JqZm X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Mary, kernel test robot noticed the following build warnings: [auto build test WARNING on lee-mfd/for-mfd-next] [also build test WARNING on lee-mfd/for-mfd-fixes andi-shyti/i2c/i2c-host akpm-mm/mm-everything linus/master v6.11-rc1 next-20240802] [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/Mary-Strodl/x86-Add-basic-support-for-the-Congatec-CGEB-BIOS-interface/20240803-013725 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next patch link: https://lore.kernel.org/r/20240801160610.101859-2-mstrodl%40csh.rit.edu patch subject: [PATCH v2 1/2] x86: Add basic support for the Congatec CGEB BIOS interface config: x86_64-randconfig-121-20240804 (https://download.01.org/0day-ci/archive/20240804/202408040629.HQM8a5ga-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/20240804/202408040629.HQM8a5ga-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 | Closes: https://lore.kernel.org/oe-kbuild-all/202408040629.HQM8a5ga-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/mfd/congatec-cgeb.c:407:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got void *data @@ drivers/mfd/congatec-cgeb.c:407:43: sparse: expected void [noderef] __user *to drivers/mfd/congatec-cgeb.c:407:43: sparse: got void *data >> drivers/mfd/congatec-cgeb.c:436:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __user *code @@ got void *[addressable] data @@ drivers/mfd/congatec-cgeb.c:436:21: sparse: expected void [noderef] __user *code drivers/mfd/congatec-cgeb.c:436:21: sparse: got void *[addressable] data drivers/mfd/congatec-cgeb.c:527:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got void *data @@ drivers/mfd/congatec-cgeb.c:527:38: sparse: expected void [noderef] __user *to drivers/mfd/congatec-cgeb.c:527:38: sparse: got void *data >> drivers/mfd/congatec-cgeb.c:535:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __user * @@ got void *data @@ drivers/mfd/congatec-cgeb.c:535:21: sparse: expected void [noderef] __user * drivers/mfd/congatec-cgeb.c:535:21: sparse: got void *data >> drivers/mfd/congatec-cgeb.c:564:25: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __user * @@ got void *[addressable] data @@ drivers/mfd/congatec-cgeb.c:564:25: sparse: expected void [noderef] __user * drivers/mfd/congatec-cgeb.c:564:25: sparse: got void *[addressable] data >> drivers/mfd/congatec-cgeb.c:572:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[assigned] data @@ got void [noderef] __user *memory @@ drivers/mfd/congatec-cgeb.c:572:23: sparse: expected void *[assigned] data drivers/mfd/congatec-cgeb.c:572:23: sparse: got void [noderef] __user *memory >> drivers/mfd/congatec-cgeb.c:612:49: sparse: sparse: Using plain integer as NULL pointer >> drivers/mfd/congatec-cgeb.c:651:35: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __user *optr_user @@ got void *[addressable] optr @@ drivers/mfd/congatec-cgeb.c:651:35: sparse: expected void [noderef] __user *optr_user drivers/mfd/congatec-cgeb.c:651:35: sparse: got void *[addressable] optr >> drivers/mfd/congatec-cgeb.c:786:39: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[assigned] data @@ got void [noderef] __user *off @@ drivers/mfd/congatec-cgeb.c:786:39: sparse: expected void *[assigned] data drivers/mfd/congatec-cgeb.c:786:39: sparse: got void [noderef] __user *off drivers/mfd/congatec-cgeb.c:788:42: sparse: sparse: Using plain integer as NULL pointer >> drivers/mfd/congatec-cgeb.c:863:40: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __user *off @@ got void *[addressable] virt @@ drivers/mfd/congatec-cgeb.c:863:40: sparse: expected void [noderef] __user *off drivers/mfd/congatec-cgeb.c:863:40: sparse: got void *[addressable] virt drivers/mfd/congatec-cgeb.c:865:42: sparse: sparse: Using plain integer as NULL pointer >> drivers/mfd/congatec-cgeb.c:884:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *[assigned] data @@ got void [noderef] __user *ptr @@ drivers/mfd/congatec-cgeb.c:884:23: sparse: expected void *[assigned] data drivers/mfd/congatec-cgeb.c:884:23: sparse: got void [noderef] __user *ptr >> drivers/mfd/congatec-cgeb.c:911:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *_mem @@ got void [noderef] __iomem *[assigned] pcur @@ drivers/mfd/congatec-cgeb.c:911:36: sparse: expected void *_mem drivers/mfd/congatec-cgeb.c:911:36: sparse: got void [noderef] __iomem *[assigned] pcur >> drivers/mfd/congatec-cgeb.c:938:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *_mem @@ got void [noderef] __iomem *[assigned] high_desc_virt @@ drivers/mfd/congatec-cgeb.c:938:37: sparse: expected void *_mem drivers/mfd/congatec-cgeb.c:938:37: sparse: got void [noderef] __iomem *[assigned] high_desc_virt vim +407 drivers/mfd/congatec-cgeb.c 401 402 static int cgeb_copy_to_user(struct cgeb_msg *resp, void *user) 403 { 404 struct cgeb_high_desc *high_desc; 405 unsigned long uncopied; 406 high_desc = user; > 407 uncopied = copy_to_user(resp->code.data, high_desc, 408 high_desc->code_size); 409 if (uncopied) { 410 pr_err("CGEB: Couldn't copy code into userspace! %ld\n", 411 uncopied); 412 return -ENOMEM; 413 } 414 return 0; 415 } 416 417 static int cgeb_upload_code(struct cgeb_high_desc *high_desc, 418 struct cgeb_board_data *board) 419 { 420 struct cgeb_msg req = {0}, resp; 421 size_t len = high_desc->code_size; 422 int ret = 0; 423 424 req.type = CGEB_MSG_ALLOC_CODE; 425 req.code.length = len; 426 pr_debug("CGEB: Allocating memory for code\n"); 427 ret = cgeb_request(req, &resp, cgeb_copy_to_user, high_desc); 428 if (ret) 429 goto out; 430 if (resp.type != CGEB_MSG_CODE) { 431 pr_err("CGEB: Bad response type for alloc: %d\n", resp.type); 432 ret = -EINVAL; 433 goto out; 434 } 435 > 436 board->code = resp.code.data; 437 board->code_size = len; 438 439 req.type = CGEB_MSG_CODE; 440 req.code.data = resp.code.data; 441 req.code.entry_rel = high_desc->entry_rel; 442 req.code.length = len; 443 444 pr_debug("CGEB: Uploading code\n"); 445 ret = cgeb_request(req, &resp, NULL, NULL); 446 447 if (ret) 448 goto out; 449 450 /* Do stuff with response */ 451 if (resp.type != CGEB_MSG_ACK) { 452 pr_err("CGEB: Failed to upload code! Got non-ack response!\n"); 453 ret = -EINVAL; 454 } 455 456 out: 457 return ret; 458 } 459 460 static unsigned short get_data_segment(void) 461 { 462 unsigned short ret; 463 464 #ifdef CONFIG_X86_64 465 ret = 0; 466 #else 467 asm volatile("mov %%ds, %0\n" 468 : "=r"(ret) 469 : 470 : "memory" 471 ); 472 #endif 473 474 return ret; 475 } 476 477 static int cgeb_after_call(struct cgeb_msg *resp, void *user) 478 { 479 int ret = 0; 480 int alloc_size; 481 struct cgeb_call_user *data = user; 482 if (!resp->fps.fps.optr) 483 return ret; 484 485 switch(resp->fps.fps.status) { 486 case CGEB_NEXT: 487 case CGEB_NOIRQS: 488 case CGEB_DELAY: 489 case CGEB_DBG_HEX: 490 case CGEB_DBG_DEC: 491 /* These lead to continuations, we don't need their memory */ 492 return ret; 493 494 /* Everything else we could need */ 495 case CGEB_DBG_STR: 496 data->size = alloc_size = strnlen_user(resp->fps.fps.optr, 1023); 497 if (alloc_size > 1023) { 498 data->size = 1023; 499 alloc_size = data->size + 1; 500 } 501 /* Special case, because these come from program memory */ 502 data->optr = kzalloc(alloc_size, GFP_KERNEL); 503 if (!data->optr) 504 return -ENOMEM; 505 } 506 507 ret = copy_from_user(data->optr, resp->fps.fps.optr, data->size); 508 509 if (ret) { 510 pr_err("CGEB: Couldn't copy optr out of userspace! %d\n", ret); 511 ret = -ENOMEM; 512 } 513 514 if (resp->fps.fps.status == CGEB_SUCCESS && data->callback) { 515 data->callback(resp->fps.fps.optr, data->optr, 516 data->callback_data); 517 } 518 519 return ret; 520 } 521 522 static int cgeb_after_alloc(struct cgeb_msg *resp, void *user) 523 { 524 int ret; 525 struct cgeb_after_alloc_data *data = user; 526 > 527 ret = copy_to_user(resp->code.data, data->kernel, data->length); 528 529 if (ret) { 530 pr_err("CGEB: Couldn't copy iptr into userspace! %d\n", ret); 531 532 ret = -ENOMEM; 533 } 534 > 535 *data->user = resp->code.data; 536 537 return ret; 538 } 539 540 static int cgeb_get_user_ptr(void *kernel, void __user **user, size_t length) 541 { 542 struct cgeb_msg req = {0}, resp; 543 struct cgeb_after_alloc_data data; 544 545 data.kernel = kernel; 546 data.user = user; 547 data.length = length; 548 549 req.type = CGEB_MSG_ALLOC; 550 req.code.length = length; 551 return cgeb_request(req, &resp, cgeb_after_alloc, &data); 552 } 553 554 static void __user *cgeb_user_alloc(size_t length) 555 { 556 int ret; 557 struct cgeb_msg req = {0}, resp; 558 req.type = CGEB_MSG_ALLOC; 559 req.code.length = length; 560 ret = cgeb_request(req, &resp, NULL, NULL); 561 if (ret) 562 return NULL; 563 > 564 return resp.code.data; 565 } 566 567 static int cgeb_user_free(void __user *memory) 568 { 569 struct cgeb_msg req = {0}, resp; 570 571 req.type = CGEB_MSG_FREE; > 572 req.code.data = memory; 573 return cgeb_request(req, &resp, NULL, NULL); 574 } 575 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki