qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Guoheyi <guoheyi@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Dave Martin <Dave.Martin@arm.com>, qemu-arm <qemu-arm@nongnu.org>,
	James Morse <james.morse@arm.com>,
	wanghaibin.wang@huawei.com, kvmarm@lists.cs.columbia.edu,
	arm-mail-list <linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC PATCH 00/12] Add SDEI support for arm64
Date: Wed, 9 Oct 2019 21:42:02 +0800	[thread overview]
Message-ID: <84e1a629-bdd3-faaf-e12f-17930945adf4@huawei.com> (raw)
In-Reply-To: <CAFEAcA_ztr0_Bu9d__dSr9oH75s2DSd5=6NZvVMrxuDTxf31mw@mail.gmail.com>



On 2019/9/30 21:15, Peter Maydell wrote:
> On Tue, 24 Sep 2019 at 16:23, Heyi Guo <guoheyi@huawei.com> wrote:
>> As promised, this is the first RFC patch set for arm64 SDEI support.
> Hi; for the benefit of possible reviewers who aren't familiar
> with every corner of the arm ecosystem, could you provide a
> summary of:
>   * what is SDEI ?
SDEI is for ARM "Software Delegated Exception Interface". AS ARM64 
doesn't have native non-maskable interrupt (NMI), we can rely on higher 
privileged software to change the pc of lower privileged software on 
certain events occur, to emulate NMI mechanism, and SDEI is the standard 
interfaces between the two levels of privileged software. It is based on 
SMC/HVC calls.

In virtualization situation, guest OS is the lower privileged software 
and hypervisor is the higher one. Major interfaces provided by SDEI include:
1. interrupt bind: guest OS can request to bind an interrupt to an SDEI 
event.
2. register: guest OS can request to register a handler to an SDEI 
event, so hypervisor will change pc of guest to this handler when 
certain event occurs.
3. complete: guest OS notifies hypervisor that it has completed the 
event handling, so hypervisor will restore the context of guest when it 
is interrupted.
>   * what do KVM and QEMU want/need to do with it ?
KVM is supposed to pass SMC/HVC calls to qemu, and qemu will serve the 
SDEI requests after parsing SMC/HVC calls. qemu also takes the 
responsibility to trigger the events. If an interrupt is requested to be 
bound to an event, qemu should not inject the interrupt to guest any 
more; instead, it should save the context of VCPU and change the PC to 
event handler which is registered by guest, and then return to guest.

To make the conversion of interrupt to SDEI event transparent to other 
modules in qemu, we used qemu_irq and qemu_irq_intercept_in() to 
override the default irq handler with SDEI event trigger. I saw 
qemu_irq_intercept_in() should be only used in qemu MST, but it seemed 
fit to override interrupt injection with event trigger after guest 
requests to bind interrupt to SDEI event.
>   * what is this patchset trying to solve ?
This patchset is trying to implement the whole SDEI framework in qemu 
with KVM enabled, including all SDEI v1.0 interfaces, as well as event 
trigger conduit from other qemu devices after interrupt binding.

I will also provide the above context in the cover letter of v2 RFC.

Thanks,

Heyi

>
> That would provide some useful context for trying to
> review the patchset.
>
> thanks
> -- PMM
>
> .
>




      reply	other threads:[~2019-10-09 18:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 15:21 [RFC PATCH 00/12] Add SDEI support for arm64 Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 01/12] linux-headers: import arm_sdei.h Heyi Guo
2019-09-24 15:39   ` Michael S. Tsirkin
2019-09-25  8:12     ` Guoheyi
2019-09-24 15:21 ` [RFC PATCH 02/12] arm/sdei: add virtual device framework Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 03/12] arm/sdei: add support to handle SDEI requests from guest Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 04/12] arm/sdei: add system reset callback Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 05/12] arm/sdei: add support to trigger event by GIC interrupt ID Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 06/12] core/irq: add qemu_irq_remove_intercept interface Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 07/12] arm/sdei: override qemu_irq handler when binding interrupt Heyi Guo
2019-09-30 13:19   ` Peter Maydell
2019-10-09 13:06     ` Guoheyi
2019-09-24 15:21 ` [RFC PATCH 08/12] arm/sdei: add support to register interrupt bind notifier Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 09/12] linux-headers/kvm.h: add capability to forward hypercall Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 10/12] arm/sdei: check KVM cap and enable SDEI Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 11/12] arm/kvm: handle guest exit of hypercall Heyi Guo
2019-09-24 15:21 ` [RFC PATCH 12/12] virt/acpi: add SDEI table if SDEI is enabled Heyi Guo
2019-10-10  9:15   ` Igor Mammedov
2019-10-10 13:08     ` Guoheyi
2019-10-10 13:57       ` Igor Mammedov
2019-10-10 14:01   ` Michael S. Tsirkin
2019-09-25  6:54 ` [RFC PATCH 00/12] Add SDEI support for arm64 no-reply
2019-09-25  6:58 ` no-reply
2019-09-30 13:15 ` Peter Maydell
2019-10-09 13:42   ` Guoheyi [this message]

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=84e1a629-bdd3-faaf-e12f-17930945adf4@huawei.com \
    --to=guoheyi@huawei.com \
    --cc=Dave.Martin@arm.com \
    --cc=james.morse@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wanghaibin.wang@huawei.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).