From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Wanpeng Li <wanpeng.li@hotmail.com>
Subject: Re: [Qemu-devel] [PATCH] KVM: Add async pf flag to KVM_GET/SET_VCPU_EVENTS interface
Date: Wed, 21 Jun 2017 18:28:37 +0200 [thread overview]
Message-ID: <20170621162833.GA22745@potion> (raw)
In-Reply-To: <1498014889-52658-1-git-send-email-wanpeng.li@hotmail.com>
2017-06-20 20:14-0700, Wanpeng Li:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> This patch adds async pf flag to KVM_GET/SET_VCPU_EVENTS interface.
>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h
> @@ -300,6 +301,7 @@ struct kvm_vcpu_events {
> __u8 has_error_code;
> __u8 pad;
> __u32 error_code;
> + bool async_page_fault;
Touching userspace interfaces is always a major fun ...
You must not change the layout of an existing structure. You can try to
reuse the pad and hope that some userspace didn't check it for 0.
(I think it's a decent compromise between safety and sanity.)
> } exception;
> struct {
> __u8 injected;
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> @@ -2493,6 +2493,7 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level)
> events.exception.has_error_code = env->has_error_code;
> events.exception.error_code = env->error_code;
> events.exception.pad = 0;
> + events.exception.async_page_fault = env->async_page_fault;
>
> events.interrupt.injected = (env->interrupt_injected >= 0);
Old QEMUs would break below this point, because interrupt.injected used
to be where exception.async_page_fault is.
> events.interrupt.nr = env->interrupt_injected;
next prev parent reply other threads:[~2017-06-21 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 3:14 [Qemu-devel] [PATCH] KVM: Add async pf flag to KVM_GET/SET_VCPU_EVENTS interface Wanpeng Li
2017-06-21 4:19 ` no-reply
2017-06-21 16:28 ` Radim Krčmář [this message]
2017-06-22 2:09 ` Wanpeng Li
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=20170621162833.GA22745@potion \
--to=rkrcmar@redhat.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wanpeng.li@hotmail.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).