Re: Regression with 4.7.2 on sun4u

2016-10-24 Thread James Clarke
> On 24 Oct 2016, at 19:11, David Miller  wrote:
> 
> From: James Clarke 
> Date: Sat, 22 Oct 2016 10:51:28 +0100
> 
>> @@ -19,12 +19,20 @@ void arch_jump_label_transform(struct jump_entry *entry,
>>  if (type == JUMP_LABEL_JMP) {
>>  s32 off = (s32)entry->target - (s32)entry->code;
>> 
>> +BUG_ON(off & 3);
>> +
>> #ifdef CONFIG_SPARC64
>> -/* ba,pt %xcc, . + (off << 2) */
>> -val = 0x1068 | ((u32) off >> 2);
>> +/* WDISP19 - target is . + (immed << 2) */
>> +BUG_ON(off > 0xf);
>> +BUG_ON(off < -0x10);
>> +/* ba,pt %xcc, . + off */
>> +val = 0x1068 | (((u32) off >> 2) & 0x7);
>> #else
>> -/* ba . + (off << 2) */
>> -val = 0x1080 | ((u32) off >> 2);
>> +/* WDISP22 - target is . + (immed << 2) */
>> +BUG_ON(off > 0x7f);
>> +BUG_ON(off < -0x80);
>> +/* ba . + off */
>> +val = 0x1080 | (((u32) off >> 2) & 0x3f);
>> #endif
> 
> Since we can determine at run time whether we need to use a non-v9
> branch or not, it makes no sense to fail when a v9 branch is out of
> range.
> 
> We can simply downgrade to a pre-v9 one.
> 
> Something like this:
> 
> diff --git a/arch/sparc/kernel/jump_label.c b/arch/sparc/kernel/jump_label.c
> index 59bbeff..689e557 100644
> --- a/arch/sparc/kernel/jump_label.c
> +++ b/arch/sparc/kernel/jump_label.c
> @@ -13,19 +13,24 @@
> void arch_jump_label_transform(struct jump_entry *entry,
>  enum jump_label_type type)
> {
> - u32 val;
>   u32 *insn = (u32 *) (unsigned long) entry->code;
> + u32 val;
> 
>   if (type == JUMP_LABEL_JMP) {
>   s32 off = (s32)entry->target - (s32)entry->code;
> + bool use_v9_branch = false;
> 
> #ifdef CONFIG_SPARC64
> - /* ba,pt %xcc, . + (off << 2) */
> - val = 0x1068 | ((u32) off >> 2);
> -#else
> - /* ba . + (off << 2) */
> - val = 0x1080 | ((u32) off >> 2);
> + if (off <= 0xf && off >= -0x10)
> + use_v9_branch = true;
> #endif
> + if (use_v9_branch) {
> + /* ba,pt %xcc, . + (off << 2) */
> + val = 0x1068 | (((u32) off >> 2) & 0x7);
> + } else {
> + /* ba . + (off << 2) */
> + val = 0x1080 | (((u32) off >> 2) & 0x3f);
> + }
>   } else {
>   val = 0x0100;
>   }

Sure, that makes sense; updated and tested for a few hours:

From d5997fd98fc80d1ceabe11f6fcd63dfce99b8253 Mon Sep 17 00:00:00 2001
From: James Clarke 
Date: Mon, 24 Oct 2016 19:49:25 +0100
Subject: [PATCH v2] sparc: Handle negative offsets in
 arch_jump_label_transform

Additionally, if the offset will overflow the immediate for a ba,pt
instruction, fall back on a standard ba to get an extra 3 bits.

Signed-off-by: James Clarke 
---
 arch/sparc/kernel/jump_label.c | 23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/arch/sparc/kernel/jump_label.c b/arch/sparc/kernel/jump_label.c
index 59bbeff..07933b9 100644
--- a/arch/sparc/kernel/jump_label.c
+++ b/arch/sparc/kernel/jump_label.c
@@ -13,19 +13,30 @@
 void arch_jump_label_transform(struct jump_entry *entry,
   enum jump_label_type type)
 {
-   u32 val;
u32 *insn = (u32 *) (unsigned long) entry->code;
+   u32 val;
 
if (type == JUMP_LABEL_JMP) {
s32 off = (s32)entry->target - (s32)entry->code;
+   bool use_v9_branch = false;
+
+   BUG_ON(off & 3);
 
 #ifdef CONFIG_SPARC64
-   /* ba,pt %xcc, . + (off << 2) */
-   val = 0x1068 | ((u32) off >> 2);
-#else
-   /* ba . + (off << 2) */
-   val = 0x1080 | ((u32) off >> 2);
+   if (off <= 0xf && off >= -0x10)
+   use_v9_branch = true;
 #endif
+   if (use_v9_branch) {
+   /* WDISP19 - target is . + immed << 2 */
+   /* ba,pt %xcc, . + off */
+   val = 0x1068 | (((u32) off >> 2) & 0x7);
+   } else {
+   /* WDISP22 - target is . + immed << 2 */
+   BUG_ON(off > 0x7f);
+   BUG_ON(off < -0x80);
+   /* ba . + off */
+   val = 0x1080 | (((u32) off >> 2) & 0x3f);
+   }
} else {
val = 0x0100;
}
-- 
2.9.3



Re: Regression with 4.7.2 on sun4u

2016-10-24 Thread David Miller
From: James Clarke 
Date: Sat, 22 Oct 2016 10:51:28 +0100

> @@ -19,12 +19,20 @@ void arch_jump_label_transform(struct jump_entry *entry,
>   if (type == JUMP_LABEL_JMP) {
>   s32 off = (s32)entry->target - (s32)entry->code;
>  
> + BUG_ON(off & 3);
> +
>  #ifdef CONFIG_SPARC64
> - /* ba,pt %xcc, . + (off << 2) */
> - val = 0x1068 | ((u32) off >> 2);
> + /* WDISP19 - target is . + (immed << 2) */
> + BUG_ON(off > 0xf);
> + BUG_ON(off < -0x10);
> + /* ba,pt %xcc, . + off */
> + val = 0x1068 | (((u32) off >> 2) & 0x7);
>  #else
> - /* ba . + (off << 2) */
> - val = 0x1080 | ((u32) off >> 2);
> + /* WDISP22 - target is . + (immed << 2) */
> + BUG_ON(off > 0x7f);
> + BUG_ON(off < -0x80);
> + /* ba . + off */
> + val = 0x1080 | (((u32) off >> 2) & 0x3f);
>  #endif

Since we can determine at run time whether we need to use a non-v9
branch or not, it makes no sense to fail when a v9 branch is out of
range.

We can simply downgrade to a pre-v9 one.

Something like this:

diff --git a/arch/sparc/kernel/jump_label.c b/arch/sparc/kernel/jump_label.c
index 59bbeff..689e557 100644
--- a/arch/sparc/kernel/jump_label.c
+++ b/arch/sparc/kernel/jump_label.c
@@ -13,19 +13,24 @@
 void arch_jump_label_transform(struct jump_entry *entry,
   enum jump_label_type type)
 {
-   u32 val;
u32 *insn = (u32 *) (unsigned long) entry->code;
+   u32 val;
 
if (type == JUMP_LABEL_JMP) {
s32 off = (s32)entry->target - (s32)entry->code;
+   bool use_v9_branch = false;
 
 #ifdef CONFIG_SPARC64
-   /* ba,pt %xcc, . + (off << 2) */
-   val = 0x1068 | ((u32) off >> 2);
-#else
-   /* ba . + (off << 2) */
-   val = 0x1080 | ((u32) off >> 2);
+   if (off <= 0xf && off >= -0x10)
+   use_v9_branch = true;
 #endif
+   if (use_v9_branch) {
+   /* ba,pt %xcc, . + (off << 2) */
+   val = 0x1068 | (((u32) off >> 2) & 0x7);
+   } else {
+   /* ba . + (off << 2) */
+   val = 0x1080 | (((u32) off >> 2) & 0x3f);
+   }
} else {
val = 0x0100;
}



Sun hardware in need of a good home

2016-10-24 Thread Bob Ham
Hi all,

Let me tell you a little story.  Many moons ago, while I was living away
from Bristol, a man appeared at a meeting of the Bristol and Bath Linux
User Group offering abundant gifts to all and sundry.  Inside the boot
of his car lay a treasure trove of Sun computers, as I understand,
originating from the University of Bath.  A number of these were taken
by a LUG regular, a hacker of great skill named John Honniball, who took
them in order to offer the gems to any who sought to learn the ways of
the SPARC and the arcane magic of Engineering Workstations The Right
Way.  When I returned to Bristol I was honoured to be offered, and
accept, a SPARCclassic from John.

Some years later, after I had left Bristol and returned again, another
LUG regular, a Unix wizard from the University of Bristol's department
of physics named Winnie Lacesso, notified us that there were a number of
Sun workstations being disposed of by her department.  (The same
department providing part of the computing grid for the LHC no less.)  I
took the opportunity to visit the department and acquire a SPARCstation
4, along with two Sun monitors, from the learned folks.

Now, I live in Liverpool.  I have tinkered and explored and learned.  I
have gained a great deal from these gifts.  However, I have moved on and
I feel it is right that instead of gathering dust, these gems should
again be offered to any who seek.  So, in need of a good home are:



* Sun SPARCclassic workstation, 64MB memory, 9GB SCSI disk

http://www.obsolyte.com/sun_lx/
http://www.computinghistory.org.uk/det/6751/Sun-SPARCclassic/

The battery in the NVRAM has gone.  If you're not familiar with NVRAM
issues, see:

http://www.lib.ru/TXT/faqsunnvram.txt

and for an adventure to whose excitement I can personally attest:

https://gigawa.lt/gigawa.lt/Sun_NVRAM.html



* Sun SPARCstation 4 workstation, 64MB memory, 9GB SCSI disk

https://en.wikipedia.org/wiki/SPARCstation_4
http://www.obsolyte.com/sun_ss5/



* Sun GDM-17E20 monitor

http://www.shrubbery.net/~heas/sun-feh-2_1/Devices/Monitor/MONITOR_Color_17_Premium_CRT.html#365-1338



* Sun GDM-17E10 monitor

http://www.shrubbery.net/~heas/sun-feh-2_1/Devices/Monitor/MONITOR_Color_17_Premium_CRT.html#365-1316

From what I recall (and the scribblings on the top of it), this monitor
is unstable sometimes.  Having just plugged it in, it displays the
console fine but I haven't tried X with higher resolutions, or for an
extended period.



* I also have a type 6 keyboard and mouse.  This was bought for £20 on
eBay so that I could press two keys, Stop+N, in order to reset the NVRAM
on the SPARCclassic and get the serial port back.  A good lesson there:
don't fiddle with the flow control settings of a serial port if said
serial port is the only way to access a machine :-)  As I paid for it,
I'd like to have some token offering in return.


* In Bristol, I have a monster 21" Sun monitor which needs two people to
carry it safely (this is not a joke).



If you wish to receive any of these, email me back and we'll sort
something out.  They are currently residing in Liverpool unless
otherwise stated; if you want them and live further afield, let me know
and we may be able to arrange something.  First come, first served.


Happy hacking,

Bob



HR Metrics Course by a Certified HR Metrics and Analytics Professional

2016-10-24 Thread HR Metrics and Analytics
http://tracking.valdus.net/tracking/reportspam?msgid=LyLbVY4YhlMiz3AP8U6CoA2=debian-sparc@lists.debian.org
 
http://tracking.valdus.net/tracking/why?msgid=LyLbVY4YhlMiz3AP8U6CoA2=debian-sparc@lists.debian.org
 HR Metrics Workshop
View this email in your browser

that create discernable behavioural change that can be applied immediately in 
the

workplace.

We have always been firm believers in an interactive and engaging instructing 
style appropriate for adult learning. From theory, to strategy, to proven 
practical tools, VALDUS Training Centre delivers readily applicable ideas and 
solutions to prepare participants for real-world situations.