From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] KVM: PPC: Add SPR emulation exits
Date: Sun, 07 Oct 2012 15:34:55 +0200 [thread overview]
Message-ID: <507184FF.6090407@redhat.com> (raw)
In-Reply-To: <40230564-51D2-482B-A316-5C84D0C9DEF4@suse.de>
On 10/07/2012 03:30 PM, Alexander Graf wrote:
>>>
>>> Yup. The new APIC MSR registers would also have the same problem, right?
>>
>> Which new APIC MSR registers?
>
> I thought x2apic can be accessed through MSRs? If you want to emulate that in user space, you need something similar.
It's emulated in the kernel. But yes, for -no-kvm-irqchip -cpu +x2apic
we have to do this kind of forwarding.
>>
>> An SPR becomes heavily used by a guest, and there is therefore pressure
>> to emulate it in the kernel in order to improve performance.
>
> Then you enable a CAP to have it enabled in kernel space and thus user and kernel space know about it.
Ok.
>
>> The downside of this generic approach is that it prepares suprises down
>> the road. The alternative approach, of adding a new KVM_EXIT_RESET,
>> avoids this minefield, but requires ABI changes every time we want to
>> emulate something in userspace. Can you provide a critique of this
>> alternate approach?
>
> Yeah, it doesn't scale as well. The SPR read/write give us all information we need to emulate other registers too, like the magical "read this SPR and automatically get the interrupt vector from the MPIC and ack the interrupt along the way" register we have on e500. We'd have to add a new exit for that one as well. And for the next, and the next.
Unless we emulate the MPIC in the kernel (of course that shouldn't be
the trigger).
>
> Plus, today we don't get good error messages when we fail an SPR read/write. With this approach, you do. And you can potentially configure whether you want to ignore unknown SPRs on a per-VM basis.
Ok, it makes sense. Maybe we should do the same for x86, though I'm
worried about fragmenting the implementation - the cpu is now
implemented in both userspace and the kernel, and we need to document
precisely which MSRs are emulated in the kernel.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-10-07 13:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-06 23:41 [PATCH 0/3] KVM: PPC: Enable user space handled SPRs Alexander Graf
2012-10-06 23:41 ` [PATCH 1/3] KVM: PPC: Move mtspr/mfspr emulation into own functions Alexander Graf
2012-10-06 23:41 ` [PATCH 2/3] KVM: PPC: Add SPR emulation exits Alexander Graf
2012-10-07 13:13 ` Avi Kivity
2012-10-07 13:19 ` Alexander Graf
2012-10-07 13:26 ` Avi Kivity
2012-10-07 13:30 ` Alexander Graf
2012-10-07 13:34 ` Avi Kivity [this message]
2012-10-07 13:37 ` Alexander Graf
2012-10-08 20:45 ` Scott Wood
2012-10-08 21:01 ` Alexander Graf
2012-10-08 21:07 ` Scott Wood
2012-10-07 13:26 ` Alexander Graf
2012-10-07 13:30 ` Avi Kivity
2012-10-07 13:33 ` Alexander Graf
2012-10-06 23:41 ` [PATCH 3/3] KVM: PPC: BookE: Forward DBCR0 to user space Alexander Graf
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=507184FF.6090407@redhat.com \
--to=avi@redhat.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox