From: Jan Kiszka <jan.kiszka@siemens.com>
To: Liu Sheng <liusheng@linux.vnet.ibm.com>
Cc: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com,
xiaoguangrong@linux.vnet.ibm.com, qemu-devel@nongnu.org,
aliguori@us.ibm.com
Subject: Re: [PATCH 2/3] update kvm related the head file from kernel
Date: Fri, 07 Sep 2012 10:49:39 +0200 [thread overview]
Message-ID: <5049B523.8090303@siemens.com> (raw)
In-Reply-To: <1347006389-543-3-git-send-email-liusheng@linux.vnet.ibm.com>
On 2012-09-07 10:26, Liu Sheng wrote:
> updated the head file from kernel for readonly memory
> feature.
>
> Signed-off-by: Liu Sheng <liusheng@linux.vnet.ibm.com>
> ---
> linux-headers/asm-x86/kvm.h | 1 +
> linux-headers/linux/kvm.h | 16 +++++++++++++---
> 2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h
> index 246617e..521bf25 100644
> --- a/linux-headers/asm-x86/kvm.h
> +++ b/linux-headers/asm-x86/kvm.h
> @@ -25,6 +25,7 @@
> #define __KVM_HAVE_DEBUGREGS
> #define __KVM_HAVE_XSAVE
> #define __KVM_HAVE_XCRS
> +#define __KVM_HAVE_READONLY_MEM
>
> /* Architectural interrupt line count. */
> #define KVM_NR_INTERRUPTS 256
> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
> index 4b9e575..02fae9e 100644
> --- a/linux-headers/linux/kvm.h
> +++ b/linux-headers/linux/kvm.h
> @@ -101,9 +101,13 @@ struct kvm_userspace_memory_region {
> __u64 userspace_addr; /* start of the userspace allocated memory */
> };
>
> -/* for kvm_memory_region::flags */
> -#define KVM_MEM_LOG_DIRTY_PAGES 1UL
> -#define KVM_MEMSLOT_INVALID (1UL << 1)
> +/*
> + * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace,
> + * other bits are reserved for kvm internal use which are defined in
> + * include/linux/kvm_host.h.
> + */
> +#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0)
> +#define KVM_MEM_READONLY (1UL << 1)
>
> /* for KVM_IRQ_LINE */
> struct kvm_irq_level {
> @@ -222,6 +226,9 @@ struct kvm_run {
> __u8 data[8];
> __u32 len;
> __u8 is_write;
> +#ifdef __KVM_HAVE_READONLY_MEM
> + __u8 write_readonly_mem;
> +#endif
> } mmio;
> /* KVM_EXIT_HYPERCALL */
> struct {
> @@ -618,6 +625,9 @@ struct kvm_ppc_smmu_info {
> #define KVM_CAP_PPC_GET_SMMU_INFO 78
> #define KVM_CAP_S390_COW 79
> #define KVM_CAP_PPC_ALLOC_HTAB 80
> +#ifdef __KVM_HAVE_READONLY_MEM
> +#define KVM_CAP_READONLY_MEM 81
> +#endif
Sorry for commenting on the wrong patch, this must be fixed in the
kernel: no more conditional CAPs, please. Usually, they only require
#ifdef messes in QEMU (see patch 3).
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2012-09-07 8:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 8:26 [PATCH 0/3] support kvm readonly memory slot in qemu Liu Sheng
2012-09-07 8:26 ` [PATCH 1/3] set the readonly property of rom memory region in pc Liu Sheng
2012-09-07 8:26 ` [PATCH 2/3] update kvm related the head file from kernel Liu Sheng
2012-09-07 8:49 ` Jan Kiszka [this message]
2012-09-07 9:39 ` Xiao Guangrong
2012-09-07 10:17 ` Jan Kiszka
2012-09-07 8:26 ` [PATCH 3/3] support readonly memory feature in qemu Liu Sheng
2012-09-07 8:50 ` Jan Kiszka
2012-09-09 15:45 ` Avi Kivity
2012-09-10 9:25 ` Jan Kiszka
2012-09-11 3:02 ` Kevin O'Connor
2012-09-11 15:31 ` Jan Kiszka
2012-09-11 16:15 ` Anthony Liguori
2012-09-11 16:33 ` Jan Kiszka
2012-09-12 0:01 ` Kevin O'Connor
2012-09-09 15:42 ` Avi Kivity
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=5049B523.8090303@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=liusheng@linux.vnet.ibm.com \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiaoguangrong@linux.vnet.ibm.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