All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org, x86@kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>, Deep Shah <sdeep@vmware.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH v4 6/6] x86/paravirt: avoid needless paravirt step clearing page table entries
Date: Sat, 15 Aug 2020 12:06:41 +0200	[thread overview]
Message-ID: <20200815100641.26362-7-jgross@suse.com> (raw)
In-Reply-To: <20200815100641.26362-1-jgross@suse.com>

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 <jgross@suse.com>
---
 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/paravirt.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)
 
 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
-- 
2.26.2


WARNING: multiple messages have this Message-ID (diff)
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org, x86@kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH v4 6/6] x86/paravirt: avoid needless paravirt step clearing page table entries
Date: Sat, 15 Aug 2020 12:06:41 +0200	[thread overview]
Message-ID: <20200815100641.26362-7-jgross@suse.com> (raw)
In-Reply-To: <20200815100641.26362-1-jgross@suse.com>

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 <jgross@suse.com>
---
 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/paravirt.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)
 
 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
-- 
2.26.2

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2020-08-15 21:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 10:06 [PATCH v4 0/6] x86/paravirt: cleanup after 32-bit PV removal Juergen Gross
2020-08-15 10:06 ` Juergen Gross
2020-08-15 10:06 ` [PATCH v4 1/6] x86/paravirt: remove 32-bit support from PARAVIRT_XXL Juergen Gross
2020-08-15 10:06   ` Juergen Gross
2020-08-15 15:46   ` [tip: x86/paravirt] x86/paravirt: Remove 32-bit support from CONFIG_PARAVIRT_XXL tip-bot2 for Juergen Gross
2020-08-16 18:37   ` [PATCH v4 1/6] x86/paravirt: remove 32-bit support from PARAVIRT_XXL boris.ostrovsky
2020-08-16 18:37     ` boris.ostrovsky
2020-08-15 10:06 ` [PATCH v4 2/6] x86/paravirt: cleanup paravirt macros Juergen Gross
2020-08-15 10:06   ` Juergen Gross
2020-08-15 15:46   ` [tip: x86/paravirt] x86/paravirt: Clean up " tip-bot2 for Juergen Gross
2020-08-15 10:06 ` [PATCH v4 3/6] x86/paravirt: use CONFIG_PARAVIRT_XXL instead of CONFIG_PARAVIRT Juergen Gross
2020-08-15 15:46   ` [tip: x86/paravirt] x86/paravirt: Use " tip-bot2 for Juergen Gross
2020-08-15 10:06 ` [PATCH v4 4/6] x86/entry/32: revert "Fix XEN_PV build dependency" Juergen Gross
2020-08-15 15:46   ` [tip: x86/paravirt] x86/entry/32: Simplify CONFIG_XEN_PV build dependency tip-bot2 for Juergen Gross
2020-08-15 10:06 ` [PATCH v4 5/6] x86/paravirt: remove set_pte_at pv-op Juergen Gross
2020-08-15 10:06   ` Juergen Gross
2020-08-15 15:46   ` [tip: x86/paravirt] x86/paravirt: Remove set_pte_at() pv-op tip-bot2 for Juergen Gross
2020-08-16 18:44   ` [PATCH v4 5/6] x86/paravirt: remove set_pte_at pv-op boris.ostrovsky
2020-08-16 18:44     ` boris.ostrovsky
2020-08-15 10:06 ` Juergen Gross [this message]
2020-08-15 10:06   ` [PATCH v4 6/6] x86/paravirt: avoid needless paravirt step clearing page table entries Juergen Gross
2020-08-15 15:46   ` [tip: x86/paravirt] x86/paravirt: Avoid " tip-bot2 for Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200815100641.26362-7-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pv-drivers@vmware.com \
    --cc=sdeep@vmware.com \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.