Skip to contentSkip to conversation

ARC fixes for 6.12

PATCH New Vineet Gupta 1 participant 4 messages Oct 16, 2024 Synopsys ARC architecture

lore
Share & tools
lore

Vineet Gupta

author maintainer
#0 lore raw

cover ARC fixes for 6.12

Hi,

Changes slated for a near future rc.

Thx,
-Vineet

Benjamin Szőke (1):
arc: rename aux.h to arc_aux.h

Paul E. McKenney (1):
ARC: build: Use __force to suppress per-CPU cmpxchg warnings

Vineet Gupta (1):
ARC: build: disallow invalid PAE40 + 4K page config

 arch/arc/Kconfig                     | 4 ++--
 arch/arc/include/asm/arcregs.h       | 2 +-
 arch/arc/include/asm/cmpxchg.h       | 2 +-
 arch/arc/include/asm/mmu-arcv2.h     | 2 +-
 include/soc/arc/{aux.h => arc_aux.h} | 0
 include/soc/arc/mcip.h               | 2 +-
 include/soc/arc/timers.h             | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
 rename include/soc/arc/{aux.h => arc_aux.h} (100%)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/3 arc: rename aux.h to arc_aux.h

From: Benjamin Szőke <[email protected]>

The goal is to clean-up Linux repository from AUX file names, because the use of such file names is prohibited on other operating systems such as Windows, so the Linux repository cannot be cloned and edited on them.

---
 arch/arc/include/asm/arcregs.h       | 2 +-
 arch/arc/include/asm/mmu-arcv2.h     | 2 +-
 include/soc/arc/{aux.h => arc_aux.h} | 0
 include/soc/arc/mcip.h               | 2 +-
 include/soc/arc/timers.h             | 2 +-
 5 files changed, 4 insertions(+), 4 deletions(-)
 rename include/soc/arc/{aux.h => arc_aux.h} (100%)
arch/arc/include/asm/arcregs.h +1 -1
index 4b13f60fe7ca..005d9e4d187a 100644
@@ -146,7 +146,7 @@
 
 #ifndef __ASSEMBLY__
 
-#include <soc/arc/aux.h>
+#include <soc/arc/arc_aux.h>
 
 /* Helpers */
 #define TO_KB(bytes)		((bytes) >> 10)
arch/arc/include/asm/mmu-arcv2.h +1 -1
index d85dc0721907..41412642f279 100644
@@ -9,7 +9,7 @@
 #ifndef _ASM_ARC_MMU_ARCV2_H
 #define _ASM_ARC_MMU_ARCV2_H
 
-#include <soc/arc/aux.h>
+#include <soc/arc/arc_aux.h>
 
 /*
  * TLB Management regs
include/soc/arc/arc_aux.h renamed from include/soc/arc/aux.h +0 -0
similarity index 100%
rename from include/soc/arc/aux.h
rename to include/soc/arc/arc_aux.h
include/soc/arc/mcip.h +1 -1
index d1a93c73f006..a78dacd149f1 100644
@@ -8,7 +8,7 @@
 #ifndef __SOC_ARC_MCIP_H
 #define __SOC_ARC_MCIP_H
 
-#include <soc/arc/aux.h>
+#include <soc/arc/arc_aux.h>
 
 #define ARC_REG_MCIP_BCR	0x0d0
 #define ARC_REG_MCIP_IDU_BCR	0x0D5
include/soc/arc/timers.h +1 -1
index ae99d3e855f1..51a74166296c 100644
@@ -6,7 +6,7 @@
 #ifndef __SOC_ARC_TIMERS_H
 #define __SOC_ARC_TIMERS_H
 
-#include <soc/arc/aux.h>
+#include <soc/arc/arc_aux.h>
 
 /* Timer related Aux registers */
 #define ARC_REG_TIMER0_LIMIT	0x23	/* timer 0 limit */
Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH 2/3 ARC: build: disallow invalid PAE40 + 4K page config

In reply to Vineet Gupta

The config option being built was

| CONFIG_ARC_MMU_V4=y
| CONFIG_ARC_PAGE_SIZE_4K=y
| CONFIG_HIGHMEM=y
| CONFIG_ARC_HAS_PAE40=y

This was hitting a BUILD_BUG_ON() since a 4K page can't hoist 1k, 8-byte PTE entries (8 byte due to PAE40). BUILD_BUG_ON() is a good last ditch resort, but such a config needs to be disallowed explicitly in Kconfig.

Side-note: the actual fix is single liner dependency, but while at it cleaned out a few things:
- 4K dependency on MMU v3 or v4 is always true, since 288ff7de62af09 ("ARC: retire MMUv1 and MMUv2 support")
- PAE40 dependency in on MMU ver not really ISA, although that follows eventually.

---
 arch/arc/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arc/Kconfig +2 -2
index 5b2488142041..69c6e71fa1e6 100644
@@ -297,7 +297,6 @@ config ARC_PAGE_SIZE_16K
 config ARC_PAGE_SIZE_4K
 	bool "4KB"
 	select HAVE_PAGE_SIZE_4KB
-	depends on ARC_MMU_V3 || ARC_MMU_V4
 
 endchoice
 
@@ -474,7 +473,8 @@ config HIGHMEM
 
 config ARC_HAS_PAE40
 	bool "Support for the 40-bit Physical Address Extension"
-	depends on ISA_ARCV2
+	depends on MMU_V4
+	depends on !ARC_PAGE_SIZE_4K
 	select HIGHMEM
 	select PHYS_ADDR_T_64BIT
 	help
Signature · 1 line
2.43.0
author maintainer
#3 lore raw

PATCH 3/3 ARC: build: Use __force to suppress per-CPU cmpxchg warnings

In reply to Vineet Gupta

From: "Paul E. McKenney" <[email protected]>

Currently, the cast of the first argument to cmpxchg_emu_u8() drops the __percpu address-space designator, which results in sparse complaints when applying cmpxchg() to per-CPU variables in ARC. Therefore, use __force to suppress these complaints, given that this does not pertain to cmpxchg() semantics, which are plently well-defined on variables in general, whether per-CPU or otherwise.

---
 arch/arc/include/asm/cmpxchg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arc/include/asm/cmpxchg.h +1 -1
index 58045c898340..76f43db0890f 100644
@@ -48,7 +48,7 @@
 									\
 	switch(sizeof((_p_))) {						\
 	case 1:								\
-		_prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *)_p_, (uintptr_t)_o_, (uintptr_t)_n_);	\
+		_prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *__force)_p_, (uintptr_t)_o_, (uintptr_t)_n_);	\
 		break;							\
 	case 4:								\
 		_prev_ = __cmpxchg(_p_, _o_, _n_);			\
Signature · 1 line
2.43.0