From patchwork Wed Oct 7 12:20:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 11820533 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDC27618 for ; Wed, 7 Oct 2020 12:20:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92FE920789 for ; Wed, 7 Oct 2020 12:20:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="x/d2uFk8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728166AbgJGMUZ (ORCPT ); Wed, 7 Oct 2020 08:20:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727927AbgJGMUZ (ORCPT ); Wed, 7 Oct 2020 08:20:25 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA16C061755; Wed, 7 Oct 2020 05:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Mime-Version:Content-Type:Date:Cc:To: From:Subject:Message-ID:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=QVdD3TQ2H6lJ3p8rHm4Fp9Y1icR9/VihX18vHOISEEM=; b=x/d2uFk8Hy5K8rV8FK5BCbfmK4 P/DG5WBcs5qbI0hOmIASOKELpBbPskWT0Gw+jopgoRvPaMAmdjMq4NWk+8nOSqmBeYt1COIEFtiMH pxf4u+e0klNXyoSBB3nzz7zp786+GIvi+XYK+OPNgs9oDZobWN5CdnQvQe9bj/laKopPCyuIkE8wH Wu6h2GiMBFn5M3BEe2rblqeRI3V7EsaWkYqOkKOdIF68SsM2rXQOJY9sum/WQwLthnN89a0Si1/Px c45Cl552vYxCzmVDLj6N1QwW+xFmiNwarpbo2/BguoAtorxV0Ai2zUab1GJAZ/fEAXpMW6FPy382R F3D8B6eg==; Received: from [54.239.6.187] (helo=freeip.amazon.com) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQ8Qg-0007ya-Mo; Wed, 07 Oct 2020 12:20:22 +0000 Message-ID: <803bb6b2212e65c568c84ff6882c2aa8a0ee03d5.camel@infradead.org> Subject: [PATCH 0/5] Fix x2apic enablement and allow up to 32768 CPUs without IR where supported From: David Woodhouse To: x86 Cc: kvm , Thomas Gleixner , Paolo Bonzini , linux-kernel Date: Wed, 07 Oct 2020 13:20:20 +0100 X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Splitting out the simpler parts of my previous patch set. The full support for per-irqdomain affinity limits will take a bit more work but this part is quite simple. Since we don't yet have per-irqdomain affinity, we currently attempt to avoid bringing CPUs online at all if they can't be targeted by external interrupts. Except we still let them get hotplugged later... which is moderately suboptimal. Fix that, and support the hypervisor enlightenment which at least extends the range of targetable APIC IDs to 15 bits, as seen in the patch at https://patchwork.kernel.org/patch/11816693/ for qemu. David Woodhouse (5): x86/apic: Fix x2apic enablement without interrupt remapping x86/msi: Only use high bits of MSI address for DMAR unit x86/ioapic: Handle Extended Destination ID field in RTE x86/apic: Support 15 bits of APIC ID in IOAPIC/MSI where available x86/kvm: Add KVM_FEATURE_MSI_EXT_DEST_ID Documentation/virt/kvm/cpuid.rst | 4 ++++ arch/x86/include/asm/apic.h | 1 + arch/x86/include/asm/io_apic.h | 3 ++- arch/x86/include/asm/mpspec.h | 1 + arch/x86/include/asm/x86_init.h | 2 ++ arch/x86/include/uapi/asm/kvm_para.h | 1 + arch/x86/kernel/apic/apic.c | 27 +++++++++++++++++++++------ arch/x86/kernel/apic/io_apic.c | 19 +++++++++++++------ arch/x86/kernel/apic/msi.c | 41 +++++++++++++++++++++++++++++++++++------ arch/x86/kernel/apic/x2apic_phys.c | 9 +++++++++ arch/x86/kernel/kvm.c | 6 ++++++ arch/x86/kernel/x86_init.c | 1 + 12 files changed, 96 insertions(+), 19 deletions(-)