qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 02/11] target/ppc: moved ppc_store_sdr1 to cpu.c


From: David Gibson
Subject: Re: [PATCH 02/11] target/ppc: moved ppc_store_sdr1 to cpu.c
Date: Mon, 7 Jun 2021 13:50:28 +1000

On Mon, May 31, 2021 at 03:17:47PM -0300, Bruno Piazera Larsen wrote:
> 
> On 13/05/2021 00:50, David Gibson wrote:
> > On Wed, May 12, 2021 at 11:08:04AM -0300, Bruno Larsen (billionai) wrote:
> > > Moved this function that is required in !TCG cases into a
> > > common code file
> > The reasons it's needed by !TCG are kind of bogus, related to
> > weirdness in the way KVM PR works.  But it's fair not to care about
> > that right now, so, applied to ppc-for-6.1.
> Now that the future is here, I was looking into why might the reasons be
> bogus. From what I can see, what should be happening is just storing what
> was retrieved by the kvm ioctl, right? Am I missing something?

Actually, I was mixing this up with something else.  We invoke
ppc_store_sdr1() in several places from !TCG code.  From explicitly
KVM code in kvmppc_book_get_sregs() - since we more or less trust KVM
we could in theory just store directly to the value.  However we also
use it in common code in machine.c in the loadvm path.  I don't want
to bypass ppc_store_sdr1() there so that we have a common place for
all SDR1 updates, for sanity checking and any secondary alterations we
need.

So having this in common code is the right thing to do.

(In case you care, the "bogus reason" thing I was thinking of in
connection to SDR1 handling is actually the special
encode_hpt_for_kvm_pr() case in kvmppc_but_books_sregs.  That's there
because KVM PR requires us to inform us of the *qemu userspace*
location of the hash table for PAPR guests via the SDR1 value, which
doesn't really make sense)

-- 
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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]