[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] update kvm related the head file from kerne
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] update kvm related the head file from kernel |
Date: |
Fri, 07 Sep 2012 10:49:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2012-09-07 10:26, Liu Sheng wrote:
> updated the head file from kernel for readonly memory
> feature.
>
> Signed-off-by: Liu Sheng <address@hidden>
> ---
> 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
- [Qemu-devel] [PATCH 0/3] support kvm readonly memory slot in qemu, Liu Sheng, 2012/09/07
- [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Liu Sheng, 2012/09/07
- Re: [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Jan Kiszka, 2012/09/07
- Re: [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Avi Kivity, 2012/09/09
- Re: [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Jan Kiszka, 2012/09/10
- Re: [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Kevin O'Connor, 2012/09/10
- Re: [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Jan Kiszka, 2012/09/11
- Re: [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Anthony Liguori, 2012/09/11
- Re: [Qemu-devel] [PATCH 3/3] support readonly memory feature in qemu, Jan Kiszka, 2012/09/11