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 X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A095EC433DF for ; Mon, 18 May 2020 03:27:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75EAF2070A for ; Mon, 18 May 2020 03:27:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CdDKS8HT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgERD1s (ORCPT ); Sun, 17 May 2020 23:27:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56612 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726639AbgERD1s (ORCPT ); Sun, 17 May 2020 23:27:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589772466; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XWq69cxc6uMliMSLmzS+y2EN4gmCm0BpLb7U6ruoHg0=; b=CdDKS8HTH6L6NKbyOBHKBaJ8sHW5bkX2hpddAmkVwp/02k4l1dKMQIRFiHyXjAKtq8Yg82 kN59+1sez7du8a+HsKJPJWucS1KN/MVxOU/iStEePnWE8Vf+YXuRjBm9Gf67F5sA12P84K J751ihtAAj8aSqmrzCQCU8OriqXdRQ0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-bZgQyu2AMO-a8DtVqHT04g-1; Sun, 17 May 2020 23:27:44 -0400 X-MC-Unique: bZgQyu2AMO-a8DtVqHT04g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D42A8015D2; Mon, 18 May 2020 03:27:43 +0000 (UTC) Received: from [10.72.13.232] (ovpn-13-232.pek2.redhat.com [10.72.13.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE12E10013D9; Mon, 18 May 2020 03:27:38 +0000 (UTC) Subject: Re: [PATCH] vhost: missing __user tags To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org Cc: kbuild test robot , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org References: <20200515153347.1092235-1-mst@redhat.com> From: Jason Wang Message-ID: Date: Mon, 18 May 2020 11:27:37 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200515153347.1092235-1-mst@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/15 下午11:33, Michael S. Tsirkin wrote: > sparse warns about converting void * to void __user *. This is not new > but only got noticed now that vhost is built on more systems. > This is just a question of __user tags missing in a couple of places, > so fix it up. > > Fixes: f88949138058 ("vhost: introduce O(1) vq metadata cache") > Reported-by: kbuild test robot > Signed-off-by: Michael S. Tsirkin > --- > drivers/vhost/vhost.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index d450e16c5c25..21a59b598ed8 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -730,7 +730,7 @@ static inline void __user *vhost_vq_meta_fetch(struct vhost_virtqueue *vq, > if (!map) > return NULL; > > - return (void *)(uintptr_t)(map->addr + addr - map->start); > + return (void __user *)(uintptr_t)(map->addr + addr - map->start); > } > > /* Can we switch to this memory table? */ > @@ -869,7 +869,7 @@ static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq, > * not happen in this case. > */ > static inline void __user *__vhost_get_user(struct vhost_virtqueue *vq, > - void *addr, unsigned int size, > + void __user *addr, unsigned int size, > int type) > { > void __user *uaddr = vhost_vq_meta_fetch(vq, Acked-by: Jason Wang