From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753592AbdFVRKb (ORCPT ); Thu, 22 Jun 2017 13:10:31 -0400 Received: from terminus.zytor.com ([65.50.211.136]:44989 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752107AbdFVRKa (ORCPT ); Thu, 22 Jun 2017 13:10:30 -0400 Date: Thu, 22 Jun 2017 10:05:50 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, marc.zyngier@arm.com, axboe@kernel.dk, peterz@infradead.org, hch@lst.de, keith.busch@intel.com, mingo@kernel.org, mpe@ellerman.id.au Reply-To: axboe@kernel.dk, peterz@infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, marc.zyngier@arm.com, keith.busch@intel.com, mingo@kernel.org, mpe@ellerman.id.au, hch@lst.de In-Reply-To: <20170619235446.878370703@linutronix.de> References: <20170619235446.878370703@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] x86/apic: Implement effective irq mask update Git-Commit-ID: c7d6c9dd871f42c4e0ce5563d2f684e78ea673cf X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c7d6c9dd871f42c4e0ce5563d2f684e78ea673cf Gitweb: http://git.kernel.org/tip/c7d6c9dd871f42c4e0ce5563d2f684e78ea673cf Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:46 +0200 Committer: Thomas Gleixner CommitDate: Thu, 22 Jun 2017 18:21:23 +0200 x86/apic: Implement effective irq mask update Add the effective irq mask update to the apic implementations and enable effective irq masks for x86. Signed-off-by: Thomas Gleixner Cc: Jens Axboe Cc: Marc Zyngier Cc: Michael Ellerman Cc: Keith Busch Cc: Peter Zijlstra Cc: Christoph Hellwig Link: http://lkml.kernel.org/r/20170619235446.878370703@linutronix.de --- arch/x86/Kconfig | 1 + arch/x86/kernel/apic/apic.c | 3 +++ arch/x86/kernel/apic/x2apic_cluster.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index fcf1dad..0172c0b 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -87,6 +87,7 @@ config X86 select GENERIC_EARLY_IOREMAP select GENERIC_FIND_FIRST_BIT select GENERIC_IOMAP + select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP select GENERIC_IRQ_MIGRATION if SMP select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 14e5a47..e740946 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2210,6 +2210,7 @@ int default_cpu_mask_to_apicid(const struct cpumask *mask, if (cpu >= nr_cpu_ids) return -EINVAL; *apicid = per_cpu(x86_cpu_to_apicid, cpu); + irq_data_update_effective_affinity(irqdata, cpumask_of(cpu)); return 0; } @@ -2218,11 +2219,13 @@ int flat_cpu_mask_to_apicid(const struct cpumask *mask, unsigned int *apicid) { + struct cpumask *effmsk = irq_data_get_effective_affinity_mask(irqdata); unsigned long cpu_mask = cpumask_bits(mask)[0] & APIC_ALL_CPUS; if (!cpu_mask) return -EINVAL; *apicid = (unsigned int)cpu_mask; + cpumask_bits(effmsk)[0] = cpu_mask; return 0; } diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 305031e..481237c 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -107,6 +108,7 @@ static int x2apic_cpu_mask_to_apicid(const struct cpumask *mask, struct irq_data *irqdata, unsigned int *apicid) { + struct cpumask *effmsk = irq_data_get_effective_affinity_mask(irqdata); unsigned int cpu; u32 dest = 0; u16 cluster; @@ -118,10 +120,12 @@ x2apic_cpu_mask_to_apicid(const struct cpumask *mask, struct irq_data *irqdata, dest = per_cpu(x86_cpu_to_logical_apicid, cpu); cluster = x2apic_cluster(cpu); + cpumask_clear(effmsk); for_each_cpu(cpu, mask) { if (cluster != x2apic_cluster(cpu)) continue; dest |= per_cpu(x86_cpu_to_logical_apicid, cpu); + cpumask_set_cpu(cpu, effmsk); } *apicid = dest;