From patchwork Wed Apr 22 14:35:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 185695 Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp833669ilf; Wed, 22 Apr 2020 07:35:56 -0700 (PDT) X-Received: by 2002:a4a:9605:: with SMTP id q5mr21380452ooi.16.1587566155885; Wed, 22 Apr 2020 07:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587566155; cv=none; d=google.com; s=arc-20160816; b=0xWZRX4t7yB9OwoZBmdhfGg4lRE4TavDZSwhZb51ToGDzVGJv/Asrsge4g6rDbWcoN xk8q5rCv7455/B+kY8MT7LhqLRSrQvQv9c+5K1iHZ2d/GVKZAwt02ac8AsxS7qtr4V2i iHvXQMAcOiVKB75cCXnbgNkO+ffu7rBTbqHPa06aFwtT5ohExv5yE22PcjTeZLXPfPmD NdnF0dJ5ouwDM0cinD52TQqtbhd3hxHkbgVKBFxlfdO90V2M7N/f4vwTGZMIwYsVP0PO FDszdfW7AngQn6O0y58C9yEh5FkHluyB5qcyensB5pu+/QKOE4yG2u8De9lXnxZLoC8z yyAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iZlX3qI3DOrQp2dXg0tXmAB1b4Jn5t/S/MWmmmiRunE=; b=eCS8oYt1wd50wtR0+dHQfL6Y78b2opY+AJoHK0xjKQ5lvt7VFQL4mmZqNP3tnZsqE7 mR2ox+O7WLXLtRxmOIssWTAe+vvm14M+VVEuQbJ9CT322K33qVmCjPUtUFtQTL/hdarT xfyR1K+m3XfuscEOgcvqBroAtv0uFJMuibh28zH/XylYXc5o9ykovvuzqLrBB4T0xI0c 4h8SSz865nkyyaezaovdsmrsFHb7aRL6ogDAXTlvqOLsb2fiNK4s8tDl1g0Yocf1EvlV 5hB+v4H7c6pUxXf4zhcguDEyIT/tAWitO16sSTbKNRzAwspnUwGVv386ZPMan3EWq21X vkWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QVzwvPie; spf=pass (google.com: domain of sumit.garg@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=sumit.garg@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c188sor5940247oif.59.2020.04.22.07.35.55 for (Google Transport Security); Wed, 22 Apr 2020 07:35:55 -0700 (PDT) Received-SPF: pass (google.com: domain of sumit.garg@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QVzwvPie; spf=pass (google.com: domain of sumit.garg@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=sumit.garg@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iZlX3qI3DOrQp2dXg0tXmAB1b4Jn5t/S/MWmmmiRunE=; b=QVzwvPieJ1w/H+7J2TE+7hOJr96Z6m2GANC6JfXnBkSgKWaK0EjJpophaIxYqAgZUP EZl3KcCQxYi78mmr+LCdCF945bZm0htZRanTD6tPCQD0jSZNDhmeVq2vPZOgLYkqzpRY M3obVswJMAba9yRFeRsiHrsk1G7TEwA4L7awfruMoXYtOIZaYrvhXiQKFCQQekV1Zzqd XrhClhIcHp5ml2hV4oWVdFKPdSQlhKoTAkx0CdvwdMNB3S/uggBdT81fZsRV+5QitI0I 9eyqScIP1sltyiYlAVP/MsPO/NrZHbVWhHv5JR/q6+Gjsy2yZ2WfJj5WFGDRfXN5uosS BUgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iZlX3qI3DOrQp2dXg0tXmAB1b4Jn5t/S/MWmmmiRunE=; b=bjtx6FBmUat0+HfrqYwn8oWior9MaqYyXhX87a0mqR3bHjStLrlWdXO0wkXmc/PHlU ffMJv4l4rXxmgZfWtrWLUsJJL5QcfsC9w7BbOOIaZ3fC2+kCvUpBAMoef3WH7tnBUQo1 QT9PxQVQNAqdyWLUF+EZqQguwRS2WcsLhqeD4mXLRdtbIoAI7etZZtMTcDdyT4+qQ12O 4ZPCgRzn1DNropWFakAyGdOotTOLi7+x9Ma0D7Msjp7WxZ/NTISyXde6ulXnmw8ZamtO 4EUZK5ue69c01j3rkHJe7H48zMrWsfSSq5LoFBWikA3tN7/NvFChF95ytVhSdQ3FUpkB zWUA== X-Gm-Message-State: AGi0PuZln92k33cV1YEbeQnYGqp0x6mordMW9g84qns0JLwsy9u34gxP 5LTAT6hA5MYiPVOUsEdnRIpxO6U8 X-Google-Smtp-Source: APiQypKbMLbHO0br4DeQmQP8x4NX3RI4CcvMObuiKwVlHd/XqBytzk8eCWkY2MFsJX5hmtYKMaRMgQ== X-Received: by 2002:a63:6e81:: with SMTP id j123mr28090959pgc.333.1587566155515; Wed, 22 Apr 2020 07:35:55 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([117.252.71.186]) by smtp.gmail.com with ESMTPSA id j13sm5723573pje.1.2020.04.22.07.35.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 07:35:54 -0700 (PDT) From: Sumit Garg To: daniel.thompson@linaro.org Cc: patches@linaro.org, Sumit Garg Subject: [RFC 2/4] irqchip/gic-v3: Add support to handle SGI as pseudo NMI Date: Wed, 22 Apr 2020 20:05:21 +0530 Message-Id: <1587566123-9935-3-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587566123-9935-1-git-send-email-sumit.garg@linaro.org> References: <1587566123-9935-1-git-send-email-sumit.garg@linaro.org> With pseudo NMIs enabled, interrupt controller can be configured to deliver SGI as a pseudo NMI. So add corresponding handling for SGIs. Signed-off-by: Sumit Garg --- drivers/irqchip/irq-gic-v3.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index d7006ef..be361bf 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -609,17 +609,29 @@ static inline void gic_handle_nmi(u32 irqnr, struct pt_regs *regs) if (irqs_enabled) nmi_enter(); - if (static_branch_likely(&supports_deactivate_key)) - gic_write_eoir(irqnr); /* * Leave the PSR.I bit set to prevent other NMIs to be * received while handling this one. * PSR.I will be restored when we ERET to the * interrupted context. */ - err = handle_domain_nmi(gic_data.domain, irqnr, regs); - if (err) - gic_deactivate_unhandled(irqnr); + if (likely(irqnr > 15)) { + if (static_branch_likely(&supports_deactivate_key)) + gic_write_eoir(irqnr); + + err = handle_domain_nmi(gic_data.domain, irqnr, regs); + if (err) + gic_deactivate_unhandled(irqnr); + } else { + gic_write_eoir(irqnr); + if (static_branch_likely(&supports_deactivate_key)) + gic_write_dir(irqnr); +#ifdef CONFIG_SMP + handle_IPI(irqnr, regs); +#else + WARN_ONCE(true, "Unexpected SGI received!\n"); +#endif + } if (irqs_enabled) nmi_exit();