All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Claudio Fontana <cfontana@suse.de>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: target/arm: "define_arm_cp_regs" and similar for KVM
Date: Tue, 2 Mar 2021 12:02:39 +0000	[thread overview]
Message-ID: <CAFEAcA9V9vtCeH9=PWdsab7iFA1YxdgB2F6ocLP0COjjP39YVQ@mail.gmail.com> (raw)
In-Reply-To: <7360ab6a-0613-8300-ef8d-b0c641fbaed1@suse.de>

On Fri, 26 Feb 2021 at 17:27, Claudio Fontana <cfontana@suse.de> wrote:
>
> Hi Peter,
>
> I am trying to find out how to split properly KVM and TCG in target/arm, among other things.
>
> I skipped or stubbed all define_arm_cp_regs and similar functions,
>
> and made a cpregs module that is TCG-only.
>
> Thought it is fine, as we have a kvm_arm_init_cpreg_list that throws away everything TCG-related anyway later:
>
> target/arm/kvm.c:
>
> /* Initialize the ARMCPU cpreg list according to the kernel's
>  * definition of what CPU registers it knows about (and throw away
>  * the previous TCG-created cpreg list).
>  */
> int kvm_arm_init_cpreg_list(ARMCPU *cpu)

It throws away the cpreg *list*, but not the cpreg hash table.
That is, we trust KVM for "what sysregs exist and need to be migrated"
but we still
use the hashtable to find out what QEMU thinks about them and where it stores
them in the CPU state structure if it knows about them. So you still
need to keep the
define_arm_cp_regs stuff to register sysregs. Not doing so will break
any bits of the
code which rely on being able to do "synchronize kernel's idea of
sysreg state to
QEMU" and then "read the register value out of the CPU state struct". It'll also
break visibility of sysregs in the gdbstub.

thanks
-- PMM


  reply	other threads:[~2021-03-02 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 17:27 target/arm: "define_arm_cp_regs" and similar for KVM Claudio Fontana
2021-03-02 12:02 ` Peter Maydell [this message]
2021-03-02 12:04   ` Claudio Fontana

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='CAFEAcA9V9vtCeH9=PWdsab7iFA1YxdgB2F6ocLP0COjjP39YVQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=cfontana@suse.de \
    --cc=qemu-devel@nongnu.org \
    /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.