Skip to contentSkip to conversation

spapr: Clear LPCR_ILE during reset

PATCH In review Anton Blanchard 3 participants 3 messages Mar 6, 2014 – Mar 20, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spapr: Clear LPCR_ILE during reset

Since an OS can set LPCR_ILE we must clear it during reset. Otherwise if we reset into an OS with a different endian we die when we take the first exception.

This fixes an issue seen on both full emulation and KVM.

---

hw/ppc/spapr.c +2 -0
index 93d02c1..4d45197 100644
@@ -739,6 +739,8 @@ static void spapr_cpu_reset(void *opaque)
 
     env->spr[SPR_HIOR] = 0;
 
+    env->spr[SPR_LPCR] &= ~LPCR_ILE;
+
     env->external_htab = (uint8_t *)spapr->htab;
     env->htab_base = -1;
     env->htab_mask = HTAB_SIZE(spapr) - 1;
#1 lore raw

Am 06.03.2014 05:06, schrieb Anton Blanchard:

Quoted 15 lines

Since an OS can set LPCR_ILE we must clear it during reset. Otherwise if we reset into an OS with a different endian we die when we take the first exception.

This fixes an issue seen on both full emulation and KVM.

---

hw/ppc/spapr.c +0 -0
index 93d02c1..4d45197 100644

hw/ppc/spapr.c static void spapr_cpu_reset(void *opaque) · line 742

Quoted 4 lines
hw/ppc/spapr.c +1 -0
@@ -739,6 +739,8 @@ static void spapr_cpu_reset(void *opaque)
 
     env->spr[SPR_HIOR] = 0;
 
+    env->spr[SPR_LPCR] &= ~LPCR_ILE;

I guess this is superseded by the generalized SPR reset?

Regards,
Andreas

Quoted 5 lines
hw/ppc/spapr.c +1 -0
+
     env->external_htab = (uint8_t *)spapr->htab;
     env->htab_base = -1;
     env->htab_mask = HTAB_SIZE(spapr) - 1;
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#2 lore raw
Quoted 17 lines · Andreas Färber

Am 06.03.2014 05:06, schrieb Anton Blanchard:

Quoted 16 lines

Since an OS can set LPCR_ILE we must clear it during reset. Otherwise if we reset into an OS with a different endian we die when we take the first exception.

This fixes an issue seen on both full emulation and KVM.

---

hw/ppc/spapr.c +0 -0
index 93d02c1..4d45197 100644
@@ -739,6 +739,8 @@ static void spapr_cpu_reset(void *opaque)
 
Quoted 5 lines

hw/ppc/spapr.c static void spapr_cpu_reset(void *opaque) · line 742

Quoted 3 lines
hw/ppc/spapr.c +1 -0
     env->spr[SPR_HIOR] = 0;
 
+    env->spr[SPR_LPCR] &= ~LPCR_ILE;

I guess this is superseded by the generalized SPR reset?

Yes, it is. I tried my patch with Anton's testcase.

Quoted 11 lines

Regards,
Andreas

Quoted 5 lines
hw/ppc/spapr.c +1 -0
+
     env->external_htab = (uint8_t *)spapr->htab;
     env->htab_base = -1;
     env->htab_mask = HTAB_SIZE(spapr) - 1;
Signature · 1 line
Alexey