diff mbox

spapr: Clear LPCR_ILE during reset

Message ID 20140306150652.1fc1313b@kryten
State New
Headers show

Commit Message

Anton Blanchard March 6, 2014, 4:06 a.m. UTC
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.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Comments

Andreas Färber March 20, 2014, 1:08 a.m. UTC | #1
Am 06.03.2014 05:06, schrieb Anton Blanchard:
> 
> 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.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 93d02c1..4d45197 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -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

> +
>      env->external_htab = (uint8_t *)spapr->htab;
>      env->htab_base = -1;
>      env->htab_mask = HTAB_SIZE(spapr) - 1;
>
Alexey Kardashevskiy March 20, 2014, 2:57 a.m. UTC | #2
On 03/20/2014 12:08 PM, Andreas Färber wrote:
> Am 06.03.2014 05:06, schrieb Anton Blanchard:
>>
>> 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.
>>
>> Signed-off-by: Anton Blanchard <anton@samba.org>
>> ---
>>
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index 93d02c1..4d45197 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -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?


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


> 
> Regards,
> Andreas
> 
>> +
>>      env->external_htab = (uint8_t *)spapr->htab;
>>      env->htab_base = -1;
>>      env->htab_mask = HTAB_SIZE(spapr) - 1;
>>
> 
>
diff mbox

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 93d02c1..4d45197 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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;