Skip to content

Commit 7c9f80c

Browse files
jgross1Ingo Molnar
authored andcommitted
x86/paravirt: Avoid needless paravirt step clearing page table entries
pte_clear() et al are based on two paravirt steps today: one step to create a page table entry with all zeroes, and one step to write this entry value. Drop the first step as it is completely useless. Signed-off-by: Juergen Gross <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e1ac3e6 commit 7c9f80c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/x86/include/asm/paravirt.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static inline pudval_t pud_val(pud_t pud)
448448

449449
static inline void pud_clear(pud_t *pudp)
450450
{
451-
set_pud(pudp, __pud(0));
451+
set_pud(pudp, native_make_pud(0));
452452
}
453453

454454
static inline void set_p4d(p4d_t *p4dp, p4d_t p4d)
@@ -485,15 +485,15 @@ static inline void __set_pgd(pgd_t *pgdp, pgd_t pgd)
485485
} while (0)
486486

487487
#define pgd_clear(pgdp) do { \
488-
if (pgtable_l5_enabled()) \
489-
set_pgd(pgdp, __pgd(0)); \
488+
if (pgtable_l5_enabled()) \
489+
set_pgd(pgdp, native_make_pgd(0)); \
490490
} while (0)
491491

492492
#endif /* CONFIG_PGTABLE_LEVELS == 5 */
493493

494494
static inline void p4d_clear(p4d_t *p4dp)
495495
{
496-
set_p4d(p4dp, __p4d(0));
496+
set_p4d(p4dp, native_make_p4d(0));
497497
}
498498

499499
static inline void set_pte_atomic(pte_t *ptep, pte_t pte)
@@ -504,12 +504,12 @@ static inline void set_pte_atomic(pte_t *ptep, pte_t pte)
504504
static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
505505
pte_t *ptep)
506506
{
507-
set_pte(ptep, __pte(0));
507+
set_pte(ptep, native_make_pte(0));
508508
}
509509

510510
static inline void pmd_clear(pmd_t *pmdp)
511511
{
512-
set_pmd(pmdp, __pmd(0));
512+
set_pmd(pmdp, native_make_pmd(0));
513513
}
514514

515515
#define __HAVE_ARCH_START_CONTEXT_SWITCH

0 commit comments

Comments
 (0)