Skip to contentSkip to conversation

parisc changes for 2.6.18

PATCH New Kyle McMartin 1 participant 12 messages Jun 25, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parisc changes for 2.6.18

The following changes since commit f36f44de721db44b4c2944133c3c5c2e06f633f0:
Linus Torvalds:
Fix NFS2 compile error

are found in the git repository at:

master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git

Carlos O'Donell:
[PARISC] Use FIXUP_BRANCH_CLOBBER to asm clobber list [PARISC] Remove unconditional #define PIC in syscall macros

Grant Grundler:
[PARISC] Fix gcc 4.1 warnings in sba_iommu.c

James Bottomley:
[PARISC] Fix PCREL22F relocation problem for most modules [PARISC] Fix do_gettimeofday() hang

Kyle McMartin:
[PARISC] Ensure all ldcw uses are ldcw,co on pa2.0 [PARISC] Whitespace clean up in asm/pgtable.h [PARISC] Add asm/mckinley.h bus header
[PARISC] Test ioc_needs_fdc variable instead of open coding [PARISC] Remove dead function pc_in_user_space [PARISC] Use MFIA in current_text_addr on pa2.0 processors [PARISC] Add is_compat_task() helper
[PARISC] Remove unused macro fixup_branch in syscall.S [PARISC] Match show_cache_info with reality [PARISC] Ensure Space ID hashing is turned off [PARISC] OS_ID_LINUX == 0x0006
[PARISC] Add os_id_to_string helper
[PARISC] Refactor show_regs in traps.c

Thibaut Varene:
[PARISC] PDC_CHASSIS is implemented on all machines [PARISC] Work around machines which do not support chassis warnings [PARISC] pdc_stable version 0.30
[PARISC] Reduce data footprint in pdc_stable.c
[PARISC] Update Thibaut Varene's CREDITS entry

 CREDITS                          |    4 -
 arch/parisc/kernel/cache.c       |   28 +++--
 arch/parisc/kernel/entry.S       |    6 +
 arch/parisc/kernel/firmware.c    |   46 +++++++-
 arch/parisc/kernel/module.c      |   63 +++++++++--
 arch/parisc/kernel/pdc_chassis.c |  109 ++++++++++++++-----
 arch/parisc/kernel/ptrace.c      |    8 +
 arch/parisc/kernel/real2.S       |    9 --
 arch/parisc/kernel/setup.c       |    5 +
 arch/parisc/kernel/signal.c      |   20 ++-
 arch/parisc/kernel/syscall.S     |   14 --
 arch/parisc/kernel/time.c        |   18 +++
 arch/parisc/kernel/traps.c       |   84 +++++++-------
 arch/parisc/kernel/unaligned.c   |   18 ++-
 drivers/parisc/Kconfig           |   33 ++++--
 drivers/parisc/pdc_stable.c      |  223 ++++++++++++++++++++++++++++++++++----
 drivers/parisc/sba_iommu.c       |   22 ++--
 include/asm-parisc/assembly.h    |    2 
 include/asm-parisc/compat.h      |   11 ++
 include/asm-parisc/mckinley.h    |    9 ++
 include/asm-parisc/pdc.h         |   22 +++-
 include/asm-parisc/pgtable.h     |    8 +
 include/asm-parisc/processor.h   |   14 +-
 include/asm-parisc/system.h      |   26 ++--
 include/asm-parisc/uaccess.h     |    9 +-
 include/asm-parisc/unistd.h      |    5 -
 26 files changed, 592 insertions(+), 224 deletions(-)
 create mode 100644 include/asm-parisc/mckinley.h

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#1 lore raw

PATCH 9/23 Remove unconditional #define PIC in syscall macros

From: Carlos O'Donell <[email protected]>

---

 include/asm-parisc/unistd.h |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

32d4e0d51cefbbc81da5ce2dd2d7fb7a585ed385

include/asm-parisc/unistd.h +0 -4
index 12b8672..27bcfad 100644
@@ -797,11 +797,6 @@ #ifndef __ASSEMBLY__
 
 #define SYS_ify(syscall_name)   __NR_##syscall_name
 
-/* Assume all syscalls are done from PIC code just to be
- * safe. The worst case scenario is that you lose a register
- * and save/restore r19 across the syscall. */
-#define PIC
#2 lore raw

PATCH 10/23 PDC_CHASSIS is implemented on all machines

In reply to Kyle McMartin

From: Thibaut Varene <[email protected]>

This patch removes a limitation of the original code, so that CHASSIS codes can be sent to all machines. On machines with a LCD panel, this code displays "INI" during bootup, "RUN" when the system is booted and running, "FLT" when a panic occurs, etc.

This part of the code can be enabled/disabled through CONFIG_PDC_CHASSIS

This patch also adds minimalistic support for Chassis warnings, through a proc entry '/proc/chassis', which will reflect the warnings status (PSU or fans failure when they happen, NVRAM battery level and temperature thresholds overflows).

This part of the code can be enabled/disabled through CONFIG_PDC_CHASSIS_WARN

---

 arch/parisc/kernel/firmware.c    |   22 +++++++++--
 arch/parisc/kernel/pdc_chassis.c |   73 ++++++++++++++++++++++++++++++++------
 drivers/parisc/Kconfig           |   33 ++++++++++++++---
 include/asm-parisc/pdc.h         |    1 +
 4 files changed, 107 insertions(+), 22 deletions(-)

10308768c98d32cf8606224ee01c92dc9ff57126

arch/parisc/kernel/firmware.c +18 -4
index 2dc06b8..0596f27 100644
@@ -11,7 +11,7 @@
  * Copyright 1999 The Puffin Group, (Alex deVries, David Kennedy)
  * Copyright 2003 Grant Grundler <grundler parisc-linux org>
  * Copyright 2003,2004 Ryan Bradetich <[email protected]>
- * Copyright 2004 Thibaut VARENE <[email protected]>
+ * Copyright 2004,2006 Thibaut VARENE <[email protected]>
  *
  *    This program is free software; you can redistribute it and/or modify
  *    it under the terms of the GNU General Public License as published by
@@ -252,10 +252,8 @@ int pdc_pat_chassis_send_log(unsigned lo
 #endif
 
 /**
- * pdc_chassis_disp - Updates display
+ * pdc_chassis_disp - Updates chassis code
  * @retval: -1 on error, 0 on success
- *
- * Works on old PDC only (E class, others?)
  */
 int pdc_chassis_disp(unsigned long disp)
 {
@@ -269,6 +267,22 @@ int pdc_chassis_disp(unsigned long disp)
 }
 
 /**
+ * pdc_chassis_warn - Fetches chassis warnings
+ * @retval: -1 on error, 0 on success
+ */
+int pdc_chassis_warn(unsigned long *warn)
+{
+	int retval = 0;
+
+	spin_lock_irq(&pdc_lock);
+	retval = mem_pdc_call(PDC_CHASSIS, PDC_CHASSIS_WARN, __pa(pdc_result));
+	*warn = pdc_result[0];
+	spin_unlock_irq(&pdc_lock);
+
+	return retval;
+}
+
+/**
  * pdc_coproc_cfg - To identify coprocessors attached to the processor.
  * @pdc_coproc_info: Return buffer address.
  *
arch/parisc/kernel/pdc_chassis.c +62 -11

136 lines not on this page · raw message

drivers/parisc/Kconfig +26 -7
index 3f5de86..1d3b84b 100644
@@ -140,18 +140,37 @@ config CHASSIS_LCD_LED
 	  If unsure, say Y.
 
 config PDC_CHASSIS
-	bool "PDC chassis State Panel support"
+	bool "PDC chassis state codes support"
 	default y
 	help
-	  Say Y here if you want to enable support for the LED State front
-	  panel as found on E class, and support for the GSP Virtual Front
-	  Panel (LED State and message logging)  as found on high end
-	  servers such as A, L and N-class.
-	  
-	  This has nothing to do with Chassis LCD and LED support.
+	  Say Y here if you want to enable support for Chassis codes.
+	  That includes support for LED State front panel as found on E
+	  class, and support for the GSP Virtual Front Panel (LED State and
+	  message logging)  as found on high end servers such as A, L and
+	  N-class.
+	  This driver will also display progress messages on LCD display,
+	  such as "INI", "RUN" and "FLT", and might thus clobber messages
+	  shown by the LED/LCD driver.
+	  This driver updates the state panel (LED and/or LCD) upon system
+	  state change (eg: boot, shutdown or panic).
 	  
 	  If unsure, say Y.
 
+
+config PDC_CHASSIS_WARN
+	bool "PDC chassis warnings support"
+	depends on PROC_FS
+	default y
+	help
+	  Say Y here if you want to enable support for Chassis warnings.
+	  This will add a proc entry '/proc/chassis' giving some information
+	  about the overall health state of the system.
+	  This includes NVRAM battery level, overtemp or failures such as
+	  fans or power units.
+
+	  If unsure, say Y.
+
+
 config PDC_STABLE
 	tristate "PDC Stable Storage support"
 	depends on SYSFS
include/asm-parisc/pdc.h +1 -0
index 08364f9..7d8a71a 100644
@@ -719,6 +719,7 @@ void setup_pdc(void);		/* in inventory.c
 int pdc_add_valid(unsigned long address);
 int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len);
 int pdc_chassis_disp(unsigned long disp);
+int pdc_chassis_warn(unsigned long *warn);
 int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
 int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
 		  void *iodc_data, unsigned int iodc_data_size);
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#3 lore raw

PATCH 12/23 pdc_stable version 0.30

In reply to Kyle McMartin

From: Thibaut Varene <[email protected]>

pdc_stable v0.30:

This patch introduces 3 more files to the /sys/firmware/stable tree:
- diagnostic, which contains a cryptic hex string
- osdep1, a 16 bytes os-dependent storage area always available
- osdep2, another os-dependent storage area which existence/size depends on hversion.

This patch also adds code to setup the "Linux" signature in stable storage. That is to say that starting with this patch, the kernel will now sign its OSID (0x0006, thx LaMont) in Stable Storage upon boot, whether pdc_stable is enabled or not.

---

 arch/parisc/kernel/setup.c  |    5 +
 drivers/parisc/pdc_stable.c |  219 ++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 210 insertions(+), 14 deletions(-)

a77039bc889939409af9726760e9b1b3fe77f6fb

arch/parisc/kernel/setup.c +5 -0
index 4a36ec3..8471486 100644
@@ -303,6 +303,8 @@ extern void eisa_init(void);
 
 static int __init parisc_init(void)
 {
+	u32 osid = (0x0006 << 16);
+
 	parisc_proc_mkdir();
 	parisc_init_resources();
 	do_device_inventory();                  /* probe for hardware */
@@ -311,6 +313,9 @@ static int __init parisc_init(void)
 	
 	/* set up a new led state on systems shipped LED State panel */
 	pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BSTART);
+
+	/* tell PDC we're Linux. Nevermind failure. */
+	pdc_stable_write(0x40, &osid, sizeof(osid));
 	
 	processor_init();
 	printk(KERN_INFO "CPU(s): %d x %s at %d.%06d MHz\n",
drivers/parisc/pdc_stable.c +205 -14

313 lines not on this page · raw message

Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#4 lore raw

PATCH 13/23 Reduce data footprint in pdc_stable.c

In reply to Kyle McMartin

From: Thibaut Varene <[email protected]>

No code change - reduce data footprint.

---

 drivers/parisc/pdc_stable.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

e2a55d47bfe9d186d8060194028a5f63114108a9

drivers/parisc/pdc_stable.c +8 -8
index 4b991d5..a109421 100644
@@ -628,16 +628,16 @@ pdcs_osid_read(struct subsystem *entry, 
 		return -EINVAL;
 
 	switch (pdcs_osid) {
-		case 0x0000:	tmpstr = "No OS-dependent data"; break;
-		case 0x0001:	tmpstr = "HP-UX dependent data"; break;
-		case 0x0002:	tmpstr = "MPE-iX dependent data"; break;
-		case 0x0003:	tmpstr = "OSF dependent data"; break;
-		case 0x0004:	tmpstr = "HP-RT dependent data"; break;
-		case 0x0005:	tmpstr = "Novell Netware dependent data"; break;
-		case 0x0006:	tmpstr = "Linux dependent data"; break;
+		case 0x0000:	tmpstr = "No OS"; break;
+		case 0x0001:	tmpstr = "HP-UX"; break;
+		case 0x0002:	tmpstr = "MPE-iX"; break;
+		case 0x0003:	tmpstr = "OSF"; break;
+		case 0x0004:	tmpstr = "HP-RT"; break;
+		case 0x0005:	tmpstr = "Novell Netware"; break;
+		case 0x0006:	tmpstr = "Linux"; break;
 		default:	tmpstr = "Unknown"; break;
 	}
-	out += sprintf(out, "%s (0x%.4x)\n", tmpstr, pdcs_osid);
+	out += sprintf(out, "%s dependent data (0x%.4x)\n", tmpstr, pdcs_osid);
 
 	return out - buf;
 }
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#5 lore raw

PATCH 15/23 Add is_compat_task() helper

In reply to Kyle McMartin

... And convert signal.c and ptrace.c to use it instead of open coded equivalents.

---

 arch/parisc/kernel/ptrace.c |    8 ++++----
 arch/parisc/kernel/signal.c |   20 ++++++++++----------
 include/asm-parisc/compat.h |   11 +++++++++++
 3 files changed, 25 insertions(+), 14 deletions(-)

d504011f391cc883c080decc1ba70d70b8a4a6ba

arch/parisc/kernel/ptrace.c +4 -4
index 413292f..3f28de9 100644
@@ -91,7 +91,7 @@ #endif
 		int copied;
 
 #ifdef __LP64__
-		if (personality(child->personality) == PER_LINUX32) {
+		if (__is_compat_task(child)) {
 			unsigned int tmp;
 
 			addr &= 0xffffffffL;
@@ -123,7 +123,7 @@ #endif
 	case PTRACE_POKEDATA:
 		ret = 0;
 #ifdef __LP64__
-		if (personality(child->personality) == PER_LINUX32) {
+		if (__is_compat_task(child)) {
 			unsigned int tmp = (unsigned int)data;
 			DBG("sys_ptrace(POKE%s, %d, %lx, %lx)\n",
 				request == PTRACE_POKETEXT ? "TEXT" : "DATA",
@@ -146,7 +146,7 @@ #endif
 	case PTRACE_PEEKUSR: {
 		ret = -EIO;
 #ifdef __LP64__
-		if (personality(child->personality) == PER_LINUX32) {
+		if (__is_compat_task(child)) {
 			unsigned int tmp;
 
 			if (addr & (sizeof(int)-1))
@@ -205,7 +205,7 @@ #endif
 			goto out_tsk;
 		}
 #ifdef __LP64__
-		if (personality(child->personality) == PER_LINUX32) {
+		if (__is_compat_task(child)) {
 			if (addr & (sizeof(int)-1))
 				goto out_tsk;
 			if ((addr = translate_usr_offset(addr)) < 0)
arch/parisc/kernel/signal.c +10 -10
index cc38edf..bb83880 100644
@@ -76,7 +76,7 @@ sys_rt_sigsuspend(sigset_t __user *unews
 #ifdef __LP64__
 	compat_sigset_t newset32;
 
-	if(personality(current->personality) == PER_LINUX32){
+	if (is_compat_task()) {
 		/* XXX: Don't preclude handling different sized sigset_t's.  */
 		if (sigsetsize != sizeof(compat_sigset_t))
 			return -EINVAL;
@@ -153,7 +153,7 @@ #ifdef __LP64__
 	compat_sigset_t compat_set;
 	struct compat_rt_sigframe __user * compat_frame;
 	
-	if(personality(current->personality) == PER_LINUX32)
+	if (is_compat_task())
 		sigframe_size = PARISC_RT_SIGFRAME_SIZE32;
 #endif
 
@@ -166,7 +166,7 @@ #endif
 #ifdef __LP64__
 	compat_frame = (struct compat_rt_sigframe __user *)frame;
 	
-	if(personality(current->personality) == PER_LINUX32){
+	if (is_compat_task()) {
 		DBG(2,"sys_rt_sigreturn: ELF32 process.\n");
 		if (__copy_from_user(&compat_set, &compat_frame->uc.uc_sigmask, sizeof(compat_set)))
 			goto give_sigsegv;
@@ -186,7 +186,7 @@ #endif
 
 	/* Good thing we saved the old gr[30], eh? */
 #ifdef __LP64__
-	if(personality(current->personality) == PER_LINUX32){
+	if (is_compat_task()) {
 		DBG(1,"sys_rt_sigreturn: compat_frame->uc.uc_mcontext 0x%p\n",
 				&compat_frame->uc.uc_mcontext);
 // FIXME: Load upper half from register file
@@ -315,7 +315,7 @@ #ifdef __LP64__
 
 	compat_frame = (struct compat_rt_sigframe __user *)frame;
 	
-	if(personality(current->personality) == PER_LINUX32) {
+	if (is_compat_task()) {
 		DBG(1,"setup_rt_frame: frame->info = 0x%p\n", &compat_frame->info);
 		err |= copy_siginfo_to_user32(&compat_frame->info, info);
 		DBG(1,"SETUP_RT_FRAME: 1\n");
@@ -392,7 +392,7 @@ #endif
 	haddr = A(ka->sa.sa_handler);
 	/* The sa_handler may be a pointer to a function descriptor */
 #ifdef __LP64__
-	if(personality(current->personality) == PER_LINUX32) {
+	if (is_compat_task()) {
 #endif
 		if (haddr & PA_PLABEL_FDESC) {
 			Elf32_Fdesc fdesc;
@@ -427,19 +427,19 @@ #endif
 	 */
 	sigframe_size = PARISC_RT_SIGFRAME_SIZE;
 #ifdef __LP64__
-	if(personality(current->personality) == PER_LINUX32)
+	if (is_compat_task())
 		sigframe_size = PARISC_RT_SIGFRAME_SIZE32;
 #endif
 	if (in_syscall) {
 		regs->gr[31] = haddr;
 #ifdef __LP64__
-		if(personality(current->personality) == PER_LINUX)
+		if (personality(current->personality) == PER_LINUX)
 			sigframe_size |= 1;
 #endif
 	} else {
 		unsigned long psw = USER_PSW;
 #ifdef __LP64__
-		if(personality(current->personality) == PER_LINUX)
+		if (personality(current->personality) == PER_LINUX)
 			psw |= PSW_W;
 #endif
 
@@ -464,7 +464,7 @@ #endif
 	regs->gr[26] = sig;               /* signal number */
 	
 #ifdef __LP64__
-	if(personality(current->personality) == PER_LINUX32){
+	if (is_compat_task()) {
 		regs->gr[25] = A(&compat_frame->info); /* siginfo pointer */
 		regs->gr[24] = A(&compat_frame->uc);   /* ucontext pointer */
 	} else
include/asm-parisc/compat.h +11 -0
index 289624d..71b4eee 100644
@@ -5,6 +5,7 @@ #define _ASM_PARISC_COMPAT_H
  */
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/personality.h>
 
 #define COMPAT_USER_HZ 100
 
@@ -149,4 +150,14 @@ static __inline__ void __user *compat_al
 	return (void __user *)regs->gr[30];
 }
 
+static inline int __is_compat_task(struct task_struct *t)
+{
+	return personality(t->personality) == PER_LINUX32;
+}
+
+static inline int is_compat_task(void)
+{
+	return __is_compat_task(current);
+}
+
 #endif /* _ASM_PARISC_COMPAT_H */
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#6 lore raw

PATCH 16/23 Remove unused macro fixup_branch in syscall.S

In reply to Kyle McMartin

---

 arch/parisc/kernel/syscall.S |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

9f6d09dc715952f5d953645d050a400ffa881af5

arch/parisc/kernel/syscall.S +0 -11
index a028c99..9670a89 100644
@@ -29,18 +29,6 @@ #else
 	.level		1.1
 #endif
 
-#ifndef CONFIG_64BIT
-	.macro fixup_branch,lbl
-	b	    \lbl
-	.endm
-#else
-	.macro fixup_branch,lbl
-	ldil	    L%\lbl, %r1
-	ldo	    R%\lbl(%r1), %r1
-	bv,n        %r0(%r1)
-	.endm
-#endif
#7 lore raw

PATCH 17/23 Match show_cache_info with reality

In reply to Kyle McMartin

show_cache_info and struct pdc_cache_cf were out of sync with published documentation. Fix the reporting of cache associativity and update the pdc_cache_cf bitfields to match documentation.

---

 arch/parisc/kernel/cache.c |   18 ++++++++++--------
 include/asm-parisc/pdc.h   |    4 ++--
 2 files changed, 12 insertions(+), 10 deletions(-)

9e474ed388eb542bf0948aced376f787fb2e26b9

arch/parisc/kernel/cache.c +10 -8
index c057ad7..851519c 100644
@@ -97,15 +97,17 @@ update_mmu_cache(struct vm_area_struct *
 void
 show_cache_info(struct seq_file *m)
 {
+	char buf[32];
+
 	seq_printf(m, "I-cache\t\t: %ld KB\n", 
 		cache_info.ic_size/1024 );
-	seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %d-way associative)\n", 
+	if (cache_info.dc_loop == 1)
+		snprintf(buf, 32, "%lu-way associative", cache_info.dc_loop);
+	seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %s)\n",
 		cache_info.dc_size/1024,
 		(cache_info.dc_conf.cc_wt ? "WT":"WB"),
 		(cache_info.dc_conf.cc_sh ? ", shared I/D":""),
-		(cache_info.dc_conf.cc_assoc)
-	);
-
+		((cache_info.dc_loop == 1) ? "direct mapped" : buf));
 	seq_printf(m, "ITLB entries\t: %ld\n" "DTLB entries\t: %ld%s\n",
 		cache_info.it_size,
 		cache_info.dt_size,
@@ -158,11 +160,11 @@ #if 0
 		cache_info.dc_conf.cc_block,
 		cache_info.dc_conf.cc_line,
 		cache_info.dc_conf.cc_shift);
-	printk("	wt %d sh %d cst %d assoc %d\n",
+	printk("	wt %d sh %d cst %d hv %d\n",
 		cache_info.dc_conf.cc_wt,
 		cache_info.dc_conf.cc_sh,
 		cache_info.dc_conf.cc_cst,
-		cache_info.dc_conf.cc_assoc);
+		cache_info.dc_conf.cc_hv);
 
 	printk("IC  base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
 		cache_info.ic_base,
@@ -176,11 +178,11 @@ #if 0
 		cache_info.ic_conf.cc_block,
 		cache_info.ic_conf.cc_line,
 		cache_info.ic_conf.cc_shift);
-	printk("	wt %d sh %d cst %d assoc %d\n",
+	printk("	wt %d sh %d cst %d hv %d\n",
 		cache_info.ic_conf.cc_wt,
 		cache_info.ic_conf.cc_sh,
 		cache_info.ic_conf.cc_cst,
-		cache_info.ic_conf.cc_assoc);
+		cache_info.ic_conf.cc_hv);
 
 	printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
 		cache_info.dt_conf.tc_sh,
include/asm-parisc/pdc.h +2 -2
index 7d8a71a..592f13b 100644
@@ -352,8 +352,8 @@ #endif
 		cc_wt	: 1,	/* 0 = WT-Dcache, 1 = WB-Dcache */
 		cc_sh	: 2,	/* 0 = separate I/D-cache, else shared I/D-cache */
 		cc_cst  : 3,	/* 0 = incoherent D-cache, 1=coherent D-cache */
-		cc_pad1 : 5,	/* reserved */
-		cc_assoc: 8;	/* associativity of I/D-cache */
+		cc_pad1 : 10,	/* reserved */
+		cc_hv   : 3;	/* hversion dependent */
 };
 
 struct pdc_tlb_cf {		/* for PDC_CACHE (I/D-TLB's) */
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#8 lore raw

PATCH 19/23 OS_ID_LINUX == 0x0006

In reply to Kyle McMartin

We were assigned an OS_ID of 0x0006. Consistently use OS_ID_LINUX instead of using the magic number. Also update the OS_ID_ defines in asm/pdc.h to reflect this.

---

 arch/parisc/kernel/firmware.c |    4 +++-
 arch/parisc/kernel/setup.c    |    2 +-
 drivers/parisc/pdc_stable.c   |    4 ++--
 include/asm-parisc/pdc.h      |    3 +--
 4 files changed, 7 insertions(+), 6 deletions(-)

889a598b271a7ef14c2c7c83b26a82ccf57d9ab9

arch/parisc/kernel/firmware.c +3 -1
index c80c277..4398d2a 100644
@@ -407,7 +407,9 @@ int pdc_model_info(struct pdc_model *mod
  * pdc_model_sysmodel - Get the system model name.
  * @name: A char array of at least 81 characters.
  *
- * Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L)
+ * Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L).
+ * Using OS_ID_HPUX will return the equivalent of the 'modelname' command
+ * on HP/UX.
  */
 int pdc_model_sysmodel(char *name)
 {
arch/parisc/kernel/setup.c +1 -1
index 8471486..278f4b9 100644
@@ -303,7 +303,7 @@ extern void eisa_init(void);
 
 static int __init parisc_init(void)
 {
-	u32 osid = (0x0006 << 16);
+	u32 osid = (OS_ID_LINUX << 16);
 
 	parisc_proc_mkdir();
 	parisc_init_resources();
drivers/parisc/pdc_stable.c +2 -2
index a109421..97b3458 100644
@@ -884,7 +884,7 @@ pdcs_osdep1_write(struct subsystem *entr
 	if (!entry || !buf || !count)
 		return -EINVAL;
 
-	if (unlikely(pdcs_osid != 0x0006))
+	if (unlikely(pdcs_osid != OS_ID_LINUX))
 		return -EPERM;
 
 	if (count > 16)
@@ -926,7 +926,7 @@ pdcs_osdep2_write(struct subsystem *entr
 	if (unlikely(pdcs_size <= 224))
 		return -ENOSYS;
 
-	if (unlikely(pdcs_osid != 0x0006))
+	if (unlikely(pdcs_osid != OS_ID_LINUX))
 		return -EPERM;
 
 	size = pdcs_size - 224;
include/asm-parisc/pdc.h +1 -2
index 3d3446e..33bff61 100644
@@ -278,12 +278,11 @@ #define PDC_LINK_USB_ENTRY_POINTS	1  /* 
 /* constants for OS (NVM...) */
 #define OS_ID_NONE		0	/* Undefined OS ID	*/
 #define OS_ID_HPUX		1	/* HP-UX OS		*/
-#define OS_ID_LINUX		OS_ID_HPUX /* just use the same value as hpux */
 #define OS_ID_MPEXL		2	/* MPE XL OS		*/
 #define OS_ID_OSF		3	/* OSF OS		*/
 #define OS_ID_HPRT		4	/* HP-RT OS		*/
 #define OS_ID_NOVEL		5	/* NOVELL OS		*/
-#define OS_ID_NT		6	/* NT OS		*/
+#define OS_ID_LINUX		6	/* Linux		*/
 
 
 /* constants for PDC_CHASSIS */
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#9 lore raw

PATCH 20/23 Add os_id_to_string helper

In reply to Kyle McMartin

Add a helper to asm/pdc.h to translate OS_ID values to strings and use it in the pdc_stable driver.

---

 drivers/parisc/pdc_stable.c |   14 ++------------
 include/asm-parisc/pdc.h    |   13 +++++++++++++
 2 files changed, 15 insertions(+), 12 deletions(-)

484e05640cb33480c6cbd8c9f8e519a635424d1a

drivers/parisc/pdc_stable.c +2 -12
index 97b3458..ea1b7a6 100644
@@ -622,22 +622,12 @@ static ssize_t
 pdcs_osid_read(struct subsystem *entry, char *buf)
 {
 	char *out = buf;
-	char *tmpstr = NULL;
 
 	if (!entry || !buf)
 		return -EINVAL;
 
-	switch (pdcs_osid) {
-		case 0x0000:	tmpstr = "No OS"; break;
-		case 0x0001:	tmpstr = "HP-UX"; break;
-		case 0x0002:	tmpstr = "MPE-iX"; break;
-		case 0x0003:	tmpstr = "OSF"; break;
-		case 0x0004:	tmpstr = "HP-RT"; break;
-		case 0x0005:	tmpstr = "Novell Netware"; break;
-		case 0x0006:	tmpstr = "Linux"; break;
-		default:	tmpstr = "Unknown"; break;
-	}
-	out += sprintf(out, "%s dependent data (0x%.4x)\n", tmpstr, pdcs_osid);
+	out += sprintf(out, "%s dependent data (0x%.4x)\n",
+		os_id_to_string(pdcs_osid), pdcs_osid);
 
 	return out - buf;
 }
include/asm-parisc/pdc.h +13 -0
index 33bff61..7a21f10 100644
@@ -284,6 +284,19 @@ #define OS_ID_HPRT		4	/* HP-RT OS		*/
 #define OS_ID_NOVEL		5	/* NOVELL OS		*/
 #define OS_ID_LINUX		6	/* Linux		*/
 
+static inline char * os_id_to_string(u16 os_id) {
+	switch(os_id) {
+	case OS_ID_NONE:	return "No OS";
+	case OS_ID_HPUX:	return "HP-UX";
+	case OS_ID_MPEXL:	return "MPE-iX";
+	case OS_ID_OSF:		return "OSF";
+	case OS_ID_HPRT:	return "HP-RT";
+	case OS_ID_NOVEL:	return "Novell Netware";
+	case OS_ID_LINUX:	return "Linux";
+	default:	return "Unknown";
+	}
+}
+
 
 /* constants for PDC_CHASSIS */
 #define OSTAT_OFF		0
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#10 lore raw

PATCH 21/23 Refactor show_regs in traps.c

In reply to Kyle McMartin

show_regs() was one bloaty function. Split it into a few cleaner functions and define a clean macro to print a line of registers.

[And from Thibaut, only print fprs on a usermode trap.]

---

 arch/parisc/kernel/traps.c |   84 +++++++++++++++++++++-----------------------
 1 files changed, 40 insertions(+), 44 deletions(-)

b91fba22eff9ce81d60b078d4c4f9973a31692dc

arch/parisc/kernel/traps.c +40 -44
index ff20060..348344a 100644
@@ -66,57 +66,42 @@ #define RFMT "%016lx"
 #else
 #define RFMT "%08lx"
 #endif
+#define FFMT "%016llx"	/* fpregs are 64-bit always */
 
-void show_regs(struct pt_regs *regs)
+#define PRINTREGS(lvl,r,f,fmt,x)	\
+	printk("%s%s%02d-%02d  " fmt " " fmt " " fmt " " fmt "\n",	\
+		lvl, f, (x), (x+3), (r)[(x)+0], (r)[(x)+1],		\
+		(r)[(x)+2], (r)[(x)+3])
+
+static void print_gr(char *level, struct pt_regs *regs)
 {
 	int i;
-	char buf[128], *p;
-	char *level;
-	unsigned long cr30;
-	unsigned long cr31;
-	/* carlos says that gcc understands better memory in a struct,
-	 * and it makes our life easier with fpregs -- T-Bone */
-	struct { u32 sw[2]; } s;
-	
-	level = user_mode(regs) ? KERN_DEBUG : KERN_CRIT;
-
-	printk("%s\n", level); /* don't want to have that pretty register dump messed up */
+	char buf[64];
 
+	printk("%s\n", level);
 	printk("%s     YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI\n", level);
 	printbinary(buf, regs->gr[0], 32);
 	printk("%sPSW: %s %s\n", level, buf, print_tainted());
 
-	for (i = 0; i < 32; i += 4) {
-		int j;
-		p = buf;
-		p += sprintf(p, "%sr%02d-%02d ", level, i, i + 3);
-		for (j = 0; j < 4; j++) {
-			p += sprintf(p, " " RFMT, (i+j) == 0 ? 0 : regs->gr[i + j]);
-		}
-		printk("%s\n", buf);
-	}
+	for (i = 0; i < 32; i += 4)
+		PRINTREGS(level, regs->gr, "r", RFMT, i);
+}
 
-	for (i = 0; i < 8; i += 4) {
-		int j;
-		p = buf;
-		p += sprintf(p, "%ssr%d-%d  ", level, i, i + 3);
-		for (j = 0; j < 4; j++) {
-			p += sprintf(p, " " RFMT, regs->sr[i + j]);
-		}
-		printk("%s\n", buf);
-	}
+static void print_fr(char *level, struct pt_regs *regs)
+{
+	int i;
+	char buf[64];
+	struct { u32 sw[2]; } s;
 
 	/* FR are 64bit everywhere. Need to use asm to get the content
 	 * of fpsr/fper1, and we assume that we won't have a FP Identify
 	 * in our way, otherwise we're screwed.
 	 * The fldd is used to restore the T-bit if there was one, as the
 	 * store clears it anyway.
-	 * BTW, PA2.0 book says "thou shall not use fstw on FPSR/FPERs". */ 
-	__asm__ (
-		"fstd %%fr0,0(%1)	\n\t"
-		"fldd 0(%1),%%fr0	\n\t"
-		: "=m" (s) : "r" (&s) : "%r0"
-		);
+	 * PA2.0 book says "thou shall not use fstw on FPSR/FPERs" - T-Bone */
+	asm volatile ("fstd %%fr0,0(%1)	\n\t"
+		      "fldd 0(%1),%%fr0	\n\t"
+		      : "=m" (s) : "r" (&s) : "r0");
 
 	printk("%s\n", level);
 	printk("%s      VZOUICununcqcqcqcqcqcrmunTDVZOUI\n", level);
@@ -125,14 +110,25 @@ void show_regs(struct pt_regs *regs)
 	printk("%sFPER1: %08x\n", level, s.sw[1]);
 
 	/* here we'll print fr0 again, tho it'll be meaningless */
-	for (i = 0; i < 32; i += 4) {
-		int j;
-		p = buf;
-		p += sprintf(p, "%sfr%02d-%02d ", level, i, i + 3);
-		for (j = 0; j < 4; j++)
-			p += sprintf(p, " %016llx", (i+j) == 0 ? 0 : regs->fr[i+j]);
-		printk("%s\n", buf);
-	}
+	for (i = 0; i < 32; i += 4)
+		PRINTREGS(level, regs->fr, "fr", FFMT, i);
+}
+
+void show_regs(struct pt_regs *regs)
+{
+	int i;
+	char *level;
+	unsigned long cr30, cr31;
+
+	level = user_mode(regs) ? KERN_DEBUG : KERN_CRIT;
+
+	print_gr(level, regs);
+
+	for (i = 0; i < 8; i += 4)
+		PRINTREGS(level, regs->sr, "sr", RFMT, i);
+
+	if (user_mode(regs))
+		print_fr(level, regs);
 
 	cr30 = mfctl(30);
 	cr31 = mfctl(31);
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#11 lore raw

PATCH 22/23 Fix PCREL22F relocation problem for most modules

In reply to Kyle McMartin

From: James Bottomley <[email protected]>

The new problem, which has been affecting many more modules was that our new ioremap really takes chunks out of our vmalloc space. The net result being that any two kernel vmalloc's now have to slot into the chunked up space. So the vmallocs for a modules init and core sectons are no longer necessarily contiguous. Unfortunately, the module loader thinks that any internal symbol references should be satisfiable using the jump instruction, which isn't true if the symbol is referenced from init to core and vmalloc placed them a long way apart.

Fix this by introducing a new stub type for intra module inter sectional jumps and using it.

And, by the way, before anyone complains, this won't fix modules that fail to load because PCREF22F can't reach the stubs in the first place (like ipv6.)

---

 arch/parisc/kernel/module.c |   63 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 50 insertions(+), 13 deletions(-)

78a01907452ac0dccd0ed38f9d25c6bee6b1cf95

arch/parisc/kernel/module.c +50 -13
index f27cfe4..aee3118 100644
@@ -89,6 +89,12 @@ static inline int is_local(struct module
 	return is_init(me, loc) || is_core(me, loc);
 }
 
+static inline int is_local_section(struct module *me, void *loc, void *dot)
+{
+	return (is_init(me, loc) && is_init(me, dot)) ||
+		(is_core(me, loc) && is_core(me, dot));
+}
+
 
 #ifndef __LP64__
 struct got_entry {
@@ -364,8 +370,14 @@ static Elf_Addr get_fdesc(struct module 
 }
 #endif /* __LP64__ */
 
+enum elf_stub_type {
+	ELF_STUB_GOT,
+	ELF_STUB_MILLI,
+	ELF_STUB_DIRECT,
+};
+
 static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
-	int millicode, int init_section)
+	enum elf_stub_type stub_type, int init_section)
 {
 	unsigned long i;
 	struct stub_entry *stub;
@@ -396,7 +408,7 @@ #ifndef __LP64__
 	stub->insns[1] |= reassemble_17(rrsel(value, addend) / 4);
 
 #else
-/* for 64-bit we have two kinds of stubs:
+/* for 64-bit we have three kinds of stubs:
  * for normal function calls:
  * 	ldd 0(%dp),%dp
  * 	ldd 10(%dp), %r1
@@ -408,18 +420,23 @@ #else
  * 	ldo 0(%r1), %r1
  * 	ldd 10(%r1), %r1
  * 	bve,n (%r1)
+ *
+ * for direct branches (jumps between different section of the
+ * same module):
+ *	ldil 0, %r1
+ *	ldo 0(%r1), %r1
+ *	bve,n (%r1)
  */
-	if (!millicode)
-	{
+	switch (stub_type) {
+	case ELF_STUB_GOT:
 		stub->insns[0] = 0x537b0000;	/* ldd 0(%dp),%dp	*/
 		stub->insns[1] = 0x53610020;	/* ldd 10(%dp),%r1	*/
 		stub->insns[2] = 0xe820d000;	/* bve (%r1)		*/
 		stub->insns[3] = 0x537b0030;	/* ldd 18(%dp),%dp	*/
 
 		stub->insns[0] |= reassemble_14(get_got(me, value, addend) & 0x3fff);
-	}
-	else
-	{
+		break;
+	case ELF_STUB_MILLI:
 		stub->insns[0] = 0x20200000;	/* ldil 0,%r1		*/
 		stub->insns[1] = 0x34210000;	/* ldo 0(%r1), %r1	*/
 		stub->insns[2] = 0x50210020;	/* ldd 10(%r1),%r1	*/
@@ -427,7 +444,17 @@ #else
 
 		stub->insns[0] |= reassemble_21(lrsel(value, addend));
 		stub->insns[1] |= reassemble_14(rrsel(value, addend));
+		break;
+	case ELF_STUB_DIRECT:
+		stub->insns[0] = 0x20200000;    /* ldil 0,%r1           */
+		stub->insns[1] = 0x34210000;    /* ldo 0(%r1), %r1      */
+		stub->insns[2] = 0xe820d002;    /* bve,n (%r1)          */
+
+		stub->insns[0] |= reassemble_21(lrsel(value, addend));
+		stub->insns[1] |= reassemble_14(rrsel(value, addend));
+		break;
 	}
+
 #endif
 
 	return (Elf_Addr)stub;
@@ -539,14 +566,14 @@ #endif
 			break;
 		case R_PARISC_PCREL17F:
 			/* 17-bit PC relative address */
-			val = get_stub(me, val, addend, 0, is_init(me, loc));
+			val = get_stub(me, val, addend, ELF_STUB_GOT, is_init(me, loc));
 			val = (val - dot - 8)/4;
 			CHECK_RELOC(val, 17)
 			*loc = (*loc & ~0x1f1ffd) | reassemble_17(val);
 			break;
 		case R_PARISC_PCREL22F:
 			/* 22-bit PC relative address; only defined for pa20 */
-			val = get_stub(me, val, addend, 0, is_init(me, loc));
+			val = get_stub(me, val, addend, ELF_STUB_GOT, is_init(me, loc));
 			DEBUGP("STUB FOR %s loc %lx+%lx at %lx\n", 
 			       strtab + sym->st_name, (unsigned long)loc, addend, 
 			       val)
@@ -643,13 +670,23 @@ #endif
 			       strtab + sym->st_name,
 			       loc, val);
 			/* can we reach it locally? */
-			if(!is_local(me, (void *)val)) {
-				if (strncmp(strtab + sym->st_name, "$$", 2)
+			if(!is_local_section(me, (void *)val, (void *)dot)) {
+
+				if (is_local(me, (void *)val))
+					/* this is the case where the
+					 * symbol is local to the
+					 * module, but in a different
+					 * section, so stub the jump
+					 * in case it's more than 22
+					 * bits away */
+					val = get_stub(me, val, addend, ELF_STUB_DIRECT,
+						       is_init(me, loc));
+				else if (strncmp(strtab + sym->st_name, "$$", 2)
 				    == 0)
-					val = get_stub(me, val, addend, 1,
+					val = get_stub(me, val, addend, ELF_STUB_MILLI,
 						       is_init(me, loc));
 				else
-					val = get_stub(me, val, addend, 0,
+					val = get_stub(me, val, addend, ELF_STUB_GOT,
 						       is_init(me, loc));
 			}
 			DEBUGP("STUB FOR %s loc %lx, val %lx+%lx at %lx\n", 
Signature · 6 lines
1.3.3

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux