[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YqGAZoG6/pVX9NqN@infradead.org>
Date: Wed, 8 Jun 2022 22:08:54 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Dongli Zhang <dongli.zhang@...cle.com>
Cc: iommu@...ts.linux-foundation.org, xen-devel@...ts.xenproject.org,
x86@...nel.org, linuxppc-dev@...ts.ozlabs.org,
virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, hch@...radead.org,
m.szyprowski@...sung.com, jgross@...e.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
sstabellini@...nel.org, mpe@...erman.id.au, konrad.wilk@...cle.com,
mst@...hat.com, jasowang@...hat.com, joe.jin@...cle.com
Subject: Re: [PATCH RFC v1 3/7] swiotlb-xen: support highmem for xen specific
code
On Wed, Jun 08, 2022 at 05:55:49PM -0700, Dongli Zhang wrote:
> @@ -109,19 +110,25 @@ int xen_swiotlb_fixup(void *buf, unsigned long nslabs, bool high)
> int rc;
> unsigned int order = get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT);
> unsigned int i, dma_bits = order + PAGE_SHIFT;
> + unsigned int max_dma_bits = MAX_DMA32_BITS;
> dma_addr_t dma_handle;
> phys_addr_t p = virt_to_phys(buf);
>
> BUILD_BUG_ON(IO_TLB_SEGSIZE & (IO_TLB_SEGSIZE - 1));
> BUG_ON(nslabs % IO_TLB_SEGSIZE);
>
> + if (high) {
> + dma_bits = MAX_DMA64_BITS;
> + max_dma_bits = MAX_DMA64_BITS;
> + }
> +
I think you really want to pass the addressing bits or mask to the
remap callback and not do magic with a 'high' flag here.
Powered by blists - more mailing lists