Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp287637ybl; Thu, 29 Aug 2019 23:10:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYVO42FlQdtRhBrtMRXWz8SX5QqdJyH7xEh3xBCgIteNRSdcZ+ddKuJO93h6m1KW5/1mWt X-Received: by 2002:a17:902:7449:: with SMTP id e9mr12458007plt.242.1567145409121; Thu, 29 Aug 2019 23:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567145409; cv=none; d=google.com; s=arc-20160816; b=cxSQuocxxgOShTtVQEAMLOMU1IJ+xfr1aULSHQRZGM8Kx5mEwcuVyfAv3Tbn7M6vHS nwMVFkIPSXM0V+2Q7T3Ayq+OCEaUUkt1LfGrOr/ybC+FhLQ1KjImNjsnmuu+9w1TpneX gEHu08fOLriAt0y3TnaTlI1YZHSWpCNKcbs4tfmuW0koEdQErXS7AlWR87NCv54TDjAP Y5H565kSRYpTIAO3AC4rWrGQSP+Y+2WFJKQaynFtrrOBR9wYBDrnq5Q5sf2XF/o2lrmf mIrFGH+wSkLZuLajHN4oSnvMc9PjlSrj4+Kp0zEa+Pnrz1jJhfsv96BGGqdzQVfZsH6n dOKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nsVlKthzuYNHhjDEoeX2HSJPewipNjtAdVJnfroWOck=; b=LYjj7qo8kplLYSL2AWUgi0VFnCM2lVXFn8Y+IY/QsXGyvh1rX0K53repLJMKaoV2jS 0wvOE4TuN3s6HrOHmUhstoNDIn8pEZwRpZbC9jWQYT/e6UfHBadO0CBYFJRYCd9mwHVR 3WRCj2ckW1dIox3SgAw1mdTlLGWQjmXh0eEKoNN1oJr2FB4PjTZ/BnZvq+gOQYTHZWZV 3JRb9O/zjvzMIwSVKU65JJwpLQXcZNJOYwGtU+JshjTSR/w7VZYM6UVlNNm6LvthYrwm K7aQUZIvETxYKz0xnE+MkRLaj4vv77w/RrN0Lw0yVT+Uu+5yJUnbmpzAQqOsUvP3VeAM 53hA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9si4026640pjo.109.2019.08.29.23.09.53; Thu, 29 Aug 2019 23:10:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727681AbfH3GJA (ORCPT + 99 others); Fri, 30 Aug 2019 02:09:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726978AbfH3GI7 (ORCPT ); Fri, 30 Aug 2019 02:08:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB4E030832C6; Fri, 30 Aug 2019 06:08:58 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-95.ams2.redhat.com [10.36.116.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BB755C1D6; Fri, 30 Aug 2019 06:08:58 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A32B317536; Fri, 30 Aug 2019 08:08:57 +0200 (CEST) Date: Fri, 30 Aug 2019 08:08:57 +0200 From: Gerd Hoffmann To: David Riley Cc: dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, David Airlie , Daniel Vetter , Gurchetan Singh , =?utf-8?B?U3TDqXBoYW5l?= Marchesin , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/virtio: Use vmalloc for command buffer allocations. Message-ID: <20190830060857.tzrzgoi2hrmchdi5@sirius.home.kraxel.org> References: <20190829212417.257397-1-davidriley@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829212417.257397-1-davidriley@chromium.org> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 30 Aug 2019 06:08:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > { > if (vbuf->resp_size > MAX_INLINE_RESP_SIZE) > kfree(vbuf->resp_buf); > - kfree(vbuf->data_buf); > + kvfree(vbuf->data_buf); if (is_vmalloc_addr(vbuf->data_buf)) ... needed here I gues? > +/* Create sg_table from a vmalloc'd buffer. */ > +static struct sg_table *vmalloc_to_sgt(char *data, uint32_t size) Hmm, isn't there an existing function for that? I'd be surprised if virtio-gpu is the first driver needing this ... And it case there really isn't one this should probably added to the vmalloc or scatterlist code, not the virtio-gpu driver. cheers, Gerd