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 C132AC43217 for ; Tue, 25 Jan 2022 19:18:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF5DF6B0080; Tue, 25 Jan 2022 14:18:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AA2C56B0081; Tue, 25 Jan 2022 14:18:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 947746B0083; Tue, 25 Jan 2022 14:18:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 7E8CB6B0081 for ; Tue, 25 Jan 2022 14:18:20 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 312AE92ECE for ; Tue, 25 Jan 2022 19:18:20 +0000 (UTC) X-FDA: 79069770360.18.55B7633 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf23.hostedemail.com (Postfix) with ESMTP id 3D3F4140019 for ; Tue, 25 Jan 2022 19:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643138299; x=1674674299; h=date:from:to:cc:subject:message-id:mime-version; bh=CqQt9TWaKHoDLKg/Q7rD8eTrxeshMEFEdwFdpGztwj0=; b=edWZ/8ptElWM+Z8wUhWk7LXtngphxfCJ3r7Nc86OtnNw8fcMAUVBG1Vx 2Bqhq+1ucJ9rLuHFTXDVZ5gf/VNCmMyA2HvPXZvAkzB1brYOeOQiU+Ocs Byx3//PoxleytEWtZUBYygRjZ6jdGI9YkQdPFD08MejAYr9KHLi/DLVY9 AiEl9oFpbiZrfszZKux5/3ki1spbc1zmSIes1MeA1SjO5EVyNMlO7FLoQ 29tCYB8v1lWSeqGzbVyhXc4Xa/AH1h+EAvEYMIVlDwWDzKnOSSQQXIjFW OWham85jejxZidCiOw7KR9P+eZYvBiQeZhbzjBLdgJzF5gDu/83viLmop Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="229968116" X-IronPort-AV: E=Sophos;i="5.88,315,1635231600"; d="scan'208";a="229968116" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 11:18:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,315,1635231600"; d="scan'208";a="520511435" Received: from lkp-server01.sh.intel.com (HELO 276f1b88eecb) ([10.239.97.150]) by orsmga007.jf.intel.com with ESMTP; 25 Jan 2022 11:18:16 -0800 Received: from kbuild by 276f1b88eecb with local (Exim 4.92) (envelope-from ) id 1nCRKZ-000KLn-PK; Tue, 25 Jan 2022 19:18:15 +0000 Date: Wed, 26 Jan 2022 03:17:21 +0800 From: kernel test robot To: Kees Cook Cc: kbuild-all@lists.01.org, Linux Memory Management List Subject: [linux-next:master 1564/1734] drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: sparse: incorrect type in argument 1 (different address spaces) Message-ID: <202201260213.oowhhI4F-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspam-User: nil X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3D3F4140019 X-Stat-Signature: fugqabqdsknfbkxybkyyybi31jmemt57 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="edWZ/8pt"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf23.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 134.134.136.126) smtp.mailfrom=lkp@intel.com X-HE-Tag: 1643138298-321459 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: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: d25ee88530253138d0b20d43511ca5acbda4e9f7 commit: 6f6f253efa1346fb0b7206c0361428aadbb22e08 [1564/1734] fortify: Detect struct member overflows in memset() at compile-time config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220126/202201260213.oowhhI4F-lkp@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.4-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=6f6f253efa1346fb0b7206c0361428aadbb22e08 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 6f6f253efa1346fb0b7206c0361428aadbb22e08 # save the config file to linux build tree mkdir build_dir make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/gma500/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem * @@ drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: expected void const * drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: got unsigned char [noderef] [usertype] __iomem * >> drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got unsigned char [noderef] [usertype] __iomem * @@ drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: expected void const * drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: got unsigned char [noderef] [usertype] __iomem * >> drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got unsigned char [noderef] [usertype] __iomem * @@ drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: expected void * drivers/gpu/drm/gma500/framebuffer.c:268:9: sparse: got unsigned char [noderef] [usertype] __iomem * vim +268 drivers/gpu/drm/gma500/framebuffer.c 4d8d096e9ae866 Alan Cox 2011-11-03 225 4d8d096e9ae866 Alan Cox 2011-11-03 226 /** 4d8d096e9ae866 Alan Cox 2011-11-03 227 * psbfb_create - create a framebuffer 358794a29a5fe3 Lee Jones 2021-01-15 228 * @fb_helper: the framebuffer helper 4d8d096e9ae866 Alan Cox 2011-11-03 229 * @sizes: specification of the layout 4d8d096e9ae866 Alan Cox 2011-11-03 230 * 4d8d096e9ae866 Alan Cox 2011-11-03 231 * Create a framebuffer to the specifications provided 4d8d096e9ae866 Alan Cox 2011-11-03 232 */ 6b7ce2c4161a00 Thomas Zimmermann 2019-11-22 233 static int psbfb_create(struct drm_fb_helper *fb_helper, 4d8d096e9ae866 Alan Cox 2011-11-03 234 struct drm_fb_helper_surface_size *sizes) 4d8d096e9ae866 Alan Cox 2011-11-03 235 { 6b7ce2c4161a00 Thomas Zimmermann 2019-11-22 236 struct drm_device *dev = fb_helper->dev; f71635e893c383 Thomas Zimmermann 2021-09-20 237 struct drm_psb_private *dev_priv = to_drm_psb_private(dev); a2c68495b57986 Thomas Zimmermann 2020-12-01 238 struct pci_dev *pdev = to_pci_dev(dev->dev); 4d8d096e9ae866 Alan Cox 2011-11-03 239 struct fb_info *info; 0a8ec2ed0783eb Thomas Zimmermann 2019-11-22 240 struct drm_framebuffer *fb; a9a644ac9e8d6c Dave Airlie 2011-11-28 241 struct drm_mode_fb_cmd2 mode_cmd; 4d8d096e9ae866 Alan Cox 2011-11-03 242 int size; 4d8d096e9ae866 Alan Cox 2011-11-03 243 int ret; f2d061ed01b3f0 Thomas Zimmermann 2021-10-15 244 struct psb_gem_object *backing; 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 245 struct drm_gem_object *obj; a9a644ac9e8d6c Dave Airlie 2011-11-28 246 u32 bpp, depth; 4d8d096e9ae866 Alan Cox 2011-11-03 247 4d8d096e9ae866 Alan Cox 2011-11-03 248 mode_cmd.width = sizes->surface_width; 4d8d096e9ae866 Alan Cox 2011-11-03 249 mode_cmd.height = sizes->surface_height; a9a644ac9e8d6c Dave Airlie 2011-11-28 250 bpp = sizes->surface_bpp; 6aa1ead1b85581 Kirill A. Shutemov 2012-03-08 251 depth = sizes->surface_depth; 4d8d096e9ae866 Alan Cox 2011-11-03 252 4d8d096e9ae866 Alan Cox 2011-11-03 253 /* No 24bit packed */ a9a644ac9e8d6c Dave Airlie 2011-11-28 254 if (bpp == 24) a9a644ac9e8d6c Dave Airlie 2011-11-28 255 bpp = 32; 4d8d096e9ae866 Alan Cox 2011-11-03 256 ebc7d6470ac4b5 Patrik Jakobsson 2020-10-28 257 mode_cmd.pitches[0] = ALIGN(mode_cmd.width * DIV_ROUND_UP(bpp, 8), 64); a6ba582d264f67 Alan Cox 2011-11-29 258 a6ba582d264f67 Alan Cox 2011-11-29 259 size = mode_cmd.pitches[0] * mode_cmd.height; a6ba582d264f67 Alan Cox 2011-11-29 260 size = ALIGN(size, PAGE_SIZE); a6ba582d264f67 Alan Cox 2011-11-29 261 4d8d096e9ae866 Alan Cox 2011-11-03 262 /* Allocate the framebuffer in the GTT with stolen page backing */ 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 263 backing = psb_gem_create(dev, size, "fb", true, PAGE_SIZE); 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 264 if (IS_ERR(backing)) 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 265 return PTR_ERR(backing); f2d061ed01b3f0 Thomas Zimmermann 2021-10-15 266 obj = &backing->base; 4d8d096e9ae866 Alan Cox 2011-11-03 267 bb84977941ad85 Alan Cox 2012-05-03 @268 memset(dev_priv->vram_addr + backing->offset, 0, size); bb84977941ad85 Alan Cox 2012-05-03 269 6b7ce2c4161a00 Thomas Zimmermann 2019-11-22 270 info = drm_fb_helper_alloc_fbi(fb_helper); 546187c85d4d4e Archit Taneja 2015-07-22 271 if (IS_ERR(info)) { 546187c85d4d4e Archit Taneja 2015-07-22 272 ret = PTR_ERR(info); 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 273 goto err_drm_gem_object_put; 4d8d096e9ae866 Alan Cox 2011-11-03 274 } 4d8d096e9ae866 Alan Cox 2011-11-03 275 a9a644ac9e8d6c Dave Airlie 2011-11-28 276 mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth); a9a644ac9e8d6c Dave Airlie 2011-11-28 277 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 278 fb = psb_framebuffer_create(dev, &mode_cmd, obj); 0a8ec2ed0783eb Thomas Zimmermann 2019-11-22 279 if (IS_ERR(fb)) { 0a8ec2ed0783eb Thomas Zimmermann 2019-11-22 280 ret = PTR_ERR(fb); 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 281 goto err_drm_gem_object_put; 0a8ec2ed0783eb Thomas Zimmermann 2019-11-22 282 } 4d8d096e9ae866 Alan Cox 2011-11-03 283 6b7ce2c4161a00 Thomas Zimmermann 2019-11-22 284 fb_helper->fb = fb; 4d8d096e9ae866 Alan Cox 2011-11-03 285 a6ba582d264f67 Alan Cox 2011-11-29 286 info->fbops = &psbfb_unaccel_ops; 4d8d096e9ae866 Alan Cox 2011-11-03 287 4d8d096e9ae866 Alan Cox 2011-11-03 288 info->fix.smem_start = dev->mode_config.fb_base; 4d8d096e9ae866 Alan Cox 2011-11-03 289 info->fix.smem_len = size; ebc7d6470ac4b5 Patrik Jakobsson 2020-10-28 290 info->fix.ywrapstep = 0; a6ba582d264f67 Alan Cox 2011-11-29 291 info->fix.ypanstep = 0; 4d8d096e9ae866 Alan Cox 2011-11-03 292 4d8d096e9ae866 Alan Cox 2011-11-03 293 /* Accessed stolen memory directly */ 37214ca00e6474 Kirill A. Shutemov 2012-05-03 294 info->screen_base = dev_priv->vram_addr + backing->offset; 4d8d096e9ae866 Alan Cox 2011-11-03 295 info->screen_size = size; 4d8d096e9ae866 Alan Cox 2011-11-03 296 4d8d096e9ae866 Alan Cox 2011-11-03 297 if (dev_priv->gtt.stolen_size) { 4d8d096e9ae866 Alan Cox 2011-11-03 298 info->apertures->ranges[0].base = dev->mode_config.fb_base; 4d8d096e9ae866 Alan Cox 2011-11-03 299 info->apertures->ranges[0].size = dev_priv->gtt.stolen_size; 4d8d096e9ae866 Alan Cox 2011-11-03 300 } 4d8d096e9ae866 Alan Cox 2011-11-03 301 6b7ce2c4161a00 Thomas Zimmermann 2019-11-22 302 drm_fb_helper_fill_info(info, fb_helper, sizes); 4d8d096e9ae866 Alan Cox 2011-11-03 303 a2c68495b57986 Thomas Zimmermann 2020-12-01 304 info->fix.mmio_start = pci_resource_start(pdev, 0); a2c68495b57986 Thomas Zimmermann 2020-12-01 305 info->fix.mmio_len = pci_resource_len(pdev, 0); 4d8d096e9ae866 Alan Cox 2011-11-03 306 fb2a99e15ff0d3 Sascha Hauer 2012-02-06 307 /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ 4d8d096e9ae866 Alan Cox 2011-11-03 308 e18da8ce7d730b Thomas Zimmermann 2019-11-22 309 dev_dbg(dev->dev, "allocated %dx%d fb\n", fb->width, fb->height); 4d8d096e9ae866 Alan Cox 2011-11-03 310 4d8d096e9ae866 Alan Cox 2011-11-03 311 return 0; 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 312 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 313 err_drm_gem_object_put: 957a2d0e7ea38d Thomas Zimmermann 2021-10-15 314 drm_gem_object_put(obj); 4d8d096e9ae866 Alan Cox 2011-11-03 315 return ret; 4d8d096e9ae866 Alan Cox 2011-11-03 316 } 4d8d096e9ae866 Alan Cox 2011-11-03 317 :::::: The code at line 268 was first introduced by commit :::::: bb84977941ad85a5c0b9ff4fd5331913e31107c4 gma500: wide framebuffer memory :::::: TO: Alan Cox :::::: CC: Dave Airlie --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org