Matthew Wilcox (Oracle) [Fri, 10 Feb 2023 20:35:06 +0000 (15:35 -0500)]
arm: Implement the new page table range API
Add set_ptes(), update_mmu_cache_range(), flush_dcache_folio() and
flush_icache_pages(). Change the PG_dcache_clear flag from being per-page
to per-folio which makes __dma_page_dev_to_cpu() a bit more exciting.
Also add flush_cache_pages(), even though this isn't used by generic code
(yet?)
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Cc: linux-arm-kernel@lists.infradead.org
Matthew Wilcox (Oracle) [Fri, 10 Feb 2023 20:35:06 +0000 (15:35 -0500)]
arc: Implement the new page table range API
Add PFN_PTE_SHIFT, update_mmu_cache_range(), flush_dcache_folio()
and flush_icache_pages().
Change the PG_dc_clean flag from being per-page to per-folio (which
means it cannot always be set as we don't know that all pages in this
folio were cleaned). Enhance the internal flush routines to take the
number of pages to flush.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Cc: Vineet Gupta <vgupta@kernel.org> Cc: linux-snps-arc@lists.infradead.org
Matthew Wilcox (Oracle) [Wed, 8 Feb 2023 19:07:59 +0000 (14:07 -0500)]
alpha: Implement the new page table range API
Add PFN_PTE_SHIFT, update_mmu_cache_range() and flush_icache_pages().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: linux-alpha@vger.kernel.org
Matthew Wilcox (Oracle) [Fri, 3 Mar 2023 16:52:17 +0000 (11:52 -0500)]
mm: Add default definition of set_ptes()
Most architectures can just define set_pte() and PFN_PTE_SHIFT to
use this definition. It's also a handy spot to document the guarantees
provided by the MM.
Suggested-by: Mike Rapoport (IBM) <rppt@kernel.org> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Matthew Wilcox (Oracle) [Fri, 10 Feb 2023 20:30:38 +0000 (15:30 -0500)]
mm: Add folio_flush_mapping()
This is the folio equivalent of page_mapping_file(), but rename it
to make it clear that it's very different from page_file_mapping().
Theoretically, there's nothing flush-only about it, but there are no
other users today, and I doubt there will be; it's almost always more
useful to know the swapfile's mapping or the swapcache's mapping.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Matthew Wilcox (Oracle) [Wed, 8 Feb 2023 19:17:52 +0000 (14:17 -0500)]
mm: Add generic flush_icache_pages() and documentation
flush_icache_page() is deprecated but not yet removed, so add
a range version of it. Change the documentation to refer to
update_mmu_cache_range() instead of update_mmu_cache().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Mike Rapoport (IBM) <rppt@kernel.org> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Determine if a value lies within a range more efficiently (subtraction +
comparison vs two comparisons and an AND). It also has useful (under
some circumstances) behaviour if the range exceeds the maximum value of
the type. Convert all the conflicting definitions of in_range() within
the kernel; some can use the generic definition while others need their
own definition.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
ata: sata_sil24: fix parameter type of sil24_exec_polled_cmd()
sil24_exec_polled_cmd() passes its 'unsigned long timeout_msec' parameter
to ata_wait_register() that now takes 'unsigned int' -- eliminate unneeded
implicit casts, not forgetting about sil24_do_softreset()...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
ata: ahci_xgene: fix parameter types of xgene_ahci_poll_reg_val()
xgene_ahci_poll_reg_val() passes its 'unsigned long {interval|timeout}'
params verbatim to ata_{msleep|deadline}() that just take 'unsigned int'
param for the time intervals in ms -- eliminate unneeded implicit cast...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
ata: libahci: fix parameter type of ahci_exec_polled_cmd()
ahci_exec_polled_cmd() passes its 'unsigned long timeout_msec' parameter
to ata_wait_register() that now takes 'unsigned int' -- eliminate unneeded
implicit casts, not forgetting about ahci_do_softreset()...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
ata: libata-scsi: fix timeout type in ata_scsi_park_store()
ata_scsi_park_store() passes its 'long input' variable (if it's >= 0) to
ata_deadline() that now takes 'unsigned int' -- eliminate unneeded implicit
cast...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
sata_deb_timing_{hotplug|long|normal}[] store 'unsigned long' debounce
timeouts in ms, while sata_link_debounce() eventually uses those timeouts
by calling ata_{deadline|msleep}( which take just 'unsigned int'. Change
the debounce timeout table element's type to 'unsigned int' -- all these
timeouts happily fit into 'unsigned int'...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
ata_eh_reset_timeouts[] stores 'unsigned long' timeouts in ms, while
ata_eh_reset() passes these values to ata_deadline() that takes just
'unsigned int timeout_msecs' parameter. Change the reset timeout table
element's type to 'unsigned int' -- all timeouts fit into 'unsigned int'
but we have to change ULONG_MAX to UINT_MAX...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
ata: libata-core: fix parameter types of ata_wait_register()
ata_wait_register() passes its 'unsigned long {interval|timeout}' params
verbatim to ata_{msleep|deadline}() that just take 'unsigned int' param
for the time intervals in ms -- eliminate unneeded implicit casts...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
ata_deadline() passes its 'unsigned long timeout_msecs' parameter verbatim
to msecs_to_jiffies() which takes just 'unsigned int' -- eliminate unneeded
implicit cast...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>