Re: Lock up when faking MMIO read[bwl] on some machines [WAS: FakingMMIO ops? Fooling a driver]

From: RafaÅ MiÅecki
Date: Sat Jun 18 2011 - 16:52:20 EST


W dniu 18 czerwca 2011 16:43 uÅytkownik RafaÅ MiÅecki
<zajec5@xxxxxxxxx> napisaÅ:
> W dniu 18 czerwca 2011 14:03 uÅytkownik Pekka Paalanen <pq@xxxxxx> napisaÅ:
>> Maybe the driver is doing a 16-bit wide access, and happens to
>> store something else in the other 16/48 bits of RAX?
>
> OK, attached is updated version of my patch. I think we can get some
> clue from dmesgs with this patch applied.
>
>
> My system (working):
> [ Â 74.472502] mmiotrace: ZAJEC: overwriting 0x27 with 0xFFFF
> [ Â 74.472511] mmiotrace: [ZAJEC] opcode is 0x8B
> [ Â 74.472515] mmiotrace: [ZAJEC] prf info: shorted:1; enlarged:0, rexr:0, rex:0
> [ Â 74.472517] mmiotrace: [ZAJEC] register is 0x0
> [ Â 74.472520] mmiotrace: [ZAJEC] overwritting 2-byte value 0x0514 with 0xFFFF
> [ Â 74.472523] mmiotrace: [ZAJEC] overwritting resulted in 0xFFFF
>
> [ Â 74.487081] mmiotrace: ZAJEC: overwriting 0x20 with 0xFFFF
> [ Â 74.487086] mmiotrace: [ZAJEC] opcode is 0x8B
> [ Â 74.487089] mmiotrace: [ZAJEC] prf info: shorted:1; enlarged:0, rexr:0, rex:0
> [ Â 74.487092] mmiotrace: [ZAJEC] register is 0x0
> [ Â 74.487095] mmiotrace: [ZAJEC] overwritting 2-byte value 0x427E with 0xFFFF
> [ Â 74.487097] mmiotrace: [ZAJEC] overwritting resulted in 0xFFFF
>
>
> MacBook (with real overwritting commenet out!):
> [ Â228.248715] mmiotrace: ZAJEC: overwriting 0x810 with 0xFFFF
> [ Â228.254227] mmiotrace: [ZAJEC] opcode is 0xB70F
> [ Â228.259784] mmiotrace: [ZAJEC] prf info: shorted:0; enlarged:0, rexr:0, rex:0
> [ Â228.265399] mmiotrace: [ZAJEC] register is 0x0
> [ Â228.270955] mmiotrace: [ZAJEC] overwritting 4-byte value 0x00000000
> with 0xFFFF
> [ Â228.276597] mmiotrace: [ZAJEC] overwritting resulted in 0x00000000
>
> [ Â228.284284] mmiotrace: ZAJEC: overwriting 0x810 with 0xFFFF
> [ Â228.289818] mmiotrace: [ZAJEC] opcode is 0xB70F
> [ Â228.295250] mmiotrace: [ZAJEC] prf info: shorted:0; enlarged:0, rexr:0, rex:0
> [ Â228.300838] mmiotrace: [ZAJEC] register is 0x0
> [ Â228.306339] mmiotrace: [ZAJEC] overwritting 4-byte value 0x00000000
> with 0xFFFF
> [ Â228.311905] mmiotrace: [ZAJEC] overwritting resulted in 0x00000000
>
>
> It's 2-byte vs. 4-byte. I suspect this can be the source of our
> problem. Writing u16 0xFFFF value as u32 write.

Ohh, that was so stupid...

Writing 0xFFFF to PHY register 0x810 causes lockup on BCM4331! That's
all! My code is working fine, just some bits in 0xFFFF value are
really not friendly for the hardware.

--
RafaÅ
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/