x86/paravirt: cleanup after 32-bit PV removal
Subsystems (7)
Juergen Gross
maintainerv4 cover x86/paravirt: cleanup after 32-bit PV removal
A lot of cleanup after removal of 32-bit Xen PV guest support in paravirt code.
Changes in V4:
- dropped patches 1-3, as already committed
- addressed comments to V3
- added new patches 5+6
Changes in V3:
- addressed comments to V2
- split patch 1 into 2 patches
- new patches 3 and 7
Changes in V2:
- rebase to 5.8 kernel
- addressed comments to V1
- new patches 3 and 4
Juergen Gross (6):
x86/paravirt: remove 32-bit support from PARAVIRT_XXL x86/paravirt: cleanup paravirt macros
x86/paravirt: use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT x86/entry/32: revert "Fix XEN_PV build dependency" x86/paravirt: remove set_pte_at pv-op
x86/paravirt: avoid needless paravirt step clearing page table entries
arch/x86/entry/entry_64.S | 4 +- arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 + arch/x86/include/asm/fixmap.h | 2 +- arch/x86/include/asm/idtentry.h | 4 +- arch/x86/include/asm/paravirt.h | 151 +++----------------- arch/x86/include/asm/paravirt_types.h | 23 --- arch/x86/include/asm/pgtable-3level_types.h | 5 - arch/x86/include/asm/pgtable.h | 7 +- arch/x86/include/asm/required-features.h | 2 +- arch/x86/include/asm/segment.h | 4 - arch/x86/kernel/cpu/common.c | 8 -- arch/x86/kernel/kprobes/core.c | 1 - arch/x86/kernel/kprobes/opt.c | 1 - arch/x86/kernel/paravirt.c | 19 --- arch/x86/kernel/paravirt_patch.c | 17 --- arch/x86/xen/enlighten_pv.c | 6 - arch/x86/xen/mmu_pv.c | 8 -- include/trace/events/xen.h | 20 --- 18 files changed, 27 insertions(+), 256 deletions(-)
Signature · 6 lines
2.26.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Juergen Gross
maintainerPATCH v4 1/6 x86/paravirt: remove 32-bit support from PARAVIRT_XXL
The last 32-bit user of stuff under CONFIG_PARAVIRT_XXL is gone.
Remove 32-bit specific parts.
--- arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 + arch/x86/include/asm/paravirt.h | 120 ++------------------ arch/x86/include/asm/paravirt_types.h | 21 ---- arch/x86/include/asm/pgtable-3level_types.h | 5 - arch/x86/include/asm/segment.h | 4 - arch/x86/kernel/cpu/common.c | 8 -- arch/x86/kernel/kprobes/core.c | 1 - arch/x86/kernel/kprobes/opt.c | 1 - arch/x86/kernel/paravirt.c | 18 --- arch/x86/kernel/paravirt_patch.c | 17 --- arch/x86/xen/enlighten_pv.c | 6 - 11 files changed, 13 insertions(+), 189 deletions(-)
arch/x86/entry/vdso/vdso32/vclock_gettime.c +1 -0
@@ -14,6 +14,7 @@#undef CONFIG_ILLEGAL_POINTER_VALUE#undef CONFIG_SPARSEMEM_VMEMMAP#undef CONFIG_NR_CPUS +#undef CONFIG_PARAVIRT_XXL#define CONFIG_X86_32 1#define CONFIG_PGTABLE_LEVELS 2
arch/x86/include/asm/paravirt.h +12 -108
198 lines not on this page · raw message
arch/x86/include/asm/paravirt_types.h +0 -21
@@ -68,12 +68,7 @@ struct paravirt_callee_save {/* general info */ struct pv_info {#ifdef CONFIG_PARAVIRT_XXL -unsigned int kernel_rpl; -int shared_kernel_pmd; - -#ifdef CONFIG_X86_64 u16 extra_user_64bit_cs;/* __USER_CS if none */ -#endif #endif const char *name;
@@ -126,9 +121,7 @@ struct pv_cpu_ops {void (*set_ldt)(const void *desc,unsigned entries);unsigned long (*store_tr)(void );void (*load_tls)(struct thread_struct *t,unsigned int cpu); -#ifdef CONFIG_X86_64 void (*load_gs_index)(unsigned int idx); -#endif void (*write_ldt_entry)(struct desc_struct *ldt,int entrynum,const void *desc); void (*write_gdt_entry)(struct desc_struct *,
@@ -264,21 +257,11 @@ struct pv_mmu_ops {struct paravirt_callee_save pgd_val;struct paravirt_callee_save make_pgd; -#if CONFIG_PGTABLE_LEVELS >=3 -#ifdef CONFIG_X86_PAE -void (*set_pte_atomic)(pte_t *ptep,pte_t pteval); -void (*pte_clear)(struct mm_struct *mm,unsigned long addr, -pte_t *ptep); -void (*pmd_clear)(pmd_t *pmdp); - -#endif /* CONFIG_X86_PAE */ -void (*set_pud)(pud_t *pudp,pud_t pudval);struct paravirt_callee_save pmd_val;struct paravirt_callee_save make_pmd; -#if CONFIG_PGTABLE_LEVELS >=4 struct paravirt_callee_save pud_val;struct paravirt_callee_save make_pud;
@@ -291,10 +274,6 @@ struct pv_mmu_ops {void (*set_pgd)(pgd_t *pgdp,pgd_t pgdval);#endif /* CONFIG_PGTABLE_LEVELS >= 5 */ -#endif /* CONFIG_PGTABLE_LEVELS >= 4 */ - -#endif /* CONFIG_PGTABLE_LEVELS >= 3 */ -struct pv_lazy_ops lazy_mode;/* dom0 ops */
arch/x86/include/asm/pgtable-3level_types.h +0 -5
@@ -20,12 +20,7 @@ typedef union { } pte_t;#endif /* !__ASSEMBLY__ */ -#ifdef CONFIG_PARAVIRT_XXL -#define SHARED_KERNEL_PMD ((!static_cpu_has(X86_FEATURE_PTI) && \ - (pv_info.shared_kernel_pmd))) -#else #define SHARED_KERNEL_PMD (!static_cpu_has(X86_FEATURE_PTI)) -#endif #define ARCH_PAGE_TABLE_SYNC_MASK (SHARED_KERNEL_PMD ? 0 : PGTBL_PMD_MODIFIED)
arch/x86/include/asm/segment.h +0 -4
@@ -222,10 +222,6 @@#endif -#ifndef CONFIG_PARAVIRT_XXL -# define get_kernel_rpl () 0 -#endif -#define IDT_ENTRIES 256#define NUM_EXCEPTION_VECTORS 32
arch/x86/kernel/cpu/common.c +0 -8
@@ -1413,15 +1413,7 @@ static void generic_identify(struct cpuinfo_x86 *c)* ESPFIX issue, we can change this. */ #ifdef CONFIG_X86_32 -# ifdef CONFIG_PARAVIRT_XXL -do { -extern void native_iret (void ); -if (pv_ops.cpu.iret == native_iret) -set_cpu_bug (c,X86_BUG_ESPFIX ); - }while (0 ); -# else set_cpu_bug (c,X86_BUG_ESPFIX ); -# endif #endif }
arch/x86/kernel/kprobes/core.c +0 -1
@@ -793,7 +793,6 @@ __used __visible void *trampoline_handler(struct pt_regs *regs)/* fixup registers */ regs->cs = __KERNEL_CS;#ifdef CONFIG_X86_32 - regs->cs |=get_kernel_rpl (); regs->gs =0 ;#endif /* We use pt_regs->sp for return address holder. */
arch/x86/kernel/kprobes/opt.c +0 -1
@@ -181,7 +181,6 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)/* Save skipped registers */ regs->cs = __KERNEL_CS;#ifdef CONFIG_X86_32 - regs->cs |=get_kernel_rpl (); regs->gs =0 ;#endif regs->ip = (unsigned long )op->kp.addr +INT3_INSN_SIZE ;
arch/x86/kernel/paravirt.c +0 -18
@@ -263,13 +263,8 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)struct pv_info pv_info = { .name ="bare hardware" , #ifdef CONFIG_PARAVIRT_XXL - .kernel_rpl =0 , - .shared_kernel_pmd =1 ,/* Only used when CONFIG_X86_PAE is set */ - -#ifdef CONFIG_X86_64 .extra_user_64bit_cs = __USER_CS, #endif -#endif };/* 64-bit pagetable entries */
@@ -305,9 +300,7 @@ struct paravirt_patch_template pv_ops = { .cpu.load_idt = native_load_idt, .cpu.store_tr = native_store_tr, .cpu.load_tls = native_load_tls, -#ifdef CONFIG_X86_64 .cpu.load_gs_index = native_load_gs_index, -#endif .cpu.write_ldt_entry = native_write_ldt_entry, .cpu.write_gdt_entry = native_write_gdt_entry, .cpu.write_idt_entry = native_write_idt_entry,
@@ -317,9 +310,7 @@ struct paravirt_patch_template pv_ops = { .cpu.load_sp0 = native_load_sp0, -#ifdef CONFIG_X86_64 .cpu.usergs_sysret64 = native_usergs_sysret64, -#endif .cpu.iret = native_iret, .cpu.swapgs = native_swapgs,
@@ -375,18 +366,11 @@ struct paravirt_patch_template pv_ops = { .mmu.ptep_modify_prot_start = __ptep_modify_prot_start, .mmu.ptep_modify_prot_commit = __ptep_modify_prot_commit, -#if CONFIG_PGTABLE_LEVELS >=3 -#ifdef CONFIG_X86_PAE - .mmu.set_pte_atomic = native_set_pte_atomic, - .mmu.pte_clear = native_pte_clear, - .mmu.pmd_clear = native_pmd_clear, -#endif .mmu.set_pud = native_set_pud, .mmu.pmd_val = PTE_IDENT, .mmu.make_pmd = PTE_IDENT, -#if CONFIG_PGTABLE_LEVELS >= 4 .mmu.pud_val = PTE_IDENT, .mmu.make_pud = PTE_IDENT,
@@ -398,8 +382,6 @@ struct paravirt_patch_template pv_ops = { .mmu.set_pgd = native_set_pgd,#endif /* CONFIG_PGTABLE_LEVELS >= 5 */ -#endif /* CONFIG_PGTABLE_LEVELS >= 4 */ -#endif /* CONFIG_PGTABLE_LEVELS >= 3 */ .mmu.pte_val = PTE_IDENT, .mmu.pgd_val = PTE_IDENT,
arch/x86/kernel/paravirt_patch.c +0 -17
@@ -26,14 +26,10 @@ struct patch_xxl {const unsigned char mmu_read_cr3[3 ];const unsigned char mmu_write_cr3[3 ];const unsigned char irq_restore_fl[2 ]; -# ifdef CONFIG_X86_64 const unsigned char cpu_wbinvd[2 ];const unsigned char cpu_usergs_sysret64[6 ];const unsigned char cpu_swapgs[3 ];const unsigned char mov64[3 ]; -# else -const unsigned char cpu_iret[1 ]; -# endif };static const struct patch_xxl patch_data_xxl = {
@@ -42,7 +38,6 @@ static const struct patch_xxl patch_data_xxl = { .irq_save_fl = { 0x9c, 0x58 }, // pushf; pop %[re]ax .mmu_read_cr2 = { 0x0f, 0x20, 0xd0 }, // mov %cr2, %[re]ax .mmu_read_cr3 = { 0x0f, 0x20, 0xd8 }, // mov %cr3, %[re]ax -# ifdef CONFIG_X86_64 .mmu_write_cr3 = { 0x0f, 0x22, 0xdf }, // mov %rdi, %cr3 .irq_restore_fl = { 0x57, 0x9d }, // push %rdi; popfq .cpu_wbinvd = { 0x0f, 0x09 }, // wbinvd
@@ -50,19 +45,11 @@ static const struct patch_xxl patch_data_xxl = { 0x48, 0x0f, 0x07 }, // swapgs; sysretq .cpu_swapgs = { 0x0f, 0x01, 0xf8 }, // swapgs .mov64 = { 0x48, 0x89, 0xf8 }, // mov %rdi, %rax -# else - .mmu_write_cr3 = { 0x0f, 0x22, 0xd8 }, // mov %eax, %cr3 - .irq_restore_fl = { 0x50, 0x9d }, // push %eax; popf - .cpu_iret = { 0xcf }, // iret -# endif };unsigned int paravirt_patch_ident_64 (void *insn_buff,unsigned int len) { -#ifdef CONFIG_X86_64 return PATCH (xxl, mov64, insn_buff, len); -#endif -return 0 ; }# endif /* CONFIG_PARAVIRT_XXL */
@@ -98,13 +85,9 @@ unsigned int native_patch(u8 type, void *insn_buff, unsigned long addr,PATCH_CASE (mmu, read_cr3, xxl, insn_buff, len);PATCH_CASE (mmu, write_cr3, xxl, insn_buff, len); -# ifdef CONFIG_X86_64 PATCH_CASE (cpu, usergs_sysret64, xxl, insn_buff, len);PATCH_CASE (cpu, swapgs, xxl, insn_buff, len);PATCH_CASE (cpu, wbinvd, xxl, insn_buff, len); -# else -PATCH_CASE (cpu, iret, xxl, insn_buff, len); -# endif #endif #ifdef CONFIG_PARAVIRT_SPINLOCKS
arch/x86/xen/enlighten_pv.c +0 -6
@@ -1014,8 +1014,6 @@ void __init xen_setup_vcpu_info_placement(void) }static const struct pv_info xen_info__initconst = { - .shared_kernel_pmd =0 , - .extra_user_64bit_cs =FLAT_USER_CS64 , .name ="Xen" , };
@@ -1314,10 +1312,6 @@ asmlinkage __visible void __init xen_start_kernel(void) xen_start_info->nr_pages);xen_reserve_special_pages (); -/* keep using Xen gdt for now; no urgent need to change it */ - - pv_info.kernel_rpl =0 ; -/* * We used to do this in xen_arch_setup, but that is too late * on AMD were early_cpu_init (run before ->arch_setup()) calls
Signature · 6 lines
2.26.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
[tip: x86/paravirt] x86/paravirt: Remove 32-bit support from CONFIG_PARAVIRT_XXL
The following commit has been merged into the x86/paravirt branch of tip:
The following commit has been merged into the x86/paravirt branch of tip:
Commit-ID: 0cabf9914990dc59a7e1793ef2fb294d578dc210 Gitweb: https://git.kernel.org/tip/0cabf9914990dc59a7e1793ef2fb294d578dc210 Author: Juergen Gross <[email protected]> AuthorDate: Sat, 15 Aug 2020 12:06:36 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Sat, 15 Aug 2020 13:52:11 +02:00
x86/paravirt: Remove 32-bit support from CONFIG_PARAVIRT_XXL
The last 32-bit user of stuff under CONFIG_PARAVIRT_XXL is gone.
Remove 32-bit specific parts.
--- arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 +- arch/x86/include/asm/paravirt.h | 120 +------------------ arch/x86/include/asm/paravirt_types.h | 21 +--- arch/x86/include/asm/pgtable-3level_types.h | 5 +- arch/x86/include/asm/segment.h | 4 +- arch/x86/kernel/cpu/common.c | 8 +- arch/x86/kernel/kprobes/core.c | 1 +- arch/x86/kernel/kprobes/opt.c | 1 +- arch/x86/kernel/paravirt.c | 18 +--- arch/x86/kernel/paravirt_patch.c | 17 +--- arch/x86/xen/enlighten_pv.c | 6 +- 11 files changed, 13 insertions(+), 189 deletions(-)
arch/x86/entry/vdso/vdso32/vclock_gettime.c +1 -0
@@ -14,6 +14,7 @@#undef CONFIG_ILLEGAL_POINTER_VALUE#undef CONFIG_SPARSEMEM_VMEMMAP#undef CONFIG_NR_CPUS +#undef CONFIG_PARAVIRT_XXL#define CONFIG_X86_32 1#define CONFIG_PGTABLE_LEVELS 2
arch/x86/include/asm/paravirt.h +12 -108
198 lines not on this page · raw message
arch/x86/include/asm/paravirt_types.h +0 -21
@@ -68,13 +68,8 @@ struct paravirt_callee_save {/* general info */ struct pv_info {#ifdef CONFIG_PARAVIRT_XXL -unsigned int kernel_rpl; -int shared_kernel_pmd; - -#ifdef CONFIG_X86_64 u16 extra_user_64bit_cs;/* __USER_CS if none */ #endif -#endif const char *name; };
@@ -126,9 +121,7 @@ struct pv_cpu_ops {void (*set_ldt)(const void *desc,unsigned entries);unsigned long (*store_tr)(void );void (*load_tls)(struct thread_struct *t,unsigned int cpu); -#ifdef CONFIG_X86_64 void (*load_gs_index)(unsigned int idx); -#endif void (*write_ldt_entry)(struct desc_struct *ldt,int entrynum,const void *desc); void (*write_gdt_entry)(struct desc_struct *,
@@ -264,21 +257,11 @@ struct pv_mmu_ops {struct paravirt_callee_save pgd_val;struct paravirt_callee_save make_pgd; -#if CONFIG_PGTABLE_LEVELS >=3 -#ifdef CONFIG_X86_PAE -void (*set_pte_atomic)(pte_t *ptep,pte_t pteval); -void (*pte_clear)(struct mm_struct *mm,unsigned long addr, -pte_t *ptep); -void (*pmd_clear)(pmd_t *pmdp); - -#endif /* CONFIG_X86_PAE */ -void (*set_pud)(pud_t *pudp,pud_t pudval);struct paravirt_callee_save pmd_val;struct paravirt_callee_save make_pmd; -#if CONFIG_PGTABLE_LEVELS >=4 struct paravirt_callee_save pud_val;struct paravirt_callee_save make_pud;
@@ -291,10 +274,6 @@ struct pv_mmu_ops {void (*set_pgd)(pgd_t *pgdp,pgd_t pgdval);#endif /* CONFIG_PGTABLE_LEVELS >= 5 */ -#endif /* CONFIG_PGTABLE_LEVELS >= 4 */ - -#endif /* CONFIG_PGTABLE_LEVELS >= 3 */ -struct pv_lazy_ops lazy_mode;/* dom0 ops */
arch/x86/include/asm/pgtable-3level_types.h +0 -5
@@ -20,12 +20,7 @@ typedef union { } pte_t;#endif /* !__ASSEMBLY__ */ -#ifdef CONFIG_PARAVIRT_XXL -#define SHARED_KERNEL_PMD ((!static_cpu_has(X86_FEATURE_PTI) && \ - (pv_info.shared_kernel_pmd))) -#else #define SHARED_KERNEL_PMD (!static_cpu_has(X86_FEATURE_PTI)) -#endif #define ARCH_PAGE_TABLE_SYNC_MASK (SHARED_KERNEL_PMD ? 0 : PGTBL_PMD_MODIFIED)
arch/x86/include/asm/segment.h +0 -4
@@ -222,10 +222,6 @@#endif -#ifndef CONFIG_PARAVIRT_XXL -# define get_kernel_rpl () 0 -#endif -#define IDT_ENTRIES 256#define NUM_EXCEPTION_VECTORS 32
arch/x86/kernel/cpu/common.c +0 -8
@@ -1413,15 +1413,7 @@ static void generic_identify(struct cpuinfo_x86 *c)* ESPFIX issue, we can change this. */ #ifdef CONFIG_X86_32 -# ifdef CONFIG_PARAVIRT_XXL -do { -extern void native_iret (void ); -if (pv_ops.cpu.iret == native_iret) -set_cpu_bug (c,X86_BUG_ESPFIX ); - }while (0 ); -# else set_cpu_bug (c,X86_BUG_ESPFIX ); -# endif #endif }
arch/x86/kernel/kprobes/core.c +0 -1
@@ -793,7 +793,6 @@ __used __visible void *trampoline_handler(struct pt_regs *regs)/* fixup registers */ regs->cs = __KERNEL_CS;#ifdef CONFIG_X86_32 - regs->cs |=get_kernel_rpl (); regs->gs =0 ;#endif /* We use pt_regs->sp for return address holder. */
arch/x86/kernel/kprobes/opt.c +0 -1
@@ -181,7 +181,6 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)/* Save skipped registers */ regs->cs = __KERNEL_CS;#ifdef CONFIG_X86_32 - regs->cs |=get_kernel_rpl (); regs->gs =0 ;#endif regs->ip = (unsigned long )op->kp.addr +INT3_INSN_SIZE ;
arch/x86/kernel/paravirt.c +0 -18
@@ -263,13 +263,8 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)struct pv_info pv_info = { .name ="bare hardware" , #ifdef CONFIG_PARAVIRT_XXL - .kernel_rpl =0 , - .shared_kernel_pmd =1 ,/* Only used when CONFIG_X86_PAE is set */ - -#ifdef CONFIG_X86_64 .extra_user_64bit_cs = __USER_CS, #endif -#endif };/* 64-bit pagetable entries */
@@ -305,9 +300,7 @@ struct paravirt_patch_template pv_ops = { .cpu.load_idt = native_load_idt, .cpu.store_tr = native_store_tr, .cpu.load_tls = native_load_tls, -#ifdef CONFIG_X86_64 .cpu.load_gs_index = native_load_gs_index, -#endif .cpu.write_ldt_entry = native_write_ldt_entry, .cpu.write_gdt_entry = native_write_gdt_entry, .cpu.write_idt_entry = native_write_idt_entry,
@@ -317,9 +310,7 @@ struct paravirt_patch_template pv_ops = { .cpu.load_sp0 = native_load_sp0, -#ifdef CONFIG_X86_64 .cpu.usergs_sysret64 = native_usergs_sysret64, -#endif .cpu.iret = native_iret, .cpu.swapgs = native_swapgs,
@@ -375,18 +366,11 @@ struct paravirt_patch_template pv_ops = { .mmu.ptep_modify_prot_start = __ptep_modify_prot_start, .mmu.ptep_modify_prot_commit = __ptep_modify_prot_commit, -#if CONFIG_PGTABLE_LEVELS >=3 -#ifdef CONFIG_X86_PAE - .mmu.set_pte_atomic = native_set_pte_atomic, - .mmu.pte_clear = native_pte_clear, - .mmu.pmd_clear = native_pmd_clear, -#endif .mmu.set_pud = native_set_pud, .mmu.pmd_val = PTE_IDENT, .mmu.make_pmd = PTE_IDENT, -#if CONFIG_PGTABLE_LEVELS >= 4 .mmu.pud_val = PTE_IDENT, .mmu.make_pud = PTE_IDENT,
@@ -398,8 +382,6 @@ struct paravirt_patch_template pv_ops = { .mmu.set_pgd = native_set_pgd,#endif /* CONFIG_PGTABLE_LEVELS >= 5 */ -#endif /* CONFIG_PGTABLE_LEVELS >= 4 */ -#endif /* CONFIG_PGTABLE_LEVELS >= 3 */ .mmu.pte_val = PTE_IDENT, .mmu.pgd_val = PTE_IDENT,
arch/x86/kernel/paravirt_patch.c +0 -17
@@ -26,14 +26,10 @@ struct patch_xxl {const unsigned char mmu_read_cr3[3 ];const unsigned char mmu_write_cr3[3 ];const unsigned char irq_restore_fl[2 ]; -# ifdef CONFIG_X86_64 const unsigned char cpu_wbinvd[2 ];const unsigned char cpu_usergs_sysret64[6 ];const unsigned char cpu_swapgs[3 ];const unsigned char mov64[3 ]; -# else -const unsigned char cpu_iret[1 ]; -# endif };static const struct patch_xxl patch_data_xxl = {
@@ -42,7 +38,6 @@ static const struct patch_xxl patch_data_xxl = { .irq_save_fl = { 0x9c, 0x58 }, // pushf; pop %[re]ax .mmu_read_cr2 = { 0x0f, 0x20, 0xd0 }, // mov %cr2, %[re]ax .mmu_read_cr3 = { 0x0f, 0x20, 0xd8 }, // mov %cr3, %[re]ax -# ifdef CONFIG_X86_64 .mmu_write_cr3 = { 0x0f, 0x22, 0xdf }, // mov %rdi, %cr3 .irq_restore_fl = { 0x57, 0x9d }, // push %rdi; popfq .cpu_wbinvd = { 0x0f, 0x09 }, // wbinvd
@@ -50,19 +45,11 @@ static const struct patch_xxl patch_data_xxl = { 0x48, 0x0f, 0x07 }, // swapgs; sysretq .cpu_swapgs = { 0x0f, 0x01, 0xf8 }, // swapgs .mov64 = { 0x48, 0x89, 0xf8 }, // mov %rdi, %rax -# else - .mmu_write_cr3 = { 0x0f, 0x22, 0xd8 }, // mov %eax, %cr3 - .irq_restore_fl = { 0x50, 0x9d }, // push %eax; popf - .cpu_iret = { 0xcf }, // iret -# endif };unsigned int paravirt_patch_ident_64 (void *insn_buff,unsigned int len) { -#ifdef CONFIG_X86_64 return PATCH (xxl, mov64, insn_buff, len); -#endif -return 0 ; }# endif /* CONFIG_PARAVIRT_XXL */
@@ -98,13 +85,9 @@ unsigned int native_patch(u8 type, void *insn_buff, unsigned long addr,PATCH_CASE (mmu, read_cr3, xxl, insn_buff, len);PATCH_CASE (mmu, write_cr3, xxl, insn_buff, len); -# ifdef CONFIG_X86_64 PATCH_CASE (cpu, usergs_sysret64, xxl, insn_buff, len);PATCH_CASE (cpu, swapgs, xxl, insn_buff, len);PATCH_CASE (cpu, wbinvd, xxl, insn_buff, len); -# else -PATCH_CASE (cpu, iret, xxl, insn_buff, len); -# endif #endif #ifdef CONFIG_PARAVIRT_SPINLOCKS
arch/x86/xen/enlighten_pv.c +0 -6
@@ -1014,8 +1014,6 @@ void __init xen_setup_vcpu_info_placement(void) }static const struct pv_info xen_info__initconst = { - .shared_kernel_pmd =0 , - .extra_user_64bit_cs =FLAT_USER_CS64 , .name ="Xen" , };
@@ -1314,10 +1312,6 @@ asmlinkage __visible void __init xen_start_kernel(void) xen_start_info->nr_pages);xen_reserve_special_pages (); -/* keep using Xen gdt for now; no urgent need to change it */ - - pv_info.kernel_rpl =0 ; -/* * We used to do this in xen_arch_setup, but that is too late * on AMD were early_cpu_init (run before ->arch_setup()) calls
Re: [PATCH v4 1/6] x86/paravirt: remove 32-bit support from PARAVIRT_XXL
In reply to Juergen GrossQuoted 5 lines · Juergen Gross
The last 32-bit user of stuff under
CONFIG_PARAVIRT_XXLis gone.Remove 32-bit specific parts.
Signed-off-by Juergen Gross <[email protected]>
(There is another '#ifdef CONFIG_X86_64' in paravirt.h, at the bottom, that can be removed as well)
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Juergen Gross
maintainerPATCH v4 2/6 x86/paravirt: cleanup paravirt macros
In reply to Juergen GrossSome paravirt macros are no longer used, delete them.
--- arch/x86/include/asm/paravirt.h | 15 --------------- 1 file changed, 15 deletions(-)
arch/x86/include/asm/paravirt.h +0 -15
@@ -586,16 +586,9 @@ bool __raw_callee_save___native_vcpu_is_preempted(long cpu);#endif /* SMP && PARAVIRT_SPINLOCKS */ #ifdef CONFIG_X86_32 -#define PV_SAVE_REGS "pushl %ecx; pushl %edx;" -#define PV_RESTORE_REGS "popl %edx; popl %ecx;" -/* save and restore all caller-save registers, except return value */ #define PV_SAVE_ALL_CALLER_REGS "pushl %ecx;"#define PV_RESTORE_ALL_CALLER_REGS "popl %ecx;" - -#define PV_FLAGS_ARG "0" -#define PV_EXTRA_CLOBBERS -#define PV_VEXTRA_CLOBBERS #else /* save and restore all caller-save registers, except return value */ #define PV_SAVE_ALL_CALLER_REGS \
@@ -616,14 +609,6 @@ bool __raw_callee_save___native_vcpu_is_preempted(long cpu);"pop %rsi;" \"pop %rdx;" \ "pop %rcx;" - -/* We save some registers, but all of them, that's too much. We clobber all - * caller saved registers but the argument parameter */ -#define PV_SAVE_REGS "pushq %%rdi;" -#define PV_RESTORE_REGS "popq %%rdi;" -#define PV_EXTRA_CLOBBERS EXTRA_CLOBBERS, "rcx" , "rdx", "rsi" -#define PV_VEXTRA_CLOBBERS EXTRA_CLOBBERS, "rdi", "rcx" , "rdx", "rsi" -#define PV_FLAGS_ARG "D"#endif /*
Signature · 6 lines
2.26.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
[tip: x86/paravirt] x86/paravirt: Clean up paravirt macros
The following commit has been merged into the x86/paravirt branch of tip:
The following commit has been merged into the x86/paravirt branch of tip:
Commit-ID: 94b827becc6a87c905ab30b398e12a266518acbb Gitweb: https://git.kernel.org/tip/94b827becc6a87c905ab30b398e12a266518acbb Author: Juergen Gross <[email protected]> AuthorDate: Sat, 15 Aug 2020 12:06:37 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Sat, 15 Aug 2020 13:52:11 +02:00
x86/paravirt: Clean up paravirt macros
Some paravirt macros are no longer used, delete them.
--- arch/x86/include/asm/paravirt.h | 15 --------------- 1 file changed, 15 deletions(-)
arch/x86/include/asm/paravirt.h +0 -15
@@ -586,16 +586,9 @@ bool __raw_callee_save___native_vcpu_is_preempted(long cpu);#endif /* SMP && PARAVIRT_SPINLOCKS */ #ifdef CONFIG_X86_32 -#define PV_SAVE_REGS "pushl %ecx; pushl %edx;" -#define PV_RESTORE_REGS "popl %edx; popl %ecx;" -/* save and restore all caller-save registers, except return value */ #define PV_SAVE_ALL_CALLER_REGS "pushl %ecx;"#define PV_RESTORE_ALL_CALLER_REGS "popl %ecx;" - -#define PV_FLAGS_ARG "0" -#define PV_EXTRA_CLOBBERS -#define PV_VEXTRA_CLOBBERS #else /* save and restore all caller-save registers, except return value */ #define PV_SAVE_ALL_CALLER_REGS \
@@ -616,14 +609,6 @@ bool __raw_callee_save___native_vcpu_is_preempted(long cpu);"pop %rsi;" \"pop %rdx;" \ "pop %rcx;" - -/* We save some registers, but all of them, that's too much. We clobber all - * caller saved registers but the argument parameter */ -#define PV_SAVE_REGS "pushq %%rdi;" -#define PV_RESTORE_REGS "popq %%rdi;" -#define PV_EXTRA_CLOBBERS EXTRA_CLOBBERS, "rcx" , "rdx", "rsi" -#define PV_VEXTRA_CLOBBERS EXTRA_CLOBBERS, "rdi", "rcx" , "rdx", "rsi" -#define PV_FLAGS_ARG "D"#endif /*
Juergen Gross
maintainerPATCH v4 3/6 x86/paravirt: use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT
In reply to Juergen GrossThere are some code parts using CONFIG_PARAVIRT for Xen pvops related issues instead of the more stringent CONFIG_PARAVIRT_XXL.
--- arch/x86/entry/entry_64.S | 4 ++-- arch/x86/include/asm/fixmap.h | 2 +- arch/x86/include/asm/required-features.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/entry/entry_64.S +2 -2
@@ -46,13 +46,13 @@ .code64 .section .entry.text, "ax" -#ifdef CONFIG_PARAVIRT +#ifdef CONFIG_PARAVIRT_XXL SYM_CODE_START(native_usergs_sysret64) UNWIND_HINT_EMPTY swapgs sysretq SYM_CODE_END(native_usergs_sysret64) -#endif /* CONFIG_PARAVIRT */ +#endif /* CONFIG_PARAVIRT_XXL */ /* * 64-bit SYSCALL instruction entry. Up to 6 arguments in registers.
arch/x86/include/asm/fixmap.h +1 -1
@@ -99,7 +99,7 @@ enum fixed_addresses { FIX_PCIE_MCFG,#endif #endif -#ifdef CONFIG_PARAVIRT +#ifdef CONFIG_PARAVIRT_XXL FIX_PARAVIRT_BOOTMAP,#endif #ifdef CONFIG_X86_INTEL_MID
arch/x86/include/asm/required-features.h +1 -1
@@ -54,7 +54,7 @@#endif #ifdef CONFIG_X86_64 -#ifdef CONFIG_PARAVIRT +#ifdef CONFIG_PARAVIRT_XXL /* Paravirtualized systems may not have PSE or PGE available */ #define NEED_PSE 0#define NEED_PGE 0
Signature · 1 line
2.26.2
[tip: x86/paravirt] x86/paravirt: Use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT
The following commit has been merged into the x86/paravirt branch of tip:
The following commit has been merged into the x86/paravirt branch of tip:
Commit-ID: ecac71816a1829c0e54c41c5f1845f75b55dc618 Gitweb: https://git.kernel.org/tip/ecac71816a1829c0e54c41c5f1845f75b55dc618 Author: Juergen Gross <[email protected]> AuthorDate: Sat, 15 Aug 2020 12:06:38 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Sat, 15 Aug 2020 13:52:11 +02:00
x86/paravirt: Use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT
There are some code parts using CONFIG_PARAVIRT for Xen pvops related issues instead of the more stringent CONFIG_PARAVIRT_XXL.
--- arch/x86/entry/entry_64.S | 4 ++-- arch/x86/include/asm/fixmap.h | 2 +- arch/x86/include/asm/required-features.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/entry/entry_64.S +2 -2
@@ -46,13 +46,13 @@ .code64 .section .entry.text, "ax" -#ifdef CONFIG_PARAVIRT +#ifdef CONFIG_PARAVIRT_XXL SYM_CODE_START(native_usergs_sysret64) UNWIND_HINT_EMPTY swapgs sysretq SYM_CODE_END(native_usergs_sysret64) -#endif /* CONFIG_PARAVIRT */ +#endif /* CONFIG_PARAVIRT_XXL */ /* * 64-bit SYSCALL instruction entry. Up to 6 arguments in registers.
arch/x86/include/asm/fixmap.h +1 -1
@@ -99,7 +99,7 @@ enum fixed_addresses { FIX_PCIE_MCFG,#endif #endif -#ifdef CONFIG_PARAVIRT +#ifdef CONFIG_PARAVIRT_XXL FIX_PARAVIRT_BOOTMAP,#endif #ifdef CONFIG_X86_INTEL_MID
arch/x86/include/asm/required-features.h +1 -1
@@ -54,7 +54,7 @@#endif #ifdef CONFIG_X86_64 -#ifdef CONFIG_PARAVIRT +#ifdef CONFIG_PARAVIRT_XXL /* Paravirtualized systems may not have PSE or PGE available */ #define NEED_PSE 0#define NEED_PGE 0
Juergen Gross
maintainerPATCH v4 4/6 x86/entry/32: revert "Fix XEN_PV build dependency"
In reply to Juergen GrossWith 32-bit Xen PV support gone commit a4c0e91d1d65bc58 ("x86/entry/32: Fix XEN_PV build dependency") can be reverted again.
--- arch/x86/include/asm/idtentry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/idtentry.h +2 -2
@@ -547,7 +547,7 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check);/* NMI */ DECLARE_IDTENTRY_NMI (X86_TRAP_NMI , exc_nmi); -#if defined(CONFIG_XEN_PV ) && defined(CONFIG_X86_64 ) +#ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW (X86_TRAP_NMI , xenpv_exc_nmi);#endif
@@ -557,7 +557,7 @@ DECLARE_IDTENTRY_DEBUG(X86_TRAP_DB, exc_debug);#else DECLARE_IDTENTRY_RAW (X86_TRAP_DB , exc_debug);#endif -#if defined(CONFIG_XEN_PV ) && defined(CONFIG_X86_64 ) +#ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW (X86_TRAP_DB , xenpv_exc_debug);#endif
Signature · 1 line
2.26.2
[tip: x86/paravirt] x86/entry/32: Simplify CONFIG_XEN_PV build dependency
The following commit has been merged into the x86/paravirt branch of tip:
The following commit has been merged into the x86/paravirt branch of tip:
Commit-ID: 76fdb041c1f02311e6e05211c895e932af08b041 Gitweb: https://git.kernel.org/tip/76fdb041c1f02311e6e05211c895e932af08b041 Author: Juergen Gross <[email protected]> AuthorDate: Sat, 15 Aug 2020 12:06:39 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Sat, 15 Aug 2020 13:52:12 +02:00
x86/entry/32: Simplify CONFIG_XEN_PV build dependency
With 32-bit Xen PV support gone, the following commit is not needed anymore:
a4c0e91d1d65bc58 ("x86/entry/32: Fix XEN_PV build dependency")
--- arch/x86/include/asm/idtentry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/idtentry.h +2 -2
@@ -547,7 +547,7 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check);/* NMI */ DECLARE_IDTENTRY_NMI (X86_TRAP_NMI , exc_nmi); -#if defined(CONFIG_XEN_PV ) && defined(CONFIG_X86_64 ) +#ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW (X86_TRAP_NMI , xenpv_exc_nmi);#endif
@@ -557,7 +557,7 @@ DECLARE_IDTENTRY_DEBUG(X86_TRAP_DB, exc_debug);#else DECLARE_IDTENTRY_RAW (X86_TRAP_DB , exc_debug);#endif -#if defined(CONFIG_XEN_PV ) && defined(CONFIG_X86_64 ) +#ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW (X86_TRAP_DB , xenpv_exc_debug);#endif
Juergen Gross
maintainerPATCH v4 5/6 x86/paravirt: remove set_pte_at pv-op
In reply to Juergen GrossOn x86 set_pte_at() is now always falling back to set_pte(). So instead of having this fallback after the paravirt maze just drop the set_pte_at paravirt operation and let set_pte_at() use the set_pte() function directly.
--- arch/x86/include/asm/paravirt.h | 8 +------- arch/x86/include/asm/paravirt_types.h | 2 -- arch/x86/include/asm/pgtable.h | 7 +++---- arch/x86/kernel/paravirt.c | 1 - arch/x86/xen/mmu_pv.c | 8 -------- include/trace/events/xen.h | 20 -------------------- 6 files changed, 4 insertions(+), 42 deletions(-)
arch/x86/include/asm/paravirt.h +1 -7
@@ -412,12 +412,6 @@ static inline void set_pte(pte_t *ptep, pte_t pte)PVOP_VCALL2 (mmu.set_pte, ptep, pte.pte); } -static inline void set_pte_at (struct mm_struct *mm,unsigned long addr, -pte_t *ptep,pte_t pte) -{ -PVOP_VCALL4 (mmu.set_pte_at, mm, addr, ptep, pte.pte); -} -static inline void set_pmd (pmd_t *pmdp,pmd_t pmd) {PVOP_VCALL2 (mmu.set_pmd, pmdp,native_pmd_val (pmd));
@@ -510,7 +504,7 @@ static inline void set_pte_atomic(pte_t *ptep, pte_t pte)static inline void pte_clear (struct mm_struct *mm,unsigned long addr,pte_t *ptep) { -set_pte_at (mm, addr, ptep,__pte (0 )); +set_pte (ptep,__pte (0 )); }static inline void pmd_clear (pmd_t *pmdp)
arch/x86/include/asm/paravirt_types.h +0 -2
@@ -242,8 +242,6 @@ struct pv_mmu_ops {/* Pagetable manipulation functions */ void (*set_pte)(pte_t *ptep,pte_t pteval); -void (*set_pte_at)(struct mm_struct *mm,unsigned long addr, -pte_t *ptep,pte_t pteval);void (*set_pmd)(pmd_t *pmdp,pmd_t pmdval); pte_t (*ptep_modify_prot_start)(struct vm_area_struct *vma, unsigned long addr,
arch/x86/include/asm/pgtable.h +3 -4
@@ -63,7 +63,6 @@ extern pmdval_t early_pmd_flags;#include <asm/paravirt.h> #else /* !CONFIG_PARAVIRT_XXL */ #define set_pte (ptep, pte) native_set_pte(ptep, pte) -#define set_pte_at (mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)#define set_pte_atomic (ptep, pte) \ native_set_pte_atomic(ptep, pte)
@@ -1033,10 +1032,10 @@ static inline pud_t native_local_pudp_get_and_clear(pud_t *pudp)return res; } -static inline void native_set_pte_at (struct mm_struct *mm,unsigned long addr, -pte_t *ptep ,pte_t pte) +static inline void set_pte_at (struct mm_struct *mm,unsigned long addr, +pte_t *ptep,pte_t pte) { -native_set_pte (ptep, pte); +set_pte (ptep, pte); } static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
arch/x86/kernel/paravirt.c +0 -1
@@ -360,7 +360,6 @@ struct paravirt_patch_template pv_ops = { .mmu.release_p4d = paravirt_nop, .mmu.set_pte = native_set_pte, - .mmu.set_pte_at = native_set_pte_at, .mmu.set_pmd = native_set_pmd, .mmu.ptep_modify_prot_start = __ptep_modify_prot_start,
arch/x86/xen/mmu_pv.c +0 -8
@@ -285,13 +285,6 @@ static void xen_set_pte(pte_t *ptep, pte_t pteval)__xen_set_pte (ptep, pteval); } -static void xen_set_pte_at (struct mm_struct *mm,unsigned long addr, -pte_t *ptep,pte_t pteval) -{ -trace_xen_mmu_set_pte_at (mm, addr, ptep, pteval); -__xen_set_pte (ptep, pteval); -} -pte_t xen_ptep_modify_prot_start (struct vm_area_struct *vma,unsigned long addr,pte_t *ptep) {
@@ -2105,7 +2098,6 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { .release_pmd = xen_release_pmd_init, .set_pte = xen_set_pte_init, - .set_pte_at = xen_set_pte_at, .set_pmd = xen_set_pmd_hyper, .ptep_modify_prot_start = __ptep_modify_prot_start,
include/trace/events/xen.h +0 -20
@@ -153,26 +153,6 @@ DECLARE_EVENT_CLASS(xen_mmu__set_pte,DEFINE_XEN_MMU_SET_PTE (xen_mmu_set_pte); -TRACE_EVENT (xen_mmu_set_pte_at, - TP_PROTO(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pteval), -TP_ARGS (mm, addr, ptep, pteval), -TP_STRUCT__entry ( - __field(struct mm_struct *, mm) - __field(unsigned long, addr) - __field(pte_t *, ptep) -__field (pteval_t, pteval) - ), - TP_fast_assign(__entry->mm = mm; - __entry->addr = addr; - __entry->ptep = ptep; - __entry->pteval = pteval.pte), -TP_printk ("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)" , - __entry->mm, __entry->addr, __entry->ptep, - (int )sizeof (pteval_t) *2 , (unsigned long long )pte_val (native_make_pte (__entry->pteval)), - (int )sizeof (pteval_t) *2 , (unsigned long long )__entry->pteval) - ); -TRACE_DEFINE_SIZEOF (pmdval_t); TRACE_EVENT(xen_mmu_set_pmd,
Signature · 6 lines
2.26.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
[tip: x86/paravirt] x86/paravirt: Remove set_pte_at() pv-op
The following commit has been merged into the x86/paravirt branch of tip:
The following commit has been merged into the x86/paravirt branch of tip:
Commit-ID: e1ac3e66d301e57472f31ebee81b916e9fa8b35b Gitweb: https://git.kernel.org/tip/e1ac3e66d301e57472f31ebee81b916e9fa8b35b Author: Juergen Gross <[email protected]> AuthorDate: Sat, 15 Aug 2020 12:06:40 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Sat, 15 Aug 2020 13:52:12 +02:00
x86/paravirt: Remove set_pte_at() pv-op
On x86 set_pte_at() is now always falling back to set_pte(). So instead of having this fallback after the paravirt maze just drop the set_pte_at paravirt operation and let set_pte_at() use the set_pte() function directly.
--- arch/x86/include/asm/paravirt.h | 8 +------- arch/x86/include/asm/paravirt_types.h | 2 -- arch/x86/include/asm/pgtable.h | 7 +++---- arch/x86/kernel/paravirt.c | 1 - arch/x86/xen/mmu_pv.c | 8 -------- include/trace/events/xen.h | 20 -------------------- 6 files changed, 4 insertions(+), 42 deletions(-)
arch/x86/include/asm/paravirt.h +1 -7
@@ -412,12 +412,6 @@ static inline void set_pte(pte_t *ptep, pte_t pte)PVOP_VCALL2 (mmu.set_pte, ptep, pte.pte); } -static inline void set_pte_at (struct mm_struct *mm,unsigned long addr, -pte_t *ptep,pte_t pte) -{ -PVOP_VCALL4 (mmu.set_pte_at, mm, addr, ptep, pte.pte); -} -static inline void set_pmd (pmd_t *pmdp,pmd_t pmd) {PVOP_VCALL2 (mmu.set_pmd, pmdp,native_pmd_val (pmd));
@@ -510,7 +504,7 @@ static inline void set_pte_atomic(pte_t *ptep, pte_t pte)static inline void pte_clear (struct mm_struct *mm,unsigned long addr,pte_t *ptep) { -set_pte_at (mm, addr, ptep,__pte (0 )); +set_pte (ptep,__pte (0 )); }static inline void pmd_clear (pmd_t *pmdp)
arch/x86/include/asm/paravirt_types.h +0 -2
@@ -242,8 +242,6 @@ struct pv_mmu_ops {/* Pagetable manipulation functions */ void (*set_pte)(pte_t *ptep,pte_t pteval); -void (*set_pte_at)(struct mm_struct *mm,unsigned long addr, -pte_t *ptep,pte_t pteval);void (*set_pmd)(pmd_t *pmdp,pmd_t pmdval); pte_t (*ptep_modify_prot_start)(struct vm_area_struct *vma, unsigned long addr,
arch/x86/include/asm/pgtable.h +3 -4
@@ -63,7 +63,6 @@ extern pmdval_t early_pmd_flags;#include <asm/paravirt.h> #else /* !CONFIG_PARAVIRT_XXL */ #define set_pte (ptep, pte) native_set_pte(ptep, pte) -#define set_pte_at (mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)#define set_pte_atomic (ptep, pte) \ native_set_pte_atomic(ptep, pte)
@@ -1033,10 +1032,10 @@ static inline pud_t native_local_pudp_get_and_clear(pud_t *pudp)return res; } -static inline void native_set_pte_at (struct mm_struct *mm,unsigned long addr, -pte_t *ptep ,pte_t pte) +static inline void set_pte_at (struct mm_struct *mm,unsigned long addr, +pte_t *ptep,pte_t pte) { -native_set_pte (ptep, pte); +set_pte (ptep, pte); } static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
arch/x86/kernel/paravirt.c +0 -1
@@ -360,7 +360,6 @@ struct paravirt_patch_template pv_ops = { .mmu.release_p4d = paravirt_nop, .mmu.set_pte = native_set_pte, - .mmu.set_pte_at = native_set_pte_at, .mmu.set_pmd = native_set_pmd, .mmu.ptep_modify_prot_start = __ptep_modify_prot_start,
arch/x86/xen/mmu_pv.c +0 -8
@@ -285,13 +285,6 @@ static void xen_set_pte(pte_t *ptep, pte_t pteval)__xen_set_pte (ptep, pteval); } -static void xen_set_pte_at (struct mm_struct *mm,unsigned long addr, -pte_t *ptep,pte_t pteval) -{ -trace_xen_mmu_set_pte_at (mm, addr, ptep, pteval); -__xen_set_pte (ptep, pteval); -} -pte_t xen_ptep_modify_prot_start (struct vm_area_struct *vma,unsigned long addr,pte_t *ptep) {
@@ -2105,7 +2098,6 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { .release_pmd = xen_release_pmd_init, .set_pte = xen_set_pte_init, - .set_pte_at = xen_set_pte_at, .set_pmd = xen_set_pmd_hyper, .ptep_modify_prot_start = __ptep_modify_prot_start,
include/trace/events/xen.h +0 -20
@@ -153,26 +153,6 @@ DECLARE_EVENT_CLASS(xen_mmu__set_pte,DEFINE_XEN_MMU_SET_PTE (xen_mmu_set_pte); -TRACE_EVENT (xen_mmu_set_pte_at, - TP_PROTO(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pteval), -TP_ARGS (mm, addr, ptep, pteval), -TP_STRUCT__entry ( - __field(struct mm_struct *, mm) - __field(unsigned long, addr) - __field(pte_t *, ptep) -__field (pteval_t, pteval) - ), - TP_fast_assign(__entry->mm = mm; - __entry->addr = addr; - __entry->ptep = ptep; - __entry->pteval = pteval.pte), -TP_printk ("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)" , - __entry->mm, __entry->addr, __entry->ptep, - (int )sizeof (pteval_t) *2 , (unsigned long long )pte_val (native_make_pte (__entry->pteval)), - (int )sizeof (pteval_t) *2 , (unsigned long long )__entry->pteval) - ); -TRACE_DEFINE_SIZEOF (pmdval_t); TRACE_EVENT(xen_mmu_set_pmd,
Re: [PATCH v4 5/6] x86/paravirt: remove set_pte_at pv-op
In reply to Juergen GrossQuoted 6 lines · Juergen Gross
On x86
set_pte_at()is now always falling back toset_pte(). So instead of having this fallback after the paravirt maze just drop theset_pte_atparavirt operation and letset_pte_at()use theset_pte()function directly.Signed-off-by Juergen Gross <[email protected]>
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Juergen Gross
maintainerPATCH v4 6/6 x86/paravirt: avoid needless paravirt step clearing page table entries
In reply to Juergen Grosspte_clear() et al are based on tw0 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.
--- arch/x86/include/asm/paravirt.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/x86/include/asm/paravirt.h +6 -6
@@ -448,7 +448,7 @@ static inline pudval_t pud_val(pud_t pud)static inline void pud_clear (pud_t *pudp) { -set_pud (pudp,__pud (0 )); +set_pud (pudp,native_make_pud (0 )); }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) } while (0)#define pgd_clear (pgdp) do { \ - if (pgtable_l5_enabled()) \ - set_pgd(pgdp, __pgd(0)); \ + if (pgtable_l5_enabled()) \ + set_pgd(pgdp, native_make_pgd(0)); \ } while (0)#endif /* CONFIG_PGTABLE_LEVELS == 5 */ static inline void p4d_clear (p4d_t *p4dp) { -set_p4d (p4dp,__p4d (0 )); +set_p4d (p4dp,native_make_p4d (0 )); }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)static inline void pte_clear (struct mm_struct *mm,unsigned long addr,pte_t *ptep) { -set_pte (ptep,__pte (0 )); +set_pte (ptep,native_make_pte (0 )); }static inline void pmd_clear (pmd_t *pmdp) { -set_pmd (pmdp,__pmd (0 )); +set_pmd (pmdp,native_make_pmd (0 )); }#define __HAVE_ARCH_START_CONTEXT_SWITCH
Signature · 6 lines
2.26.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
[tip: x86/paravirt] x86/paravirt: Avoid needless paravirt step clearing page table entries
The following commit has been merged into the x86/paravirt branch of tip:
The following commit has been merged into the x86/paravirt branch of tip:
Commit-ID: 7c9f80cb76ec9f14c3b25509168b1a2f7942e418 Gitweb: https://git.kernel.org/tip/7c9f80cb76ec9f14c3b25509168b1a2f7942e418 Author: Juergen Gross <[email protected]> AuthorDate: Sat, 15 Aug 2020 12:06:41 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Sat, 15 Aug 2020 13:52:12 +02:00
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.
--- arch/x86/include/asm/paravirt.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/x86/include/asm/paravirt.h +6 -6
@@ -448,7 +448,7 @@ static inline pudval_t pud_val(pud_t pud)static inline void pud_clear (pud_t *pudp) { -set_pud (pudp,__pud (0 )); +set_pud (pudp,native_make_pud (0 )); }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) } while (0)#define pgd_clear (pgdp) do { \ - if (pgtable_l5_enabled()) \ - set_pgd(pgdp, __pgd(0)); \ + if (pgtable_l5_enabled()) \ + set_pgd(pgdp, native_make_pgd(0)); \ } while (0)#endif /* CONFIG_PGTABLE_LEVELS == 5 */ static inline void p4d_clear (p4d_t *p4dp) { -set_p4d (p4dp,__p4d (0 )); +set_p4d (p4dp,native_make_p4d (0 )); }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)static inline void pte_clear (struct mm_struct *mm,unsigned long addr,pte_t *ptep) { -set_pte (ptep,__pte (0 )); +set_pte (ptep,native_make_pte (0 )); }static inline void pmd_clear (pmd_t *pmdp) { -set_pmd (pmdp,__pmd (0 )); +set_pmd (pmdp,native_make_pmd (0 )); }#define __HAVE_ARCH_START_CONTEXT_SWITCH