From patchwork Wed Apr 22 14:35:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 185696 Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp833739ilf; Wed, 22 Apr 2020 07:35:59 -0700 (PDT) X-Received: by 2002:a17:902:8202:: with SMTP id x2mr1413975pln.287.1587566159772; Wed, 22 Apr 2020 07:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587566159; cv=none; d=google.com; s=arc-20160816; b=JUdY+SD+n7mzDigfjzTxIVod9r9q2cTaMHcT1RhS2QyGRyWNsFdeQLrFkQK4VF3CWc jK+H1en4uDV4HYBCdbP0uT0BRvUAVWuLqlLpbq1U9ge04/9cqRLjczabRZxGRaAcd79O rQenLBLqzwFmqg/9q3lq4EukMHvtbyBUZDbhrr1IRmBdamDTLaJF6qOabcAZxZ6JqKLe dMzkWo008u8AobCK64sogAa9c2I8+GKvdf88q0esG9BXA0AZ+cQaes4ZItLKfWFmne93 3YZtmGLmMYpfnPeOyB2ZVIfrCtfAN0Q2qTXOyWcUUv4t0LGtYtOi/vXP5p7GWDZu9X3n 6pQw== 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=VxQ4o9PvJLeDXlCdKC6FnBvF+Rh/OB42QR1xOvGVmug=; b=iZ+GfjMvm13rfXaSIo6yLW9wznsYZ6Z0/ehXq5cpVSj78AvWQ+5wc0T/2wYcb7rSrT 9aozylax881JiBlL1Qc1noyRTrbK40N0fsR2Cc+xb8+Zbiq+fovHk9IRKfwrIT5tl/zI WveC2PiI8f/LUbu9jtVcH4h8V27tzDlBRS1Ibbi7tATnYDKoMp6hpxYKcMd2WrWx058h bRgUtZ3xCvC9TwqvDCK31CoMvrCh9ZymqN4WxNjoqgpRu052BtpgeaQxQ1HJgkMpsd+z +dIY+C0aeX7Ajrgflh2cn41QzXK999j2rcusfZ4HIu8xG0X5gKB1eAMkUrwwqnXSRtsA MDqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hg7a3JtB; 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 m5sor8288307pls.56.2020.04.22.07.35.59 for (Google Transport Security); Wed, 22 Apr 2020 07:35:59 -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=hg7a3JtB; 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=VxQ4o9PvJLeDXlCdKC6FnBvF+Rh/OB42QR1xOvGVmug=; b=hg7a3JtB5sI2XDMCGh/9KzAX5xyYdxAvzVKH79Qn2+NyjekgcoOmY32cdhRTQckNTq t0MoxDPbPT/KUCREA4arEk7k5dwJSo0MLjmpmptbQmn9P4L3RbQ/DCeKMD/pGBJosUDT VnecFCYa4yJif6WWCt/5xQGoLAWpHYg3p0q8ojT4yko5K4G25BxOMB4mWIE/e5ZZOQNH Ol+9uNoVVp/FVxXAr3EZhXr3lfpBbNHlOVORI5d3xOVCNGDEwadF74ctwS/6CwzPa6mD cg77Sd1X7SdcAplO7WA04ct6Pu7HLxPJ4WHpJRVNDdONT80KN74lTQHKIR0XsKjxJnY7 e7DA== 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=VxQ4o9PvJLeDXlCdKC6FnBvF+Rh/OB42QR1xOvGVmug=; b=M+5Re4VvQpSlKvcphniB3kqkKn+dkP+HuWbav02PgB5MzCX9FxSkTR/jW9+41MWw4z 3dTl0KDN4BYtN2rIISiqodkeiKAry8pc9A1W/XGo0jKmtn4M0oP72pUgGzV8LfizBXnG qImkpbGZ8NOict406CG1beEzbaQe9qbjHz+Eh9X9tqQ++QbsjgW6Oj4a1//dequZU0AO jjZ6dwNClRIT/u0LKil8oBIKfgHRfHiDAbJ/YD9D4nS3CuEgUAB8GLg7VoYG1U0QtjzA JLbPIkTZiqNpMJDMKVK7XVT2M/ob42vikadtlM3Y9PDIKVjhhS1NhK+MtUqXlE203zpU GLVQ== X-Gm-Message-State: AGi0Pua3VQwAY/zljNIBMtZpsH2WeRfBWpSp8vqYHq7GYgxeutLJb56N jNocpHPWpFCoZPOXSkGM0lYun1wM X-Google-Smtp-Source: APiQypK6NjFfZDKs0UkF/9bpotSFxHPVESWWIb4eILaVJCslpqzkS8kNGsgUsWYG3xtHbqP3qYJ0HQ== X-Received: by 2002:a17:902:d201:: with SMTP id t1mr5671220ply.328.1587566159437; Wed, 22 Apr 2020 07:35:59 -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.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2020 07:35:58 -0700 (PDT) From: Sumit Garg To: daniel.thompson@linaro.org Cc: patches@linaro.org, Sumit Garg Subject: [RFC 3/4] irqchip/gic-v3: Enable arch specific IPI as pseudo NMI Date: Wed, 22 Apr 2020 20:05:22 +0530 Message-Id: <1587566123-9935-4-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> Add support to mark arch specific IPI as pseudo NMI. Currently its used to allows arm64 specific IPI_CALL_NMI_FUNC to be marked as pseudo NMI. Signed-off-by: Sumit Garg --- arch/arm64/kernel/smp.c | 5 +++++ drivers/irqchip/irq-gic-v3.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+) -- 2.7.4 diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 42fe7bb..27c8ee1 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -802,6 +802,11 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { S(IPI_CALL_NMI_FUNC, "NMI function call interrupts"), }; +int arch_get_ipinr_nmi(void) +{ + return IPI_CALL_NMI_FUNC; +} + static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) { trace_ipi_raise(target, ipi_types[ipinr]); diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index be361bf..a3d2cf3 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1048,6 +1048,11 @@ static int gic_dist_supports_lpis(void) !gicv3_nolpi); } +int __weak arch_get_ipinr_nmi(void) +{ + return -1; +} + static void gic_cpu_init(void) { void __iomem *rbase; @@ -1072,6 +1077,15 @@ static void gic_cpu_init(void) gic_cpu_config(rbase, gic_data.ppi_nr + 16, gic_redist_wait_for_rwp); + if (gic_supports_nmi()) { + int ipinr; + + ipinr = arch_get_ipinr_nmi(); + if (ipinr >= 0 && ipinr < 16) + writeb_relaxed(GICD_INT_NMI_PRI, + rbase + GICD_IPRIORITYR + ipinr); + } + /* initialise system registers */ gic_cpu_sys_reg_init(); }