mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	David Rientjes <rientjes@google.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [patch] kvm: suppress KVM_SET_GSI_ROUTING allocation failure
Date: Wed, 14 Feb 2018 12:32:29 +0100	[thread overview]
Message-ID: <55452103-8c14-19df-38d8-99459e9abd6a@redhat.com> (raw)
In-Reply-To: <cef46bea-c511-c303-e795-ca0e3b540164@de.ibm.com>

On 14/02/2018 12:14, Christian Borntraeger wrote:
> 
> 
> On 02/14/2018 11:10 AM, Paolo Bonzini wrote:
>> On 14/02/2018 02:03, David Rientjes wrote:
>>> On Tue, 13 Feb 2018, Paolo Bonzini wrote:
>>>
>>>>>> The KVM_SET_GSI_ROUTING ioctl does a vmalloc() of
>>>>>> sizeof(struct kvm_irq_routing_entry) multiplied by a user-supplied value.
>>>>>> This can be up to 4096 entries on architectures such as arm64 and s390
>>>>>> (and the upper bound may be increased on s390 eventually).
>>>>>>
>>>>>> This can produce a vmalloc allocation failure warning:
>>>>>>
>>>>> [...]
>>>>>>  kvm_vm_ioctl+0x910/0x15e0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4153
>>>>>
>>>>>                                                                        ^^^^^
>>>>>
>>>>>> @@ -3063,7 +3063,8 @@ static long kvm_vm_ioctl(struct file *filp,
>>>>>
>>>>>       ^^^^^
>>>>>
>>>>>
>>>>> Are you sure that you got the right vmalloc?
>>>>
>>>> Nice catch!  But well, it's the only one in the whole file. :)
>>>>
>>>> That seems very much like an old patch then.  I'm unqueuing it.
>>>>
>>>
>>> It's not a catch at all, the fact that I saw this warning with an older 
>>> kernel for KVM_SET_GSI_ROUTING doesn't mean that I can't patch it with an 
>>> upstream kernel.  Would you prefer I remove the stack trace completely?
>>
>> The upstream kernel doesn't warn.  It checks "if (routing.nr)" before
>> calling vmalloc.
> 
> It will warn of the vmalloc space is really exhausted. But then I really ask
> myself if we really want to suppress this warning. This should be a big
> ALERT to the host admin.

Especially since the biggest allocation KVM_SET_GSI_ROUTING can do is
128 KiB...

Paolo

      reply	other threads:[~2018-02-14 11:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 21:35 David Rientjes
2018-02-13 14:40 ` Paolo Bonzini
2018-02-13 14:48 ` Michal Hocko
2018-02-13 15:03   ` Paolo Bonzini
2018-02-13 15:44     ` Michal Hocko
2018-02-13 15:49       ` Paolo Bonzini
2018-02-13 15:58         ` Michal Hocko
2018-02-13 15:14 ` Christian Borntraeger
2018-02-13 15:17   ` Paolo Bonzini
2018-02-14  1:03     ` David Rientjes
2018-02-14  8:30       ` Christian Borntraeger
2018-02-14 10:10       ` Paolo Bonzini
2018-02-14 11:14         ` Christian Borntraeger
2018-02-14 11:32           ` Paolo Bonzini [this message]

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=55452103-8c14-19df-38d8-99459e9abd6a@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=rkrcmar@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

all inboxes | Powered by JetHome®