diff mbox

ppc: regression in 2.7.0-rc3 on rfi/rfid/hrfi instructions

Message ID 1472103184.2246.77.camel@kernel.crashing.org
State New
Headers show

Commit Message

Benjamin Herrenschmidt Aug. 25, 2016, 5:33 a.m. UTC
On Thu, 2016-08-25 at 11:31 +1000, Benjamin Herrenschmidt wrote:

> Interesting, the problem is only with 603, not 604. I think I might
> have broken something with the 603 SW TLB loading stuff which is
> a bit weird, I'll have a look. Thanks.

This fixes it to some extent... It gets to "press enter to activate
this console" but from there things don't work properly unless I
emulate a 604. I suspect there are still issues with the 603 SW
TLB mode.

Comments

Hervé Poussineau Aug. 25, 2016, 8:14 p.m. UTC | #1
Le 25/08/2016 à 07:33, Benjamin Herrenschmidt a écrit :
> On Thu, 2016-08-25 at 11:31 +1000, Benjamin Herrenschmidt wrote:
>>
>> Interesting, the problem is only with 603, not 604. I think I might
>> have broken something with the 603 SW TLB loading stuff which is
>> a bit weird, I'll have a look. Thanks.
>
> This fixes it to some extent... It gets to "press enter to activate
> this console" but from there things don't work properly unless I
> emulate a 604. I suspect there are still issues with the 603 SW
> TLB mode.
>
> --- a/target-ppc/excp_helper.c
> +++ b/target-ppc/excp_helper.c
> @@ -959,8 +959,13 @@ static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr)
>  {
>      CPUState *cs = CPU(ppc_env_get_cpu(env));
>
> -    /* MSR:POW cannot be set by any form of rfi */
> -    msr &= ~(1ULL << MSR_POW);
> +    /* These bits cannot be set by RFI on non-BookE systems and so must
> +     * be filtered out. 6xx and 7xxx with SW TLB management will put
> +     * TLB related junk in there among other things.
> +     */
> +    if (env->excp_model &= POWERPC_EXCP_BOOKE) {
> +            msr &= ~(target_ulong)0xf0000;
> +    }
>
>  #if defined(TARGET_PPC64)
>      /* Switching to 32-bit ? Crop the nip */
> @@ -990,7 +995,6 @@ void helper_rfi(CPUPPCState *env)
>      do_rfi(env, env->spr[SPR_SRR0], env->spr[SPR_SRR1] & 0xfffffffful);
>  }
>
> -#define MSR_BOOK3S_MASK
>  #if defined(TARGET_PPC64)
>  void helper_rfid(CPUPPCState *env)
>  {
>

Fixes: a2e71b28e832346409efc795ecd1f0a2bcb705a3
Reported-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Hervé Poussineau <hpoussin@reactos.org>

For the problem to press enter to "activate this console", this is another regression.
However, I was unable to pin-point it to a specific commit (too much interwinded regressions)
It was working in 2.6.0 (commit a2e71b28e832346409efc795ecd1f0a2bcb705a3)

Hervé
Benjamin Herrenschmidt Aug. 25, 2016, 9:27 p.m. UTC | #2
On Thu, 2016-08-25 at 22:14 +0200, Hervé Poussineau wrote:

> Fixes: a2e71b28e832346409efc795ecd1f0a2bcb705a3
> Reported-by: Hervé Poussineau <hpoussin@reactos.org>
> Tested-by: Hervé Poussineau <hpoussin@reactos.org>
> 
> For the problem to press enter to "activate this console", this is
> another regression.
> However, I was unable to pin-point it to a specific commit (too much
> interwinded regressions)
> It was working in 2.6.0 (commit
> a2e71b28e832346409efc795ecd1f0a2bcb705a3)

Well, if you can get me that kernel source, I may have more chances to
track this down ;-)

Cheers,
Ben.
Hervé Poussineau Aug. 26, 2016, 6:43 a.m. UTC | #3
Le 25/08/2016 à 23:27, Benjamin Herrenschmidt a écrit :
> On Thu, 2016-08-25 at 22:14 +0200, Hervé Poussineau wrote:
>>
>> Fixes: a2e71b28e832346409efc795ecd1f0a2bcb705a3
>> Reported-by: Hervé Poussineau <hpoussin@reactos.org>
>> Tested-by: Hervé Poussineau <hpoussin@reactos.org>
>>
>> For the problem to press enter to "activate this console", this is
>> another regression.
>> However, I was unable to pin-point it to a specific commit (too much
>> interwinded regressions)
>> It was working in 2.6.0 (commit
>> a2e71b28e832346409efc795ecd1f0a2bcb705a3)
>
> Well, if you can get me that kernel source, I may have more chances to
> track this down ;-)

Of course, I don't have the exact source :)

Here is the dmesg of the running system on QEMU 2.6.0:

Memory BAT mapping: BAT2=128Mb, BAT3=0Mb, residual: 0Mb
Total memory = 128MB; using 512kB for hash table (at c0300000)
Linux version 2.4.18 (root@Juneau-lug) (gcc version 2.95.4 20011002 (Debian prerelease)) #5 Wed May 21 23:50:43 AKDT 2003
PReP architecture
On node 0 totalpages: 32768
zone(0): 32768 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=/dev/ttyS0,9600 console=tty0 ether=5,0x210,eth0 ether=11,0x300,eth1 ramdisk_size=8192 root=/dev/ram
time_init: decrementer frequency = 68.925649 MHz
Console: colour VGA+ 80x25
Calibrating delay loop... 691.40 BogoMIPS
Memory: 124740k available (1656k kernel code, 856k data, 248k init, 0k highmem)
Dentry-cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
Buffer-cache hash table entries: 8192 (order: 3, 32768 bytes)
Page-cache hash table entries: 32768 (order: 5, 131072 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
Fixup res 2 (200) of dev 00:0d.0: 31000000 -> f1000000
Fixup res 6 (7201) of dev 00:0d.0: f1010000 -> b1010000
Setting PCI interrupts for a "Mesquite cPCI (MCP750)"
PCI: Cannot allocate resource region 0 of PCI bridge 0
PCI: resource is 0..fffffff (100), parent c020105c
PCI:00:0d.0: Resource 2: f1000000-f1000fff (f=200)
PCI: Switching off ROM of 00:0d.0
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.10 (20020120) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x0
Detected PS/2 Mouse Port.
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
request_module[parport_lowlevel]: Root fs not mounted
lp: driver loaded but no devices found
rtc: I/O port 112 is not free.
block: 128 slots per queue, batch=32
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
hdc: QEMU DVD-ROM, ATAPI CD/DVD-ROM drive
hdc: IRQ probe failed (0x0)
hdd: IRQ probe failed (0x0)
hdd: IRQ probe failed (0x0)
ide1 at 0x170-0x177,0x376 on irq 13
hdc: ATAPI 4X DVD-ROM drive, 512kB Cache
Uniform CD-ROM driver Revision: 3.12
ide-floppy driver 0.97.sv
loop: loaded (max 8 devices)
ide-floppy driver 0.97.sv
SCSI subsystem driver Revision: 1.00
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Macintosh non-volatile memory driver v1.0
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb.c: registered new driver hid
hid-core.c: v1.8 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>
hid-core.c: USB HID support drivers
mice: PS/2 mouse device common for all mice
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 1024 buckets, 8Kbytes
TCP: Hash tables configured (established 8192 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 852k freed
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 248k init 48k pmac 8k chrp 12k openfirmware

According to "INSTALLING LINUX" section of http://www.juneau-lug.org/sandalfoot.php
This is a 2.4.18 Debian kernel (2.2 or 3.0, I didn't understood), where is applied a patch from Sven Dickert, available at http://www.remote.org/sven/ppc/40p.patch

Hervé
diff mbox

Patch

--- a/target-ppc/excp_helper.c
+++ b/target-ppc/excp_helper.c
@@ -959,8 +959,13 @@  static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr)
 {
     CPUState *cs = CPU(ppc_env_get_cpu(env));
 
-    /* MSR:POW cannot be set by any form of rfi */
-    msr &= ~(1ULL << MSR_POW);
+    /* These bits cannot be set by RFI on non-BookE systems and so must
+     * be filtered out. 6xx and 7xxx with SW TLB management will put
+     * TLB related junk in there among other things.
+     */
+    if (env->excp_model &= POWERPC_EXCP_BOOKE) {
+            msr &= ~(target_ulong)0xf0000;
+    }
 
 #if defined(TARGET_PPC64)
     /* Switching to 32-bit ? Crop the nip */
@@ -990,7 +995,6 @@  void helper_rfi(CPUPPCState *env)
     do_rfi(env, env->spr[SPR_SRR0], env->spr[SPR_SRR1] & 0xfffffffful);
 }
 
-#define MSR_BOOK3S_MASK
 #if defined(TARGET_PPC64)
 void helper_rfid(CPUPPCState *env)
 {