From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhenyu Wang Subject: Re: [PATCH] drm/i915/gvt: Annotate iomem usage Date: Thu, 4 Apr 2019 15:42:50 +0800 Message-ID: <20190404074250.GR2322@zhen-hp.sh.intel.com> References: <20190404071425.25847-1-chris@chris-wilson.co.uk> Reply-To: Zhenyu Wang Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1871709291==" Return-path: In-Reply-To: <20190404071425.25847-1-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1871709291== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ngPZezdD7QsvFaqQ" Content-Disposition: inline --ngPZezdD7QsvFaqQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019.04.04 08:14:25 +0100, Chris Wilson wrote: > Fix the sparse warning for blithely using iomem with normal memcpy: >=20 > drivers/gpu/drm/i915/gvt/kvmgt.c:916:21: warning: incorrect type in assig= nment (different address spaces) > drivers/gpu/drm/i915/gvt/kvmgt.c:916:21: expected void *aperture_va > drivers/gpu/drm/i915/gvt/kvmgt.c:916:21: got void [noderef] * > drivers/gpu/drm/i915/gvt/kvmgt.c:927:26: warning: incorrect type in argum= ent 1 (different address spaces) > drivers/gpu/drm/i915/gvt/kvmgt.c:927:26: expected void [noderef] *vaddr > drivers/gpu/drm/i915/gvt/kvmgt.c:927:26: got void *aperture_va >=20 > Fixes: d480b28a41a6 ("drm/i915/gvt: Fix aperture read/write emulation whe= n enable x-no-mmap=3Don") > Signed-off-by: Chris Wilson > Cc: Zhenyu Wang > Cc: Changbin Du > Cc: Zhi Wang > --- > drivers/gpu/drm/i915/gvt/kvmgt.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/= kvmgt.c > index d5fcc447d22f..a68addf95c23 100644 > --- a/drivers/gpu/drm/i915/gvt/kvmgt.c > +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c > @@ -905,7 +905,7 @@ static inline bool intel_vgpu_in_aperture(struct inte= l_vgpu *vgpu, u64 off) > static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, u64 off, > void *buf, unsigned long count, bool is_write) > { > - void *aperture_va; > + void __iomem *aperture_va; > =20 > if (!intel_vgpu_in_aperture(vgpu, off) || > !intel_vgpu_in_aperture(vgpu, off + count)) { > @@ -920,9 +920,9 @@ static int intel_vgpu_aperture_rw(struct intel_vgpu *= vgpu, u64 off, > return -EIO; > =20 > if (is_write) > - memcpy(aperture_va + offset_in_page(off), buf, count); > + memcpy_toio(aperture_va + offset_in_page(off), buf, count); > else > - memcpy(buf, aperture_va + offset_in_page(off), count); > + memcpy_fromio(buf, aperture_va + offset_in_page(off), count); > =20 > io_mapping_unmap(aperture_va); > =20 > --=20 Reviewed-by: Zhenyu Wang thanks! --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --ngPZezdD7QsvFaqQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQTXuabgHDW6LPt9CICxBBozTXgYJwUCXKW1egAKCRCxBBozTXgY J8E+AJ9nEnXy/VIqZNNYBeO6Nb/7g8V6vwCfWJ3680ujrr2WSKEp5i1SkfigRPI= =PIJ0 -----END PGP SIGNATURE----- --ngPZezdD7QsvFaqQ-- --===============1871709291== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4 --===============1871709291==--