qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>,
	mjaggi@caviumnetworks.com, "Nair,
	Jayachandran" <Jayachandran.Nair@cavium.com>,
	"quintela@redhat.com" <quintela@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"eric.auger@redhat.com" <eric.auger@redhat.com>,
	"Jaggi, Manish" <Manish.Jaggi@cavium.com>,
	"Nowicki, Tomasz" <Tomasz.Nowicki@cavium.com>
Subject: Re: [Qemu-devel] [RFC] [PATCH 0/3] qemu: arm: Migration between machines with different MIDR values
Date: Fri, 5 Oct 2018 10:17:50 +0100	[thread overview]
Message-ID: <CAFEAcA-FuXeqp7LvuzSArh7TXYHm8WR18QOPD8VsubpnWP=+1w@mail.gmail.com> (raw)
In-Reply-To: <20181005084835.GB2285@work-vm>

On 5 October 2018 at 09:48, Dr. David Alan Gilbert <dgilbert@redhat.com> wrote:
> * Peter Maydell (peter.maydell@linaro.org) wrote:
>> On 4 October 2018 at 16:05, Andrew Jones <drjones@redhat.com> wrote:
>> > On Tue, Oct 02, 2018 at 02:07:38PM +0100, Peter Maydell wrote:
>> >> Hi; thanks for this patch. The issue I see with this patch
>> >> is that the KVM/ARM QEMU approach to system registers so far
>> >> has been "the kernel knows about these and it is in control".
>> >> So we ask the kernel for the list of registers, and just save
>> >> and restore those. That would suggest that if there are sysregs
>> >> where it's OK in fact to ignore a difference between two constant
>> >> register values, it should be the kernel doing the "actually, this
>> >> mismatch is OK" behaviour...
>> >
>> > I don't think the kernel should have to maintain all that logic. If a user
>> > wants to load guest registers, then the kernel should do it, as long as
>> > it's safe from the host's integrity/security PoV, and the hardware would
>> > actually support it. Anything that can only break the guest, but not the
>> > host, should be allowed. The KVM userspace can certainly ask the kernel
>> > what it recommends first (i.e. read the invariant registers first, before
>> > deciding what to write), but the decision of what to write should be left
>> > up to the user.
>>
>> I can see the logic of that approach. But right now QEMU
>> userspace knows basically nothing about the system registers
>> when we're using KVM: all that knowledge is in the kernel.
>> So we don't have a place really to put policy info (and
>> not really anywhere to put policy info that depends on the
>> host CPU type when mostly we let the kernel care about that).
>
> It would seem wrong to put this logic in the kernel because the
> priviliged code should be as small as possible.

Agreed. But if we want to move to "QEMU knows about all the
possible host CPUs" that's a fair-sized design change and
needs more than the minimalist approach this patch has.

thanks
-- PMM

  reply	other threads:[~2018-10-05  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1537868529.git.manish.jaggi@cavium.com>
2018-10-02 13:07 ` [Qemu-devel] [RFC] [PATCH 0/3] qemu: arm: Migration between machines with different MIDR values Peter Maydell
2018-10-04 15:05   ` Andrew Jones
2018-10-04 15:26     ` Peter Maydell
2018-10-05  8:48       ` Dr. David Alan Gilbert
2018-10-05  9:17         ` Peter Maydell [this message]
     [not found] ` <2a127056e5c1a1edb4a5d8e093bc67467685e0ac.1537868529.git.manish.jaggi@cavium.com>
2018-10-04 15:15   ` [Qemu-devel] [RFC] [PATCH 3/3] arm: Skip invariant register restore Andrew Jones

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='CAFEAcA-FuXeqp7LvuzSArh7TXYHm8WR18QOPD8VsubpnWP=+1w@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=Jayachandran.Nair@cavium.com \
    --cc=Manish.Jaggi@cavium.com \
    --cc=Tomasz.Nowicki@cavium.com \
    --cc=dgilbert@redhat.com \
    --cc=drjones@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@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 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).