From: peter.maydell@linaro.org (Peter Maydell)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v8 1/4] arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS
Date: Thu, 19 Jul 2018 15:34:50 +0100 [thread overview]
Message-ID: <CAFEAcA8vav_yt2xMoVxAmdo_h8hP9THCZGzrCOEQEj--nHYGYg@mail.gmail.com> (raw)
In-Reply-To: <a840714a-16b3-2da8-c6e2-5be85c73bda2@arm.com>
On 19 July 2018 at 15:15, James Morse <james.morse@arm.com> wrote:
> Hi guys,
>
> On 19/07/18 08:39, gengdongjiu wrote:
>> On 2018/7/18 0:33, Peter Maydell wrote:
>>> On 13 July 2018 at 16:47, James Morse <james.morse@arm.com> wrote:
>>>> From: Dongjiu Geng <gengdongjiu@huawei.com>
>>>>
>>>> For the migrating VMs, user space may need to know the exception
>>>> state. For example, in the machine A, KVM make an SError pending,
>>>> when migrate to B, KVM also needs to pend an SError.
>>>>
>>>> This new IOCTL exports user-invisible states related to SError.
>>>> Together with appropriate user space changes, user space can get/set
>>>> the SError exception state to do migrate/snapshot/suspend.
>
>>>> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
>>>> index d10944e619d3..e3940f8715a5 100644
>>>> --- a/Documentation/virtual/kvm/api.txt
>>>> +++ b/Documentation/virtual/kvm/api.txt
>
>
>>>> +Gets currently pending SError exceptions as well as related states of the vcpu.
>>>
>>> Any chance of expanding this to explain what this state actually is?
>>> (ie something you could use to implement or review the userspace
>>> code which has to manipulate it)
>> sure, can expand it.
>>
>> serror_pending means whether KVM is pending Serror for guest.
>> serror_has_esr means whether KVM or user space can set the SError syndrome for guest.
>> serror_esr means the value of SError syndrome.
>
> I've had a go at something more verbose for this section:
> ------------------%<------------------
> If the guest accesses a device that is being emulated by the host kernel in such
> a way that a real device would generate a physical SError, KVM may make a
> virtual SError pending for that VCPU. This system error interrupt remains
> pending until the guest takes the exception by unmasking PSTATE.A.
>
> Running the VCPU may cause it to take a pending SError, or make an access that
> causes an SError to become pending. The event's description is only valid while
> the VPCU is not running.
>
> This API provides a way to read and write the pending 'event' state that is not
> visible to the guest. To save, restore or migrate a VCPU the struct representing
> the state can be read then written using this GET/SET API, along with the other
> guest-visible registers. It is not possible to 'cancel' an SError that has been
> made pending.
>
> A device being emulated in user-space may also wish to generate an SError. To do
> this the events structure can be populated by user-space. The current state
> should be read first, to ensure no existing SError is pending. If an existing
> SError is pending, the architectures 'Multiple SError interrupts' rules should
"architecture's"
> be followed. (2.5.3 of DDI0587.a "ARM Reliability, Availability, and
> Serviceability (RAS) Specification").
> ------------------%<------------------
Otherwise looks good.
thanks
-- PMM
next prev parent reply other threads:[~2018-07-19 14:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 15:47 [PATCH v8 0/4] support exception state migration and set VSESR_EL2 by user space James Morse
2018-07-13 15:47 ` [PATCH v8 1/4] arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS James Morse
2018-07-17 16:33 ` Peter Maydell
2018-07-19 7:39 ` gengdongjiu
2018-07-19 14:15 ` James Morse
2018-07-19 14:34 ` Peter Maydell [this message]
2018-07-13 15:47 ` [PATCH v8 2/4] arm64: KVM: export the capability to set guest SError syndrome James Morse
2018-07-17 16:36 ` Peter Maydell
2018-07-19 8:54 ` gengdongjiu
2018-07-19 9:10 ` Peter Maydell
2018-07-19 9:29 ` gengdongjiu
2018-07-19 14:15 ` James Morse
2018-07-19 14:37 ` Peter Maydell
2018-07-13 15:47 ` [PATCH v8 3/4] KVM: arm64: Share the parts of get/set events useful to 32bit James Morse
2018-07-16 2:50 ` gengdongjiu
2018-07-13 15:47 ` [PATCH v8 4/4] KVM: arm: Add 32bit get/set events support James Morse
2018-07-16 3:00 ` gengdongjiu
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=CAFEAcA8vav_yt2xMoVxAmdo_h8hP9THCZGzrCOEQEj--nHYGYg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).