All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christoffer Dall <christoffer.dall@linaro.org>, kvm@vger.kernel.org
Cc: Gleb Natapov <gleb@kernel.org>
Subject: Re: [PATCH 1/2] KVM: Unconditionally export KVM_CAP_READONLY_MEM
Date: Tue, 26 Aug 2014 14:30:52 +0200	[thread overview]
Message-ID: <53FC7DFC.1050800@redhat.com> (raw)
In-Reply-To: <1409054438-14293-1-git-send-email-christoffer.dall@linaro.org>

Il 26/08/2014 14:00, Christoffer Dall ha scritto:
> The idea between capabilities and the KVM_CHECK_EXTENSION ioctl is that
> userspace can, at run-time, determine if a feature is supported or not.
> This allows KVM to being supporting a new feature with a new kernel
> version without any need to update user space.  Unfortunately, since the
> definition of KVM_CAP_READONLY_MEM was guarded by #ifdef
> __KVM_HAVE_READONLY_MEM, such discovery still required a user space
> update.
> 
> Therefore, unconditionally export KVM_CAP_READONLY_MEM and change the
> in-kernel conditional to rely on __KVM_HAVE_READONLY_MEM.
> 
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> ---
>  include/uapi/linux/kvm.h | 2 --
>  virt/kvm/kvm_main.c      | 2 +-
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index cf3a2ff..90d3eda 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -738,9 +738,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
>  #define KVM_CAP_PPC_HTAB_FD 84
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 5a0817e..1d03967 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -708,7 +708,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
>  
> 

Thanks, applying both.  Next time please include a cover letter. :)

Paolo

  parent reply	other threads:[~2014-08-26 12:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 12:00 [PATCH 1/2] KVM: Unconditionally export KVM_CAP_READONLY_MEM Christoffer Dall
2014-08-26 12:00 ` [PATCH 2/2] KVM: Unconditionally export KVM_CAP_USER_NMI Christoffer Dall
2014-08-26 12:30 ` Paolo Bonzini [this message]
2014-08-26 12:40   ` [PATCH 1/2] KVM: Unconditionally export KVM_CAP_READONLY_MEM Christoffer Dall

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=53FC7DFC.1050800@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=gleb@kernel.org \
    --cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.