Skip to contentSkip to conversation

PATCH hppa ordered load absolute ops

parisc-linux Grant Grundler 3 participants 7 messages Jan 31, 2003

lore
Share & tools
lore
#0 lore raw

in trying to close a potential memory ordering hole for pa2.0 machines, I've run into the following problem with binutils.

hppa linux kernel uses ldwa to access MMIO space instead of using virtually mapped addresses. Normally, ordering is enforced automatically to all IO space accesses according to the PA 2.0 architecture. However, some platforms (not supported yet) have IO devices responding to physical addresses *outside* the architected IO spaces and that's the hole I was trying to close.

hppa64-linux-gcc -D__KERNEL__ -I/home/src/2.4.20/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -mpa-risc-2-0 -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0 -mschedule=8000 -nostdinc -I /opt/palinux/lib/gcc-lib/hppa64-linux/3.0.4/include -DKBUILD_BASENAME=eeprom -c -o eeprom.o eeprom.c
{standard input}: Assembler messages:
{standard input}:1039: Error: Invalid operands
{standard input}:1054: Error: Invalid operands
...

the -S output from eeprom.s looks like:
...
1034 #NO_APP
1035 extrd,u %r19,63,32,%r19
1036 #APP
1037 stwa,o %r19,0(%r26)
1038
1039 ldwa,o 0(%r26),%r21
1040
1041 #NO_APP
1042 or %r20,%r22,%r20

As one can see, "stwa,o" was ok but "ldwa,o" was not. I've checked the pa2.0 arch and one of the restrictions is the "im5" value must be zero (which it obviously is).

Appended is my very first attempt at adding a new opcode. i think I have the match/mask fields right.
I'm still a bit sketchy on co/cc/@ specs.

thanks,
grant

binutils-2.13.90.0.16/include/opcode/hppa.h 2003-01-30 22:58:54.000000000 -0800 renamed from binutils-2.13.90.0.16/include/opcode/hppa.h-orig 2003-01-30 21:06:56.000000000 -0800 +2 -0
@@ -405,6 +405,7 @@ static const struct pa_opcode pa_opcodes
 { "ldbx",       0x0c000000, 0xfc001fc0, "cXx(b),t", pa10, 0},
 { "ldwa",       0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT},
 { "ldwa",	0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldwa",	0x0c0031a0, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},
 { "ldcw",       0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa10, FLAG_STRICT},
 { "ldcw",       0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa10, FLAG_STRICT},
 { "ldcw",	0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa10, FLAG_STRICT},
@@ -415,6 +416,7 @@ static const struct pa_opcode pa_opcodes
 { "stby",	0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa10, FLAG_STRICT},
 { "ldda",       0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
 { "ldda",	0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
+{ "ldda",	0x0c003100, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},
 { "ldcd",       0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT},
 { "ldcd",       0x0c000140, 0xfc0013c0, "cxcdx(b),t", pa20, FLAG_STRICT},
 { "ldcd",	0x0c001140, 0xfc0013c0, "cmcd5(s,b),t", pa20, FLAG_STRICT},
#1 lore raw

Grant,

Quoted 3 lines

{ "ldwa", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT},
{ "ldwa", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldwa", 0x0c0031a0, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},

? 0x0c0011a0, 0xfc1ff3e0

Quoted 3 lines

{ "ldda", 0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
{ "ldda", 0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
+{ "ldda", 0x0c003100, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},

? 0x0c001120, 0xfc1ff3e0

Shouldn't a=0, m=1 and im5=0?

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#2 lore raw
In reply to Grant Grundler

Grant,

Quoted 3 lines

{ "ldwa", 0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT},
{ "ldwa", 0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldwa", 0x0c0031a0, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},

? 0x0c0011a0, 0xfc1ff3e0

Quoted 3 lines

{ "ldda", 0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
{ "ldda", 0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
+{ "ldda", 0x0c003100, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},

? 0x0c001120, 0xfc1ff3e0

Shouldn't a=0, m=1 and im5=0?

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#3 lore raw
Quoted 4 lines · John David Anglin
Quoted 1 line

+{ "ldda", 0x0c003100, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},

? 0x0c001120, 0xfc1ff3e0

Shouldn't a=0, m=1 and im5=0?

yes - I thought I did that.
I laid out the bits on paper and then converted to hex. I'll review tonight but trust you can get them right :^)

thanks,
grant

#6 lore raw
In reply to John David Anglin
Quoted 4 lines · John David Anglin
Quoted 1 line

+{ "ldda", 0x0c003100, 0xfc1ff3d0, "cocc@(b),t", pa20, FLAG_STRICT},

? 0x0c001120, 0xfc1ff3e0

Shouldn't a=0, m=1 and im5=0?

yes - I thought I did that.
I laid out the bits on paper and then converted to hex. I'll review tonight but trust you can get them right :^)

thanks,
grant

#4 lore raw
In reply to Grant Grundler

I checked, and John's encodings are correct.

-- Jim

Quoted 28 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Grant Grundler
Sent: Friday, January 31, 2003 11:19 AM
To: John David Anglin
Cc: [email protected]; [email protected]
Subject: Re: [parisc-linux] PATCH hppa ordered load absolute ops

Quoted 1 line · John David Anglin
Quoted 1 line

+{ "ldda", 0x0c003100, 0xfc1ff3d0, "cocc@(b),t",

pa20, FLAG_STRICT},

Quoted 3 lines

? 0x0c001120, 0xfc1ff3e0

Shouldn't a=0, m=1 and im5=0?

yes - I thought I did that.
I laid out the bits on paper and then converted to hex. I'll review tonight but trust you can get them right :^)

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

#5 lore raw
In reply to Grant Grundler

I checked, and John's encodings are correct.

-- Jim

Quoted 28 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Grant Grundler
Sent: Friday, January 31, 2003 11:19 AM
To: John David Anglin
Cc: [email protected]; [email protected]
Subject: Re: [parisc-linux] PATCH hppa ordered load absolute ops

Quoted 1 line · John David Anglin
Quoted 1 line

+{ "ldda", 0x0c003100, 0xfc1ff3d0, "cocc@(b),t",

pa20, FLAG_STRICT},

Quoted 3 lines

? 0x0c001120, 0xfc1ff3e0

Shouldn't a=0, m=1 and im5=0?

yes - I thought I did that.
I laid out the bits on paper and then converted to hex. I'll review tonight but trust you can get them right :^)

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