qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Greg Kurz <gkurz@linux.vnet.ibm.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Marc Zyngier" <marc.zyngier@arm.com>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"bharata@linux.vnet.ibm.com" <bharata@linux.vnet.ibm.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v3 3/4] target-ppc: ppc can be either endian
Date: Wed, 07 May 2014 13:54:36 +0200	[thread overview]
Message-ID: <536A1EFC.4060405@suse.de> (raw)
In-Reply-To: <20140507121924.3503e110@bahia.local>

On 05/07/2014 12:19 PM, Greg Kurz wrote:
> On Wed, 7 May 2014 11:41:10 +0200
> Alexander Graf <agraf@suse.de> wrote:
>
>>
>>> Am 07.05.2014 um 11:26 schrieb Peter Maydell <peter.maydell@linaro.org>:
>>>
>>>> On 7 May 2014 10:09, Alexander Graf <agraf@suse.de> wrote:
>>>> I don't think we should overengineer hacks for legacy virtio.
>>> Agreed. So what's our final conclusion: virtio endianness
>>> is the endianness of the guest kernel at the point where
>>> it triggers a reset of the virtio device, yes?
>> I just realized we're talking about virtio in a non-virtio thread. This patch set is about core dump support which is different from virtio bi-endian support. While both may end up at the same logic, I don't like the idea to mix them. This function is PPC internal.
>>
>> Alex
>>
> Correct and now I have this feeling about using LPCR_ILE versus MSR_LE...
>
> LPCR_ILE reflects the interrupt vector endianness. It is set during early boot
> by the guest kernel according to the desired endianness. MSR_LE gives the
> current endian mode for the cpu.
>
> The idea is that you need to rely on LPCR_ILE when you peek from the host
> because you lack context and MSR_LE may be have been temporarily changed.
> This is clearly the case for dump support.
>
> Now when it comes to virtio, we cache the endianness at device reset time: MSR_LE from
> current_cpu should reflect the guest kernel endianness, no ?
>
> In this case we could end up like what's being currently discussed with ARM:
>
> http://www.spinics.net/lists/kvm-arm/msg09099.html
> http://www.spinics.net/lists/kvm-arm/msg09091.html
>
> Alex,
>
> If we agree that current_cpu->MSR_LE does the job when the guest kernel resets
> the device, then I guess we don't even need this patch...

Either one works for me as long as we put it into a spec. No solution 
will be able to fulfill all cases.

The uglyness about the current_cpu bit is that devices are usually not 
supposed to know about the cpu accesses come from usually. But then 
again devices shouldn't know about the endianness of a cpu either so I 
guess it's ok to breach layers here.

Rusty, do you have strong feelings either way?


Alex

  reply	other threads:[~2014-05-07 11:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05  8:02 [Qemu-devel] [PATCH v3 0/4] little-endian dump for ppc64 Greg Kurz
2014-05-05  8:04 ` [Qemu-devel] [PATCH v3 1/4] dump: Make DumpState and endian conversion routines available for arch-specific dump code Greg Kurz
2014-05-05  8:05 ` [Qemu-devel] [PATCH v3 2/4] ppc64-dump: Support dump for little endian ppc64 Greg Kurz
2014-05-05 11:04   ` Alexander Graf
2014-05-07  8:20     ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2014-05-07 19:02       ` Tom Musta
2014-05-07 20:54         ` Tom Musta
2014-05-07 20:59           ` Alexander Graf
2014-05-08  7:49           ` Greg Kurz
2014-05-05  8:07 ` [Qemu-devel] [PATCH v3 3/4] target-ppc: ppc can be either endian Greg Kurz
2014-05-06 18:37   ` Peter Maydell
2014-05-07  8:14     ` Greg Kurz
2014-05-07  9:06       ` Peter Maydell
2014-05-07  9:09       ` Alexander Graf
2014-05-07  9:26         ` Peter Maydell
2014-05-07  9:37           ` Alexander Graf
2014-05-07  9:40             ` Peter Maydell
2014-05-07  9:44               ` Alexander Graf
2014-05-07  9:41           ` Alexander Graf
2014-05-07 10:19             ` Greg Kurz
2014-05-07 11:54               ` Alexander Graf [this message]
2014-05-07 12:40                 ` Greg Kurz
2014-05-07 13:04                   ` Alexander Graf
2014-05-08  1:36                 ` Rusty Russell
2014-05-05  8:07 ` [Qemu-devel] [PATCH v2 4/4] ppc64 dump: Set the correct endianness in ELF dump header Greg Kurz
2014-05-05 11:08 ` [Qemu-devel] [PATCH v3 0/4] little-endian dump for ppc64 Alexander Graf
2014-05-07 21:14 ` Andreas Färber

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=536A1EFC.4060405@suse.de \
    --to=agraf@suse.de \
    --cc=afaerber@suse.de \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=marc.zyngier@arm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rusty@rustcorp.com.au \
    /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 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).