From patchwork Wed Nov 23 10:08:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Tanwar X-Patchwork-Id: 24866 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2707230wrr; Wed, 23 Nov 2022 02:33:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf6PM7BUAaj95pEad8sMeLHlPaQ+wD92UI3jdSrD03bgUxc4rxbDQFFfZBnMbGtLg8vdMZcM X-Received: by 2002:a17:902:c7d1:b0:179:b756:5b60 with SMTP id r17-20020a170902c7d100b00179b7565b60mr11755397pla.22.1669199582424; Wed, 23 Nov 2022 02:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669199582; cv=none; d=google.com; s=arc-20160816; b=l/aZeB9+m13TeqeDDJqbwK3W13uzjNWW5lWFacmmjpcnbMPU9dhKwCSNDmjtlSX/si wIM785zODarkvJfzdBtyTrpIINnuQRNyi/yCwLJI/xdwhpp5cMfwsPCLRIgYqom4Irhf TRDdeDEShwS/AgxVok30cPTTFc5ihgVeZ9hegaSlGUs51bh6+nM571L+0iqyzMHjf4or HxfCwksGw5gSSgWpaQjWblisDKF3lyy6AOUFh4SLQaJ5zy9y6i995VUl9gDuQxUg9Ahl LfyBDwLKqhawNvBk0wIxmlGbfrOaYdJLM6jru8KAeR3s9QJEPIr4N//WkCRA2d4FMn+R tY3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Mc2NS0olCt0qUzsLi0zWfYaDeL0jAmHwQjCqJZ5SsT8=; b=jJnRfO0/7s+YXISldttwCVlKSYzFOsTEpYw6hfEQq9F5kqXYdXLoCkn62tYN3TH3Tn /+BfR0aM6G0iUonaK5kt/f+JuQlFV3SMX8VS7TLkLm1AOhJRplPlvrjd/o/zPjDOu8r1 mmCQyXEX2WJUUgPj/zqAbgSxz37Scr5V56SpvMjlzzNKQGJQ9tYJ5ZRFfZqNNxVgPUBG JCrHpoLJ5YcQQJ5nCWIVVOleQ5EDJaocRh0zvzph2yOoapKzHclANr4TAjTLAhvmHGOa o3T+gYJ7F/8oKPdy2Np1p3ilTkN+x9nw6nvCPciUBaTcytzVeURCf878VNxNM/Br7YIB XlxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maxlinear.com header.s=selector header.b=RcvdiO6Z; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=maxlinear.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q185-20020a632ac2000000b00450200a1078si16856739pgq.853.2022.11.23.02.32.49; Wed, 23 Nov 2022 02:33:02 -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=@maxlinear.com header.s=selector header.b=RcvdiO6Z; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=maxlinear.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236847AbiKWK0K (ORCPT + 99 others); Wed, 23 Nov 2022 05:26:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235897AbiKWKZJ (ORCPT ); Wed, 23 Nov 2022 05:25:09 -0500 Received: from us-smtp-delivery-115.mimecast.com (us-smtp-delivery-115.mimecast.com [170.10.133.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680A2134127 for ; Wed, 23 Nov 2022 02:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maxlinear.com; s=selector; t=1669198160; h=from:from: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=Mc2NS0olCt0qUzsLi0zWfYaDeL0jAmHwQjCqJZ5SsT8=; b=RcvdiO6Z5CWmhEdhqft/GB4vg4tSIdwBuJIKKXpQfQT+xc7Kegd+QZg0pznnshEcoAInde pv13+9o2HgiLWUBS64bAlZkrtEwAdxMlRaMjkljXH2/Xkk6uECsFDLCHVv2m77cfMtDVWl AIZdDDc4GBfqpKRwGdrcST2SD75Y/2kP237JiMZVxSQgDb8hqEOzsaSpPC1b2FjjpHqTz0 jxmNk/3UH58Ji3eY0PaAKxy64v5MxqMyXwB9Tl4YC8FQHI2mYZXYOvrmJoRzByUgqM0TxN fsZTSMn9Mr09pWK1Pl6L7WAUesOIk/Sg2kEdMI/CX3KjkHD9eKCfcVM/33wDJA== Received: from mail.maxlinear.com (174-47-1-84.static.ctl.one [174.47.1.84]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id us-mta-60-BskRCc8PMByVuKyULDY1HA-1; Wed, 23 Nov 2022 05:09:16 -0500 X-MC-Unique: BskRCc8PMByVuKyULDY1HA-1 Received: from sgsxdev001.isng.phoenix.local (10.226.81.111) by mail.maxlinear.com (10.23.38.119) with Microsoft SMTP Server id 15.1.2375.24; Wed, 23 Nov 2022 02:09:08 -0800 From: Rahul Tanwar To: Rahul Tanwar , , CC: Thomas Gleixner , Marc Zyngier , "Rob Herring" , Krzysztof Kozlowski , Ingo Molnar , "Borislav Petkov" , Dave Hansen , , "H. Peter Anvin" , , Subject: [PATCH v4 4/4] x86/of: Add support for boot time interrupt delivery mode configuration Date: Wed, 23 Nov 2022 18:08:50 +0800 Message-ID: <20221123100850.22969-5-rtanwar@maxlinear.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221123100850.22969-1-rtanwar@maxlinear.com> References: <20221123100850.22969-1-rtanwar@maxlinear.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: maxlinear.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1750282621383475499?= X-GMAIL-MSGID: =?utf-8?q?1750282621383475499?= 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 legacy PIC mode. This causes boot time crash for platforms which do not use 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 interrupt-controller node of local APIC. 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 Reviewed-by: Andy Shevchenko --- 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 fcc6f1b7818f..458e43490414 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -167,7 +167,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); }