From nobody Sat May 4 04:40:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1597486041; cv=none; d=zohomail.com; s=zohoarc; b=E9G0zMV8Dca1QAyYv53hErAJ0czLYPcA4jQXYOaNGutzJrL6SPAu20tM0U+1shzyCm548iUJUmDJuTSgA+wIGAX10e7X1ORcy+l78wMJKub7Z4O0J10okFHtRIOf1rt0hG6pxq6NGegAoj0bBvRaRDtf2bRUiiYeVlD+sRa2kLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597486041; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BQjIAJGCfwcDiCegyGFN3jgCaBp+xrP1fs4X90ZXG44=; b=fSOf989zbF7w0u7+pFIdP6wFGC5vKKA9OEyBXtuAWJeuR/e8LDUa9Mp1pZVZYOWdEnXO/7vIhfRWg628IGFNBohHIER+Zwr5wekDl/A4BuGMGEH9ULAZ0zCAuL8p6XunpvumaLgIGFwFAQFzAkzb8cqTgvmM2jF32hv4OYrqKLs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1597486041623961.4582328069205; Sat, 15 Aug 2020 03:07:21 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5S-0007Vk-Os; Sat, 15 Aug 2020 10:06:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5R-0007V6-7t for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 10:06:53 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 486d2b56-140a-4c61-a0c1-9395f4941551; Sat, 15 Aug 2020 10:06:47 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 014ACB03E; Sat, 15 Aug 2020 10:07:10 +0000 (UTC) X-Inumbo-ID: 486d2b56-140a-4c61-a0c1-9395f4941551 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: Juergen Gross , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Deep Shah , "VMware, Inc." , Boris Ostrovsky , Stefano Stabellini Subject: [PATCH v4 1/6] x86/paravirt: remove 32-bit support from PARAVIRT_XXL Date: Sat, 15 Aug 2020 12:06:36 +0200 Message-Id: <20200815100641.26362-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815100641.26362-1-jgross@suse.com> References: <20200815100641.26362-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" The last 32-bit user of stuff under CONFIG_PARAVIRT_XXL is gone. Remove 32-bit specific parts. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- 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(-) diff --git a/arch/x86/entry/vdso/vdso32/vclock_gettime.c b/arch/x86/entry/v= dso/vdso32/vclock_gettime.c index 84a4a73f77f7..283ed9d00426 100644 --- a/arch/x86/entry/vdso/vdso32/vclock_gettime.c +++ b/arch/x86/entry/vdso/vdso32/vclock_gettime.c @@ -14,6 +14,7 @@ #undef CONFIG_ILLEGAL_POINTER_VALUE #undef CONFIG_SPARSEMEM_VMEMMAP #undef CONFIG_NR_CPUS +#undef CONFIG_PARAVIRT_XXL =20 #define CONFIG_X86_32 1 #define CONFIG_PGTABLE_LEVELS 2 diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravir= t.h index 3d2afecde50c..25c7a73461f6 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -160,8 +160,6 @@ static inline void wbinvd(void) PVOP_VCALL0(cpu.wbinvd); } =20 -#define get_kernel_rpl() (pv_info.kernel_rpl) - static inline u64 paravirt_read_msr(unsigned msr) { return PVOP_CALL1(u64, cpu.read_msr, msr); @@ -277,12 +275,10 @@ static inline void load_TLS(struct thread_struct *t, = unsigned cpu) PVOP_VCALL2(cpu.load_tls, t, cpu); } =20 -#ifdef CONFIG_X86_64 static inline void load_gs_index(unsigned int gs) { PVOP_VCALL1(cpu.load_gs_index, gs); } -#endif =20 static inline void write_ldt_entry(struct desc_struct *dt, int entry, const void *desc) @@ -375,52 +371,22 @@ static inline void paravirt_release_p4d(unsigned long= pfn) =20 static inline pte_t __pte(pteval_t val) { - pteval_t ret; - - if (sizeof(pteval_t) > sizeof(long)) - ret =3D PVOP_CALLEE2(pteval_t, mmu.make_pte, val, (u64)val >> 32); - else - ret =3D PVOP_CALLEE1(pteval_t, mmu.make_pte, val); - - return (pte_t) { .pte =3D ret }; + return (pte_t) { PVOP_CALLEE1(pteval_t, mmu.make_pte, val) }; } =20 static inline pteval_t pte_val(pte_t pte) { - pteval_t ret; - - if (sizeof(pteval_t) > sizeof(long)) - ret =3D PVOP_CALLEE2(pteval_t, mmu.pte_val, - pte.pte, (u64)pte.pte >> 32); - else - ret =3D PVOP_CALLEE1(pteval_t, mmu.pte_val, pte.pte); - - return ret; + return PVOP_CALLEE1(pteval_t, mmu.pte_val, pte.pte); } =20 static inline pgd_t __pgd(pgdval_t val) { - pgdval_t ret; - - if (sizeof(pgdval_t) > sizeof(long)) - ret =3D PVOP_CALLEE2(pgdval_t, mmu.make_pgd, val, (u64)val >> 32); - else - ret =3D PVOP_CALLEE1(pgdval_t, mmu.make_pgd, val); - - return (pgd_t) { ret }; + return (pgd_t) { PVOP_CALLEE1(pgdval_t, mmu.make_pgd, val) }; } =20 static inline pgdval_t pgd_val(pgd_t pgd) { - pgdval_t ret; - - if (sizeof(pgdval_t) > sizeof(long)) - ret =3D PVOP_CALLEE2(pgdval_t, mmu.pgd_val, - pgd.pgd, (u64)pgd.pgd >> 32); - else - ret =3D PVOP_CALLEE1(pgdval_t, mmu.pgd_val, pgd.pgd); - - return ret; + return PVOP_CALLEE1(pgdval_t, mmu.pgd_val, pgd.pgd); } =20 #define __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION @@ -438,78 +404,40 @@ static inline void ptep_modify_prot_commit(struct vm_= area_struct *vma, unsigned pte_t *ptep, pte_t old_pte, pte_t pte) { =20 - if (sizeof(pteval_t) > sizeof(long)) - /* 5 arg words */ - pv_ops.mmu.ptep_modify_prot_commit(vma, addr, ptep, pte); - else - PVOP_VCALL4(mmu.ptep_modify_prot_commit, - vma, addr, ptep, pte.pte); + PVOP_VCALL4(mmu.ptep_modify_prot_commit, vma, addr, ptep, pte.pte); } =20 static inline void set_pte(pte_t *ptep, pte_t pte) { - if (sizeof(pteval_t) > sizeof(long)) - PVOP_VCALL3(mmu.set_pte, ptep, pte.pte, (u64)pte.pte >> 32); - else - PVOP_VCALL2(mmu.set_pte, ptep, pte.pte); + PVOP_VCALL2(mmu.set_pte, ptep, pte.pte); } =20 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) { - if (sizeof(pteval_t) > sizeof(long)) - /* 5 arg words */ - pv_ops.mmu.set_pte_at(mm, addr, ptep, pte); - else - PVOP_VCALL4(mmu.set_pte_at, mm, addr, ptep, pte.pte); + PVOP_VCALL4(mmu.set_pte_at, mm, addr, ptep, pte.pte); } =20 static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) { - pmdval_t val =3D native_pmd_val(pmd); - - if (sizeof(pmdval_t) > sizeof(long)) - PVOP_VCALL3(mmu.set_pmd, pmdp, val, (u64)val >> 32); - else - PVOP_VCALL2(mmu.set_pmd, pmdp, val); + PVOP_VCALL2(mmu.set_pmd, pmdp, native_pmd_val(pmd)); } =20 -#if CONFIG_PGTABLE_LEVELS >=3D 3 static inline pmd_t __pmd(pmdval_t val) { - pmdval_t ret; - - if (sizeof(pmdval_t) > sizeof(long)) - ret =3D PVOP_CALLEE2(pmdval_t, mmu.make_pmd, val, (u64)val >> 32); - else - ret =3D PVOP_CALLEE1(pmdval_t, mmu.make_pmd, val); - - return (pmd_t) { ret }; + return (pmd_t) { PVOP_CALLEE1(pmdval_t, mmu.make_pmd, val) }; } =20 static inline pmdval_t pmd_val(pmd_t pmd) { - pmdval_t ret; - - if (sizeof(pmdval_t) > sizeof(long)) - ret =3D PVOP_CALLEE2(pmdval_t, mmu.pmd_val, - pmd.pmd, (u64)pmd.pmd >> 32); - else - ret =3D PVOP_CALLEE1(pmdval_t, mmu.pmd_val, pmd.pmd); - - return ret; + return PVOP_CALLEE1(pmdval_t, mmu.pmd_val, pmd.pmd); } =20 static inline void set_pud(pud_t *pudp, pud_t pud) { - pudval_t val =3D native_pud_val(pud); - - if (sizeof(pudval_t) > sizeof(long)) - PVOP_VCALL3(mmu.set_pud, pudp, val, (u64)val >> 32); - else - PVOP_VCALL2(mmu.set_pud, pudp, val); + PVOP_VCALL2(mmu.set_pud, pudp, native_pud_val(pud)); } -#if CONFIG_PGTABLE_LEVELS >=3D 4 + static inline pud_t __pud(pudval_t val) { pudval_t ret; @@ -574,29 +502,6 @@ static inline void p4d_clear(p4d_t *p4dp) set_p4d(p4dp, __p4d(0)); } =20 -#endif /* CONFIG_PGTABLE_LEVELS =3D=3D 4 */ - -#endif /* CONFIG_PGTABLE_LEVELS >=3D 3 */ - -#ifdef CONFIG_X86_PAE -/* Special-case pte-setting operations for PAE, which can't update a - 64-bit pte atomically */ -static inline void set_pte_atomic(pte_t *ptep, pte_t pte) -{ - PVOP_VCALL3(mmu.set_pte_atomic, ptep, pte.pte, pte.pte >> 32); -} - -static inline void pte_clear(struct mm_struct *mm, unsigned long addr, - pte_t *ptep) -{ - PVOP_VCALL3(mmu.pte_clear, mm, addr, ptep); -} - -static inline void pmd_clear(pmd_t *pmdp) -{ - PVOP_VCALL1(mmu.pmd_clear, pmdp); -} -#else /* !CONFIG_X86_PAE */ static inline void set_pte_atomic(pte_t *ptep, pte_t pte) { set_pte(ptep, pte); @@ -612,7 +517,6 @@ static inline void pmd_clear(pmd_t *pmdp) { set_pmd(pmdp, __pmd(0)); } -#endif /* CONFIG_X86_PAE */ =20 #define __HAVE_ARCH_START_CONTEXT_SWITCH static inline void arch_start_context_switch(struct task_struct *prev) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/p= aravirt_types.h index 8dfcb2508e6d..f27c3febaa6e 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -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 =20 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; =20 -#if CONFIG_PGTABLE_LEVELS >=3D 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); =20 struct paravirt_callee_save pmd_val; struct paravirt_callee_save make_pmd; =20 -#if CONFIG_PGTABLE_LEVELS >=3D 4 struct paravirt_callee_save pud_val; struct paravirt_callee_save make_pud; =20 @@ -291,10 +274,6 @@ struct pv_mmu_ops { void (*set_pgd)(pgd_t *pgdp, pgd_t pgdval); #endif /* CONFIG_PGTABLE_LEVELS >=3D 5 */ =20 -#endif /* CONFIG_PGTABLE_LEVELS >=3D 4 */ - -#endif /* CONFIG_PGTABLE_LEVELS >=3D 3 */ - struct pv_lazy_ops lazy_mode; =20 /* dom0 ops */ diff --git a/arch/x86/include/asm/pgtable-3level_types.h b/arch/x86/include= /asm/pgtable-3level_types.h index 80fbb4a9ed87..56baf43befb4 100644 --- a/arch/x86/include/asm/pgtable-3level_types.h +++ b/arch/x86/include/asm/pgtable-3level_types.h @@ -20,12 +20,7 @@ typedef union { } pte_t; #endif /* !__ASSEMBLY__ */ =20 -#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 =20 #define ARCH_PAGE_TABLE_SYNC_MASK (SHARED_KERNEL_PMD ? 0 : PGTBL_PMD_MODIF= IED) =20 diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 9646c300f128..517920928989 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -222,10 +222,6 @@ =20 #endif =20 -#ifndef CONFIG_PARAVIRT_XXL -# define get_kernel_rpl() 0 -#endif - #define IDT_ENTRIES 256 #define NUM_EXCEPTION_VECTORS 32 =20 diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c5d6f17d9b9d..8aa20bc2f1ca 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -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 =3D=3D native_iret) - set_cpu_bug(c, X86_BUG_ESPFIX); - } while (0); -# else set_cpu_bug(c, X86_BUG_ESPFIX); -# endif #endif } =20 diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index fdadc37d72af..2ca10b770cff 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -793,7 +793,6 @@ __used __visible void *trampoline_handler(struct pt_reg= s *regs) /* fixup registers */ regs->cs =3D __KERNEL_CS; #ifdef CONFIG_X86_32 - regs->cs |=3D get_kernel_rpl(); regs->gs =3D 0; #endif /* We use pt_regs->sp for return address holder. */ diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index 40f380461e6d..b8dd113a1284 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c @@ -181,7 +181,6 @@ optimized_callback(struct optimized_kprobe *op, struct = pt_regs *regs) /* Save skipped registers */ regs->cs =3D __KERNEL_CS; #ifdef CONFIG_X86_32 - regs->cs |=3D get_kernel_rpl(); regs->gs =3D 0; #endif regs->ip =3D (unsigned long)op->kp.addr + INT3_INSN_SIZE; diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index de2138ba38e5..e56a144c13b3 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -263,13 +263,8 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void) struct pv_info pv_info =3D { .name =3D "bare hardware", #ifdef CONFIG_PARAVIRT_XXL - .kernel_rpl =3D 0, - .shared_kernel_pmd =3D 1, /* Only used when CONFIG_X86_PAE is set */ - -#ifdef CONFIG_X86_64 .extra_user_64bit_cs =3D __USER_CS, #endif -#endif }; =20 /* 64-bit pagetable entries */ @@ -305,9 +300,7 @@ struct paravirt_patch_template pv_ops =3D { .cpu.load_idt =3D native_load_idt, .cpu.store_tr =3D native_store_tr, .cpu.load_tls =3D native_load_tls, -#ifdef CONFIG_X86_64 .cpu.load_gs_index =3D native_load_gs_index, -#endif .cpu.write_ldt_entry =3D native_write_ldt_entry, .cpu.write_gdt_entry =3D native_write_gdt_entry, .cpu.write_idt_entry =3D native_write_idt_entry, @@ -317,9 +310,7 @@ struct paravirt_patch_template pv_ops =3D { =20 .cpu.load_sp0 =3D native_load_sp0, =20 -#ifdef CONFIG_X86_64 .cpu.usergs_sysret64 =3D native_usergs_sysret64, -#endif .cpu.iret =3D native_iret, .cpu.swapgs =3D native_swapgs, =20 @@ -375,18 +366,11 @@ struct paravirt_patch_template pv_ops =3D { .mmu.ptep_modify_prot_start =3D __ptep_modify_prot_start, .mmu.ptep_modify_prot_commit =3D __ptep_modify_prot_commit, =20 -#if CONFIG_PGTABLE_LEVELS >=3D 3 -#ifdef CONFIG_X86_PAE - .mmu.set_pte_atomic =3D native_set_pte_atomic, - .mmu.pte_clear =3D native_pte_clear, - .mmu.pmd_clear =3D native_pmd_clear, -#endif .mmu.set_pud =3D native_set_pud, =20 .mmu.pmd_val =3D PTE_IDENT, .mmu.make_pmd =3D PTE_IDENT, =20 -#if CONFIG_PGTABLE_LEVELS >=3D 4 .mmu.pud_val =3D PTE_IDENT, .mmu.make_pud =3D PTE_IDENT, =20 @@ -398,8 +382,6 @@ struct paravirt_patch_template pv_ops =3D { =20 .mmu.set_pgd =3D native_set_pgd, #endif /* CONFIG_PGTABLE_LEVELS >=3D 5 */ -#endif /* CONFIG_PGTABLE_LEVELS >=3D 4 */ -#endif /* CONFIG_PGTABLE_LEVELS >=3D 3 */ =20 .mmu.pte_val =3D PTE_IDENT, .mmu.pgd_val =3D PTE_IDENT, diff --git a/arch/x86/kernel/paravirt_patch.c b/arch/x86/kernel/paravirt_pa= tch.c index 3eff63c090d2..ace6e334cb39 100644 --- a/arch/x86/kernel/paravirt_patch.c +++ b/arch/x86/kernel/paravirt_patch.c @@ -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 }; =20 static const struct patch_xxl patch_data_xxl =3D { @@ -42,7 +38,6 @@ static const struct patch_xxl patch_data_xxl =3D { .irq_save_fl =3D { 0x9c, 0x58 }, // pushf; pop %[re]ax .mmu_read_cr2 =3D { 0x0f, 0x20, 0xd0 }, // mov %cr2, %[re]ax .mmu_read_cr3 =3D { 0x0f, 0x20, 0xd8 }, // mov %cr3, %[re]ax -# ifdef CONFIG_X86_64 .mmu_write_cr3 =3D { 0x0f, 0x22, 0xdf }, // mov %rdi, %cr3 .irq_restore_fl =3D { 0x57, 0x9d }, // push %rdi; popfq .cpu_wbinvd =3D { 0x0f, 0x09 }, // wbinvd @@ -50,19 +45,11 @@ static const struct patch_xxl patch_data_xxl =3D { 0x48, 0x0f, 0x07 }, // swapgs; sysretq .cpu_swapgs =3D { 0x0f, 0x01, 0xf8 }, // swapgs .mov64 =3D { 0x48, 0x89, 0xf8 }, // mov %rdi, %rax -# else - .mmu_write_cr3 =3D { 0x0f, 0x22, 0xd8 }, // mov %eax, %cr3 - .irq_restore_fl =3D { 0x50, 0x9d }, // push %eax; popf - .cpu_iret =3D { 0xcf }, // iret -# endif }; =20 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 */ =20 @@ -98,13 +85,9 @@ unsigned int native_patch(u8 type, void *insn_buff, unsi= gned long addr, PATCH_CASE(mmu, read_cr3, xxl, insn_buff, len); PATCH_CASE(mmu, write_cr3, xxl, insn_buff, len); =20 -# 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 =20 #ifdef CONFIG_PARAVIRT_SPINLOCKS diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 22e741e0b10c..41485a8a6dcf 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1014,8 +1014,6 @@ void __init xen_setup_vcpu_info_placement(void) } =20 static const struct pv_info xen_info __initconst =3D { - .shared_kernel_pmd =3D 0, - .extra_user_64bit_cs =3D FLAT_USER_CS64, .name =3D "Xen", }; @@ -1314,10 +1312,6 @@ asmlinkage __visible void __init xen_start_kernel(vo= id) xen_start_info->nr_pages); xen_reserve_special_pages(); =20 - /* keep using Xen gdt for now; no urgent need to change it */ - - pv_info.kernel_rpl =3D 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 --=20 2.26.2 From nobody Sat May 4 04:40:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1597486039; cv=none; d=zohomail.com; s=zohoarc; b=Mwz5TfPfcA8u0gc0r+ifo0WkjG4CBR3vTCSyRsqtMZetoJ//E0RxhjAyxpSmmw97TedEyKDmZ8HtWhzBXxKV2qV1ltwvFUMT/AKVZuQgnfbbqh2+yXjfIXAL/VB9sX/nfkMuIRrM0ByfjIcVtgkrkrfrs3vxB/QiJMifp3D3eQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597486039; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IIa7bYebxNamjspPdV2TozQlERnOfRayacnic9AP2aE=; b=kmjMUQpc0D8yJWmf+tsru95YAYWeCjnrHd1N71geR6akYe2ptSdUijYLqVJFQ1yPP6hlNZ5fvIHGs4Fo+7LE7vhWsx+86GiL7hebUc6ZRrfxPqWNbUqTKyzIQZrlExAH6VEUXRhERFED4U22jEZwG8jri9+dOLaS1D9HdZTk1m4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1597486039838767.7427004697669; Sat, 15 Aug 2020 03:07:19 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5O-0007VM-ED; Sat, 15 Aug 2020 10:06:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5M-0007V7-I0 for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 10:06:48 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id cfe266f4-e3db-4c1a-9917-9b5879809052; Sat, 15 Aug 2020 10:06:47 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1BE2BB048; Sat, 15 Aug 2020 10:07:10 +0000 (UTC) X-Inumbo-ID: cfe266f4-e3db-4c1a-9917-9b5879809052 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Deep Shah , "VMware, Inc." , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v4 2/6] x86/paravirt: cleanup paravirt macros Date: Sat, 15 Aug 2020 12:06:37 +0200 Message-Id: <20200815100641.26362-3-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815100641.26362-1-jgross@suse.com> References: <20200815100641.26362-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" Some paravirt macros are no longer used, delete them. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravir= t.h index 25c7a73461f6..e02c409fa054 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -586,16 +586,9 @@ bool __raw_callee_save___native_vcpu_is_preempted(long= cpu); #endif /* SMP && PARAVIRT_SPINLOCKS */ =20 #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 =20 /* --=20 2.26.2 From nobody Sat May 4 04:40:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1597486040; cv=none; d=zohomail.com; s=zohoarc; b=m9N23jY6+Nt9zUZ4zTS3dtHxf/R6gX5qj8t0E7ZOjupc7dj2YFOor4XvSXrYNMsx73nY/AoAhx1JMHclMEic7G5r4HceJnDUdOxZ159/vm4W1PqueX/jsy8rlFGh4mch1UWBi8nLQSeN9jmV5bqaRgJqpYadWMRaTEWZSlsuVBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597486040; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jHqDg+ugXro092UBAEgermR52c63Pvh/nslPWY3FHv0=; b=CxK+YNsjap+AA+3JyISyUISsiWnFZCSdOadJar1j1YLOhH09y7Pcwxdtq0Xf7hW7GhL+gdPVBu3Y6MVgsA7wWBPXqjEUo5jO0bpH6bTW/uY2lcZFjfif/yqHrGFIIGzQ/jqF8vTN6rWNQKFnr3t3/hkIDLABPewWgmOyKUnAnx8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1597486040402328.374829783872; Sat, 15 Aug 2020 03:07:20 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5X-0007Wm-TW; Sat, 15 Aug 2020 10:06:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5W-0007V7-Ej for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 10:06:58 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id aa74126e-0920-4030-b27e-51b8719049d6; Sat, 15 Aug 2020 10:06:47 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 565B3B04C; Sat, 15 Aug 2020 10:07:10 +0000 (UTC) X-Inumbo-ID: aa74126e-0920-4030-b27e-51b8719049d6 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v4 3/6] x86/paravirt: use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT Date: Sat, 15 Aug 2020 12:06:38 +0200 Message-Id: <20200815100641.26362-4-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815100641.26362-1-jgross@suse.com> References: <20200815100641.26362-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" There are some code parts using CONFIG_PARAVIRT for Xen pvops related issues instead of the more stringent CONFIG_PARAVIRT_XXL. Signed-off-by: Juergen Gross --- 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(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 70dea9337816..26fc9b42fadc 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -46,13 +46,13 @@ .code64 .section .entry.text, "ax" =20 -#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 */ =20 /* * 64-bit SYSCALL instruction entry. Up to 6 arguments in registers. diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 0f0dd645b594..77217bd292bd 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h @@ -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 diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/as= m/required-features.h index 6847d85400a8..3ff0d48469f2 100644 --- a/arch/x86/include/asm/required-features.h +++ b/arch/x86/include/asm/required-features.h @@ -54,7 +54,7 @@ #endif =20 #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 --=20 2.26.2 From nobody Sat May 4 04:40:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1597486039; cv=none; d=zohomail.com; s=zohoarc; b=TJDgCoOkDk5JVm3LNZY4T4XMFFouiPmOvyP9ip56O+6QHSuJ0Ai+VXCdfsDb5bd0ABTYX/mRHlvTIh5Wx7h/QQPZcaqoeNhzcFS/VQOVCs8UBWdHDqDVHOhXdwendcABtA2kFrA859+1s/JpyXt6BKQ3Upb9sagzO1e7BAaz6Ro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597486039; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yl8Cvp5vfWyZjiprdocrgIuAIHojHzicR2LwFsYnC0U=; b=h89lUSwZGHgggbZQbzHxrHswsc65A5NFvKTMWUMe3oQsVDxqFRyoBreb7mSjzgltxSV7CaDQJLPd+n1rRQIN8y68UNTyGET+CsiCCqQyWP5jKFmNiW/7HRGEZuURbXujlsEQcFLJ1kKLOOOKdQZylMETr+qwVUdSjqsdqfFoE34= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1597486039649182.43947651236954; Sat, 15 Aug 2020 03:07:19 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5T-0007Vt-38; Sat, 15 Aug 2020 10:06:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5R-0007V7-ES for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 10:06:53 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0a0c8da6-331e-484d-9751-282eef4a4d7b; Sat, 15 Aug 2020 10:06:47 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 8CFB7B052; Sat, 15 Aug 2020 10:07:10 +0000 (UTC) X-Inumbo-ID: 0a0c8da6-331e-484d-9751-282eef4a4d7b X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v4 4/6] x86/entry/32: revert "Fix XEN_PV build dependency" Date: Sat, 15 Aug 2020 12:06:39 +0200 Message-Id: <20200815100641.26362-5-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815100641.26362-1-jgross@suse.com> References: <20200815100641.26362-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" With 32-bit Xen PV support gone commit a4c0e91d1d65bc58 ("x86/entry/32: Fix XEN_PV build dependency") can be reverted again. Signed-off-by: Juergen Gross --- arch/x86/include/asm/idtentry.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentr= y.h index a43366191212..337dcfd45472 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -547,7 +547,7 @@ DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check); =20 /* 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 =20 @@ -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 =20 --=20 2.26.2 From nobody Sat May 4 04:40:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1597486041; cv=none; d=zohomail.com; s=zohoarc; b=h+p+fn3WuUVZyqdtcPepfUGpLg260SKJ2nTK7EHsxR5DRYJNhAViqASF1aZBi+fqVsSJFp2ElL8abN3Xm0KBj72T9CJBK+sq7MOv0Ik+Poq5hGoGTvJQB48PZsYx+k1dVJ9xDbcMNe005WeVqnakWnhzBDhJ2QKJK9sezNN99A4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597486041; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A8IYB5tR9dM7+1fdvWOplkUS8rsQVhGm+6XZyz+VQyE=; b=n2qJf+miqjcoNY1d6YvPUEBMzFKZtYtDmqDA0IPFNB5P8iPBeqREWRaXjlRQFTYbb2Gxtlg/gK5JYJA1CCndcf62fDLQpRT/3bqQvkNYWbVoevrI0qOGBVF8nxT/jtsV8ANK8xnWZY/8uTD7YkW+lJFmbieMItxwRBJWnjVEnIs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 159748604111992.49125696183; Sat, 15 Aug 2020 03:07:21 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5X-0007WO-DM; Sat, 15 Aug 2020 10:06:59 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5W-0007V6-7x for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 10:06:58 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e2207bb1-e10c-40ff-9c88-89eac581cd9a; Sat, 15 Aug 2020 10:06:48 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E3EECB049; Sat, 15 Aug 2020 10:07:10 +0000 (UTC) X-Inumbo-ID: e2207bb1-e10c-40ff-9c88-89eac581cd9a X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Deep Shah , "VMware, Inc." , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Boris Ostrovsky , Stefano Stabellini , Steven Rostedt Subject: [PATCH v4 5/6] x86/paravirt: remove set_pte_at pv-op Date: Sat, 15 Aug 2020 12:06:40 +0200 Message-Id: <20200815100641.26362-6-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815100641.26362-1-jgross@suse.com> References: <20200815100641.26362-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky --- 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(-) diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravir= t.h index e02c409fa054..f0464b88ea1e 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -412,12 +412,6 @@ static inline void set_pte(pte_t *ptep, pte_t pte) PVOP_VCALL2(mmu.set_pte, ptep, pte.pte); } =20 -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 pt= e) 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)); } =20 static inline void pmd_clear(pmd_t *pmdp) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/p= aravirt_types.h index f27c3febaa6e..0fad9f61c76a 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -242,8 +242,6 @@ struct pv_mmu_ops { =20 /* 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); =20 pte_t (*ptep_modify_prot_start)(struct vm_area_struct *vma, unsigned long= addr, diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index b836138ce852..7414b416779b 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -63,7 +63,6 @@ extern pmdval_t early_pmd_flags; #include #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) =20 #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; } =20 -static inline void native_set_pte_at(struct mm_struct *mm, unsigned long a= ddr, - 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); } =20 static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index e56a144c13b3..6c3407ba6ee9 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c @@ -360,7 +360,6 @@ struct paravirt_patch_template pv_ops =3D { .mmu.release_p4d =3D paravirt_nop, =20 .mmu.set_pte =3D native_set_pte, - .mmu.set_pte_at =3D native_set_pte_at, .mmu.set_pmd =3D native_set_pmd, =20 .mmu.ptep_modify_prot_start =3D __ptep_modify_prot_start, diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c index 3273c985d3dd..eda78144c000 100644 --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -285,13 +285,6 @@ static void xen_set_pte(pte_t *ptep, pte_t pteval) __xen_set_pte(ptep, pteval); } =20 -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 __initcons= t =3D { .release_pmd =3D xen_release_pmd_init, =20 .set_pte =3D xen_set_pte_init, - .set_pte_at =3D xen_set_pte_at, .set_pmd =3D xen_set_pmd_hyper, =20 .ptep_modify_prot_start =3D __ptep_modify_prot_start, diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index a5ccfa67bc5c..3b61b587e137 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h @@ -153,26 +153,6 @@ DECLARE_EVENT_CLASS(xen_mmu__set_pte, =20 DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte); =20 -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 =3D mm; - __entry->addr =3D addr; - __entry->ptep =3D ptep; - __entry->pteval =3D 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); =20 TRACE_EVENT(xen_mmu_set_pmd, --=20 2.26.2 From nobody Sat May 4 04:40:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1597486040; cv=none; d=zohomail.com; s=zohoarc; b=jNai2Nw/RHzad04VRYOVjm/RdZB7eL9ItbJedUuRIXiNGKFwEfUD/tlSfznn1f49XTPt2yj9RHx+pKxYzVgbdTQwzQcICAqVizP1CCvDehhQ+jOlOw5MSy2erh49Se+9KZsAnzl8R1MmZ0bqXHwjU5PthfUh/QlzYmq/NkxaiVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597486040; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jTL0fw+jPC8MxBJPeTrBVC5AN9m66s+vyih3kZfVLYU=; b=AlUANLwkKsGR+Rrus2sa4JiEcUWWUnbIkRCkkA9OyKWJ34GegQAS6YXmMSZQ6qqoh75u+NEUyPmrExZuW5ZGcvAaZpLWTlGzCgdfaXwA4mfF/DIcMxShO12QTIJuxd+sql/3TZqRM5fEXs1R8VQOlomPC0QCt0BfQ3sNIDYGvJM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1597486040872493.7259129970438; Sat, 15 Aug 2020 03:07:20 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5d-0007Zg-A7; Sat, 15 Aug 2020 10:07:05 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k6t5b-0007V7-F0 for xen-devel@lists.xenproject.org; Sat, 15 Aug 2020 10:07:03 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5fbcb7c1-5436-4d29-8857-c0003d2a3a61; Sat, 15 Aug 2020 10:06:48 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3634FB04F; Sat, 15 Aug 2020 10:07:11 +0000 (UTC) X-Inumbo-ID: 5fbcb7c1-5436-4d29-8857-c0003d2a3a61 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org, x86@kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Deep Shah , "VMware, Inc." , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v4 6/6] x86/paravirt: avoid needless paravirt step clearing page table entries Date: Sat, 15 Aug 2020 12:06:41 +0200 Message-Id: <20200815100641.26362-7-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200815100641.26362-1-jgross@suse.com> References: <20200815100641.26362-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" pte_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. Signed-off-by: Juergen Gross --- arch/x86/include/asm/paravirt.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravir= t.h index f0464b88ea1e..d25cc6830e89 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -448,7 +448,7 @@ static inline pudval_t pud_val(pud_t pud) =20 static inline void pud_clear(pud_t *pudp) { - set_pud(pudp, __pud(0)); + set_pud(pudp, native_make_pud(0)); } =20 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) =20 #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) =20 #endif /* CONFIG_PGTABLE_LEVELS =3D=3D 5 */ =20 static inline void p4d_clear(p4d_t *p4dp) { - set_p4d(p4dp, __p4d(0)); + set_p4d(p4dp, native_make_p4d(0)); } =20 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)); } =20 static inline void pmd_clear(pmd_t *pmdp) { - set_pmd(pmdp, __pmd(0)); + set_pmd(pmdp, native_make_pmd(0)); } =20 #define __HAVE_ARCH_START_CONTEXT_SWITCH --=20 2.26.2