Skip to content

Commit be786eb

Browse files
committed
Merge tag 'x86_mm_for_6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm update from Dave Hansen: "A single change to remove an open-coded TLB flush operation by using an existing helper. This came out of Rik van Riel's work to get the INVLPGB instruction working. - Change cpa_flush() to call flush_kernel_range() directly" * tag 'x86_mm_for_6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Change cpa_flush() to call flush_kernel_range() directly
2 parents 50ac57c + 86e6815 commit be786eb

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

arch/x86/mm/pat/set_memory.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,6 @@ static void cpa_flush_all(unsigned long cache)
399399
on_each_cpu(__cpa_flush_all, (void *) cache, 1);
400400
}
401401

402-
static void __cpa_flush_tlb(void *data)
403-
{
404-
struct cpa_data *cpa = data;
405-
unsigned int i;
406-
407-
for (i = 0; i < cpa->numpages; i++)
408-
flush_tlb_one_kernel(fix_addr(__cpa_addr(cpa, i)));
409-
}
410-
411402
static int collapse_large_pages(unsigned long addr, struct list_head *pgtables);
412403

413404
static void cpa_collapse_large_pages(struct cpa_data *cpa)
@@ -444,6 +435,7 @@ static void cpa_collapse_large_pages(struct cpa_data *cpa)
444435

445436
static void cpa_flush(struct cpa_data *cpa, int cache)
446437
{
438+
unsigned long start, end;
447439
unsigned int i;
448440

449441
BUG_ON(irqs_disabled() && !early_boot_irqs_disabled);
@@ -453,10 +445,12 @@ static void cpa_flush(struct cpa_data *cpa, int cache)
453445
goto collapse_large_pages;
454446
}
455447

456-
if (cpa->force_flush_all || cpa->numpages > tlb_single_page_flush_ceiling)
457-
flush_tlb_all();
458-
else
459-
on_each_cpu(__cpa_flush_tlb, cpa, 1);
448+
start = fix_addr(__cpa_addr(cpa, 0));
449+
end = fix_addr(__cpa_addr(cpa, cpa->numpages));
450+
if (cpa->force_flush_all)
451+
end = TLB_FLUSH_ALL;
452+
453+
flush_tlb_kernel_range(start, end);
460454

461455
if (!cache)
462456
goto collapse_large_pages;

0 commit comments

Comments
 (0)