qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
To: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: KVM <kvm@vger.kernel.org>, Jan Kiszka <jan.kiszka@siemens.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel@nongnu.org, Kevin O'Connor <kevin@koconnor.net>,
	Avi Kivity <avi@redhat.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Liu Sheng <liusheng@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH v2 1/5] KVM: define KVM_CAP_READONLY_MEM unconditionally
Date: Thu, 25 Oct 2012 17:21:09 +0800	[thread overview]
Message-ID: <50890485.902@linux.vnet.ibm.com> (raw)
In-Reply-To: <50890462.5010307@linux.vnet.ibm.com>

let it not depend on __KVM_HAVE_READONLY_MEM to make it friendly
to userspace

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
---
 arch/x86/kvm/x86.c  |    2 ++
 include/linux/kvm.h |    2 --
 virt/kvm/kvm_main.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ec07cd3..0fd220b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2189,7 +2189,9 @@ int kvm_dev_ioctl_check_extension(long ext)
 	case KVM_CAP_GET_TSC_KHZ:
 	case KVM_CAP_PCI_2_3:
 	case KVM_CAP_KVMCLOCK_CTRL:
+#ifdef __KVM_HAVE_READONLY_MEM
 	case KVM_CAP_READONLY_MEM:
+#endif
 	case KVM_CAP_IRQFD_RESAMPLE:
 		r = 1;
 		break;
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 494a84c..a9001c1 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -629,9 +629,7 @@ 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
 #define KVM_CAP_IRQFD_RESAMPLE 82
 #define KVM_CAP_PPC_BOOKE_WATCHDOG 83

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index e26a55f..55f12a1 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -684,7 +684,7 @@ static int check_memory_region_flags(struct kvm_userspace_memory_region *mem)
 {
 	u32 valid_flags = KVM_MEM_LOG_DIRTY_PAGES;

-#ifdef KVM_CAP_READONLY_MEM
+#ifdef __KVM_HAVE_READONLY_MEM
 	valid_flags |= KVM_MEM_READONLY;
 #endif

-- 
1.7.7.6

  reply	other threads:[~2012-10-25  9:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  9:20 [Qemu-devel] [PATCH v2 0/5] Qemu: implement readonly memory Xiao Guangrong
2012-10-25  9:21 ` Xiao Guangrong [this message]
2012-10-25 12:14   ` [Qemu-devel] [PATCH v2 1/5] KVM: define KVM_CAP_READONLY_MEM unconditionally Jan Kiszka
2012-10-25  9:21 ` [Qemu-devel] [PATCH v2 2/5] Qemu: update header files Xiao Guangrong
2012-10-25 11:03   ` Peter Maydell
2012-10-25  9:22 ` [Qemu-devel] [PATCH v2 3/5] Qemu: do not mark bios readonly Xiao Guangrong
2012-10-26 10:35   ` Jan Kiszka
2012-10-29  7:09     ` Xiao Guangrong
2012-10-29  7:44       ` Jan Kiszka
2012-10-29  8:31         ` Xiao Guangrong
2012-10-31  6:03           ` Jan Kiszka
2012-10-31  6:35             ` Xiao Guangrong
2012-10-31  6:46               ` Jan Kiszka
2012-10-31  7:01                 ` Xiao Guangrong
2012-10-31  7:21                   ` Jan Kiszka
2012-10-25  9:22 ` [Qemu-devel] [PATCH v2 4/5] Qemu: implement readonly memory Xiao Guangrong
2012-10-25  9:23 ` [Qemu-devel] [PATCH v2 5/5] Qemu: mark pci rom readonly Xiao Guangrong

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=50890485.902@linux.vnet.ibm.com \
    --to=xiaoguangrong@linux.vnet.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=liusheng@linux.vnet.ibm.com \
    --cc=mtosatti@redhat.com \
    --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).