From patchwork Fri Dec 2 14:03:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 28919 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp875676wrr; Fri, 2 Dec 2022 06:05:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf48Rz2h4+MY31Vc6xB7aRI3sQBMMazNicHtHmb+UIdfW9y+xMfUEaadN/TONWz8wHuBeU9u X-Received: by 2002:a17:906:3291:b0:7c0:bda4:2dab with SMTP id 17-20020a170906329100b007c0bda42dabmr3707758ejw.521.1669989936277; Fri, 02 Dec 2022 06:05:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669989936; cv=none; d=google.com; s=arc-20160816; b=e3a0Px85hrWzKGKxnYfvnGRJci6QUJZubP6gBWci5HOj2KHR0pMxPoKFwicEugQy3B WZxqOuprJn5o9G145u74YAuvNiXgXqnn/ZTDjO0xAD8fwgejkOxdYi586N5CMxqEN+df aeO8ALLOD3MPQcP284RNy7lcQJzlKf9R7FF8+sfm6Vf0Atm5NOAhlfemetu/xQM1AigT KdqYICLJsBLD/b3uaHBCvfEkiENS7BnQF8aooAkA4YxzNNsC0K3JzWZdeqyvmccz59ur qjjJVGnP1XbK/f9IxkGiJ93x5ZRFBVwAa0LiB+YKPiRts6DNVrvvPZ4xyyqoebDS2Mzd oQ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=v9/VVB6YB4wgZHpv4JxrSHkdVN43DQfG6ar/1FBDzPY=; b=l+7X0yLVemRn+1uEikASc/+In69o1zCjgTCHn3vGJOxPy8c4qA5xVUCV3fHrnSrHUZ khFtgvgbiFqmBqUSz3Z6KrliItF/Bu+xpyJcaRFbevMQOAotQNYDLuZVXKUVm5RjhQvZ lHec3N+h7zFUdQLxpm/V1udCIdzgVt0xeeUsV/X7vCCrFH/CZ28ulEGxiNhKCiiQDTD0 jlS3NxNvhKaQet9P9bHhw+AzkHMY8uhEGzyKIgH+niA4j0f0fK3c8brbajBxyKa4Yron HeCTh6Z9Rs4WOhXF1bSwBcleJxx4d6xFqdvJVSIcOKVE9OuFi2MRn0qgz4NapC+Yf71k 6VCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ayIxdckX; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a056402274200b0046b392e8c56si6649215edd.10.2022.12.02.06.04.54; Fri, 02 Dec 2022 06:05:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ayIxdckX; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233257AbiLBOEC (ORCPT + 99 others); Fri, 2 Dec 2022 09:04:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231776AbiLBOEB (ORCPT ); Fri, 2 Dec 2022 09:04:01 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3599BCCFF0; Fri, 2 Dec 2022 06:04:00 -0800 (PST) Date: Fri, 02 Dec 2022 14:03:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669989838; 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=v9/VVB6YB4wgZHpv4JxrSHkdVN43DQfG6ar/1FBDzPY=; b=ayIxdckXlrlkUKiQek92NRftJ2jIVde3UnRJl+Pg522qr3Rw35u0mn0YHUJxHBjCHkr0/g szYakWh5ofW43NieOlXNxw4yJu9gaWwG2CYGKgg9mCmUtPaSZMXzMXsRWzlF8inQWUCTN/ i3ZJD3iftxvY25AQDCMUVrx9VqOUDCIrrJfwklinzBV6phvGSEduzUrUGav36RXcbqpUw7 wJ6ZSy8woaLi0MuTfTLKOOsd3CEWt81TFVzQuHXrKXVvrVbWcfThnakJjF+0yW6oYVhq+i pNOWzo3EeOmr0wTWpGs3CSHaAxBtU3w+jGMrJ05sdzmejvRrDhkdF89jjhw5cA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669989838; 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=v9/VVB6YB4wgZHpv4JxrSHkdVN43DQfG6ar/1FBDzPY=; b=7CCHGJkvu2uuSpyJRgmyCXEOHi6FQoqWux2FM3sHlmA9UxBgVJxpZv1GTJQEx8PqXTJVOc SG8rNbtlcXzkKdCw== From: "tip-bot2 for Rahul Tanwar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/of: Add support for boot time interrupt delivery mode configuration Cc: Rahul Tanwar , Thomas Gleixner , Andy Shevchenko , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221124084143.21841-5-rtanwar@maxlinear.com> References: <20221124084143.21841-5-rtanwar@maxlinear.com> MIME-Version: 1.0 Message-ID: <166998983740.4906.7393408926569297500.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750367059982910483?= X-GMAIL-MSGID: =?utf-8?q?1751111367716008914?= The following commit has been merged into the x86/apic branch of tip: Commit-ID: 2833275568755eb937a52c358bf8bfa7125a463e Gitweb: https://git.kernel.org/tip/2833275568755eb937a52c358bf8bfa7125a463e Author: Rahul Tanwar AuthorDate: Thu, 24 Nov 2022 16:41:43 +08:00 Committer: Thomas Gleixner CommitterDate: Fri, 02 Dec 2022 14:57:14 +01:00 x86/of: Add support for boot time interrupt delivery mode configuration Presently, init/boot time interrupt delivery mode is enumerated only for ACPI enabled systems by parsing MADT table or for older systems by parsing MP table. But for OF based x86 systems, it is assumed & hardcoded to be legacy PIC mode. This causes a boot time crash for platforms which do not provide a 8259 compliant legacy PIC. Add support for configuration of init time interrupt delivery mode for x86 OF based systems by introducing a new optional boolean property 'intel,virtual-wire-mode' for the local APIC interrupt-controller node. This property emulates IMCRP Bit 7 of MP feature info byte 2 of MP floating pointer structure. Defaults to legacy PIC mode if absent. Configures it to virtual wire compatibility mode if present. Signed-off-by: Rahul Tanwar Signed-off-by: Thomas Gleixner Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20221124084143.21841-5-rtanwar@maxlinear.com --- arch/x86/kernel/devicetree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 484783f..28da5dd 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -162,7 +162,14 @@ static void __init dtb_lapic_setup(void) return; } smp_found_config = 1; - pic_mode = 1; + if (of_property_read_bool(dn, "intel,virtual-wire-mode")) { + pr_info("Virtual Wire compatibility mode.\n"); + pic_mode = 0; + } else { + pr_info("IMCR and PIC compatibility mode.\n"); + pic_mode = 1; + } + register_lapic_address(lapic_addr); }