All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: Narayana Murty N <nnmlinux@linux.ibm.com>,
	danielhb413@gmail.com, clg@kaod.org, david@gibson.dropbear.id.au,
	groug@kaod.org
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	npiggin@linux.ibm.com, vajain21@linux.ibm.com,
	harshpb@linux.ibm.com, sbhat@linux.ibm.com
Subject: Re: [PATCH] target: ppc: Correctly initialize HILE in HID-0 for book3s processors
Date: Thu, 20 Apr 2023 15:19:56 -0300	[thread overview]
Message-ID: <87v8hq8lgz.fsf@suse.de> (raw)
In-Reply-To: <20230420145055.10196-1-nnmlinux@linux.ibm.com>

Narayana Murty N <nnmlinux@linux.ibm.com> writes:

> On PPC64 the HILE(Hypervisor Interrupt Little Endian) bit in HID-0
> register needs to be initialized as per isa 3.0b[1] section
> 2.10. This bit gets copied to the MSR_LE when handling interrupts that
> are handled in HV mode to establish the Endianess mode of the interrupt
> handler.
>
> Qemu's ppc_interrupts_little_endian() depends on HILE to determine Host
> endianness which is then used to determine the endianess of the guest dump.
>

Not quite. We use the interrupt endianness as a proxy to guest
endianness to avoid reading MSR_LE at an inopportune moment when the
guest is switching endianness. This is not dependent on host
endianness. The HILE check is used when taking a memory dump of a
HV-capable machine such as the emulated powernv.

I think the actual issue might be that we're calling
ppc_interrupts_little_endian with hv=true for the dump.

> Currently the HILE bit is never set in the HID0 register even if the
> qemu is running in Little-Endian mode. This causes the guest dumps to be
> always taken in Big-Endian byte ordering. A guest memory dump of a
> Little-Endian guest running on Little-Endian qemu guest fails with the
> crash tool as illustrated below:
>

Could you describe in more detail what is your setup? Specifically
whether both guests are running TCG or KVM (info kvm) and the state of
the nested-hv capability in QEMU command line.


  parent reply	other threads:[~2023-04-20 18:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 14:50 [PATCH] target: ppc: Correctly initialize HILE in HID-0 for book3s processors Narayana Murty N
2023-04-20 15:52 ` Harsh Prateek Bora
2023-04-20 18:19 ` Fabiano Rosas [this message]
2023-04-28  4:53   ` Vaibhav Jain
2023-04-28 14:30     ` Fabiano Rosas
2023-05-04  5:35       ` Narayana Murty N
2023-05-15  6:32       ` Nicholas Piggin
2023-05-16  1:54         ` Narayana Murty N
2023-05-16  3:13           ` Nicholas Piggin

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=87v8hq8lgz.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=harshpb@linux.ibm.com \
    --cc=nnmlinux@linux.ibm.com \
    --cc=npiggin@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sbhat@linux.ibm.com \
    --cc=vajain21@linux.ibm.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.