Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4404441imu; Mon, 14 Jan 2019 22:34:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN5wm7KCHP9ekgvEjTzZX+CSUjy9TJbdC1MoPpRFgk0O6feWeI3jZ19gXgwIlDvIVDzhyCfW X-Received: by 2002:a62:16d6:: with SMTP id 205mr2406444pfw.256.1547534055513; Mon, 14 Jan 2019 22:34:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547534055; cv=none; d=google.com; s=arc-20160816; b=RrFW2TMHZSLnoufiJE0Ime1yVyBlkDsy1pAZ0MQlD1gnv/fU+DaMMMybPmckATKe2M 0sOYb8jCV97ZsdgIm1WKu7szC55EOFHvAOi651oyQl5qzAqKjgp6YydkN/069zbgHoYe EVlFkYJwQzfaGtMHQ/4liCkIkdorrFyhmodloDQC69Pmlq95qz6QjdclakXuf5rxA191 mukp4tgeNyiAMVnyuMub/IEvR/pPBfhCSRGaGPmdL4urWqMmWb5cyQXFTW6krU3jHMhV rL7eq55t1rADYMjL98MQXEc4nsk9Ob8xf/lxBxvrWFHXeNSosv60p9/aePwrT3S85tQQ Nt7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5U4Yr+jS2JUdn/D+ygFqqoeUDxn+oxmgJpsC2yObEJM=; b=0aOVEdeoIUFv8NKcw7vmmPuBfxHxSou2rSkg9r03IcZjchIodRSwOckuzaG+TaKGsA i14BRlT6rOdItnW15yVR30Oq1IYuMYA8xsKKHizbgVa2mJ+5zFkoaH+JZ08KvVW2okwT 3+Ex+XsyHycSfA59MJFDDlhhnQDhAH/MY+DS5RNCI+MNaVWGLjhOJNJlVvOWyTi5Vzgd 0ghEyKgwrwVMscY0QnW65WjVdACOf0germZAQVA87G9nwZh+61MIYc3ejokoEFV8gjZd 0+a8FNv0K66OGfFBDxNfAKSp2rdJrPUW3NxSfEn7dWFDKyWKzxjysdumpdJV47WrAYSN xAaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=opB0LILt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l66si2530987pfl.258.2019.01.14.22.33.59; Mon, 14 Jan 2019 22:34:15 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=opB0LILt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728055AbfAOFmL (ORCPT + 99 others); Tue, 15 Jan 2019 00:42:11 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:45956 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727211AbfAOFmK (ORCPT ); Tue, 15 Jan 2019 00:42:10 -0500 Received: by mail-lf1-f68.google.com with SMTP id b20so1044928lfa.12 for ; Mon, 14 Jan 2019 21:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5U4Yr+jS2JUdn/D+ygFqqoeUDxn+oxmgJpsC2yObEJM=; b=opB0LILtjOwB4hb42JKCpZE4Vs5XNkvxk0O3/UNZ3WLPXcdQA73iwKl29YrZA9d3L1 8SYhAKEJ+NkJ4fESoaOHLpGIwJmCf+vLZfi0f+lg5Ys8NLLYSk0slaL0ai2pp8D0KE4b DnVqr7YBDo9B8pSz18T9jviys2CSqrndoW3SEYNTfqJgJ+HKGfq6MzrvbJS1FihcUe5G r+6b366ncZ2Qpy3LtTQQLDN3djzMmTLMxKzof/RcKVvta1n+mLO4hGax2pt/sq2aGIls 5cMgxzgmJ8dyRiAY+FSgbTw1QdtV0NpuxoBp/DdNlpAdkwEAHjhtvRTWUXc3wSPdvM27 qHpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5U4Yr+jS2JUdn/D+ygFqqoeUDxn+oxmgJpsC2yObEJM=; b=HKsm0Ax0bXmYs/pU9CJy5y//b/F5H2DCvLfrdDYpmYBejdPNG5UWedoNcWZU14yhJ7 /kj7Qm6I3q+NHLsylyQLt7vjngtCINcKMe75/4TaNK18dISqFO2Nv9aKIQgiYgK0ZMGx QB3JV1FKaHOkAvVYXwHfwcLPq8GwiaKzR+HRDvbT03md48hvVHRU33E8fjDWHZmVCc5P BDArk4tNJTZuRcLMTMRr6BJbdWko3ZJnYakku4dwGyH+fURsimyrsSd9dkePJCtJ7OV4 CoaezbU2KBPam0QvgVaUwUi+nXg9FY2gSgrdz8Se/s5Mt5eiEIDRvarB6nXvn3hnWvPz 96Qw== X-Gm-Message-State: AJcUukfNlOsRGqWRItAiJVZG5kP1/GtBnknbDTbBIE7Qislx5NXe5pKv 7zyI68PY+JACDAskh+pOsmXWRU28XVtqsGWUWD0= X-Received: by 2002:a19:2906:: with SMTP id p6mr1442310lfp.17.1547530928341; Mon, 14 Jan 2019 21:42:08 -0800 (PST) MIME-Version: 1.0 References: <20190111151326.GA2853@jordon-HP-15-Notebook-PC> <8b0e0809-8e66-079d-1186-90b3f2df7a38@oracle.com> In-Reply-To: <8b0e0809-8e66-079d-1186-90b3f2df7a38@oracle.com> From: Souptick Joarder Date: Tue, 15 Jan 2019 11:11:56 +0530 Message-ID: Subject: Re: [PATCH 9/9] xen/privcmd-buf.c: Convert to use vm_insert_range_buggy To: Boris Ostrovsky Cc: Andrew Morton , Matthew Wilcox , Michal Hocko , Juergen Gross , Russell King - ARM Linux , robin.murphy@arm.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 15, 2019 at 5:01 AM Boris Ostrovsky wrote: > > On 1/11/19 10:13 AM, Souptick Joarder wrote: > > Convert to use vm_insert_range_buggy() to map range of kernel > > memory to user vma. > > > > This driver has ignored vm_pgoff. We could later "fix" these drivers > > to behave according to the normal vm_pgoff offsetting simply by > > removing the _buggy suffix on the function name and if that causes > > regressions, it gives us an easy way to revert. > > > > Signed-off-by: Souptick Joarder > > --- > > drivers/xen/privcmd-buf.c | 8 ++------ > > 1 file changed, 2 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/xen/privcmd-buf.c b/drivers/xen/privcmd-buf.c > > index de01a6d..a9d7e97 100644 > > --- a/drivers/xen/privcmd-buf.c > > +++ b/drivers/xen/privcmd-buf.c > > @@ -166,12 +166,8 @@ static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma) > > if (vma_priv->n_pages != count) > > ret = -ENOMEM; > > else > > - for (i = 0; i < vma_priv->n_pages; i++) { > > - ret = vm_insert_page(vma, vma->vm_start + i * PAGE_SIZE, > > - vma_priv->pages[i]); > > - if (ret) > > - break; > > - } > > + ret = vm_insert_range_buggy(vma, vma_priv->pages, > > + vma_priv->n_pages); > > This can use the non-buggy version. But since the original code was > indeed buggy in this respect I can submit this as a separate patch later. > > So > > Reviewed-by: Boris Ostrovsky Thanks Boris. > > > > > > if (ret) > > privcmd_buf_vmapriv_free(vma_priv); >