* [Qemu-devel] [PATCH] ppc64: set MSR_SF bit
@ 2016-03-16 9:43 Laurent Vivier
2016-03-16 9:48 ` Alexander Graf
2016-03-21 1:28 ` [Qemu-devel] [Qemu-ppc] " David Gibson
0 siblings, 2 replies; 8+ messages in thread
From: Laurent Vivier @ 2016-03-16 9:43 UTC (permalink / raw)
To: Alexander Graf; +Cc: Laurent Vivier, dgibson, thuth, qemu-ppc, qemu-devel
When a qemu-system-ppc64 is started, the 64-bit mode bit
is not set in MSR.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
target-ppc/translate_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index bd0cffc..d7a1aeb 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9663,7 +9663,7 @@ static void ppc_cpu_reset(CPUState *s)
#if defined(TARGET_PPC64)
if (env->mmu_model & POWERPC_MMU_64) {
- env->msr |= (1ULL << MSR_SF);
+ msr |= (1ULL << MSR_SF);
}
#endif
--
2.5.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc64: set MSR_SF bit
2016-03-16 9:43 [Qemu-devel] [PATCH] ppc64: set MSR_SF bit Laurent Vivier
@ 2016-03-16 9:48 ` Alexander Graf
2016-03-16 10:05 ` Laurent Vivier
2016-03-21 1:28 ` [Qemu-devel] [Qemu-ppc] " David Gibson
1 sibling, 1 reply; 8+ messages in thread
From: Alexander Graf @ 2016-03-16 9:48 UTC (permalink / raw)
To: Laurent Vivier; +Cc: dgibson, thuth, qemu-ppc, qemu-devel
On 16.03.16 10:43, Laurent Vivier wrote:
> When a qemu-system-ppc64 is started, the 64-bit mode bit
> is not set in MSR.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
I guess commit 2cf3eb6df552cee74b52de9989e270b74e42847e broke this. I'm
surprised it didn't cause us more problems :).
Reviewed-by: Alexander Graf <agraf@suse.de>
> ---
> target-ppc/translate_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index bd0cffc..d7a1aeb 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -9663,7 +9663,7 @@ static void ppc_cpu_reset(CPUState *s)
>
> #if defined(TARGET_PPC64)
> if (env->mmu_model & POWERPC_MMU_64) {
> - env->msr |= (1ULL << MSR_SF);
> + msr |= (1ULL << MSR_SF);
> }
> #endif
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc64: set MSR_SF bit
2016-03-16 9:48 ` Alexander Graf
@ 2016-03-16 10:05 ` Laurent Vivier
2016-03-16 10:06 ` Alexander Graf
0 siblings, 1 reply; 8+ messages in thread
From: Laurent Vivier @ 2016-03-16 10:05 UTC (permalink / raw)
To: Alexander Graf; +Cc: dgibson, thuth, qemu-ppc, qemu-devel
On 16/03/2016 10:48, Alexander Graf wrote:
>
>
> On 16.03.16 10:43, Laurent Vivier wrote:
>> When a qemu-system-ppc64 is started, the 64-bit mode bit
>> is not set in MSR.
>>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>
> I guess commit 2cf3eb6df552cee74b52de9989e270b74e42847e broke this. I'm
> surprised it didn't cause us more problems :).
Linux kernel is ready to manage that: see enable_64b_mode in
arch/powerpc/kernel/head_64.S
> Reviewed-by: Alexander Graf <agraf@suse.de>
Thanks,
Laurent
>> ---
>> target-ppc/translate_init.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
>> index bd0cffc..d7a1aeb 100644
>> --- a/target-ppc/translate_init.c
>> +++ b/target-ppc/translate_init.c
>> @@ -9663,7 +9663,7 @@ static void ppc_cpu_reset(CPUState *s)
>>
>> #if defined(TARGET_PPC64)
>> if (env->mmu_model & POWERPC_MMU_64) {
>> - env->msr |= (1ULL << MSR_SF);
>> + msr |= (1ULL << MSR_SF);
>> }
>> #endif
>>
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc64: set MSR_SF bit
2016-03-16 10:05 ` Laurent Vivier
@ 2016-03-16 10:06 ` Alexander Graf
2016-03-16 10:30 ` Laurent Vivier
2016-03-16 10:32 ` Thomas Huth
0 siblings, 2 replies; 8+ messages in thread
From: Alexander Graf @ 2016-03-16 10:06 UTC (permalink / raw)
To: Laurent Vivier; +Cc: dgibson, thuth, qemu-ppc, qemu-devel
On 16.03.16 11:05, Laurent Vivier wrote:
> On 16/03/2016 10:48, Alexander Graf wrote:
>>
>>
>> On 16.03.16 10:43, Laurent Vivier wrote:
>>> When a qemu-system-ppc64 is started, the 64-bit mode bit
>>> is not set in MSR.
>>>
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>
>> I guess commit 2cf3eb6df552cee74b52de9989e270b74e42847e broke this. I'm
>> surprised it didn't cause us more problems :).
>
> Linux kernel is ready to manage that: see enable_64b_mode in
> arch/powerpc/kernel/head_64.S
We don't boot Linux directly though, only openBIOS and SLOF :).
Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc64: set MSR_SF bit
2016-03-16 10:06 ` Alexander Graf
@ 2016-03-16 10:30 ` Laurent Vivier
2016-03-16 10:32 ` Thomas Huth
1 sibling, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2016-03-16 10:30 UTC (permalink / raw)
To: Alexander Graf; +Cc: dgibson, thuth, qemu-ppc, qemu-devel
On 16/03/2016 11:06, Alexander Graf wrote:
>
>
> On 16.03.16 11:05, Laurent Vivier wrote:
>> On 16/03/2016 10:48, Alexander Graf wrote:
>>>
>>>
>>> On 16.03.16 10:43, Laurent Vivier wrote:
>>>> When a qemu-system-ppc64 is started, the 64-bit mode bit
>>>> is not set in MSR.
>>>>
>>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>>
>>> I guess commit 2cf3eb6df552cee74b52de9989e270b74e42847e broke this. I'm
>>> surprised it didn't cause us more problems :).
>>
>> Linux kernel is ready to manage that: see enable_64b_mode in
>> arch/powerpc/kernel/head_64.S
>
> We don't boot Linux directly though, only openBIOS and SLOF :).
Same thing in SLOF:
./board-qemu/llfw/startup.S
_start:
...
mfmsr r11 /* grab the current MSR */
li r12,(MSR_SF | MSR_ISF)@highest
sldi r12,r12,48
or r11,r11,r12
mtmsrd r11
isync
And openbios seems to disable it explicitly:
./arch/ppc/qemu/start.S
_entry:
...
/* clear MSR, disable MMU, SF */
[BTW, I've never been able to compile a 64bit version of openbios...]
Laurent
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc64: set MSR_SF bit
2016-03-16 10:06 ` Alexander Graf
2016-03-16 10:30 ` Laurent Vivier
@ 2016-03-16 10:32 ` Thomas Huth
2016-03-16 10:42 ` Alexander Graf
1 sibling, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2016-03-16 10:32 UTC (permalink / raw)
To: Alexander Graf, Laurent Vivier; +Cc: dgibson, qemu-ppc, qemu-devel
On 16.03.2016 11:06, Alexander Graf wrote:
>
>
> On 16.03.16 11:05, Laurent Vivier wrote:
>> On 16/03/2016 10:48, Alexander Graf wrote:
>>>
>>>
>>> On 16.03.16 10:43, Laurent Vivier wrote:
>>>> When a qemu-system-ppc64 is started, the 64-bit mode bit
>>>> is not set in MSR.
>>>>
>>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>>
>>> I guess commit 2cf3eb6df552cee74b52de9989e270b74e42847e broke this. I'm
>>> surprised it didn't cause us more problems :).
>>
>> Linux kernel is ready to manage that: see enable_64b_mode in
>> arch/powerpc/kernel/head_64.S
>
> We don't boot Linux directly though, only openBIOS and SLOF :).
Both, SLOF and OpenBIOS, seem to enable the SF bit manually, too, see:
https://github.com/qemu/openbios/blob/master/arch/ppc/qemu/start.S#L524
https://github.com/aik/SLOF/blob/master/board-qemu/llfw/startup.S#L91
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] ppc64: set MSR_SF bit
2016-03-16 10:32 ` Thomas Huth
@ 2016-03-16 10:42 ` Alexander Graf
0 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2016-03-16 10:42 UTC (permalink / raw)
To: Thomas Huth, Laurent Vivier; +Cc: dgibson, qemu-ppc, qemu-devel
On 16.03.16 11:32, Thomas Huth wrote:
> On 16.03.2016 11:06, Alexander Graf wrote:
>>
>>
>> On 16.03.16 11:05, Laurent Vivier wrote:
>>> On 16/03/2016 10:48, Alexander Graf wrote:
>>>>
>>>>
>>>> On 16.03.16 10:43, Laurent Vivier wrote:
>>>>> When a qemu-system-ppc64 is started, the 64-bit mode bit
>>>>> is not set in MSR.
>>>>>
>>>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>>>
>>>> I guess commit 2cf3eb6df552cee74b52de9989e270b74e42847e broke this. I'm
>>>> surprised it didn't cause us more problems :).
>>>
>>> Linux kernel is ready to manage that: see enable_64b_mode in
>>> arch/powerpc/kernel/head_64.S
>>
>> We don't boot Linux directly though, only openBIOS and SLOF :).
>
> Both, SLOF and OpenBIOS, seem to enable the SF bit manually, too, see:
>
> https://github.com/qemu/openbios/blob/master/arch/ppc/qemu/start.S#L524
>
> https://github.com/aik/SLOF/blob/master/board-qemu/llfw/startup.S#L91
Power up is slightly tricky, as machine state is pushed into the CPU
from the outside FWIW. I think we're "cleanest" if we just consider
power up a reset.
Reset is properly defined as an exception (0x100). For exceptions, the
970MP user manual for example says:
4.5 Exception Definitions
When an exception/interrupt is taken, all bits in the MSR are set to
‘0’, with the following exceptions:
• Exceptions always set MSR[SF] to ‘1’.
So the qemu fix is the correct one IMHO.
Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc64: set MSR_SF bit
2016-03-16 9:43 [Qemu-devel] [PATCH] ppc64: set MSR_SF bit Laurent Vivier
2016-03-16 9:48 ` Alexander Graf
@ 2016-03-21 1:28 ` David Gibson
1 sibling, 0 replies; 8+ messages in thread
From: David Gibson @ 2016-03-21 1:28 UTC (permalink / raw)
To: Laurent Vivier; +Cc: dgibson, thuth, qemu-ppc, Alexander Graf, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
On Wed, Mar 16, 2016 at 10:43:52AM +0100, Laurent Vivier wrote:
> When a qemu-system-ppc64 is started, the 64-bit mode bit
> is not set in MSR.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Applied to ppc-for-2.6, thanks.
> ---
> target-ppc/translate_init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index bd0cffc..d7a1aeb 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -9663,7 +9663,7 @@ static void ppc_cpu_reset(CPUState *s)
>
> #if defined(TARGET_PPC64)
> if (env->mmu_model & POWERPC_MMU_64) {
> - env->msr |= (1ULL << MSR_SF);
> + msr |= (1ULL << MSR_SF);
> }
> #endif
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-03-21 1:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16 9:43 [Qemu-devel] [PATCH] ppc64: set MSR_SF bit Laurent Vivier
2016-03-16 9:48 ` Alexander Graf
2016-03-16 10:05 ` Laurent Vivier
2016-03-16 10:06 ` Alexander Graf
2016-03-16 10:30 ` Laurent Vivier
2016-03-16 10:32 ` Thomas Huth
2016-03-16 10:42 ` Alexander Graf
2016-03-21 1:28 ` [Qemu-devel] [Qemu-ppc] " David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).