All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 0/5] target-i386: kvm: Increase MSR entry array limits, check for array overrun
Date: Wed, 16 Dec 2015 22:38:25 +0100	[thread overview]
Message-ID: <5671D9D1.5050907@redhat.com> (raw)
In-Reply-To: <1450292806-30598-1-git-send-email-ehabkost@redhat.com>



On 16/12/2015 20:06, Eduardo Habkost wrote:
> We are dangerously close to the array limits in kvm_put_msrs()
> and kvm_get_msrs(): with the default mcg_cap configuration, we
> can set up to 148 MSRs in kvm_put_msrs(), and if we allow mcg_cap
> to be changed, we can write up to 236 MSRs[1].
> 
> This series changes the code to allocate a buffer once per VCPU,
> increase buffer size to 4096 bytes (that can hold up to 255 MSR
> entries), and check array limits before appending new entries.

Thanks, it's a good improvement.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

> [1] I have checked the limits by copying and pasting the
>     kvm_put_msrs() code to a new file, replacing the "if" lines,
>     copying the macro definitions, and adding a helper macro to
>     keep track of the kvm_msr_entry_set() calls. The code can be
>     seen at:
>     https://gist.github.com/ehabkost/08d4177a33b8648a71ef
> 
> Eduardo Habkost (5):
>   target-i386: kvm: Allocate kvm_msrs struct once per VCPU
>   target-i386: kvm: Increase MSR_BUF_SIZE
>   target-i386: kvm: Simplify MSR array construction
>   target-i386: kvm: Simplify MSR setting functions
>   target-i386: kvm: Eliminate kvm_msr_entry_set()
> 
>  target-i386/cpu-qom.h |   4 +
>  target-i386/kvm.c     | 322 +++++++++++++++++++++++---------------------------
>  2 files changed, 149 insertions(+), 177 deletions(-)
> 

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 0/5] target-i386: kvm: Increase MSR entry array limits, check for array overrun
Date: Wed, 16 Dec 2015 22:38:25 +0100	[thread overview]
Message-ID: <5671D9D1.5050907@redhat.com> (raw)
In-Reply-To: <1450292806-30598-1-git-send-email-ehabkost@redhat.com>



On 16/12/2015 20:06, Eduardo Habkost wrote:
> We are dangerously close to the array limits in kvm_put_msrs()
> and kvm_get_msrs(): with the default mcg_cap configuration, we
> can set up to 148 MSRs in kvm_put_msrs(), and if we allow mcg_cap
> to be changed, we can write up to 236 MSRs[1].
> 
> This series changes the code to allocate a buffer once per VCPU,
> increase buffer size to 4096 bytes (that can hold up to 255 MSR
> entries), and check array limits before appending new entries.

Thanks, it's a good improvement.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

> [1] I have checked the limits by copying and pasting the
>     kvm_put_msrs() code to a new file, replacing the "if" lines,
>     copying the macro definitions, and adding a helper macro to
>     keep track of the kvm_msr_entry_set() calls. The code can be
>     seen at:
>     https://gist.github.com/ehabkost/08d4177a33b8648a71ef
> 
> Eduardo Habkost (5):
>   target-i386: kvm: Allocate kvm_msrs struct once per VCPU
>   target-i386: kvm: Increase MSR_BUF_SIZE
>   target-i386: kvm: Simplify MSR array construction
>   target-i386: kvm: Simplify MSR setting functions
>   target-i386: kvm: Eliminate kvm_msr_entry_set()
> 
>  target-i386/cpu-qom.h |   4 +
>  target-i386/kvm.c     | 322 +++++++++++++++++++++++---------------------------
>  2 files changed, 149 insertions(+), 177 deletions(-)
> 

  parent reply	other threads:[~2015-12-16 21:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 19:06 [PATCH 0/5] target-i386: kvm: Increase MSR entry array limits, check for array overrun Eduardo Habkost
2015-12-16 19:06 ` [Qemu-devel] " Eduardo Habkost
2015-12-16 19:06 ` [PATCH 1/5] target-i386: kvm: Allocate kvm_msrs struct once per VCPU Eduardo Habkost
2015-12-16 19:06   ` [Qemu-devel] " Eduardo Habkost
2015-12-16 19:06 ` [PATCH 2/5] target-i386: kvm: Increase MSR_BUF_SIZE Eduardo Habkost
2015-12-16 19:06   ` [Qemu-devel] " Eduardo Habkost
2015-12-16 19:06 ` [PATCH 3/5] target-i386: kvm: Simplify MSR array construction Eduardo Habkost
2015-12-16 19:06   ` [Qemu-devel] " Eduardo Habkost
2015-12-16 19:06 ` [PATCH 4/5] target-i386: kvm: Simplify MSR setting functions Eduardo Habkost
2015-12-16 19:06   ` [Qemu-devel] " Eduardo Habkost
2015-12-16 19:06 ` [PATCH 5/5] target-i386: kvm: Eliminate kvm_msr_entry_set() Eduardo Habkost
2015-12-16 19:06   ` [Qemu-devel] " Eduardo Habkost
2015-12-16 21:38 ` Paolo Bonzini [this message]
2015-12-16 21:38   ` [Qemu-devel] [PATCH 0/5] target-i386: kvm: Increase MSR entry array limits, check for array overrun Paolo Bonzini
2016-01-23 15:11   ` Eduardo Habkost

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=5671D9D1.5050907@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kvm@vger.kernel.org \
    --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 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.