Skip to contentSkip to conversation

sparc64: add Fujitsu M3000 support

PATCH Superseded Magnus Lindholm 4 participants 16 messages Oct 11 – Oct 12

Subsystems (5)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover sparc64: add Fujitsu M3000 support

Several years ago I salvaged an M3000 SPARC Enterprise box being decommissioned at work. The box has been sitting ever since, as it did not run Linux. It did not seem impossible to get Linux running, but my earlier attempts failed. I recently found some documentation:
"SPARC JPS2: Common Specification" and the "Fujitsu SPARC64 VII Extensions", which gave me some of the missing pieces. Getting this up and running required extensive testing, some kernel instrumentation, debug printouts and many reboot iterations. For this, Codex proved very helpful. Along the way, I stumbled upon some generic sparc and driver bugs that this series addresses as well.

This series adds support for the Fujitsu SPARC Enterprise M3000, with SPARC64 VII+, Oberon PCIe and a firmware hvc console.
Based on Linux v7.3-rc1, commit cee9395acd8043be0644b25c34bfa86623f2b935.

Patches 1-3 fix existing sparc64 defects in generic clear_page, secondary queued-spinlock acquisition and sun4u kernel huge-PUD mappings. Each has a Fixes tag. Patches 4-6 add the CPU/MMU/SMP path, PCIe bridge and firmware console.

Changes since v1:
- Split the tg3 firmware byte-order fix into a standalone netdev patch, as requested by Jakub. It has no code dependency on this series.
- Address Krzysztof's topology review: replace the root-model check and adjacent-CPU assumption with compatible core nodes and cpu/core/cmp ancestry. Unknown ancestry produces no inferred sibling groups; hardware CPU IDs are unchanged. This uses the observed firmware tree, without claiming that the root model is a documented binding.
- Address Greg's console-state review: group state by HVC term number. Retain static storage for early console use and firmware-visible locked mappings; the M3000 exposes one /chosen stdin/stdout pair.
- Replace READ_ONCE/WRITE_ONCE polling-state access with explicit locking. A spinlock protects active state and timer rearming; a mutex serializes open, last close and hangup while close waits for the timer callback.
- Remove the arbitrary eight-attempt write loop. No progress returns
zero: HVC retries buffered TTY output but drops stalled console chunks. A firmware call that never returns remains unbounded.
- Retain the raw buffer lock because console writes can run in atomic contexts. The PROM lock protects firmware entry, not the buffer copies before and after it. Panic/NMI and recursive console safety remain unverified.
- Retain the service-name pointer cast: p1275_cmd_direct() takes unsigned long argument cells, as used by the existing prom_console_write_buf().
- Remove stale "experimental" wording and the console success message; add copyright, use min(), and fix the Makefile spacing and blank line.
- Retain CONFIG_SPARC64_VII and its HugeTLB/THP exclusions. Removing the option requires runtime feature gating and further MMU work. Retain separate VII demap routines: similar Cheetah assembly does not establish the same hardware synchronization requirement there.

Onboard BCM5718 networking also needs the standalone patch "tg3: normalize inherited M3000 register byte order". Apply it alongside this series for complete M3000 testing; it is not a build dependency. The two submissions can be taken through their respective trees.

The six-patch SPARC series also applies and builds without the tg3 fix. The tg3 patch applies and its driver builds independently on v7.3-rc1. Applying both submissions in either order reproduces the tested tree.

The combined v2 tree, including the standalone tg3 fix, cross-built with GCC 13.3 in SMP, true CONFIG_SMP=n and non-VII Ultra45 configurations. Each prefix of that seven-patch tree applied and built. The combined, uninstrumented SMP kernel booted from disk with eight threads; true UP also booted from disk. Both reached Gentoo/OpenRC with hvc0. SMP topology reports four cores, two threads per core and one package with reciprocal sibling masks.

Bounded SMP fork/COW and remap/protection tests passed, as did UP COW. Console testing covered login, 100 paired-open/last-close cycles, hangup/reopen, paced input, idle input and concurrent output. Rapid pasted input still loses characters. Mocked firmware tests exercised partial writes, no progress, errors and invalid return counts; topology fixtures covered sparse IDs, package separation and missing ancestry. The Ultra45 configuration was compile-tested only for this revision; topology fixtures do not establish multi-package hardware support.

Oberon MSI and native bridge error recovery, VII CPU offlining and complete RAS recovery remain unimplemented. ECC recovery was not fault-injected; urgent errors stop with a raw record. Raw-IPI page lifetime and Oberon ordering remain audit topics.

Link to v1:
https://lore.kernel.org/sparclinux/[email protected]/
Link to tg3 patch (v3):
https://lore.kernel.org/sparclinux/[email protected]/

Magnus Lindholm (6):
sparc64: return from the generic clear_page implementation
sparc64: honor queued spinlock layout in secondary startup
sparc64: avoid huge kernel PUD mappings on sun4u
sparc64: add SPARC64 VII CPU, MMU and SMP support
sparc64: add M3000 Oberon PCIe support
hvc: add an M3000 firmware console backend

 MAINTAINERS                         |   6 +
 arch/sparc/Kconfig                  |  20 +++
 arch/sparc/include/asm/head_64.h    |  15 ++
 arch/sparc/include/asm/iommu_64.h   |   1 +
 arch/sparc/include/asm/irq_64.h     |   1 +
 arch/sparc/include/asm/setup.h      |   5 +
 arch/sparc/include/asm/smp_64.h     |   4 +
 arch/sparc/include/asm/spitfire.h   |   1 +
 arch/sparc/include/asm/trap_block.h |   6 +
 arch/sparc/kernel/cpu.c             |   3 +
 arch/sparc/kernel/entry.h           |   2 +
 arch/sparc/kernel/head_64.S         |  18 +++
 arch/sparc/kernel/helpers.S         |  41 +++++
 arch/sparc/kernel/iommu.c           |  44 ++++++
 arch/sparc/kernel/irq_64.c          |  50 ++++--
 arch/sparc/kernel/pci_fire.c        |  31 +++-
 arch/sparc/kernel/pci_impl.h        |   1 +
 arch/sparc/kernel/prom_64.c         |  27 ++++
 arch/sparc/kernel/prom_irqtrans.c   |   7 +
 arch/sparc/kernel/ptrace_64.c       |   7 +
 arch/sparc/kernel/setup_64.c        |  55 +++++++
 arch/sparc/kernel/smp_64.c          |  89 ++++++++++-
 arch/sparc/kernel/trampoline_64.S   |  53 ++++++-
 arch/sparc/kernel/traps_64.c        |  27 ++++
 arch/sparc/lib/GENpage.S            |   3 +
 arch/sparc/mm/init_64.c             | 110 ++++++++++++-
 arch/sparc/mm/tsb.c                 |  19 ++-
 arch/sparc/mm/ultra.S               | 236 ++++++++++++++++++++++++++++
 drivers/tty/hvc/Kconfig             |  10 ++
 drivers/tty/hvc/Makefile            |   1 +
 drivers/tty/hvc/hvc_m3000.c         | 205 ++++++++++++++++++++++++
 31 files changed, 1064 insertions(+), 34 deletions(-)
 create mode 100644 drivers/tty/hvc/hvc_m3000.c

base-commit: cee9395acd8043be0644b25c34bfa86623f2b935

Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/6 sparc64: return from the generic clear_page implementation

GENclear_page falls through into generic_patch_pageops after clearing its page. The patcher then rewrites kernel text on each invocation. Return to the caller once the clear loop completes, as GENcopy_page does. This affects processors using the generic page-operation fallback.

Fixes 6c70b6fc7b6f ("[SPARC64]: Do not assume sun4v chips have load-twin/store-init support.")
---
 arch/sparc/lib/GENpage.S | 3 +++
 1 file changed, 3 insertions(+)
arch/sparc/lib/GENpage.S +3 -0
index c143c4d1de3f..6ce11108e143 100644
@@ -48,6 +48,9 @@ GENclear_user_page:
 	bne,pt	%xcc, 1b
 	 add	%o0, 64, %o0
 
+	retl
+	 nop
+
 #define BRANCH_ALWAYS	0x10680000
 #define NOP		0x01000000
 #define GEN_DO_PATCH(OLD, NEW)	\
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v2 1/6] sparc64: return from the generic clear_page implementation

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines

GENclear_page falls through into generic_patch_pageops after clearing its page. The patcher then rewrites kernel text on each invocation. Return to the caller once the clear loop completes, as GENcopy_page does. This affects processors using the generic page-operation fallback.

Fixes 6c70b6fc7b6f ("[SPARC64]: Do not assume sun4v chips have load-twin/store-init support.")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

PATCH v2 2/6 sparc64: honor queued spinlock layout in secondary startup

In reply to Magnus Lindholm

The trampoline's ldstub modifies the queue-tail byte of prom_entry_lock, not its locked byte, because SPARC64 uses big-endian queued spinlocks. Acquire the word with CASA, release byte three and poll while contended. Retain the predicted-branch barriers for Spitfire erratum 51.

See qspinlock_types.h for the layout and JPS2 A.10/A.35 for CASA/MEMBAR.

Fixes 145d97858597 ("arch/sparc: Enable queued spinlock support for SPARC")
---
 arch/sparc/kernel/trampoline_64.S | 34 +++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)
arch/sparc/kernel/trampoline_64.S +30 -4
index 51bf1eb92a36..62f404b3079a 100644
@@ -106,9 +106,19 @@ startup_continue:
 	 * We lock 'num_kernel_image_mappings' consequetive entries.
 	 */
 	sethi		%hi(prom_entry_lock), %g2
-1:	ldstub		[%g2 + %lo(prom_entry_lock)], %g1
+	/* Big-endian qspinlock: acquire the whole 32-bit value, not byte 0. */
+	or		%g2, %lo(prom_entry_lock), %g2
+1:	lduw		[%g2], %g1
 	brnz,pn		%g1, 1b
 	 nop
+	mov		1, %g1
+	casa		[%g2] ASI_P, %g0, %g1
+	brnz,pn		%g1, 1b
+	 nop
+	/* Spitfire erratum 51: barrier in a predicted-taken delay slot. */
+	ba,pt		%xcc, 2f
+	 membar		#Sync
+2:
 
 	/* Get onto temporary stack which will be in the locked
 	 * kernel image.
@@ -212,7 +222,10 @@ startup_continue:
 	 nop
 
 	sethi		%hi(prom_entry_lock), %g2
-	stb		%g0, [%g2 + %lo(prom_entry_lock)]
+	/* Match membar_safe() for Spitfire erratum 51. */
+	ba,pt		%xcc, 2f
+	 membar		#StoreStore | #LoadStore
+2:	stb		%g0, [%g2 + %lo(prom_entry_lock) + 3]
 
 	ba,pt		%xcc, after_lock_tlb
 	 nop
@@ -326,9 +339,19 @@ after_lock_tlb:
 	wrpr		%g0, 0, %wstate
 
 	sethi		%hi(prom_entry_lock), %g2
-1:	ldstub		[%g2 + %lo(prom_entry_lock)], %g1
+	/* Big-endian qspinlock: acquire the whole 32-bit value, not byte 0. */
+	or		%g2, %lo(prom_entry_lock), %g2
+1:	lduw		[%g2], %g1
 	brnz,pn		%g1, 1b
 	 nop
+	mov		1, %g1
+	casa		[%g2] ASI_P, %g0, %g1
+	brnz,pn		%g1, 1b
+	 nop
+	/* Spitfire erratum 51: barrier in a predicted-taken delay slot. */
+	ba,pt		%xcc, 2f
+	 membar		#Sync
+2:
 
 	/* As a hack, put &init_thread_union into %g6.
 	 * prom_world() loads from here to restore the %asi
@@ -389,7 +412,10 @@ after_lock_tlb:
 	 add		%sp, (2047 + 128), %o0
 
 3:	sethi		%hi(prom_entry_lock), %g2
-	stb		%g0, [%g2 + %lo(prom_entry_lock)]
+	/* Match membar_safe() for Spitfire erratum 51. */
+	ba,pt		%xcc, 2f
+	 membar		#StoreStore | #LoadStore
+2:	stb		%g0, [%g2 + %lo(prom_entry_lock) + 3]
 
 	ldx		[%l0], %g6
 	ldx		[%g6 + TI_TASK], %g4
Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH v2 2/6] sparc64: honor queued spinlock layout in secondary startup

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines

The trampoline's ldstub modifies the queue-tail byte of prom_entry_lock, not its locked byte, because SPARC64 uses big-endian queued spinlocks. Acquire the word with CASA, release byte three and poll while contended. Retain the predicted-branch barriers for Spitfire erratum 51.

See qspinlock_types.h for the layout and JPS2 A.10/A.35 for CASA/MEMBAR.

Fixes 145d97858597 ("arch/sparc: Enable queued spinlock support for SPARC")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#5 lore raw

PATCH v2 3/6 sparc64: avoid huge kernel PUD mappings on sun4u

In reply to Magnus Lindholm

The kernel PUD refill path merges virtual address bits 32:28 into a TTE, requiring a hardware page size of at least 256MB. On sun4u, kern_linear_pte_xor[2] and [3] instead select the 4MB fallback TTE. Consequently address bits 27:22 are lost when refilling a huge PUD.

Keep the kernel linear mapping at PMD granularity on sun4u. Its refill path preserves bit 22, as required by the 4MB TTE. Leave the sun4v mapping selection unchanged.

Fixes 0dd5b7b09e13 ("sparc64: Fix physical memory management regressions with large max_phys_bits.")
---
 arch/sparc/mm/init_64.c | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/sparc/mm/init_64.c +8 -0
index 103db4683b16..0ae97e616435 100644
@@ -1696,6 +1696,14 @@ static unsigned long __ref kernel_map_hugepud(unsigned long vstart,
 static bool kernel_can_map_hugepud(unsigned long vstart, unsigned long vend,
 				   bool guard)
 {
+	/*
+	 * The PUD miss path propagates VA bits 32:28, assuming at least
+	 * 256MB hardware pages. Sun4u uses 4MB pages here: retain PMD
+	 * mappings so bits 27:22 are not lost during TLB refill.
+	 */
+	if (tlb_type != hypervisor)
+		return false;
+
 	if (guard && !(vstart & ~PUD_MASK) && (vend - vstart) >= PUD_SIZE)
 		return true;
 
Signature · 1 line
2.43.0
#6 lore raw

Re: [PATCH v2 3/6] sparc64: avoid huge kernel PUD mappings on sun4u

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines

The kernel PUD refill path merges virtual address bits 32:28 into a TTE, requiring a hardware page size of at least 256MB. On sun4u, kern_linear_pte_xor[2] and [3] instead select the 4MB fallback TTE. Consequently address bits 27:22 are lost when refilling a huge PUD.

Quoted 8 lines

Keep the kernel linear mapping at PMD granularity on sun4u. Its refill path preserves bit 22, as required by the 4MB TTE. Leave the sun4v mapping selection unchanged.

Fixes 0dd5b7b09e13 ("sparc64: Fix physical memory management regressions with large max_phys_bits.")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#7 lore raw

PATCH v2 4/6 sparc64: add SPARC64 VII CPU, MMU and SMP support

In reply to Magnus Lindholm

Recognize implementation 7 and add the M3000 CPU/MMU/SMP path, including topology, serialized interrupt dispatch and restrainable ECC handling. Derive core and package identities from compatible core nodes and their firmware ancestry instead of the root model or adjacent CPU numbers. Use physical TSB accesses to avoid sibling aliases in the shared TLB; synchronize context writes and instruction demaps while preserving supported firmware modes and the existing non-VII demap routines. CPU offlining, HugeTLB and THP remain unsupported on this path. Keep VII demap routines separate: similar Cheetah assembly does not establish the same hardware synchronization requirement on Cheetah.

Hardware references (printed sections/pages):
- SPARC64 VII Extensions v1.0: 8.4.7 pp.42-43 (coherence), A.30 pp.64-65 (physical loads), F.10 pp.109-110 (MCNTL), F.10.4 (indexed TLBs), F.12 p.129 (sibling sharing).
- VII N.1 pp.155-156, N.4.2/N.4.3 p.158, R.3 (IPIs/target IDs); P.3.1 and P.7.1/P.7.4 pp.198-200 (error registers).
- JPS2 Common r1.0 F.10.1 p.488, F.10.11 pp.500-502 (MMU ordering).

JPS2 Commonality F.10.1 also requires a final instruction flush after demap-all so subsequent instruction fetches observe the invalidation.

---
 arch/sparc/Kconfig                  |  10 ++
 arch/sparc/include/asm/head_64.h    |  15 ++
 arch/sparc/include/asm/setup.h      |   5 +
 arch/sparc/include/asm/smp_64.h     |   4 +
 arch/sparc/include/asm/spitfire.h   |   1 +
 arch/sparc/include/asm/trap_block.h |   6 +
 arch/sparc/kernel/cpu.c             |   3 +
 arch/sparc/kernel/entry.h           |   2 +
 arch/sparc/kernel/head_64.S         |  18 +++
 arch/sparc/kernel/helpers.S         |  41 +++++
 arch/sparc/kernel/prom_64.c         |  27 ++++
 arch/sparc/kernel/ptrace_64.c       |   7 +
 arch/sparc/kernel/setup_64.c        |  55 +++++++
 arch/sparc/kernel/smp_64.c          |  89 ++++++++++-
 arch/sparc/kernel/trampoline_64.S   |  19 +++
 arch/sparc/kernel/traps_64.c        |  27 ++++
 arch/sparc/mm/init_64.c             | 102 +++++++++++-
 arch/sparc/mm/tsb.c                 |  19 ++-
 arch/sparc/mm/ultra.S               | 236 ++++++++++++++++++++++++++++
 19 files changed, 669 insertions(+), 17 deletions(-)
arch/sparc/Kconfig +10 -0
index ab77d3f2536e..1263150a5702 100644
@@ -250,6 +250,16 @@ config US3_MC
 
 	  If in doubt, say Y, as this information can be very useful.
 
+config SPARC64_VII
+	bool "Fujitsu SPARC64 VII and VII+ support"
+	depends on SPARC64
+	depends on !HUGETLB_PAGE && !TRANSPARENT_HUGEPAGE
+	help
+	  Support SPARC64 VII and VII+ processors in the Fujitsu M3000.
+	  Firmware must leave context hashing and multiple-page-size
+	  context mode disabled. HugeTLB and transparent huge pages are
+	  not supported by this CPU path.
+
 # Global things across all Sun machines.
 config GENERIC_LOCKBREAK
 	bool
arch/sparc/include/asm/head_64.h +15 -0
index 69a2062d992c..62ea826f174b 100644
@@ -20,6 +20,21 @@
 #define	RTRAP_PSTATE_IRQOFF	(PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV)
 #define RTRAP_PSTATE_AG_IRQOFF	(PSTATE_TSO|PSTATE_PEF|PSTATE_PRIV|PSTATE_AG)
 
+#define __SPARC64_VII_ID 0x00040007
+
+#ifdef CONFIG_SPARC64_VII
+#define BRANCH_IF_SPARC64_VII(tmp1, tmp2, label) \
+	rdpr %ver, %tmp1; \
+	srlx %tmp1, 32, %tmp1; \
+	sethi %hi(__SPARC64_VII_ID), %tmp2; \
+	or %tmp2, %lo(__SPARC64_VII_ID), %tmp2; \
+	cmp %tmp1, %tmp2; \
+	be,pn %icc, label; \
+	 nop
+#else
+#define BRANCH_IF_SPARC64_VII(tmp1, tmp2, label)
+#endif
+
 #define __CHEETAH_ID	0x003e0014
 #define __JALAPENO_ID	0x003e0016
 #define __SERRANO_ID	0x003e0022
arch/sparc/include/asm/setup.h +5 -0
index 21bed5514028..ef6ff1169ec0 100644
@@ -49,6 +49,11 @@ unsigned long safe_compute_effective_address(struct pt_regs *, unsigned int);
 #ifdef CONFIG_SPARC64
 void __init start_early_boot(void);
 
+extern unsigned int sparc64_ttable_tl0[], sparc64_ttable_tl1[];
+void sparc64_vii_fatal_trap(void);
+void sparc64_vii_ecc_trap(void);
+void sparc64_vii_ecc_trap_tl1(void);
+
 /* unaligned_64.c */
 int handle_ldf_stq(u32 insn, struct pt_regs *regs);
 void handle_ld_nf(u32 insn, struct pt_regs *regs);
arch/sparc/include/asm/smp_64.h +4 -0
index 759fb4a9530e..bbf171c9d1e9 100644
@@ -34,6 +34,10 @@
 DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
 extern cpumask_t cpu_core_map[NR_CPUS];
 
+#ifdef CONFIG_SPARC64_VII
+extern unsigned long vii_startup_mcntl;
+#endif
+
 void smp_init_cpu_poke(void);
 void scheduler_poke(void);
 
arch/sparc/include/asm/spitfire.h +1 -0
index 79b9dd5e9ac6..9bfa9348dd5a 100644
@@ -75,6 +75,7 @@ enum ultra_tlb_layout {
 	cheetah = 1,
 	cheetah_plus = 2,
 	hypervisor = 3,
+	sparc64_vii = 4,
 };
 
 extern enum ultra_tlb_layout tlb_type;
arch/sparc/include/asm/trap_block.h +6 -0
index 6cf2a60a0156..04f3d5826e16 100644
@@ -67,6 +67,7 @@ struct cpuid_patch_entry {
 	unsigned int	cheetah_jbus[4];
 	unsigned int	starfire[4];
 	unsigned int	sun4v[4];
+	unsigned int	vii[4];
 };
 extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;
 
@@ -146,6 +147,11 @@ extern struct sun4v_2insn_patch_entry __sun_m7_2insn_patch,
 	ldxa		[REG] ASI_SCRATCHPAD, REG;	\
 	nop;						\
 	nop;						\
+	/* SPARC64 VII: Jupiter ITID is bits 9:0. */ \
+	ldxa		[%g0] ASI_UPA_CONFIG, REG; \
+	and		REG, 0x3ff, REG; \
+	nop; \
+	nop; \
 	.previous;
 
 #ifdef CONFIG_SMP
arch/sparc/kernel/cpu.c +3 -0
index 79cd6ccfeac0..015bf4e5ca10 100644
@@ -123,6 +123,7 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
 		FPU(-1, NULL)
 	}
 },{
+	/* SPARC64 Fujitsu %ver manufacturer 4 shares the sparc32 TI value. */
 	PSR_IMPL_TI,
 	.cpu_info = {
 		CPU(0, "Texas Instruments, Inc. - SuperSparc-(II)"),
@@ -132,6 +133,7 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
 		CPU(3, "Texas Instruments, Inc. - SuperSparc 51"),
 		CPU(4, "Texas Instruments, Inc. - SuperSparc 61"),
 		CPU(5, "Texas Instruments, Inc. - unknown"),
+		CPU(7, "Fujitsu SPARC64 VII / VII+"),
 		CPU(-1, NULL)
 	},
 	.fpu_info = {
@@ -139,6 +141,7 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
 		FPU(0, "SuperSparc on-chip FPU"),
 		/* SparcClassic */
 		FPU(4, "TI MicroSparc on chip FPU"),
+		FPU(7, "Fujitsu SPARC64 VII integrated FPU"),
 		FPU(-1, NULL)
 	}
 },{
arch/sparc/kernel/entry.h +2 -0
index c746c0fd5d6b..517eb1a054f2 100644
@@ -249,5 +249,7 @@ extern unsigned long ivector_table_pa;
 void init_irqwork_curcpu(void);
 void sun4v_register_mondo_queues(int this_cpu);
 
+void sparc64_vii_ecc_error(struct pt_regs *regs);
+
 #endif /* CONFIG_SPARC32 */
 #endif /* _ENTRY_H */
arch/sparc/kernel/head_64.S +18 -0
index cf0549134234..8f879abc07f0 100644
@@ -485,6 +485,8 @@ EXPORT_SYMBOL(sun4v_chip_type)
 
 80:
 	BRANCH_IF_SUN4V(g1, jump_to_sun4u_init)
+	/* Preserve Fujitsu firmware cache/MMU control, not Spitfire LSU. */
+	BRANCH_IF_SPARC64_VII(g1,g7,jump_to_sun4u_init)
 	BRANCH_IF_CHEETAH_BASE(g1,g7,cheetah_boot)
 	BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g7,cheetah_plus_boot)
 	ba,pt	%xcc, spitfire_boot
@@ -574,6 +576,7 @@ sun4v_init:
 	ba,a,pt		%xcc, niagara_tlb_fixup
 
 sun4u_continue:
+	BRANCH_IF_SPARC64_VII(g1,g7,sparc64_vii_tlb_fixup)
 	BRANCH_IF_ANY_CHEETAH(g1, g7, cheetah_tlb_fixup)
 
 	ba,a,pt	%xcc, spitfire_tlb_fixup
@@ -692,6 +695,20 @@ cheetah_tlb_fixup:
 
 	ba,a,pt	%xcc, tlb_fixup_done
 
+sparc64_vii_tlb_fixup:
+	mov	4, %g2
+	sethi	%hi(tlb_type), %g1
+	stw	%g2, [%g1 + %lo(tlb_type)]
+	call	generic_patch_copyops
+	 nop
+	call	generic_patch_bzero
+	 nop
+	call	generic_patch_pageops
+	 nop
+	call	sparc64_vii_patch_cachetlbops
+	 nop
+	ba,a,pt	%xcc, tlb_fixup_done
+
 spitfire_tlb_fixup:
 	/* Set TLB type to spitfire. */
 	mov	0, %g2
@@ -841,6 +858,7 @@ setup_trap_table:
 	sllx	%o2, 32, %o2
 	wr	%o2, 0, %tick_cmpr
 
+	BRANCH_IF_SPARC64_VII(o2, o3, 1f)
 	BRANCH_IF_ANY_CHEETAH(o2, o3, 1f)
 
 	ba,a,pt	%xcc, 2f
arch/sparc/kernel/helpers.S +41 -0

44 lines not on this page · raw message

arch/sparc/kernel/prom_64.c +27 -0
index aa4799cbb9c1..ef14eb344a79 100644
@@ -501,6 +501,29 @@ void __init of_populate_present_mask(void)
 	of_iterate_over_cpus(record_one_cpu, 0);
 }
 
+static void __init vii_cpu_topology(struct device_node *dp, int cpuid)
+{
+	struct device_node *core = dp->parent;
+	struct device_node *package;
+
+	cpu_data(cpuid).core_id = 0;
+	cpu_data(cpuid).proc_id = -1;
+	cpu_data(cpuid).sock_id = cpuid;
+	if (!core || !of_node_is_type(core, "core") ||
+	    !of_device_is_compatible(core, "FJSV,SPARC64-VII"))
+		return;
+	package = core->parent;
+	if (!package || !of_node_name_eq(package, "cmp"))
+		return;
+	if (core->unique_id >= USHRT_MAX || package->unique_id > SHRT_MAX)
+		return;
+
+	/* Node IDs distinguish equal core addresses in different packages. */
+	cpu_data(cpuid).core_id = core->unique_id + 1;
+	cpu_data(cpuid).proc_id = package->unique_id;
+	cpu_data(cpuid).sock_id = package->unique_id;
+}
+
 static void *fill_in_one_cpu(struct device_node *dp, int cpuid, int arg)
 {
 	struct device_node *portid_parent = NULL;
@@ -564,6 +587,7 @@ static void *fill_in_one_cpu(struct device_node *dp, int cpuid, int arg)
 
 		cpu_data(cpuid).core_id = portid + 1;
 		cpu_data(cpuid).proc_id = portid;
+
 	} else {
 		cpu_data(cpuid).dcache_size =
 			of_getintprop_default(dp, "dcache-size", 16 * 1024);
@@ -585,6 +609,9 @@ static void *fill_in_one_cpu(struct device_node *dp, int cpuid, int arg)
 		cpu_data(cpuid).proc_id = -1;
 	}
 
+	if (tlb_type == sparc64_vii)
+		vii_cpu_topology(dp, cpuid);
+
 	return NULL;
 }
 
arch/sparc/kernel/ptrace_64.c +7 -0
index 825ddf55fece..0d537ae7bef3 100644
@@ -109,6 +109,13 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
 {
 	BUG_ON(len > PAGE_SIZE);
 
+	if (tlb_type == sparc64_vii) {
+		/* VII caches are coherent; ASI_DCACHE_INVALIDATE is not valid. */
+		flush_icache_range((unsigned long)kaddr,
+				   (unsigned long)kaddr + len);
+		return;
+	}
+
 	if (tlb_type == hypervisor)
 		return;
 
arch/sparc/kernel/setup_64.c +55 -0

73 lines not on this page · raw message

arch/sparc/kernel/smp_64.c +84 -5

144 lines not on this page · raw message

arch/sparc/kernel/trampoline_64.S +19 -0
index 62f404b3079a..73838a021be6 100644
@@ -40,6 +40,7 @@ tramp_stack:
 	.align		8
 	.globl		sparc64_cpu_startup, sparc64_cpu_startup_end
 sparc64_cpu_startup:
+	BRANCH_IF_SPARC64_VII(g1, g5, vii_startup)
 	BRANCH_IF_SUN4V(g1, niagara_startup)
 	BRANCH_IF_CHEETAH_BASE(g1, g5, cheetah_startup)
 	BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1, g5, cheetah_plus_startup)
@@ -47,6 +48,23 @@ sparc64_cpu_startup:
 	ba,pt	%xcc, spitfire_startup
 	 nop
 
+#ifdef CONFIG_SPARC64_VII
+vii_startup:
+	/* Preserve firmware cache/MMU control, as on the boot CPU. */
+	mov		8, %g1
+	ldxa		[%g1] 0x45, %g5
+	sethi		%hi(vii_startup_mcntl), %g1
+	stx		%g5, [%g1 + %lo(vii_startup_mcntl)]
+	membar		#Sync
+	set		0x101c0, %g1
+	andcc		%g5, %g1, %g0
+1:	bne,pn		%xcc, 1b
+	 nop
+	ba,pt		%xcc, niagara_startup
+	 nop
+
+#endif /* CONFIG_SPARC64_VII */
+
 cheetah_plus_startup:
 	/* Preserve OBP chosen DCU and DCR register settings.  */
 	ba,pt	%xcc, cheetah_generic_startup
@@ -144,6 +162,7 @@ startup_continue:
 	lduw		[%l6 + %lo(num_kernel_image_mappings)], %l6
 
 	mov		15, %l7
+	BRANCH_IF_SPARC64_VII(g1,g5,2f)
 	BRANCH_IF_ANY_CHEETAH(g1,g5,2f)
 
 	mov		63, %l7
arch/sparc/kernel/traps_64.c +27 -0
index 28cb0d66ab40..3c693b7bd32b 100644
@@ -2716,6 +2716,33 @@ void do_privact(struct pt_regs *regs)
 	do_privop(regs);
 }
 
+/* SPARC64 VII Extensions, Appendix P.7.1 and P.7.4. */
+#define VII_AFSR_DEGRADATION	((1UL << 12) | (1UL << 11) | (1UL << 10))
+
+void sparc64_vii_ecc_error(struct pt_regs *regs)
+{
+	enum ctx_state prev_state = exception_enter();
+	unsigned long afsr;
+
+	__asm__ __volatile__("ldxa [%%g0] 0x4c, %0" : "=r" (afsr));
+	/* An ECC trap without a sticky error indication is explicitly allowed. */
+	if (!afsr)
+		goto out;
+
+	/* No data recovery is implemented for raw UE or store bus errors. */
+	if (afsr & ~VII_AFSR_DEGRADATION)
+		panic("SPARC64 VII: unhandled ECC error, CPU %u AFSR=%lx TPC=%lx",
+		      smp_processor_id(), afsr, regs->tpc);
+
+	/* Hardware has already reduced the affected cache/TLB associativity. */
+	__asm__ __volatile__("stxa %0, [%%g0] 0x4c; membar #Sync"
+			     : : "r" (afsr) : "memory");
+	pr_warn_ratelimited("SPARC64 VII: CPU %u cache/TLB degradation, AFSR=%lx\n",
+			    smp_processor_id(), afsr);
+out:
+	exception_exit(prev_state);
+}
+
 /* Trap level 1 stuff or other traps we should never see... */
 void do_cee(struct pt_regs *regs)
 {
arch/sparc/mm/init_64.c +96 -6

170 lines not on this page · raw message

arch/sparc/mm/tsb.c +13 -6
index 5fe52a64c7e7..ba5dec3cb0f7 100644
@@ -126,7 +126,8 @@ void flush_tsb_user(struct tlb_batch *tb)
 	if (tb->hugepage_shift < REAL_HPAGE_SHIFT) {
 		base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb;
 		nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries;
-		if (tlb_type == cheetah_plus || tlb_type == hypervisor)
+		if (tlb_type == cheetah_plus || tlb_type == hypervisor ||
+		    tlb_type == sparc64_vii)
 			base = __pa(base);
 		if (tb->hugepage_shift == PAGE_SHIFT)
 			__flush_tsb_one(tb, PAGE_SHIFT, base, nentries);
@@ -140,7 +141,8 @@ void flush_tsb_user(struct tlb_batch *tb)
 	else if (mm->context.tsb_block[MM_TSB_HUGE].tsb) {
 		base = (unsigned long) mm->context.tsb_block[MM_TSB_HUGE].tsb;
 		nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries;
-		if (tlb_type == cheetah_plus || tlb_type == hypervisor)
+		if (tlb_type == cheetah_plus || tlb_type == hypervisor ||
+		    tlb_type == sparc64_vii)
 			base = __pa(base);
 		__flush_huge_tsb_one(tb, REAL_HPAGE_SHIFT, base, nentries,
 				     tb->hugepage_shift);
@@ -159,7 +161,8 @@ void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr,
 	if (hugepage_shift < REAL_HPAGE_SHIFT) {
 		base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb;
 		nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries;
-		if (tlb_type == cheetah_plus || tlb_type == hypervisor)
+		if (tlb_type == cheetah_plus || tlb_type == hypervisor ||
+		    tlb_type == sparc64_vii)
 			base = __pa(base);
 		if (hugepage_shift == PAGE_SHIFT)
 			__flush_tsb_one_entry(base, vaddr, PAGE_SHIFT,
@@ -174,7 +177,8 @@ void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr,
 	else if (mm->context.tsb_block[MM_TSB_HUGE].tsb) {
 		base = (unsigned long) mm->context.tsb_block[MM_TSB_HUGE].tsb;
 		nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries;
-		if (tlb_type == cheetah_plus || tlb_type == hypervisor)
+		if (tlb_type == cheetah_plus || tlb_type == hypervisor ||
+		    tlb_type == sparc64_vii)
 			base = __pa(base);
 		__flush_huge_tsb_one_entry(base, vaddr, REAL_HPAGE_SHIFT,
 					   nentries, hugepage_shift);
@@ -270,7 +274,9 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign
 	}
 	tte |= pte_sz_bits(page_sz);
 
-	if (tlb_type == cheetah_plus || tlb_type == hypervisor) {
+	/* VII siblings share TLBs: per-mm TSBs cannot reuse a fixed VA/slot. */
+	if (tlb_type == cheetah_plus || tlb_type == hypervisor ||
+	    tlb_type == sparc64_vii) {
 		/* Physical mapping, no locked TLB entry for TSB.  */
 		tsb_reg |= tsb_paddr;
 
@@ -502,7 +508,8 @@ void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long rss)
 		unsigned long old_tsb_base = (unsigned long) old_tsb;
 		unsigned long new_tsb_base = (unsigned long) new_tsb;
 
-		if (tlb_type == cheetah_plus || tlb_type == hypervisor) {
+		if (tlb_type == cheetah_plus || tlb_type == hypervisor ||
+		    tlb_type == sparc64_vii) {
 			old_tsb_base = __pa(old_tsb_base);
 			new_tsb_base = __pa(new_tsb_base);
 		}
arch/sparc/mm/ultra.S +236 -0

242 lines not on this page · raw message

Signature · 1 line
2.43.0
#8 lore raw

Re: [PATCH v2 4/6] sparc64: add SPARC64 VII CPU, MMU and SMP support

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] sparc64: missing VII membar synchronization for __flush_tlb_mm and xcall --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] sparc64: missing VII membar synchronization for __flush_tlb_mm and xcall --

commit 3658cc67da72bc2e25beda7e9124cb710a511258
Author: Magnus Lindholm <[email protected]>
sparc64: add SPARC64 VII CPU, MMU and SMP support

This commit adds support for SPARC64 VII and VII+ processors in the Fujitsu M3000. It introduces separate CPU, MMU, and SMP paths, managing CPU topology and restrainable ECC errors. It also provides separate demap routines to satisfy hardware synchronization requirements that are missing in the Cheetah paths.

Quoted 4 lines
arch/sparc/mm/ultra.S +0 -0
index 70e658d107e02..c4a9647d6eb04 100644

[ ... ]

Quoted 4 lines
arch/sparc/mm/ultra.S +0 -0
@@ -981,6 +981,242 @@ xcall_kgdb_capture:
 
 #endif /* CONFIG_SMP */
 

[ ... ]

arch/sparc/mm/ultra.S xcall_kgdb_capture: · line 1158

Quoted 8 lines
arch/sparc/mm/ultra.S +8 -0
+	.globl		sparc64_vii_patch_cachetlbops
+sparc64_vii_patch_cachetlbops:
+	save		%sp, -128, %sp
+
+	sethi		%hi(__flush_tlb_mm), %o0
+	or		%o0, %lo(__flush_tlb_mm), %o0
+	sethi		%hi(__cheetah_flush_tlb_mm), %o1
+	or		%o1, %lo(__cheetah_flush_tlb_mm), %o1

[Severity: High]
Does this incorrectly reuse the Cheetah variant for VII hardware?

The commit message explicitly notes that SPARC64 VII requires hardware synchronization (membar #Sync) for context writes and instruction demaps, and that the existing Cheetah assembly does not establish this. However, sparc64_vii_patch_cachetlbops patches __flush_tlb_mm using __cheetah_flush_tlb_mm, which lacks the required membar #Sync after writing to ASI_DMMU.

Quoted 4 lines
arch/sparc/mm/ultra.S +4 -0
+	call		tlb_patch_one
+	 mov		19, %o2
+
+	sethi		%hi(__flush_tlb_page), %o0

[ ... ]

Quoted 6 lines
arch/sparc/mm/ultra.S +6 -0
+#ifdef CONFIG_SMP
+	sethi		%hi(xcall_flush_tlb_page), %o0
+	or		%o0, %lo(xcall_flush_tlb_page), %o0
+	sethi		%hi(__vii_xcall_flush_tlb_page_patch), %o1
+	or		%o1, %lo(__vii_xcall_flush_tlb_page_patch), %o1
+	call		tlb_patch_one

arch/sparc/mm/ultra.S xcall_kgdb_capture: · line 1198

Quoted 10 lines
arch/sparc/mm/ultra.S +10 -0
+	 mov		3, %o2
+
+	/* VII uses 32-entry fTLBs: do not use the Spitfire 64-slot sweep. */
+	sethi		%hi(xcall_flush_tlb_kernel_range), %o0
+	or		%o0, %lo(xcall_flush_tlb_kernel_range), %o0
+	sethi		%hi(__cheetah_xcall_flush_tlb_kernel_range), %o1
+	or		%o1, %lo(__cheetah_xcall_flush_tlb_kernel_range), %o1
+	call		tlb_patch_one
+	 mov		44, %o2
+#endif

[Severity: High]
Is xcall_flush_tlb_mm missing from this patch block?

By omitting xcall_flush_tlb_mm entirely, it seems remote CPUs will fall back to the unpatched Spitfire handler. This would violate the JPS2 F.10.1 synchronization requirements and potentially leave the VII hardware exposed to stale TLB or pipeline states.

Quoted 3 lines
arch/sparc/mm/ultra.S +3 -0
+
+#ifdef DCACHE_ALIASING_POSSIBLE
+	sethi		%hi(__flush_dcache_page), %o0

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#9 lore raw

Re: [PATCH v2 4/6] sparc64: add SPARC64 VII CPU, MMU and SMP support

In reply to Magnus Lindholm
kernel test robot noticed the following build warnings:

Hi Magnus,

kernel test robot noticed the following build warnings:

[auto build test WARNING on cee9395acd8043be0644b25c34bfa86623f2b935]

url:    https://github.com/intel-lab-lkp/linux/commits/Magnus-Lindholm/sparc64-return-from-the-generic-clear_page-implementation/20261011-215553
base:   cee9395acd8043be0644b25c34bfa86623f2b935
patch link:    https://lore.kernel.org/r/20261011195729.981243-5-linmag7%40gmail.com
patch subject: [PATCH v2 4/6] sparc64: add SPARC64 VII CPU, MMU and SMP support
config: sparc64-defconfig (https://download.01.org/0day-ci/archive/20261012/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 51b433b4f56c531c0d95ba15e1a15e06c399d552)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261012/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> WARNING: modpost: vmlinux: section mismatch in reference: fill_in_one_cpu+0x310 (section: .text) -> vii_cpu_topology (section: .init.text)

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

#10 lore raw

PATCH v2 5/6 sparc64: add M3000 Oberon PCIe support

In reply to Magnus Lindholm

Recognize Oberon while preserving firmware link setup. Flush DVMA translations and changed noncoherent IOTSB cache lines, and route legacy interrupts using the bridge's ten-bit target ID.

Cache the bridge type and share target encoding. Leave MSI queues uninitialized so the existing architecture path uses legacy interrupts even with CONFIG_PCI_MSI=y; native bridge error handling is not provided.

---
 arch/sparc/Kconfig                | 10 +++++++
 arch/sparc/include/asm/iommu_64.h |  1 +
 arch/sparc/include/asm/irq_64.h   |  1 +
 arch/sparc/kernel/iommu.c         | 44 +++++++++++++++++++++++++++
 arch/sparc/kernel/irq_64.c        | 50 ++++++++++++++++++++++++-------
 arch/sparc/kernel/pci_fire.c      | 31 +++++++++++++++++--
 arch/sparc/kernel/pci_impl.h      |  1 +
 arch/sparc/kernel/prom_irqtrans.c |  7 +++++
 8 files changed, 132 insertions(+), 13 deletions(-)
arch/sparc/Kconfig +10 -0
index 1263150a5702..96aa140815fe 100644
@@ -387,6 +387,16 @@ endif
 endmenu
 
 menu "Bus options (PCI etc.)"
+
+config SPARC64_OBERON
+	bool "Fujitsu M3000 Oberon PCIe bridge"
+	depends on SPARC64_VII && PCI
+	help
+	  Support Oberon enumeration, translated DMA and legacy interrupts.
+	  Firmware link configuration is preserved. MSI and native bridge
+	  error interrupt handling are not supported on Oberon.
+	  Enable this option for the M3000 on-board network and disk devices.
+
 config SBUS
 	bool
 	default y
arch/sparc/include/asm/iommu_64.h +1 -0
index 0ef6dedf747e..abd7bb0fa615 100644
@@ -62,6 +62,7 @@ struct iommu {
 	unsigned long		iommu_tsbbase;
 	unsigned long		iommu_flush;
 	unsigned long		iommu_flushinv;
+	unsigned long		iommu_cache_flush; /* Oberon IOTSB cache */
 	unsigned long		iommu_tags;
 	unsigned long		iommu_ctxflush;
 	unsigned long		write_complete_reg;
arch/sparc/include/asm/irq_64.h +1 -0
index 8c4c0c87f998..c3e88f2f8e80 100644
@@ -45,6 +45,7 @@ void irq_install_pre_handler(int irq,
 			     void *arg1, void *arg2);
 #define irq_canonicalize(irq)	(irq)
 unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
+unsigned int oberon_build_irq(int inofixup, unsigned long iclr, unsigned long imap);
 unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
 unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino);
 unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p,
arch/sparc/kernel/iommu.c +44 -0

98 lines not on this page · raw message

arch/sparc/kernel/irq_64.c +40 -10

82 lines not on this page · raw message

arch/sparc/kernel/pci_fire.c +28 -3
index c35a8e3c1eae..1921996298af 100644
@@ -46,11 +46,21 @@ static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
 	iommu->iommu_tsbbase  = pbm->pbm_regs + FIRE_IOMMU_TSBBASE;
 	iommu->iommu_flush    = pbm->pbm_regs + FIRE_IOMMU_FLUSH;
 	iommu->iommu_flushinv = pbm->pbm_regs + FIRE_IOMMU_FLUSHINV;
+	if (pbm->is_oberon) {
+		/*
+		 * 0x40100 flushes an IOTSB cache line by physical address;
+		 * 0x40010 flushes a translated DVMA page.
+		 */
+		iommu->iommu_flush = pbm->pbm_regs + 0x40010UL;
+		iommu->iommu_cache_flush = pbm->pbm_regs + 0x40100UL;
+		iommu->write_complete_reg = iommu->iommu_control;
+	}
 
 	/* We use the main control/status register of FIRE as the write
 	 * completion register.
 	 */
-	iommu->write_complete_reg = pbm->controller_regs + 0x410000UL;
+	if (!iommu->iommu_cache_flush)
+		iommu->write_complete_reg = pbm->controller_regs + 0x410000UL;
 
 	/*
 	 * Invalidate TLB Entries.
@@ -62,6 +72,8 @@ static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
 	if (err)
 		return err;
 
+	/* Make initialized IOPTEs visible before publishing the table base. */
+	wmb();
 	upa_writeq(__pa(iommu->page_table) | 0x7UL, iommu->iommu_tsbbase);
 
 	control = upa_readq(iommu->iommu_control);
@@ -70,6 +82,10 @@ static int pci_fire_pbm_iommu_init(struct pci_pbm_info *pbm)
 		    0x00000002 /* Bypass enable */		|
 		    0x00000001 /* Translation enable */);
 	upa_writeq(control, iommu->iommu_control);
+	if (iommu->iommu_cache_flush) {
+		upa_writeq(~(u64)0, iommu->iommu_flushinv);
+		(void)upa_readq(iommu->iommu_control);
+	}
 
 	return 0;
 }
@@ -419,6 +435,7 @@ static int pci_fire_pbm_init(struct pci_pbm_info *pbm,
 	int err;
 
 	pbm->numa_node = NUMA_NO_NODE;
+	pbm->is_oberon = of_device_is_compatible(dp, "pciex108e,80f8");
 
 	pbm->pci_ops = &sun4u_pci_ops;
 	pbm->config_space_reg_bits = 12;
@@ -439,13 +456,18 @@ static int pci_fire_pbm_init(struct pci_pbm_info *pbm,
 
 	pci_get_pbm_props(pbm);
 
-	pci_fire_hw_init(pbm);
+	if (pbm->is_oberon)
+		pr_info("%s: experimental Oberon; preserving firmware link setup\n",
+			pbm->name);
+	else
+		pci_fire_hw_init(pbm);
 
 	err = pci_fire_pbm_iommu_init(pbm);
 	if (err)
 		return err;
 
-	pci_fire_msi_init(pbm);
+	if (!pbm->is_oberon)
+		pci_fire_msi_init(pbm);
 
 	pbm->pci_bus = pci_scan_one_pbm(pbm, &op->dev);
 
@@ -505,6 +527,9 @@ static const struct of_device_id fire_match[] = {
 		.name = "pci",
 		.compatible = "pciex108e,80f0",
 	},
+#ifdef CONFIG_SPARC64_OBERON
+	{ .name = "pci", .compatible = "pciex108e,80f8" },
+#endif
 	{},
 };
 
arch/sparc/kernel/pci_impl.h +1 -0
index 83718876f1d4..92505fcc3cf3 100644
@@ -117,6 +117,7 @@ struct pci_pbm_info {
 	/* State of 66MHz capabilities on this PBM. */
 	int				is_66mhz_capable;
 	int				all_devs_66mhz;
+	bool				is_oberon;
 
 #ifdef CONFIG_PCI_MSI
 	/* MSI info.  */
arch/sparc/kernel/prom_irqtrans.c +7 -0
index 5752bfd73ac0..60fd6b0f47e1 100644
@@ -481,6 +481,7 @@ static void __init pci_sun4v_irq_trans_init(struct device_node *dp)
 struct fire_irq_data {
 	unsigned long pbm_regs;
 	u32 portid;
+	bool oberon;
 };
 
 #define FIRE_IMAP_BASE	0x001000
@@ -537,6 +538,8 @@ static unsigned int fire_irq_build(struct device_node *dp,
 	 */
 	ino |= (irq_data->portid << 6);
 	ino -= int_ctrlr;
+	if (irq_data->oberon)
+		return oberon_build_irq(ino, iclr, imap);
 	return build_irq(ino, iclr, imap);
 }
 
@@ -553,6 +556,7 @@ static void __init fire_irq_trans_init(struct device_node *dp)
 	regs = of_get_property(dp, "reg", NULL);
 	dp->irq_trans->data = irq_data;
 
+	irq_data->oberon = of_device_is_compatible(dp, "pciex108e,80f8");
 	irq_data->pbm_regs = regs[0].phys_addr;
 	irq_data->portid = of_getintprop_default(dp, "portid", 0);
 }
@@ -778,6 +782,9 @@ static struct irq_trans __initdata pci_irq_trans_table[] = {
 	{ "pci108e,a801", tomatillo_irq_trans_init },
 	{ "SUNW,sun4v-pci", pci_sun4v_irq_trans_init },
 	{ "pciex108e,80f0", fire_irq_trans_init },
+#ifdef CONFIG_SPARC64_OBERON
+	{ "pciex108e,80f8", fire_irq_trans_init },
+#endif
 };
 #endif
 
Signature · 1 line
2.43.0
#11 lore raw

Re: [PATCH v2 5/6] sparc64: add M3000 Oberon PCIe support

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] mm: dma_4u_free_coherent leaves stale IOMMU mappings on non-Oberon platforms - [Medium] sparc64…

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] mm: dma_4u_free_coherent leaves stale IOMMU mappings on non-Oberon platforms
- [Medium] sparc64: missing check for irq_alloc() failure in build_irq() corrupts IRQ 0
- [Low] sparc/pci: missing NULL check for 'reg' property array in DT initializers --

commit 789a2867a71401d078d82b2a2031ee8cc4266973
Author: Magnus Lindholm <[email protected]>

sparc64: add M3000 Oberon PCIe support

This commit adds support for the Fujitsu M3000 Oberon PCIe bridge. It preserves firmware link setup, handles IOTSB cache line flushes for DVMA translations, and routes legacy interrupts using the bridge's ten-bit target ID.

Quoted 4 lines
arch/sparc/kernel/iommu.c +0 -0
index 7613ab0ffb89d..9132f0535ce43 100644

[ ... ]

Quoted 4 lines
arch/sparc/kernel/iommu.c +0 -0
@@ -253,6 +281,15 @@ static void dma_4u_free_coherent(struct device *dev, size_t size,
 	npages = IO_PAGE_ALIGN(size) >> IO_PAGE_SHIFT;
 	iommu = dev->archdata.iommu;
 

arch/sparc/kernel/iommu.c static void dma_4u_free_coherent(struct device *dev, size_t size, · line 293

Quoted 10 lines
arch/sparc/kernel/iommu.c +9 -0
+	if (iommu->iommu_cache_flush) {
+		iopte_t *base = iommu->page_table +
+			((dvma - iommu->tbl.table_map_base) >> IO_PAGE_SHIFT);
+		unsigned long i;
+
+		for (i = 0; i < npages; i++)
+			iopte_make_dummy(iommu, base + i);
+		iommu_sync_mapping(iommu, base, npages);
+	}
 	iommu_tbl_range_free(&iommu->tbl, dvma, npages, IOMMU_ERROR_CODE);

[Severity: High]
Does this leave stale IOMMU mappings on non-Oberon platforms?

When dma_4u_free_coherent() frees memory, the hardware IOMMU page table entries (IOPTEs) mapping that memory need to be invalidated before the physical pages are returned to the kernel allocator.

By guarding the iopte_make_dummy() loop with if (iommu->iommu_cache_flush), this clears the hardware translation only for Oberon. For other SPARC64 platforms, the hardware IOMMU entries remain valid, potentially allowing a malfunctioning or malicious device to perform a DMA use-after-free and corrupt newly re-allocated kernel memory.

Quoted 4 lines
arch/sparc/kernel/irq_64.c +0 -0
index 3f55c69d5f3bc..b0f3b26656d46 100644

[ ... ]

Quoted 4 lines
arch/sparc/kernel/irq_64.c +0 -0
@@ -642,6 +661,17 @@ unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap)
 	return irq;
 }
 

arch/sparc/kernel/irq_64.c unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap) · line 673

Quoted 10 lines
arch/sparc/kernel/irq_64.c +10 -0
+unsigned int oberon_build_irq(int inofixup, unsigned long iclr,
+			      unsigned long imap)
+{
+	unsigned int irq = build_irq(inofixup, iclr, imap);
+	struct irq_handler_data *data = irq_get_handler_data(irq);
+
+	if (data)
+		data->oberon = true;
+	return irq;
+}

[Severity: Medium]
Is there a missing check for an irq_alloc() failure here?

The newly introduced oberon_build_irq() wrapper calls build_irq(). If irq_alloc() fails during device initialization or under extreme resource pressure, it returns 0. build_irq() does not check for this 0 return value and proceeds to use it as a valid IRQ.

This would cause irq_set_chip_and_handler_name() and irq_get_handler_data() to operate on IRQ 0. Since IRQ 0 is bound to the system timer interrupt on SPARC64, could this corrupt the system timer and lead to a system hang?

Quoted 4 lines
arch/sparc/kernel/prom_irqtrans.c +0 -0
index 5752bfd73ac0c..60fd6b0f47e13 100644

[ ... ]

arch/sparc/kernel/prom_irqtrans.c static void __init fire_irq_trans_init(struct device_node *dp) · line 562

Quoted 8 lines
arch/sparc/kernel/prom_irqtrans.c +1 -0
@@ -553,6 +556,7 @@ static void __init fire_irq_trans_init(struct device_node *dp)
 	regs = of_get_property(dp, "reg", NULL);
 	dp->irq_trans->data = irq_data;
 
+	irq_data->oberon = of_device_is_compatible(dp, "pciex108e,80f8");
 	irq_data->pbm_regs = regs[0].phys_addr;
 	irq_data->portid = of_getintprop_default(dp, "portid", 0);
 }

[Severity: Low]
Does this code need a NULL check for the 'reg' property?

of_get_property() can return NULL if the property is missing or malformed. This would lead to a NULL pointer dereference when accessing regs[0].phys_addr.

While SPARC OpenBoot PROM typically guarantees the presence of 'reg' properties for PCI root nodes, making this mostly theoretical in practice, it appears to violate the API contract. Other sibling drivers enforce this check. Should we add a NULL check in fire_irq_trans_init() and pci_fire_pbm_init() to protect the new Oberon PCIe bridge compatibility?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#12 lore raw

PATCH v2 6/6 hvc: add an M3000 firmware console backend

In reply to Magnus Lindholm

Provide hvc0 through the M3000 Open Firmware pseudo-console, validating the firmware model and console endpoints before registering it. Keep firmware buffers in locked kernel mappings and serialize their use in atomic console contexts through the existing SPARC p1275 interface.

Poll input while the TTY is open and synchronize close with timer rearming. Return zero on no progress so HVC retries buffered TTY output but drops stalled console chunks instead of spinning indefinitely. A firmware call that does not return remains unbounded.

---
 MAINTAINERS                 |   6 ++
 drivers/tty/hvc/Kconfig     |  10 ++
 drivers/tty/hvc/Makefile    |   1 +
 drivers/tty/hvc/hvc_m3000.c | 205 ++++++++++++++++++++++++++++++++++++
 4 files changed, 222 insertions(+)
 create mode 100644 drivers/tty/hvc/hvc_m3000.c
MAINTAINERS +6 -0
index 3a19da74d00c..5bc9b1cabd0a 100644
@@ -10728,6 +10728,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/platform/x86/fujitsu-laptop.c
 
+FUJITSU M3000 FIRMWARE CONSOLE
+M:	Magnus Lindholm <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/tty/hvc/hvc_m3000.c
+
 FUJITSU TABLET EXTRAS
 M:	Robert Gerlach <[email protected]>
 L:	[email protected]
drivers/tty/hvc/Kconfig +10 -0
index 5866195de26a..0feb7ec98f4f 100644
@@ -134,3 +134,13 @@ config HVCS
 	  will depend on arch specific APIs exported from hvcserver.ko
 	  which will also be compiled when this driver is built as a
 	  module.
+
+config HVC_M3000
+	bool "M3000 firmware pseudo-console"
+	depends on SPARC64_VII
+	select HVC_DRIVER
+	help
+	  Provide hvc0 using Open Firmware stdin/stdout on IKKAKU only.
+	  Input is polled; no native UART registers are accessed.
+	  Firmware calls are serialized and use a locked-image bounce buffer.
+	  Say Y to use the M3000 firmware pseudo-console as hvc0.
drivers/tty/hvc/Makefile +1 -0
index 98880e357941..38c8cf349053 100644
@@ -11,3 +11,4 @@ obj-$(CONFIG_HVC_IUCV)		+= hvc_iucv.o
 obj-$(CONFIG_HVC_UDBG)		+= hvc_udbg.o
 obj-$(CONFIG_HVC_RISCV_SBI)	+= hvc_riscv_sbi.o
 obj-$(CONFIG_HVCS)		+= hvcs.o
+obj-$(CONFIG_HVC_M3000)		+= hvc_m3000.o
drivers/tty/hvc/hvc_m3000.c new file +205 -0

205 lines not on this page · raw message

Signature · 1 line
2.43.0
#13 lore raw

Re: [PATCH v2 6/6] hvc: add an M3000 firmware console backend

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines

Provide hvc0 through the M3000 Open Firmware pseudo-console, validating the firmware model and console endpoints before registering it. Keep firmware buffers in locked kernel mappings and serialize their use in atomic console contexts through the existing SPARC p1275 interface.

Poll input while the TTY is open and synchronize close with timer rearming. Return zero on no progress so HVC retries buffered TTY output but drops stalled console chunks instead of spinning indefinitely. A firmware call that does not return remains unbounded.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
maintainer
#14 lore raw

Re: [PATCH v2 6/6] hvc: add an M3000 firmware console backend

In reply to Magnus Lindholm

On 11. 10. 26, 21:55, Magnus Lindholm wrote:
...

drivers/tty/hvc/hvc_m3000.c line 26

Quoted 13 lines
drivers/tty/hvc/hvc_m3000.c new file +9 -0
@@ -0,0 +1,205 @@
 
+struct m3000_console {
+	int stdin;
+	bool ready;
+	u8 buffer[256];
+	raw_spinlock_t buffer_lock;
+	struct timer_list poll_timer;
+	struct mutex poll_mutex; /* Serialize open against synchronous close. */
+	spinlock_t poll_lock; /* Protect active state and timer rearming. */
+	bool poll_active;

Perhaps group these a bit better, so that there are not such holes?

Quoted 1 line

+};

...

drivers/tty/hvc/hvc_m3000.c line 54

Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+/*
+ * HVC's idle backoff can exceed the firmware input FIFO's capacity.
+ * Wake its worker each tick while open; keep PROM calls out of the timer.
+ */
+static void m3000_poll_tick(struct timer_list *timer)
+{
+	struct m3000_console *con = timer_container_of(con, timer, poll_timer);
+	unsigned long flags;
+
+	spin_lock_irqsave(&con->poll_lock, flags);

Any reason not to use guard()s?

Quoted 6 lines
drivers/tty/hvc/hvc_m3000.c new file +6 -0
+	if (con->poll_active) {
+		hvc_kick();
+		mod_timer(&con->poll_timer, jiffies + 1);
+	}
+	spin_unlock_irqrestore(&con->poll_lock, flags);
+}

drivers/tty/hvc/hvc_m3000.c line 70

Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+
+static int m3000_open(struct hvc_struct *hp, int data)
+{
+	struct m3000_console *con = m3000_console(hp->vtermno);
+	unsigned long flags;
+
+	if (!con)
+		return -ENODEV;
+	mutex_lock(&con->poll_mutex);
+	spin_lock_irqsave(&con->poll_lock, flags);

Same here.

Quoted 6 lines
drivers/tty/hvc/hvc_m3000.c new file +6 -0
+	con->poll_active = true;
+	mod_timer(&con->poll_timer, jiffies + 1);
+	spin_unlock_irqrestore(&con->poll_lock, flags);
+	mutex_unlock(&con->poll_mutex);
+	return 0;
+}

drivers/tty/hvc/hvc_m3000.c line 86

Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+
+static void m3000_close(struct hvc_struct *hp, int data)
+{
+	struct m3000_console *con = m3000_console(hp->vtermno);
+	unsigned long flags;
+
+	if (!con)
+		return;
+	mutex_lock(&con->poll_mutex);
+	spin_lock_irqsave(&con->poll_lock, flags);

And here.

drivers/tty/hvc/hvc_m3000.c line 98

Quoted 12 lines
drivers/tty/hvc/hvc_m3000.c new file +12 -0
+	con->poll_active = false;
+	spin_unlock_irqrestore(&con->poll_lock, flags);
+	/* Block reopen until the callback has finished and cannot rearm. */
+	timer_delete_sync(&con->poll_timer);
+	mutex_unlock(&con->poll_mutex);
+}
+
+static ssize_t m3000_io(struct m3000_console *con, u8 *in,
+			const u8 *out, size_t count)
+{
+	unsigned long args[7], flags;
+	bool input = in;

You can test "in" below directly, right?

drivers/tty/hvc/hvc_m3000.c line 105

Quoted 7 lines
drivers/tty/hvc/hvc_m3000.c new file +7 -0
+	int ret;
+
+	if (!count)
+		return 0;
+	count = min(count, input ? 1 : sizeof(con->buffer));
+	/* Console writes can run with interrupts disabled; this lock cannot sleep. */
+	raw_spin_lock_irqsave(&con->buffer_lock, flags);

scoped_guard()

Quoted 5 lines
drivers/tty/hvc/hvc_m3000.c new file +5 -0
+	if (!input)
+		memcpy(con->buffer, out, count);
+	args[0] = (unsigned long)(input ? "read" : "write");
+	args[1] = 3;
+	args[2] = 1;

drivers/tty/hvc/hvc_m3000.c line 120

Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+	args[3] = (unsigned int)(input ? con->stdin : prom_stdout);
+	args[4] = (unsigned long)con->buffer;
+	args[5] = count;
+	args[6] = (unsigned long)-1;
+	p1275_cmd_direct(args);
+	ret = (int)args[6];
+	if (ret > 0 && ret <= count && input)
+		memcpy(in, con->buffer, ret);
+	raw_spin_unlock_irqrestore(&con->buffer_lock, flags);
+	if (ret == -2 || ret == 0)

That's full of magic constants. Can we have defines for those?

drivers/tty/hvc/hvc_m3000.c line 124

Quoted 4 lines
drivers/tty/hvc/hvc_m3000.c new file +4 -0
+		return 0;
+	if (ret < 0 || ret > count)
+		return -EIO;
+	return ret;

thanks,

Signature · 2 lines
js
suse labs
#15 lore raw

Re: [PATCH v2 6/6] hvc: add an M3000 firmware console backend

Hi Jiri,

Quoted 17 lines · Jiri Slaby

On 11. 10. 26, 21:55, Magnus Lindholm wrote:
...

drivers/tty/hvc/hvc_m3000.c line 26

Quoted 13 lines
drivers/tty/hvc/hvc_m3000.c new file +9 -0
@@ -0,0 +1,205 @@
 
+struct m3000_console {
+     int stdin;
+     bool ready;
+     u8 buffer[256];
+     raw_spinlock_t buffer_lock;
+     struct timer_list poll_timer;
+     struct mutex poll_mutex; /* Serialize open against synchronous close. */
+     spinlock_t poll_lock; /* Protect active state and timer rearming. */
+     bool poll_active;
Quoted 2 lines

Perhaps group these a bit better, so that there are not such holes?

Done for v3. Reordering the members reduced the structure from 344 to 336 bytes with the tested configuration.

Quoted 15 lines
Quoted 1 line

+};

...

drivers/tty/hvc/hvc_m3000.c line 54

Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+/*
+ * HVC's idle backoff can exceed the firmware input FIFO's capacity.
+ * Wake its worker each tick while open; keep PROM calls out of the timer.
+ */
+static void m3000_poll_tick(struct timer_list *timer)
+{
+     struct m3000_console *con = timer_container_of(con, timer, poll_timer);
+     unsigned long flags;
+
+     spin_lock_irqsave(&con->poll_lock, flags);

Any reason not to use guard()s?

No particular reason. I've switched this to guard(spinlock_irqsave).

Quoted 10 lines
Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+     if (con->poll_active) {
+             hvc_kick();
+             mod_timer(&con->poll_timer, jiffies + 1);
+     }
+     spin_unlock_irqrestore(&con->poll_lock, flags);
+}
+
+static int m3000_open(struct hvc_struct *hp, int data)
+{
+     struct m3000_console *con = m3000_console(hp->vtermno);
Quoted 9 lines

drivers/tty/hvc/hvc_m3000.c line 70

Quoted 6 lines
drivers/tty/hvc/hvc_m3000.c new file +6 -0
+     unsigned long flags;
+
+     if (!con)
+             return -ENODEV;
+     mutex_lock(&con->poll_mutex);
+     spin_lock_irqsave(&con->poll_lock, flags);

Same here.

Done, using guards for both locks, preserving their acquisition and release order.

Quoted 10 lines
Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+     con->poll_active = true;
+     mod_timer(&con->poll_timer, jiffies + 1);
+     spin_unlock_irqrestore(&con->poll_lock, flags);
+     mutex_unlock(&con->poll_mutex);
+     return 0;
+}
+
+static void m3000_close(struct hvc_struct *hp, int data)
+{
+     struct m3000_console *con = m3000_console(hp->vtermno);
Quoted 9 lines

drivers/tty/hvc/hvc_m3000.c line 86

Quoted 6 lines
drivers/tty/hvc/hvc_m3000.c new file +6 -0
+     unsigned long flags;
+
+     if (!con)
+             return;
+     mutex_lock(&con->poll_mutex);
+     spin_lock_irqsave(&con->poll_lock, flags);

And here.

Done, using guard(mutex) and a scoped spinlock guard. The spinlock is released before timer_delete_sync(), while the mutex remains held.

Quoted 6 lines
Quoted 6 lines
drivers/tty/hvc/hvc_m3000.c new file +6 -0
+     con->poll_active = false;
+     spin_unlock_irqrestore(&con->poll_lock, flags);
+     /* Block reopen until the callback has finished and cannot rearm. */
+     timer_delete_sync(&con->poll_timer);
+     mutex_unlock(&con->poll_mutex);
+}
Quoted 9 lines

drivers/tty/hvc/hvc_m3000.c line 98

Quoted 6 lines
drivers/tty/hvc/hvc_m3000.c new file +6 -0
+
+static ssize_t m3000_io(struct m3000_console *con, u8 *in,
+                     const u8 *out, size_t count)
+{
+     unsigned long args[7], flags;
+     bool input = in;

You can test "in" below directly, right?

Yes, I've removed the boolean and now test "in" directly.

Quoted 10 lines

drivers/tty/hvc/hvc_m3000.c line 105

Quoted 7 lines
drivers/tty/hvc/hvc_m3000.c new file +7 -0
+     int ret;
+
+     if (!count)
+             return 0;
+     count = min(count, input ? 1 : sizeof(con->buffer));
+     /* Console writes can run with interrupts disabled; this lock cannot sleep. */
+     raw_spin_lock_irqsave(&con->buffer_lock, flags);

scoped_guard()

Done for v3. Reordering the members reduced the structure from 344 to 336 bytes with the tested configuration.

Quoted 16 lines
Quoted 5 lines
drivers/tty/hvc/hvc_m3000.c new file +5 -0
+     if (!input)
+             memcpy(con->buffer, out, count);
+     args[0] = (unsigned long)(input ? "read" : "write");
+     args[1] = 3;
+     args[2] = 1;

drivers/tty/hvc/hvc_m3000.c line 120

Quoted 10 lines
drivers/tty/hvc/hvc_m3000.c new file +10 -0
+     args[3] = (unsigned int)(input ? con->stdin : prom_stdout);
+     args[4] = (unsigned long)con->buffer;
+     args[5] = count;
+     args[6] = (unsigned long)-1;
+     p1275_cmd_direct(args);
+     ret = (int)args[6];
+     if (ret > 0 && ret <= count && input)
+             memcpy(in, con->buffer, ret);
+     raw_spin_unlock_irqrestore(&con->buffer_lock, flags);
+     if (ret == -2 || ret == 0)
Quoted 2 lines

That's full of magic constants. Can we have defines for those?

I've added defines for the firmware argument/return counts and the -1/-2 status values. I've kept zero literal as a zero-byte result.

Quoted 8 lines

drivers/tty/hvc/hvc_m3000.c line 124

Quoted 4 lines
drivers/tty/hvc/hvc_m3000.c new file +4 -0
+             return 0;
+     if (ret < 0 || ret > count)
+             return -EIO;
+     return ret;

thanks,
--
js
suse labs

Both GCC and Clang W=1 builds completed, and the GCC-built kernel passed boot and HVC input/output, open/close, and hangup/reopen tests on the M3000.

I'll put out the v3 asap

Regards,
Magnus