kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	aderumier@odiso.com, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: x86: build kvm_userspace_memory_region in x86_set_memory_region
Date: Tue, 13 Oct 2015 17:03:52 +0200	[thread overview]
Message-ID: <20151013150352.GA6877@potion.brq.redhat.com> (raw)
In-Reply-To: <1444651758-6926-2-git-send-email-pbonzini@redhat.com>

2015-10-12 14:09+0200, Paolo Bonzini:
> The next patch will make x86_set_memory_region fill the
> userspace_addr.  Since the struct is not used untouched
> anymore, it makes sense to build it in x86_set_memory_region
> directly; it also simplifies the callers.
> 
> Reported-by: Alexandre DERUMIER <aderumier@odiso.com>
> Cc: stable@vger.kernel.org
> Fixes: 9da0e4d5ac969909f6b435ce28ea28135a9cbd69
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> @@ -1199,9 +1199,7 @@ void kvm_complete_insn_gp(struct kvm_vcpu *vcpu, int err);
> -int __x86_set_memory_region(struct kvm *kvm,
> -			    const struct kvm_userspace_memory_region *mem);
> -int x86_set_memory_region(struct kvm *kvm,
> -			  const struct kvm_userspace_memory_region *mem);
> +int __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size);
> +int x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, u32 size);

kvm_userspace_memory_region has u64 size, but we only use this for few
pages anyway and will hopefully get a warning from GCC if that changes.

Patch makes the code much better,

Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>

  reply	other threads:[~2015-10-13 15:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 12:09 [PATCH 0/2] KVM: fix SMM with ept=1/unrestricted_guest=0 Paolo Bonzini
2015-10-12 12:09 ` [PATCH 1/2] KVM: x86: build kvm_userspace_memory_region in x86_set_memory_region Paolo Bonzini
2015-10-13 15:03   ` Radim Krčmář [this message]
2015-10-12 12:09 ` [PATCH 2/2] KVM: x86: map/unmap private slots in __x86_set_memory_region Paolo Bonzini
2015-10-13 15:39   ` Radim Krčmář
2015-10-13 16:28     ` Paolo Bonzini
2015-10-13 16:45       ` Radim Krčmář

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=20151013150352.GA6877@potion.brq.redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=aderumier@odiso.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=stable@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 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).