Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp899513ybt; Fri, 10 Jul 2020 15:37:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8AH3pOwXnbPhcoNEbZurdIXE7QavALrRtYFPKnRNpfAjNX52i1ovPMqWIMtwXVonbBDRs X-Received: by 2002:a17:906:f94c:: with SMTP id ld12mr62296508ejb.426.1594420629626; Fri, 10 Jul 2020 15:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594420629; cv=none; d=google.com; s=arc-20160816; b=OmCv6qz3hu8OB9K4f8Z38xiwRQlSEOfeK0f/oW+cApnaleeNSIGbHbuWBUEgyNX6iE oRo7vZsnQYzb+aFY/qQYf+JqNLC3YT2S+ZMniHDNBFi8hcKAlpaBzS/nsVUrUmHkCtwy zfdy5vWCG1w6jqFrFIWq51kei0ci0YdKl8YzpwIST+if7cw1QXUlQg1f9UXUeDBpOZnh wDYxr5HYeoQp/0xI30ftzCIGEiZYqoy5EIXYioD2CdKKc628A1dGV90Sz9w2PcBODmO3 H65/gG4uqPGm57A3uEeq0FOlyekmkgjoQCx3Pukmxtdr6F+6+d5tiLEtLrjIZLtnTUGm iBUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tUQFaTXiGKSoSZdF0jyLpLOWgcqPD4E6NIvCBssUZXg=; b=zAhpYCs2Hrk6r1j1qtPKYYuoi2XFNeZGtBFUrmGBOdL23kXp+FHIWWZ2iAaRjnjZUq M4chJ4SPvX5yUBU6GdYQdZCKaHnFVYm6kVLZl1Q8Bfqd/RQKYzjmmsPiUl9lxmVhjhee 9gwvcUaqZ8w+0LR66zGZGgMM5ByQouwnA1HRtcmWo91zeSfpqekznGNknsjr0rTTNRQd AVKOy+vOT9HYTRQVWb98XO2qlqV1YKq6rDOVo/I5pVtwrLOVc9nVljeyTwGplKAA4A24 3o8CJlw0rXC07j7FmFulOelEClyFKmplhDNoyj7pp8iJG9k/NjhZe1RSIvcAlZ1q0DYc d4Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jt2yh5WN; 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 y16si764893edv.476.2020.07.10.15.36.47; Fri, 10 Jul 2020 15:37:09 -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=jt2yh5WN; 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 S1726766AbgGJWea (ORCPT + 99 others); Fri, 10 Jul 2020 18:34:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:45902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgGJWea (ORCPT ); Fri, 10 Jul 2020 18:34:30 -0400 Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48CB62075D; Fri, 10 Jul 2020 22:34:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594420469; bh=3GwsLOtHN4zRKft6xlDRfAH+KgUHUTf+yyaVBSSdyn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jt2yh5WNYaKPWaJY8JQkbiswMPHMg7BCgVT5x2iJ3qNwf8+ekBcSJjbVzC8gz0G3r PNuGsVuGq0X296MIu4/hRFaRwZcNLrviXcJ+HjZ31g6Yg4pSVFCK5WlTb5HIX2kvj4 Rqu3BmiwZNkKDZrBDxg3PWP5kl8dkREO6P7GkM/M= From: Stefano Stabellini To: jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Cc: sstabellini@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, hch@infradead.org, Stefano Stabellini Subject: [PATCH v3 02/11] swiotlb-xen: remove start_dma_addr Date: Fri, 10 Jul 2020 15:34:18 -0700 Message-Id: <20200710223427.6897-2-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefano Stabellini It is not strictly needed. Call virt_to_phys on xen_io_tlb_start instead. It will be useful not to have a start_dma_addr around with the next patches. Note that virt_to_phys is not the same as xen_virt_to_bus but actually it is used to compared again __pa(xen_io_tlb_start) as passed to swiotlb_init_with_tbl, so virt_to_phys is actually what we want. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Tested-by: Corey Minyard Tested-by: Roman Shaposhnik --- Changes in v2: - update commit message --- drivers/xen/swiotlb-xen.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 5fbadd07819b..89a775948a02 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -52,8 +52,6 @@ static unsigned long xen_io_tlb_nslabs; * Quick lookup value of the bus address of the IOTLB. */ -static u64 start_dma_addr; - /* * Both of these functions should avoid XEN_PFN_PHYS because phys_addr_t * can be 32bit when dma_addr_t is 64bit leading to a loss in @@ -241,7 +239,6 @@ int __ref xen_swiotlb_init(int verbose, bool early) m_ret = XEN_SWIOTLB_EFIXUP; goto error; } - start_dma_addr = xen_virt_to_bus(xen_io_tlb_start); if (early) { if (swiotlb_init_with_tbl(xen_io_tlb_start, xen_io_tlb_nslabs, verbose)) @@ -392,8 +389,8 @@ static dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, */ trace_swiotlb_bounced(dev, dev_addr, size, swiotlb_force); - map = swiotlb_tbl_map_single(dev, start_dma_addr, phys, - size, size, dir, attrs); + map = swiotlb_tbl_map_single(dev, virt_to_phys(xen_io_tlb_start), + phys, size, size, dir, attrs); if (map == (phys_addr_t)DMA_MAPPING_ERROR) return DMA_MAPPING_ERROR; -- 2.17.1