From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754336AbcK1Huy convert rfc822-to-8bit (ORCPT ); Mon, 28 Nov 2016 02:50:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59794 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751725AbcK1Hur (ORCPT ); Mon, 28 Nov 2016 02:50:47 -0500 Message-ID: <1480319444.20061.4.camel@redhat.com> Subject: Re: virtio gpu sparse warning From: Gerd Hoffmann To: "Michael S. Tsirkin" Cc: Jiri Slaby , virtualization@lists.linux-foundation.org, Linux kernel mailing list , David Airlie , dri-devel@lists.freedesktop.org Date: Mon, 28 Nov 2016 08:50:44 +0100 In-Reply-To: <20161124045101-mutt-send-email-mst@kernel.org> References: <20161108223153-mutt-send-email-mst@kernel.org> <1478678517.2078.12.camel@redhat.com> <1479301975.25611.23.camel@redhat.com> <20161124045101-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 28 Nov 2016 07:50:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Do, 2016-11-24 at 04:57 +0200, Michael S. Tsirkin wrote: > sparse produces these warnings: > > drivers/gpu/drm/virtio/virtgpu_fb.c:340:27: warning: incorrect type in > assignment (different address spaces) > drivers/gpu/drm/virtio/virtgpu_fb.c:340:27: expected char [noderef] > *screen_base > drivers/gpu/drm/virtio/virtgpu_fb.c:340:27: got void *vmap > > This is because the expected type is void __iomem *, while > virtio gpu object is void *vmap. > > We could just cast the warning away but I'm not sure this > is not a symptom of an actual problem. For example, might > some code call iounmap on this address? Nobody is ever going to unmap that, the kernel will simply use given address to access the framebuffer. Actually it looks like this (in include/linux/fb.h): union { char __iomem *screen_base; /* Virtual address */ char *screen_buffer; }; and given that the virtio always uses normal ram as backing storage for the framebuffer we should simply s/screen_base/screen_buffer/. I'll go prepare a patch. cheers, Gerd