Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: sashiko-reviews@lists.linux.dev,
	"Arnd Bergmann" <arnd@kernel.org>,
	linux-mm@kvack.org
Cc: "Andreas Larsson" <andreas@gaisler.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Christophe Leroy" <chleroy@kernel.org>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"David Hildenbrand (Red Hat)" <david@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Jason Gunthorpe" <jgg@nvidia.com>,
	"Linus Walleij" <linusw@kernel.org>,
	"Lorenzo Stoakes" <ljs@kernel.org>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Madhavan Srinivasan" <maddy@linux.ibm.com>,
	"Malin Jonsson" <malin.jonsson@est.tech>,
	"Matthew Wilcox" <willy@infradead.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Michal Simek" <monstr@monstr.eu>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Nishanth Menon" <nm@ti.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Russell King" <linux@armlinux.org.uk>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	x86@kernel.org
Subject: Re: [PATCH v3 01/10] ARM: remove support for highmem on VIVT
Date: Wed, 18 Nov 2026 10:47:55 +0100	[thread overview]
Message-ID: <c8f80ac0-83ba-4d59-9930-ef497312e2b7@app.fastmail.com> (raw)
In-Reply-To: <sashiko-outbox-218796@kernel.org>

On Tue, Nov 17, 2026, at 13:49, sashiko-bot@kernel.org wrote:

>> @@ -178,14 +143,12 @@ static void xsc3_l2_flush_range(unsigned long start, unsigned long end)
>>  
>>  	start &= ~(CACHE_LINE_SIZE - 1);
>>  	while (start < end) {
>> -		vaddr = l2_map_va(start, vaddr);
>> +		vaddr = __phys_to_virt(start);
>>  		xsc3_l2_clean_mva(vaddr);
>>  		xsc3_l2_inv_mva(vaddr);
>>  		start += CACHE_LINE_SIZE;
>>  	}
>>  
>> -	l2_unmap_va(vaddr);
>> -
>>  	dsb();
>>  }
>
> [Severity: Low]
> This isn't a bug, but both xsc3_l2_clean_range() and xsc3_l2_flush_range()
> still initialize vaddr = -1 with the comment "to force the first mapping"
> right above these loops.  With l2_map_va() and l2_unmap_va() gone, those
> initializations are dead and could be dropped just like in
> xsc3_l2_inv_range().

ok, fixed.

>> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
>> index fb2eb0ed7bb87..917a546af0b90 100644
>> --- a/arch/arm/mm/dma-mapping.c
>> +++ b/arch/arm/mm/dma-mapping.c
>> @@ -647,18 +647,10 @@ static void dma_cache_maint_page(phys_addr_t phys, size_t size,
>>  			if (len + offset > PAGE_SIZE)
>>  				len = PAGE_SIZE - offset;
>>  
>> -			if (cache_is_vipt_nonaliasing()) {
>> -				vaddr = kmap_atomic_pfn(pfn);
>> +			vaddr = kmap_atomic(phys_to_page(phys));
>> +			if (vaddr) {
>>  				op(vaddr + offset, len, dir);
>>  				kunmap_atomic(vaddr);
>> -			} else {
>> -				struct page *page = phys_to_page(phys);
>> -
>> -				vaddr = kmap_high_get(page);
>> -				if (vaddr) {
>> -					op(vaddr + offset, len, dir);
>> -					kunmap_high(page);
>> -				}
>>  			}
>>  		} else {
>>  			phys += offset;
>
> [Severity: Low]
> Should this keep the kmap_atomic_pfn(pfn) call and drop the if (vaddr)
> check?
>
> 52c9aa1adc30 ("ARM: dma-mapping: Reduce struct page exposure in
> arch_sync_dma*()") converted this path to kmap_atomic_pfn(pfn) so that
> only the kmap_high_get() branch still needed phys_to_page(phys).  Using
> kmap_atomic(phys_to_page(phys)) reintroduces a struct page round-trip, and
> kmap_atomic_pfn() never returns NULL.

done.

    Arnd


  reply	other threads:[~2026-11-18  9:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 12:48 [PATCH v3 00/10] mm: highmem cleanups Arnd Bergmann
2026-11-16 12:48 ` [PATCH v3 01/10] ARM: remove support for highmem on VIVT Arnd Bergmann
2026-11-17 12:49   ` sashiko-bot
2026-11-18  9:47     ` Arnd Bergmann [this message]
2026-11-16 12:48 ` [PATCH v3 02/10] ARM: drop CONFIG_HIGHPTE support Arnd Bergmann
2026-11-16 12:48 ` [PATCH v3 03/10] ARM: pxa: support arbitrary PAGE_OFFSET Arnd Bergmann
2026-11-16 12:48 ` [PATCH v3 04/10] powerpc: kvm: allow flexible PAGE_OFFSET Arnd Bergmann
2026-11-16 13:38   ` Christophe Leroy (CS GROUP)
2026-11-16 22:54     ` Arnd Bergmann
2026-11-17 15:11       ` Christophe Leroy (CS GROUP)
2026-11-17 15:41         ` Arnd Bergmann
2026-11-17 12:49   ` sashiko-bot
2026-11-16 12:48 ` [PATCH v3 05/10] ARM: add CONFIG_VMSPLIT_2G_OPT option Arnd Bergmann
2026-11-16 12:48 ` [PATCH v3 06/10] arch/*: increase lowmem size to avoid highmem use Arnd Bergmann
2026-11-17 12:49   ` sashiko-bot
2026-11-18  9:35     ` Arnd Bergmann
2026-11-16 12:48 ` [PATCH v3 07/10] ARM: defconfig: turn off highmem in favor of CONFIG_VMSPLIT_2G_OPT Arnd Bergmann
2026-11-16 12:48 ` [PATCH v3 08/10] mm: remove ARCH_NEEDS_KMAP_HIGH_GET Arnd Bergmann
2026-11-17 10:05   ` David Hildenbrand (Arm)
2026-11-16 12:48 ` [PATCH v3 09/10] mm: drop HIGHPTE support altogether Arnd Bergmann
2026-11-16 12:48 ` [PATCH v3 10/10] mm: print pte in __print_bad_page_map_pgtable() Arnd Bergmann
2026-11-16 13:00   ` Mike Rapoport
2026-11-17 12:50   ` sashiko-bot
2026-11-18  7:32     ` Arnd Bergmann
2026-11-18  9:26       ` David Hildenbrand (Arm)
2026-11-17 10:07 ` [PATCH v3 00/10] mm: highmem cleanups David Hildenbrand (Arm)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8f80ac0-83ba-4d59-9930-ef497312e2b7@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=andreas@gaisler.com \
    --cc=arnd@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jgg@nvidia.com \
    --cc=l.stach@pengutronix.de \
    --cc=linusw@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@armlinux.org.uk \
    --cc=ljs@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=malin.jonsson@est.tech \
    --cc=mingo@redhat.com \
    --cc=monstr@monstr.eu \
    --cc=mpe@ellerman.id.au \
    --cc=nm@ti.com \
    --cc=npiggin@gmail.com \
    --cc=richard@nod.at \
    --cc=rppt@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox