From: Jan Kiszka <jan.kiszka@web.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()
Date: Tue, 14 Aug 2012 09:33:31 +0200 [thread overview]
Message-ID: <5029FF4B.8040001@web.de> (raw)
In-Reply-To: <1344272705-17825-1-git-send-email-peter.maydell@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1727 bytes --]
On 2012-08-06 19:05, Peter Maydell wrote:
> Move the init of the irqchip_inject_ioctl field of KVMState out of
> kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq()
> can be used even when no irqchip is created (for architectures
> that support async interrupt notification even without an in
> kernel irqchip).
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> We can't just set irqchip_inject_ioctl in target-*/kvm.c because
> the KVMState struct layout is private to kvm-all.c. Moving the
> default initialisation of this field seemed the simplest approach.
> It's safe because the use in kvm_set_irq() is guarded by a check of
> kvm_async_interrupts_enabled().
>
> The other approach would be to have a helper function for setting
> the field, but that seems overkill when KVM_IRQ_LINE is the standard
> default value. (KVM_IRQ_LINE_STATUS seems to be undocumented,
> incidentally. I am going to assume it's another x86ism until somebody
> does document it :-))
>
> kvm-all.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kvm-all.c b/kvm-all.c
> index 6def6c9..9a1f001 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -1200,7 +1200,6 @@ static int kvm_irqchip_create(KVMState *s)
> return ret;
> }
>
> - s->irqchip_inject_ioctl = KVM_IRQ_LINE;
> if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) {
> s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS;
> }
Either you move both or none.
KVM_IRQ_LINE is old-style, deprecated, KVM_IRQ_LINE_STATUS (i.e
injection with feedback to allow lost-tick compensation) is the current
standard that other archs should pick up.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2012-08-14 7:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 17:05 [Qemu-devel] [PATCH] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create() Peter Maydell
2012-08-12 13:13 ` Peter Maydell
2012-08-13 20:45 ` Marcelo Tosatti
2012-08-13 21:40 ` Peter Maydell
2012-08-14 7:33 ` Jan Kiszka [this message]
2012-08-14 7:40 ` Peter Maydell
2012-08-14 7:42 ` Jan Kiszka
2012-08-14 7:52 ` Peter Maydell
2012-08-14 8:09 ` Jan Kiszka
2012-08-14 13:10 ` Peter Maydell
2012-08-14 13:27 ` Jan Kiszka
2012-08-14 11:01 ` Avi Kivity
2012-08-14 11:05 ` Jan Kiszka
2012-08-14 13:14 ` Avi Kivity
2012-08-14 13:36 ` Jan Kiszka
2012-08-14 7:36 ` Jan Kiszka
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=5029FF4B.8040001@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--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 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).