From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64AE2C4332F for ; Wed, 17 Nov 2021 10:00:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D6B363236 for ; Wed, 17 Nov 2021 10:00:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235922AbhKQKC6 (ORCPT ); Wed, 17 Nov 2021 05:02:58 -0500 Received: from verein.lst.de ([213.95.11.211]:49815 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235849AbhKQKC5 (ORCPT ); Wed, 17 Nov 2021 05:02:57 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 863B668AFE; Wed, 17 Nov 2021 10:59:53 +0100 (CET) Date: Wed, 17 Nov 2021 10:59:53 +0100 From: Christoph Hellwig To: Tianyu Lan Cc: dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, jgross@suse.com, sstabellini@kernel.org, boris.ostrovsky@oracle.com, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, joro@8bytes.org, will@kernel.org, davem@davemloft.net, kuba@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, xen-devel@lists.xenproject.org, michael.h.kelley@microsoft.com, Tianyu Lan , iommu@lists.linux-foundation.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org, vkuznets@redhat.com, brijesh.singh@amd.com, konrad.wilk@oracle.com, parri.andrea@gmail.com, thomas.lendacky@amd.com, dave.hansen@intel.com Subject: Re: [PATCH 1/5] x86/Swiotlb: Add Swiotlb bounce buffer remap function for HV IVM Message-ID: <20211117095953.GA10330@lst.de> References: <20211116153923.196763-1-ltykernel@gmail.com> <20211116153923.196763-2-ltykernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211116153923.196763-2-ltykernel@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The subject is wrong, nothing x86-specific here. Please use "swiotlb: " as the prefix > + * @vaddr: The vaddr of the swiotlb memory pool. The swiotlb > + * memory pool may be remapped in the memory encrypted case and store Please avoid the overly long line. > + /* > + * With swiotlb_unencrypted_base setting, swiotlb bounce buffer will > + * be remapped in the swiotlb_update_mem_attributes() and return here > + * directly. > + */ I'd word this as: /* * If swiotlb_unencrypted_base is set, the bounce buffer memory will * be remapped and cleared in swiotlb_update_mem_attributes. */ > + ret = swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, false); > + if (ret) { > + memblock_free(mem->slots, alloc_size); > + return ret; > + } With the latest update swiotlb_init_io_tlb_mem will always return 0, so no need for the return value change or error handling here.