Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4663169ybz; Tue, 28 Apr 2020 15:58:57 -0700 (PDT) X-Google-Smtp-Source: APiQypJE0l3V/vp3VjIOidWcE1VkkiQX/KOEhPv80g+GZl0YK6elvr9W+ap/lyho4w9rfqj8mFu3 X-Received: by 2002:a17:906:82d2:: with SMTP id a18mr24535ejy.373.1588114737370; Tue, 28 Apr 2020 15:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588114737; cv=none; d=google.com; s=arc-20160816; b=tNTuBmgxVqR01l+9DCrO8EHqqr5+vDM3Fj+RR59/OhvGSZmI3es0WmsdY/4gRlNr4O rdC2EFVlKAJttRBuh4jxGbK5A89C9kgmpZcme2J9VJw1RHXjPWszgEmCs3f2rc5PRwX+ V05pzYU9j9cN2F/qKOz9RlghCIrBdRvdg050MFQufNe04+MRm9UMA+gMDgf33NRsYmlP WbhL3u3stApx2y4GZX9TR6/1sDQVJ9/7uu3Frdn/aklbw0+bg7hXwIihYEfWxeJHQG5P +SH8IL3wlq6tvoJ3u50yS0Ewi4GQVCGhYl/V5QEnUPR2WS8zt2AwC4G0ZFmrXYaXbjjs +wHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=WLKpLDQuhbmAfHqaL57rT7hjTQO+SaEn/h2bAJVGXUE=; b=VM8gvB8rOKsCUN4/SI9zxigDfKJfzs5IIjvAUxri6eBCv9iIgHIKpWPKu+NcL7nWUo ITZmt708XqnfIS4Ih/1xStNt6blN0+gJVyDe5M8jlk38mKKrTauF6eeAn3416HSqhv05 xpXY53KZbal7tLwkvbvFHyE84DpLzbPvRb8O1yOnQ59bnFVXt7D00smGjW5AEVlXQctk M9U2n6FPUHwvW4wuCe9V3RBZqxgGUjj1KwdCpVru/Ettbfrk2Bg2JDeDtrAQ5ZARnGev zRinfDdd0y9RBxY8mzABP1Jw4Ygd5DKHb6m4bxmBMMc54KFeZHnqRC3uO7Rk2fJewdB0 G6MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K8ywBOYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a35si2458792edf.377.2020.04.28.15.58.33; Tue, 28 Apr 2020 15:58:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K8ywBOYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726548AbgD1Wx4 (ORCPT + 99 others); Tue, 28 Apr 2020 18:53:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:40740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726042AbgD1Wx4 (ORCPT ); Tue, 28 Apr 2020 18:53:56 -0400 Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ACB2E206D9; Tue, 28 Apr 2020 22:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588114436; bh=ywVtSYZTVnlMl6doGY8VJNhfjwkHTSTfeN9miNjuHLc=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=K8ywBOYNFWIro+8tTcJPkzDdktI4MKmTQFI2jKuDDCZxz/UPDSdJCkEwANhDBlV4Z +AD2jXT3SglB96bLRp2T+E2dhPpvIycmfgpopwde4gOSyMWOMgY/EG/59z2V1xC782 pzdsNh2DvdLoOlNaBrJ/mPX3Dl7yMXVfFt5esrDw= Date: Tue, 28 Apr 2020 15:53:55 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Srivatsa Vaddagiri cc: konrad.wilk@oracle.com, mst@redhat.com, jasowang@redhat.com, jan.kiszka@siemens.com, will@kernel.org, stefano.stabellini@xilinx.com, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org, tsoni@codeaurora.org, pratikp@codeaurora.org, christoffer.dall@arm.com, alex.bennee@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] virtio: Add bounce DMA ops In-Reply-To: <1588073958-1793-6-git-send-email-vatsa@codeaurora.org> Message-ID: References: <1588073958-1793-1-git-send-email-vatsa@codeaurora.org> <1588073958-1793-6-git-send-email-vatsa@codeaurora.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Apr 2020, Srivatsa Vaddagiri wrote: > For better security, its desirable that a guest VM's memory is > not accessible to any entity that executes outside the context of > guest VM. In case of virtio, backend drivers execute outside the > context of guest VM and in general will need access to complete > guest VM memory. One option to restrict the access provided to > backend driver is to make use of a bounce buffer. The bounce > buffer is accessible to both backend and frontend drivers. All IO > buffers that are in private space of guest VM are bounced to be > accessible to backend. [...] > +static int __init virtio_bounce_setup(struct reserved_mem *rmem) > +{ > + unsigned long node = rmem->fdt_node; > + > + if (!of_get_flat_dt_prop(node, "no-map", NULL)) > + return -EINVAL; > + > + return virtio_register_bounce_buffer(rmem->base, rmem->size); > +} > + > +RESERVEDMEM_OF_DECLARE(virtio, "virtio_bounce_pool", virtio_bounce_setup); Is this special reserved-memory region documented somewhere?