Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp843177ybg; Wed, 3 Jun 2020 15:27:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWkEvJemuM2MfGn/7O9Q1bKlD1ybk7EHkGIGqOJauRF1bdwj8DK1QyqQMV+szIV22+FxxE X-Received: by 2002:a17:906:28da:: with SMTP id p26mr1244413ejd.551.1591223226811; Wed, 03 Jun 2020 15:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591223226; cv=none; d=google.com; s=arc-20160816; b=FEkslIE1GyXuM8K6rL2puMz+aX7GG60jNaMYD+nkuHQnOQj8kcpgu9Nn4LLtcz5b7O ntUDkqJfWonjNYe53L5T/bfvePS/0am6E7kJzAe0ebJcJREfnIjaea97naTBmTtoRag+ S3F8bLWTrgZ22BqDNRHY9PARgg3uDvqP93/vKtVWEiTnL2IOROND6MCeiS1e2uIPvFNf pkpB653zm1ej7i44r/qE1U7EgpaotTHgFs7XcaZoCvD+fXXQUM/MERF56mzCI5MUkTdm xCDPjJQR+ryKzDb78mi5uhKvf2KwtbuIULZh2a3eqzUSnTK8kThL5wfZ38kJAINAUJ1M ESKQ== 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=Squ1AkSjAJWhLLWMTiwzqaWFwwvds2/ybcU/tfl6ys8=; b=X4xMddPnIZQ7MP+5lcR3h9t1QR8pkIzf77c1lzNQLzX9cp0ELjn5r800z797aNpG/7 2ztQh+8aHUwvCed8C2+cwEAt8lZyEmv1f2XcZsmDdFZyipYyF17EhcyKIrNwpyt84Dju D8nyOtnT2oJ2f4f5+4CriU5LB2ImCl75I95mkEsc24lfXWppDfacyk2gy4noNOobRxfR BK0yQ9cuMWp2XM1GINGlBD8pRQU36UcEiWt9lUKh1yScIz6Tw8CHJQpqhl7NO9xEYFYM gOF3BfQdjBP9Sy8ZIP5rXMDYfsTyohfs1dpAR97ZIuJiU/CSZ2R57V0QCeCCYw+2eyw+ LgKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A8Gw2iZr; 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 g7si541414ejx.451.2020.06.03.15.26.44; Wed, 03 Jun 2020 15:27:06 -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=A8Gw2iZr; 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 S1727024AbgFCWX2 (ORCPT + 99 others); Wed, 3 Jun 2020 18:23:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:56576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbgFCWWu (ORCPT ); Wed, 3 Jun 2020 18:22:50 -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 62443207D0; Wed, 3 Jun 2020 22:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591222969; bh=z/W3HOqwZFpxh5RTvZrhBEC0DsqYoSYR2jgxAVw6hXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A8Gw2iZrApw37MILwEXd0XFn8MbQQTyVONoBAo2odDCqo4bx9EMQ0+3ZRahBnmF3c 0SbM5LE5YCEo4zkcQTFe/l6VXtj6IYfiLHSIpwoMiuBD/hlmH+w7eZtnJoVwe8uH1F EBekaEg39hytF9DxdM0Q7iKp0OHg9bfrinazSkS8= 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, tamas@tklengyel.com, roman@zededa.com, Stefano Stabellini Subject: [PATCH v2 02/11] swiotlb-xen: remove start_dma_addr Date: Wed, 3 Jun 2020 15:22:38 -0700 Message-Id: <20200603222247.11681-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 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 a42129cba36e..ed09f8ac34c5 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)) @@ -389,8 +386,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