public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bandan Das <bsd@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Wincy Van <fanwenyi0529@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: nVMX: Don't return error on nested bitmap memory allocation failure
Date: Wed, 29 Apr 2015 08:55:48 -0400	[thread overview]
Message-ID: <jpgpp6nnlez.fsf@redhat.com> (raw)
In-Reply-To: <554083D4.8090906@siemens.com> (Jan Kiszka's message of "Wed, 29 Apr 2015 09:10:12 +0200")

Jan Kiszka <jan.kiszka@siemens.com> writes:

> Am 2015-04-28 um 21:55 schrieb Bandan Das:
>> 
>> If get_free_page() fails for nested bitmap area, it's evident that
>> we are gonna get screwed anyway but returning failure because we failed
>> allocating memory for a nested structure seems like an unnecessary big
>> hammer. Also, save the call for later; after we are done with other
>> non-nested allocations.
>
> Frankly, I prefer failures over automatic degradations. And, as you
> noted, the whole system will probably explode anyway if allocation of a
> single page already fails. So what does this buy us?

Yeah... I hear you. Ok, let me put it this way - Assume that we can
defer this allocation up until the point that the nested subsystem is
actually used i.e L1 tries running a guest and we try to allocate this
area. If get_free_page() failed in that case, would we still want to
kill L1 too ? I guess no.

Also, assume we had a printk in there - "Failed allocating memory for
nested bitmap", the novice user is going to get confused why he's
getting an error about nested virtualization (for the not so distant
future when nested is enabled by default :))

> What could makes sense is making the allocation of the vmread/write
> bitmap depend on enable_shadow_vmcs, and that again depend on nested.

Thanks for the suggestion. I will take a look at this one.

> Jan

  reply	other threads:[~2015-04-29 12:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 19:55 [PATCH] KVM: nVMX: Don't return error on nested bitmap memory allocation failure Bandan Das
2015-04-29  7:10 ` Jan Kiszka
2015-04-29 12:55   ` Bandan Das [this message]
2015-04-29 13:05     ` Jan Kiszka
2015-04-29 13:23       ` Paolo Bonzini
2015-04-29 16:08         ` Bandan Das
2015-04-29 16:39           ` Paolo Bonzini
2015-04-29  7:27 ` Nadav Amit
2015-04-29  8:17   ` Paolo Bonzini

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=jpgpp6nnlez.fsf@redhat.com \
    --to=bsd@redhat.com \
    --cc=fanwenyi0529@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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