Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp525101pxj; Thu, 27 May 2021 06:03:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGQ2/CKAvZFDG3uRy0afQFagxkxudlwyth9LQqpdmeRhEb+RKn9A7i7zurnlUQdavdueYC X-Received: by 2002:a05:6602:1815:: with SMTP id t21mr2751062ioh.193.1622120608345; Thu, 27 May 2021 06:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622120608; cv=none; d=google.com; s=arc-20160816; b=Z8LXEB/vJ93JD0I3nL5w+HZCzxoVpZg6Ou+9cvgCHf2mU6qJsHstRgiUNZGSh/m5HA kLVpPpTcheBoM3onDMo+Y5C45w9NHcRD8hqNEBmuIP7pPAhwEHcVOLvMU/Pva/vYHP4Y 3Qkf8rlGSjY7u4DGi5RcJ/2Eozbm6wwqGSNO+slEp9AUnGZ3nouIk71oWjtP5g9xE+t8 peVfjN6bQY3eJHhcPaOkkHexuRaWgUG/kqPXKWdvVqpGy2/BwA7KgI+C72hhbpFtyX0l si25WLwrDlyAddsAmZAkj7Z4zSNnb9wib5+sGRXlVdYJVPpuo6MmfXf7YNYOZBUfiery 34VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=lWHNlQSwwiyz0ZS/gtS4QMws5kZO70morpwuKingSyo=; b=cVJik8eID7TOWdTI0bfQAzNOzvqh8eXQ9FkBpHBJxVyAbVxygK58SMLFREXamSg7sd Vmjhr6DIoT3yVZwiJRVF/VRQWe+QiLaF0IWxeqKl0Uy99StS+s8X3sobwtF6w4D/mlTA WfmRwrUXxh4ggeP4CPihf/VyhEo6StpmerMI4/HongNIC6scKmD9Q7z8rT67ZC1ACPpU CkZhEeK5JvyZNwhLxUs205+vUguvsa+PtkWBd/KsJyYRiinJS2F/lWPXfIml7S98Ll77 QlPIUgup6IKm4sIZCE42cjrVTtG6flQ2Y02clwwCeqBuTS/3w9cc8wlaBUXDIZm/Wnhi ymUg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si2258655ilo.36.2021.05.27.06.03.10; Thu, 27 May 2021 06:03:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235896AbhE0NDz (ORCPT + 99 others); Thu, 27 May 2021 09:03:55 -0400 Received: from verein.lst.de ([213.95.11.211]:38801 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235634AbhE0NDu (ORCPT ); Thu, 27 May 2021 09:03:50 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id D40FB68AFE; Thu, 27 May 2021 15:02:11 +0200 (CEST) Date: Thu, 27 May 2021 15:02:11 +0200 From: Christoph Hellwig To: Florian Fainelli Cc: Claire Chang , Rob Herring , mpe@ellerman.id.au, Joerg Roedel , Will Deacon , Frank Rowand , Konrad Rzeszutek Wilk , boris.ostrovsky@oracle.com, jgross@suse.com, Christoph Hellwig , Marek Szyprowski , benh@kernel.crashing.org, paulus@samba.org, "list@263.net:IOMMU DRIVERS" , sstabellini@kernel.org, Robin Murphy , grant.likely@arm.com, xypron.glpk@gmx.de, Thierry Reding , mingo@kernel.org, bauerman@linux.ibm.com, peterz@infradead.org, Greg KH , Saravana Kannan , "Rafael J . Wysocki" , heikki.krogerus@linux.intel.com, Andy Shevchenko , Randy Dunlap , Dan Williams , Bartosz Golaszewski , linux-devicetree , lkml , linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xenproject.org, Nicolas Boichat , Jim Quinlan , tfiga@chromium.org, bskeggs@redhat.com, bhelgaas@google.com, chris@chris-wilson.co.uk, daniel@ffwll.ch, airlied@linux.ie, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, jxgao@google.com, joonas.lahtinen@linux.intel.com, linux-pci@vger.kernel.org, maarten.lankhorst@linux.intel.com, matthew.auld@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, Tom Lendacky Subject: Re: [PATCH v7 01/15] swiotlb: Refactor swiotlb init functions Message-ID: <20210527130211.GA24344@lst.de> References: <20210518064215.2856977-1-tientzu@chromium.org> <20210518064215.2856977-2-tientzu@chromium.org> <170a54f2-be20-ec29-1d7f-3388e5f928c6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170a54f2-be20-ec29-1d7f-3388e5f928c6@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 11:50:07AM -0700, Florian Fainelli wrote: > You convert this call site with swiotlb_init_io_tlb_mem() which did not > do the set_memory_decrypted()+memset(). Is this okay or should > swiotlb_init_io_tlb_mem() add an additional argument to do this > conditionally? The zeroing is useful and was missing before. I think having a clean state here is the right thing. Not sure about the set_memory_decrypted, swiotlb_update_mem_attributes kinda suggests it is too early to set the memory decrupted. Adding Tom who should now about all this.