Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3223191yba; Mon, 22 Apr 2019 23:13:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPMzM45J380vUSgbY+pHXgWrcrAgSjn5+l7UVyRda/SvssNaEyaXVJZMjwCrXNWwmzmXpO X-Received: by 2002:aa7:8b83:: with SMTP id r3mr24872393pfd.248.1556000039682; Mon, 22 Apr 2019 23:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556000039; cv=none; d=google.com; s=arc-20160816; b=UWPawRVGYGhJLIwh0uKC+2gHG0rnE18bkMW3QofZa9jSts2lhRttgWBiYweZC25ERV 1LyDJrDD64NanJNDpJyNdJsu19eJgxmXctBDH4DWfNbdaAYTcur/Y1AdWPPENh+i51zF PocRBezXVLqMESU2M5NKfQmhsB5bmb6juKdPZodZw2jicZHmjYpBN6+ziS7h6JIfAXwq eFiaRmTQWh8lXS2RWJN9C7DZrYqisVljbDGTWh7/I6AmcBUxJaxlHJ2lZIx0n/G+MXPh NW0uMuDBv3bxhSzsLLC//JxmvYwG7GsJdgyjl344v68r/+g6l4JRS47KLPcYtazElhfH azcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=iugMndtS+DkaiLYMrTOtWCr0VRRFgS/RZ1/wHSlQ0II=; b=R7fzGXYuWSblxIlmjcFsxoRJXJKbtcRU339fodgQkSEZgbdg8VSXf5ynAO030nvhL9 0jbBw0X+lpVveThkD/hRDMxnrYKMBl7T7CiRlnj5YXX67vTT5TvOQhg+4DGMwLgYXOzJ /ndRSM5j8KA12/NWwkf+IWLuxQhDGN0z8lzodNDKjZU30c4+1dzvq9STraRZ3owjycJW IID+j0YqUg7aFTTHmHaySKTd5xmC08Qvqv3SCxORoJiX18bX/5Xno4RjfUmRql0rfEVK zA5R7rybDUfRamfABg0eSbrwtR0qlktAO2lT03rfZm8pEgBq3GMEwmCptup8X+ec8hSi l1Eg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cl15si15374186plb.117.2019.04.22.23.13.44; Mon, 22 Apr 2019 23:13:59 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726342AbfDWGMs (ORCPT + 99 others); Tue, 23 Apr 2019 02:12:48 -0400 Received: from verein.lst.de ([213.95.11.211]:44342 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfDWGMs (ORCPT ); Tue, 23 Apr 2019 02:12:48 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 64DC068AFE; Tue, 23 Apr 2019 08:12:32 +0200 (CEST) Date: Tue, 23 Apr 2019 08:12:32 +0200 From: Christoph Hellwig To: Lu Baolu Cc: Christoph Hellwig , David Woodhouse , Joerg Roedel , ashok.raj@intel.com, jacob.jun.pan@intel.com, alan.cox@intel.com, kevin.tian@intel.com, mika.westerberg@linux.intel.com, pengfei.xu@intel.com, Konrad Rzeszutek Wilk , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 02/10] swiotlb: Factor out slot allocation and free Message-ID: <20190423061232.GB12762@lst.de> References: <20190421011719.14909-1-baolu.lu@linux.intel.com> <20190421011719.14909-3-baolu.lu@linux.intel.com> <20190422164555.GA31181@lst.de> <0c6e5983-312b-0d6b-92f5-64861cd6804d@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c6e5983-312b-0d6b-92f5-64861cd6804d@linux.intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2019 at 09:58:19AM +0800, Lu Baolu wrote: > 554 for (i = 0; i < nslots; i++) > 555 io_tlb_orig_addr[index+i] = orig_addr + (i << > IO_TLB_SHIFT); > > Could the tlb orig address set to PAGE_ALIGN_DOWN(orig_addr)? We > couldn't assume the bounce buffer just starts from the beginning of the > slot. Or anything I missed? I don't see why we need to align the orig_addr. We only use io_tlb_orig_addr to find the address(es) for the swiotlb_bounce calls, and I don't see a good reason why we'd need to align those.