Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1173232rdb; Fri, 16 Feb 2024 07:26:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUNNBkP+3WlLAtIVW4VCuIDvWe6WRpMwSfSdQnRevHSc5eLpoDGTVSrXVKYk0Ocv5gz1aqqXRJ6jrX/qCgU5LlfQP8F0U3kBtvbcEPfdw== X-Google-Smtp-Source: AGHT+IHyJ54AHax7qylP8tLJenJNo35bo/0PToPuZuSpIvFcGgB7QH7MZtEXnQaw40al6JuhpijU X-Received: by 2002:a17:90a:e54c:b0:299:4649:13cb with SMTP id ei12-20020a17090ae54c00b00299464913cbmr949438pjb.9.1708097215411; Fri, 16 Feb 2024 07:26:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708097215; cv=pass; d=google.com; s=arc-20160816; b=ItIvIs+xq2jAjheS7O4idOKd9qSR8v+ToPz96PYtYk04Dk6HKyYdIR0SH+Y3peS1Z0 QFKyxyt6BQ1te4J5p2HIvIDQLOzG3wQLrt5H70t1uQLF4oDPXnqOw9yahr3xsixoqylO u9uA7cmdXNcsTmZTQT6dPfKF9HU/K05H8NWseyx6iuvtTsrRnyucV+VQTYZUBx7568Yc FOtc/zv5AW2Xc9f6Cbo55Y+ACWA5qItYFrHBGgwisqHn60LTLV1g/Lq1InyRNkzWw080 tNtoKUDx615ZUyMQVwi6EA37GtBMlH4PprBeGh6jY+jz8aJJGss+OVzTfmmcTkibzfva yReA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=lUVHMDjVvNB99KLv6E8yPEeFuwnUs0okqaffWIw/b2w=; fh=HfXWoIhgCc+vt39DMIJv/Ec0aAKnw0eFA8QxuIQTUoQ=; b=jc+w7cUoigr9RMd+kz5aq/8v0GdKcquLWdvo0j8/osfLqZBoIZxxiNZyhe09cnHXUP 5xZFuw3oZZdD03TBcQ7yiMO27j5RGAKIKH3UlsMAN8831HZL1gCUP7AWp1bKdJWBMuXF qphTc04veVlQyKupdVCb+uYZ0dyrHWy4LoXfsFs9d2myI8+VPXZD+GRLG8YEyKNV17Tm APtI09xMosVwPXRSzp4G3BibkFjWnDjz/XaInvAOpXLp/VO1FG8ds+qhc2hEIbCQOSLn VubOMgfhmjYm7qMwp5Oufim25H8LCMIAwCAMTQhZwNShzR2Q2HotQ84ljr9+2YdRG7Id Kyvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zXYKlP40; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id sf3-20020a17090b51c300b0029606bc0b08si96531pjb.171.2024.02.16.07.26.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:26:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zXYKlP40; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-68837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC938286475 for ; Fri, 16 Feb 2024 15:26:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 086F814C599; Fri, 16 Feb 2024 15:17:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zXYKlP40"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="js/BmHmR" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32181146001; Fri, 16 Feb 2024 15:17:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096645; cv=none; b=cUmV4/ODmyFlC9qAl5xCQCMb7oMelkhUmCKnuoo9w+pdAVpX0wiFdAK2/GSp7FppsjHqP4C1ozfgrTdZNl2GkhAeFjspVjwG2fiBzMq2TtRULX56e9KOwHsqsPQ1CwggeY2WnkVHD+fzVPO6LOQhmv/aACJ3+9f3eb1SYhUiiig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096645; c=relaxed/simple; bh=xQ3Nmv0qtbbeuF2j1KWBwFbp5ifZoPiPhtRV9J3XPUM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=BVrZ9KipMYxKov+TqIbXBmf6GAfGP53jPk/lVntren1ngRc+3tw9hXgcUWQOiU0fv2n/FPdA1HDySxE3DEmcscWfqoZn6ioGAbWRK6io5CcFiC9iNea0x7DusMGscahO5wGjjgZfL636JBD29zYn9Xx9hJI5BNfjQfiqNcuYgR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zXYKlP40; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=js/BmHmR; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Fri, 16 Feb 2024 15:17:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708096642; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lUVHMDjVvNB99KLv6E8yPEeFuwnUs0okqaffWIw/b2w=; b=zXYKlP40PU2MJpBPBnykIlRoTwPn4/fUDSt1ZqlPcxoj/hpSy/BAybBmAXCWMYWsK+vK6g 40BsjC4d5xIjbRZ2Gfx0HUfVnLM9Xc63VHUF6f4kpYtQUtcEaMpQn2YDlkICRGS/FnoLyr XrAmi9npY958lvVABRE/hrby30GIOz4cLzeOIEQghXIf03ObaiEc0N4IjlnTkQ7xWVFW6j XwrUjd047JpCEWsdYIJb8ZAmcbzJ/xrx3SQVfmhUaA502WJ+DX4m1RnlLukOCun/Wbs+mt N7TzNVO5kK+84loVxTGZnfMDdaU2441gnLgve4jg1Z6YwFiFrEEv5EIPS5Pc5A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708096642; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lUVHMDjVvNB99KLv6E8yPEeFuwnUs0okqaffWIw/b2w=; b=js/BmHmRQoWPadg5v2wUeUamOv15gayeseTfSX/ZA5nqbapRC/kBxu4uiD9WqNOTkc+eyE jn8+WvOtyGt+CcDA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/ioapic: Make io_apic_get_unique_id() simpler Cc: Thomas Gleixner , Michael Kelley , Sohil Mehta , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240212154639.119261725@linutronix.de> References: <20240212154639.119261725@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170809664165.398.18262468509349196306.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/apic branch of tip: Commit-ID: 533535afc079b745ae8a5fd06afd2ba51b3495fe Gitweb: https://git.kernel.org/tip/533535afc079b745ae8a5fd06afd2ba51b3495fe Author: Thomas Gleixner AuthorDate: Tue, 13 Feb 2024 22:04:57 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 15 Feb 2024 22:07:39 +01:00 x86/ioapic: Make io_apic_get_unique_id() simpler No need to go through APIC callbacks. It's already established that this is an ancient APIC. So just copy the present mask and use the direct physid* functions all over the place. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Sohil Mehta Link: https://lore.kernel.org/r/20240212154639.119261725@linutronix.de --- arch/x86/kernel/apic/io_apic.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index a4219b9..8dc91d0 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2498,17 +2498,9 @@ static int io_apic_get_unique_id(int ioapic, int apic_id) unsigned long flags; int i = 0; - /* - * The P4 platform supports up to 256 APIC IDs on two separate APIC - * buses (one for LAPICs, one for IOAPICs), where predecessors only - * supports up to 16 on one shared APIC bus. - * - * TBD: Expand LAPIC/IOAPIC support on P4-class systems to take full - * advantage of new APIC bus architecture. - */ - + /* Initialize the ID map */ if (physids_empty(apic_id_map)) - apic->ioapic_phys_id_map(&phys_cpu_present_map, &apic_id_map); + apic_id_map = phys_cpu_present_map; raw_spin_lock_irqsave(&ioapic_lock, flags); reg_00.raw = io_apic_read(ioapic, 0); @@ -2520,14 +2512,10 @@ static int io_apic_get_unique_id(int ioapic, int apic_id) apic_id = reg_00.bits.ID; } - /* - * Every APIC in a system must have a unique ID or we get lots of nice - * 'stuck on smp_invalidate_needed IPI wait' messages. - */ - if (apic->check_apicid_used(&apic_id_map, apic_id)) { - + /* Every APIC in a system must have a unique ID */ + if (physid_isset(apic_id, apic_id_map)) { for (i = 0; i < broadcast_id; i++) { - if (!apic->check_apicid_used(&apic_id_map, i)) + if (!physid_isset(i, apic_id_map)) break; }