Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp43769ybg; Mon, 8 Jun 2020 16:00:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCIAz33Q6K3Qr5RcmRBaJBx2HoSflAuLYtpBVcPStTZFaERCMccBimPok82GZd0dg+HO3t X-Received: by 2002:a17:906:7f05:: with SMTP id d5mr22413807ejr.70.1591657212189; Mon, 08 Jun 2020 16:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591657212; cv=none; d=google.com; s=arc-20160816; b=Y0yhMYVHgHEnmep09sFZvIdvPfqVfJQOyZm9mLP99tZn7dGaNXxZHhADpTjBotGfFA LhGSZL1i4kv1ki24n3E94ZJdLiXE+7vO35W7RabgxNVePeQki8WR+ZnxhL2CM6QEya2o vzratKP2tZU/YJG/GHv7CHogrq2BnVjR5agxWXUNcWU8FSPdpda3ElRUpZ+Wv56EPW5l /cRCVGV5qWaL1j9/CuXkESxO9zXV4P6dvBQJHNdqU1rKgqzRaAdYhGe7AgOKwhP7OJBx HI/IHpw8osT1vp0Nnhu8+nFWtSUjCbwHwzEleSFO7H8aWitgsqoO5cseqGS5cLZIG0ek fhgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=/0Mf0EJMPXxtCoY8t3nyt2DT1gwbJatWX3C4l0/arOY=; b=WID7oZ34ew2X/OPJmBNGDRcsT4q3LSMzZsZpM3vozTFIMbX8oUGOE62qNYnPNjk8yZ nDKSh8Txuy8N99jt7ibR+fGTIVsjbRFMFZdZEqFSg3UWYDvOsB087GixpOs7xNKkdf0h aOMMf9wMptzeua9zWOpO0ZsiqTVYnJWRBOkF2MTHkonPyiKTB53hJoFrKrKBQ/WiF+AV PX6B0bAqg1OgQYfRG3wa/RPSqxmfkTUBeBC9z0bW0m2Sf2+D/8ju6YXE/C9LA0OhH3g3 4o717ModCxHFAMp0+W5v7b5E5F0040vCzVKrs+57Bki7S3F1BzM25Q7MPJSPWTl3gDQf wSqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sV9brVTS; 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 f24si9972583edr.137.2020.06.08.15.59.49; Mon, 08 Jun 2020 16:00:12 -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=sV9brVTS; 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 S1726895AbgFHWyC (ORCPT + 99 others); Mon, 8 Jun 2020 18:54:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:38466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbgFHWyA (ORCPT ); Mon, 8 Jun 2020 18:54:00 -0400 Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6A0DD2076A; Mon, 8 Jun 2020 22:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591656839; bh=aFtqwt+bYOZhJ7U9irm3TzEiOtvg48f3YiInMbcBYs0=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=sV9brVTS0fbsMYHJ/0OiYUYepwLpKHZZvVEPsCcTclhj201DpvYC6IxwM1XDwdEIe K1aFJ5vaHAov9BwrlY9IHX4mYNHZkTNxt1DgO7EyhoVEcdrayUCUJJ00a6kr5y+QET 7Agxg++7d8MkC5wB88ZPCM3NNvh4ps0v1mIPE2Lo= Date: Mon, 8 Jun 2020 15:53:58 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Christoph Hellwig cc: Stefano Stabellini , jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, tamas@tklengyel.com, roman@zededa.com, Stefano Stabellini Subject: Re: [PATCH v2 01/11] swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses In-Reply-To: <20200608070411.GA15742@infradead.org> Message-ID: References: <20200603222247.11681-1-sstabellini@kernel.org> <20200608070411.GA15742@infradead.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, Thanks you for the review. On Mon, 8 Jun 2020, Christoph Hellwig wrote: > Well, this isn't just RPi4, but basically any ARM or ARM64 system > with non-coherent DMA (which is most of them). Well... yes :-) > > + struct page *pg; > > Please spell out page. OK > > > > if (hwdev && hwdev->coherent_dma_mask) > > dma_mask = hwdev->coherent_dma_mask; > > @@ -346,9 +347,11 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, > > /* Convert the size to actually allocated. */ > > size = 1UL << (order + XEN_PAGE_SHIFT); > > > > + pg = is_vmalloc_addr(vaddr) ? vmalloc_to_page(vaddr) : > > + virt_to_page(vaddr); > > Please use plain old if/else to make this more readable. Sure