mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 02:04:05 +08:00
powerpc: Fix endian issues in power7/8 machine check handler
The SLB save area is shared with the hypervisor and is defined as big endian, so we need to byte swap on little endian builds. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
d084775738
commit
a68c33f359
@ -50,12 +50,12 @@ static void flush_and_reload_slb(void)
|
|||||||
if (!slb)
|
if (!slb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
n = min_t(u32, slb->persistent, SLB_MIN_SIZE);
|
n = min_t(u32, be32_to_cpu(slb->persistent), SLB_MIN_SIZE);
|
||||||
|
|
||||||
/* Load up the SLB entries from shadow SLB */
|
/* Load up the SLB entries from shadow SLB */
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
unsigned long rb = slb->save_area[i].esid;
|
unsigned long rb = be64_to_cpu(slb->save_area[i].esid);
|
||||||
unsigned long rs = slb->save_area[i].vsid;
|
unsigned long rs = be64_to_cpu(slb->save_area[i].vsid);
|
||||||
|
|
||||||
rb = (rb & ~0xFFFul) | i;
|
rb = (rb & ~0xFFFul) | i;
|
||||||
asm volatile("slbmte %0,%1" : : "r" (rs), "r" (rb));
|
asm volatile("slbmte %0,%1" : : "r" (rs), "r" (rb));
|
||||||
|
Loading…
Reference in New Issue
Block a user