From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755476AbdJLJWg (ORCPT ); Thu, 12 Oct 2017 05:22:36 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:36290 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751420AbdJLJWf (ORCPT ); Thu, 12 Oct 2017 05:22:35 -0400 Date: Thu, 12 Oct 2017 11:22:20 +0200 (CEST) From: Thomas Gleixner To: Marc Zyngier cc: linux-kernel@vger.kernel.org, Jason Cooper , Shanker Donthineni , Shameer Kolothum , Christoffer Dall , Eric Auger Subject: Re: [PATCH 10/10] irqchip/gic-v4: Make the doorbells managed affinity interrupts In-Reply-To: <20171010125137.9464-11-marc.zyngier@arm.com> Message-ID: References: <20171010125137.9464-1-marc.zyngier@arm.com> <20171010125137.9464-11-marc.zyngier@arm.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Oct 2017, Marc Zyngier wrote: > int its_alloc_vcpu_irqs(struct its_vm *vm) > { > int vpe_base_irq, i; > > + vm->affinity_masks = kzalloc(vm->nr_vpes * sizeof(*vm->affinity_masks), > + GFP_KERNEL); > + if (!vm->affinity_masks) > + goto err; > + > + for (i = 0; i < vm->nr_vpes; i++) { > + if (!alloc_cpumask_var(&vm->affinity_masks[i], GFP_KERNEL)) > + goto err; > + > + cpumask_copy(vm->affinity_masks[i], cpu_possible_mask); That looks a bit like abuse of managed interrupts as you don't use any of the managing parts, i.e. the managed shutdown/startup on cpu hotplug. You can prevent user space from fiddling with the affinities by flagging these interrupts with IRQ_NO_BALANCING. Thanks, tglx