linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Gray <bgray@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: kernel test robot <lkp@intel.com>, Benjamin Gray <bgray@linux.ibm.com>
Subject: [PATCH] powerpc/tlb: Implement book3s/32/tlbflush.h local_flush_tlb_page_psize
Date: Tue, 31 Jan 2023 13:58:17 +1100	[thread overview]
Message-ID: <20230131025817.279417-1-bgray@linux.ibm.com> (raw)

The commit introducing this function implemented it as a build bug on this
platform to make the compiler happy, as the only use in the code is guarded
behind a radix_enabled() conditional.

GCC recognises that cpu_has_feature(MMU_FTR_TYPE_RADIX) returns false on this
platform and eliminates the build bug as dead code. However, when
CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG is enabled, the assertion and possible
call to early_cpu_... prevents Clang from eliminating any code that's
conditional on the return value. So Clang triggers the build bug as reported
by the kernel test robot:

https://lore.kernel.org/llvm/202301212348.eDkowvfF-lkp@intel.com

Fixes: 274d842fa1ef ("powerpc/tlb: Add local flush for page given mm_struct and psize")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
---

Supersedes https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20230124215424.9068-1-bgray@linux.ibm.com/

---
 arch/powerpc/include/asm/book3s/32/tlbflush.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/32/tlbflush.h b/arch/powerpc/include/asm/book3s/32/tlbflush.h
index 4be572908124..cde3b6f5d563 100644
--- a/arch/powerpc/include/asm/book3s/32/tlbflush.h
+++ b/arch/powerpc/include/asm/book3s/32/tlbflush.h
@@ -2,8 +2,6 @@
 #ifndef _ASM_POWERPC_BOOK3S_32_TLBFLUSH_H
 #define _ASM_POWERPC_BOOK3S_32_TLBFLUSH_H

-#include <linux/build_bug.h>
-
 #define MMU_NO_CONTEXT      (0)
 /*
  * TLB flushing for "classic" hash-MMU 32-bit CPUs, 6xx, 7xx, 7xxx
@@ -80,7 +78,7 @@ static inline void local_flush_tlb_page(struct vm_area_struct *vma,
 static inline void local_flush_tlb_page_psize(struct mm_struct *mm,
 					      unsigned long vmaddr, int psize)
 {
-	BUILD_BUG();
+	flush_range(mm, vmaddr, vmaddr + PAGE_SIZE);
 }

 static inline void local_flush_tlb_mm(struct mm_struct *mm)

base-commit: ca272751ba18ca8f137af631cbc9f3f987fab6e3
--
2.39.1

             reply	other threads:[~2023-01-31  2:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31  2:58 Benjamin Gray [this message]
2023-01-31  6:33 ` [PATCH] powerpc/tlb: Implement book3s/32/tlbflush.h local_flush_tlb_page_psize Christophe Leroy
2023-01-31 21:58   ` Benjamin Gray
2023-02-01 10:16     ` Christophe Leroy

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=20230131025817.279417-1-bgray@linux.ibm.com \
    --to=bgray@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).