public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	kvm@vger.kernel.org, Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [PATCH 1/5] KVM: Make the maximum number of user memslots a per-VM thing
Date: Thu, 28 Jan 2021 09:31:18 -0800	[thread overview]
Message-ID: <YBL05tbdt9qupGDZ@google.com> (raw)
In-Reply-To: <34f76035-8749-e06b-2fb0-f30e295f6425@redhat.com>

On Thu, Jan 28, 2021, Paolo Bonzini wrote:
> On 28/01/21 11:48, Maciej S. Szmigiero wrote:
> > > 
> > > VMMs (especially big ones like QEMU) are complex and e.g. each driver
> > > can cause memory regions (-> memslots in KVM) to change. With this
> > > feature it becomes possible to set a limit upfront (based on VM
> > > configuration) so it'll be more obvious when it's hit.
> > > 
> > 
> > I see: it's a kind of a "big switch", so every VMM doesn't have to be
> > modified or audited.
> > Thanks for the explanation.
> 
> Not really, it's the opposite: the VMM needs to opt into a smaller number of
> memslots.

Yep, my thinking is that it would be similar to using seccomp to prevent doing
something that should never happen.

> I don't know... I understand it would be defense in depth, however between
> dynamic allocation of memslots arrays and GFP_KERNEL_ACCOUNT, it seems to be
> a bit of a solution in search of a problem.

I'm a-ok waiting to add a capability until there's a VMM that actually wants to
use it.

> For now I applied patches 1-2-5.

Why keep patch 1?  Simply raising the limit in patch 2 shouldn't require per-VM
tracking.  The 'memslots_max' name is also ambiguous.  In my head, the new
capability would restrict the _number_ of memslots, but as implemented in
patches 1+3 it restrists the max _ID_ of a memslot.  Limiting the max ID also
effectively limits that max number of memslots, but that approach confuses
things since the IDs themselves do not affect memory consumption.  Limiting the
IDs bleeds the old implementation details into the ABI.

  parent reply	other threads:[~2021-01-28 17:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 17:57 [PATCH 0/5] KVM: Make the maximum number of user memslots configurable and raise the default Vitaly Kuznetsov
2021-01-27 17:57 ` [PATCH 1/5] KVM: Make the maximum number of user memslots a per-VM thing Vitaly Kuznetsov
2021-01-27 22:27   ` Maciej S. Szmigiero
2021-01-28  8:45     ` Vitaly Kuznetsov
2021-01-28 10:48       ` Maciej S. Szmigiero
2021-01-28 13:01         ` Paolo Bonzini
2021-01-28 15:26           ` Vitaly Kuznetsov
2021-01-28 17:31           ` Sean Christopherson [this message]
2021-01-28 17:59             ` Paolo Bonzini
2021-02-08 14:20               ` Vitaly Kuznetsov
2021-02-08 15:02                 ` Paolo Bonzini
2021-01-27 17:57 ` [PATCH 2/5] KVM: Raise the maximum number of user memslots Vitaly Kuznetsov
2021-01-27 17:57 ` [PATCH 3/5] KVM: Make the maximum number of user memslots configurable Vitaly Kuznetsov
2021-01-27 17:57 ` [PATCH 4/5] selftests: kvm: Test the newly introduced KVM_CAP_MEMSLOTS_LIMIT Vitaly Kuznetsov
2021-01-27 17:57 ` [PATCH 5/5] selftests: kvm: Raise the default timeout to 120 seconds Vitaly Kuznetsov

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=YBL05tbdt9qupGDZ@google.com \
    --to=seanjc@google.com \
    --cc=imammedo@redhat.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=maciej.szmigiero@oracle.com \
    --cc=pbonzini@redhat.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /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