Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754837AbbBTNpO (ORCPT ); Fri, 20 Feb 2015 08:45:14 -0500 Received: from cantor2.suse.de ([195.135.220.15]:36051 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754513AbbBTNpM (ORCPT ); Fri, 20 Feb 2015 08:45:12 -0500 Message-ID: <54E73A64.5020608@suse.de> Date: Fri, 20 Feb 2015 14:45:08 +0100 From: Alexander Graf User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Bogdan Purcareata , linuxppc-dev@lists.ozlabs.org, linux-rt-users@vger.kernel.org, bigeasy@linutronix.de, pbonzini@redhat.com CC: linux-kernel@vger.kernel.org, scottwood@freescale.com, mihai.caraman@freescale.com Subject: Re: [PATCH 2/2] powerpc/kvm: Limit MAX_VCPUS for guests running on RT Linux References: <1424251955-308-1-git-send-email-bogdan.purcareata@freescale.com> <1424251955-308-3-git-send-email-bogdan.purcareata@freescale.com> In-Reply-To: <1424251955-308-3-git-send-email-bogdan.purcareata@freescale.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2122 Lines: 57 On 18.02.15 10:32, Bogdan Purcareata wrote: > Due to the introduction of the raw_spinlock for the KVM openpic, guests with a > high number of VCPUs may induce great latencies on the underlying RT Linux > system (e.g. cyclictest reports latencies of ~15ms for guests with 24 VCPUs). > This can be further aggravated by sending a lot of external interrupts to the > guest. > > A malicious app can abuse this scenario, causing a DoS of the host Linux. > Until the KVM openpic code is refactored to use finer lock granularity, impose > a limitation on the number of VCPUs a guest can have when running on a > PREEMPT_RT_FULL system with KVM_MPIC emulation. > > Signed-off-by: Mihai Caraman > Signed-off-by: Bogdan Purcareata > Reviewed-by: Scott Wood I don't think this patch is reasonable to take upstream. If we have a latency issue, whoever spawned KVM VMs made a decision to spawn such big VMs. I'd say let's leave it at MAX_VCPUS == NR_CPUS for now and rather get someone to resolve any locking problems for real ;). Alex > --- > arch/powerpc/include/asm/kvm_host.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h > index 8ef0512..6f6b928 100644 > --- a/arch/powerpc/include/asm/kvm_host.h > +++ b/arch/powerpc/include/asm/kvm_host.h > @@ -36,8 +36,14 @@ > #include > #include > > +#if defined(CONFIG_PREEMPT_RT_FULL) && defined(CONFIG_KVM_MPIC) > +/* Limit the number of vcpus due to in-kernel mpic concurrency */ > +#define KVM_MAX_VCPUS 4 > +#define KVM_MAX_VCORES 4 > +#else > #define KVM_MAX_VCPUS NR_CPUS > #define KVM_MAX_VCORES NR_CPUS > +#endif > #define KVM_USER_MEM_SLOTS 32 > #define KVM_MEM_SLOTS_NUM KVM_USER_MEM_SLOTS > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/