All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: Alexander Graf <agraf@suse.de>, Thomas Huth <thuth@redhat.com>,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Cc: drjones@redhat.com, dgibson@redhat.com, pbonzini@redhat.com
Subject: Re: [PATCH] powerpc: enable 64-bit mode
Date: Tue, 15 Mar 2016 20:12:14 +0000	[thread overview]
Message-ID: <56E86C9E.10408@redhat.com> (raw)
In-Reply-To: <56E85807.5050903@suse.de>



On 15/03/2016 19:44, Alexander Graf wrote:
> 
> 
> On 15.03.16 19:43, Thomas Huth wrote:
>> On 15.03.2016 14:15, Laurent Vivier wrote:
>>> When they are started, processors are in 32-bit mode,
>>> as we are testing ppc64 processors, enable the 64bit mode
>>> on starting.
>>>
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>> ---
>>>  powerpc/cstart64.S | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/powerpc/cstart64.S b/powerpc/cstart64.S
>>> index c87e3d6..634b854 100644
>>> --- a/powerpc/cstart64.S
>>> +++ b/powerpc/cstart64.S
>>> @@ -18,6 +18,15 @@
>>>  .globl start
>>>  start:
>>>  	FIXUP_ENDIAN
>>> +
>>> +	/* enable 64-bit mode */
>>> +	mfmsr	r11
>>> +	li	r12,-1
>>> +	rldicr	r12,r12,0,0
>>
>> Nice idea to set the highest bit, I didn't know that one yet :-)
>>
>>> +	or	r11,r11,r12
>>> +	mtmsrd	r11
>>> +	isync
>>
>> Looks good!
>>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>
>>
>> PS: As far as I can see, the C code has already been compiled for 64
>> bits ... how did that work if it has been run in 32-bit mode so far??
> 
> And why would we enter a 64bit CPU without MSR_SF set?

I don't know, but:

When I start "qemu-system-ppc64 -machine pseries -s -S" and check the
MSR with gdb, the MSR is always set to 0 (or "info registers" in
monitor). It's why I've added this initialization.

So, perhaps there is  a bug in QEMU?

[Perhaps "env->msr |= (1ULL << MSR_SF)" is overwritten by the following
hreg_store_msr(env, msr, 1);"?]


Laurent




WARNING: multiple messages have this Message-ID (diff)
From: Laurent Vivier <lvivier@redhat.com>
To: Alexander Graf <agraf@suse.de>, Thomas Huth <thuth@redhat.com>,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org
Cc: drjones@redhat.com, dgibson@redhat.com, pbonzini@redhat.com
Subject: Re: [PATCH] powerpc: enable 64-bit mode
Date: Tue, 15 Mar 2016 21:12:14 +0100	[thread overview]
Message-ID: <56E86C9E.10408@redhat.com> (raw)
In-Reply-To: <56E85807.5050903@suse.de>



On 15/03/2016 19:44, Alexander Graf wrote:
> 
> 
> On 15.03.16 19:43, Thomas Huth wrote:
>> On 15.03.2016 14:15, Laurent Vivier wrote:
>>> When they are started, processors are in 32-bit mode,
>>> as we are testing ppc64 processors, enable the 64bit mode
>>> on starting.
>>>
>>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>>> ---
>>>  powerpc/cstart64.S | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/powerpc/cstart64.S b/powerpc/cstart64.S
>>> index c87e3d6..634b854 100644
>>> --- a/powerpc/cstart64.S
>>> +++ b/powerpc/cstart64.S
>>> @@ -18,6 +18,15 @@
>>>  .globl start
>>>  start:
>>>  	FIXUP_ENDIAN
>>> +
>>> +	/* enable 64-bit mode */
>>> +	mfmsr	r11
>>> +	li	r12,-1
>>> +	rldicr	r12,r12,0,0
>>
>> Nice idea to set the highest bit, I didn't know that one yet :-)
>>
>>> +	or	r11,r11,r12
>>> +	mtmsrd	r11
>>> +	isync
>>
>> Looks good!
>>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>
>>
>> PS: As far as I can see, the C code has already been compiled for 64
>> bits ... how did that work if it has been run in 32-bit mode so far??
> 
> And why would we enter a 64bit CPU without MSR_SF set?

I don't know, but:

When I start "qemu-system-ppc64 -machine pseries -s -S" and check the
MSR with gdb, the MSR is always set to 0 (or "info registers" in
monitor). It's why I've added this initialization.

So, perhaps there is  a bug in QEMU?

[Perhaps "env->msr |= (1ULL << MSR_SF)" is overwritten by the following
hreg_store_msr(env, msr, 1);"?]


Laurent




  parent reply	other threads:[~2016-03-15 20:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 13:15 [PATCH] powerpc: enable 64-bit mode Laurent Vivier
2016-03-15 13:15 ` Laurent Vivier
2016-03-15 13:43 ` Laurent Vivier
2016-03-15 13:43   ` Laurent Vivier
2016-03-15 18:43 ` Thomas Huth
2016-03-15 18:43   ` Thomas Huth
2016-03-15 18:44   ` Alexander Graf
2016-03-15 18:44     ` Alexander Graf
2016-03-15 19:10     ` Thomas Huth
2016-03-15 19:10       ` Thomas Huth
2016-03-15 20:12     ` Laurent Vivier [this message]
2016-03-15 20:12       ` Laurent Vivier
2016-03-16  9:45     ` Laurent Vivier
2016-03-16  9:45       ` Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E86C9E.10408@redhat.com \
    --to=lvivier@redhat.com \
    --cc=agraf@suse.de \
    --cc=dgibson@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.