Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp990205imu; Fri, 11 Jan 2019 12:50:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN6XoQfixyOEPx8kVMQNfRjSy0UlN2CAunJbNHMZ6++NnMY4ff4LyORFHgmbMY+dGHCHGgCt X-Received: by 2002:a62:6f49:: with SMTP id k70mr15925758pfc.7.1547239820204; Fri, 11 Jan 2019 12:50:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547239820; cv=none; d=google.com; s=arc-20160816; b=ouLeeRlC4Qz2WgrE8IqzetWlvftgZjIKpHEBYtDySJo4h1Sl8yv40juHCDd/Q7Kcoz Qhf7fdDENbdWrGzg99HILrZxMuxfFrIgQiGsLHMZMlcXBUdal2vK0lnKGQlQ7zQmWUqW dCTP0gU8xndxYnmhq1rCWoS5DFx2xeAWXBBwjOkast+7kHxO0J7ukeNttD+4vjmik77I xmNZ28uBEoWfs1MJTaZY1mzxjJAhkcK4rlxf0CGAUjfy3w13cWOfmtyr9Tj/pZBPOkhF nUJVH7ZuJl5pIDgaWt3TSqUzZiM9L6YO43pJu7iJnWpN217odaj418svWA3DOXfD075H iMSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=HRKqpRHmU+L58qncR6PcEXsm4g4xjV60VkG5Win5xw4=; b=zRH3bK2QjyTSeWhbfIfTzGLAkXQPej0a8OUsG2j01ibXA+CKD9evxw0Rlp+rwfAVo9 xkDxL5dADMVKveNhhBLs1gUmlRQwwWOOfB4mzZ93sR71oCYs2/2elPjCVwLFdFau0YDb oMmPScjvTUfskyn7rF3+dnL4uGyaVOimSeS2Ka/vj0j4JXhf+lCL8VxvprQUgQ8/9lXT PYJMfGj3AX6gNxyyFn7zw8uGUtyKZ3eB+NaazCn9JT8wao1de6BhQ7uuAIT6Pxv2z8gQ PWCFi790igssUKZ1nYj2DrwJONfSttLsf6mZLJ4lvsRs8Vl/bOjUlLOu/RcEzoPr1EpK SKqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JuNrLoG8; 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 o10si22580033pgg.373.2019.01.11.12.50.04; Fri, 11 Jan 2019 12:50:20 -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=JuNrLoG8; 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 S2391365AbfAKPJ1 (ORCPT + 99 others); Fri, 11 Jan 2019 10:09:27 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44365 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733093AbfAKPJ0 (ORCPT ); Fri, 11 Jan 2019 10:09:26 -0500 Received: by mail-pg1-f196.google.com with SMTP id t13so6411746pgr.11 for ; Fri, 11 Jan 2019 07:09:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=HRKqpRHmU+L58qncR6PcEXsm4g4xjV60VkG5Win5xw4=; b=JuNrLoG8W9qZ3wovEJ6sEuIJ29dYs5vMzRIRLtQz9SUWeNl4UjyyhYVOScTr6JHLn2 Eakll8RWLEKrzrgsL7JiV9od8DeDB/HnCTihU+VsG+6pQMp1IYeFSVAW8ic4nAjGgwPu ZquG80FbhCmfchutBXtjW0YNVRdpaTlpJVOe6VTaq+Nm7rNFETfSlrUrbqVTIG45AjOX YcGlCzK1UZdaie9TaJRXte+oGsy8++6U7VC24my1faXZkU2RJU+HKD6DEDvFlr7rPo5p 9hqCN38u1u8+c4OS7vN1ygZtyNLYx3RnDsPhAlpbGIdc6CloSEBGOHLU1mxZiDsPzv38 ZPgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=HRKqpRHmU+L58qncR6PcEXsm4g4xjV60VkG5Win5xw4=; b=ObekQZq7EvbTdwZZ1dlobUFnRx0FvIx95dEzkaHpZrJ14VKVQ9fKBCyVO7PMISqz+C dEv8jbwhp0N1+RKVrlCfvK1tuRaIbo+rP94E7xLSJ51saljcAIrSe+dH7Dh9TxJm/XOc Sjf95Zq/w0xhrlYPqvJUF1+pV0jrBJGDSKlJdDwCdncgrNvyQGCz2hV4UVmq4u5U+Bhb my2UaGWMnENRMOoi0dsjMCQXxNCj1vysP5h+oMydAj64+GaqBq4FylPE5QUVTzTc+a9v Yj0Xo5rM/rAPualcmrW1WXwmBdYSKNBJ8dwLG+kRf6CWU5DReP0ZBfSyxWsL0UTEda4D 3STQ== X-Gm-Message-State: AJcUukdRV6YDQhahtv3JCf8fJprJTNxVKAFsOTFGqrSeBiur9Zs+pBhc jVWitQdOO+RboJ88OZT1dkg= X-Received: by 2002:a62:8c11:: with SMTP id m17mr14936629pfd.224.1547219366063; Fri, 11 Jan 2019 07:09:26 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([49.207.52.190]) by smtp.gmail.com with ESMTPSA id j21sm109918120pfn.175.2019.01.11.07.09.23 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Jan 2019 07:09:24 -0800 (PST) Date: Fri, 11 Jan 2019 20:43:26 +0530 From: Souptick Joarder To: akpm@linux-foundation.org, willy@infradead.org, mhocko@suse.com, boris.ostrovsky@oracle.com, jgross@suse.com, linux@armlinux.org.uk, robin.murphy@arm.com Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 9/9] xen/privcmd-buf.c: Convert to use vm_insert_range_buggy Message-ID: <20190111151326.GA2853@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); if (ret) privcmd_buf_vmapriv_free(vma_priv); -- 1.9.1