Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2339549ybh; Mon, 9 Mar 2020 04:03:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vssDr42c4dasvM42RMo5o4KFMJqmLJFrCfej6it7LFK/x17ntVdtX4uZvBgaoPh54UEWn7A X-Received: by 2002:aca:f1c6:: with SMTP id p189mr11079137oih.159.1583751801208; Mon, 09 Mar 2020 04:03:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1583751801; cv=pass; d=google.com; s=arc-20160816; b=xBtA+CtggasWZZ1aQMzJXYmRnOwvYPirjSHbTV/ehQIbX3DRMC1cVwqiPKVDGykMus rmYiF5z1V+JCDtnFE7maVeba6h9n1IqNBptelaY2M9K66oLPmZR8KqucdBMkHd8hSznv uJr7tWLO2m+pbO6E8jDfRCwhw/Vn8w+06oIhtH88X4N6c3Gl7Klma5qQ5UJupOVDN4oo eibDyuumOwkXyPX88TEaeeoXUANgFOAzRPVtc4090bxw75OkcHOf+NJb+nFq1fRWZPS9 HhoeeDNc9otmXIp3brlqmSc3wMwkNZOvpcsQ5niQgrd8cVcuL1Mj3CHxRZg/yaXt4+du xtxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:wdcipoutbound:mime-version:message-id :date:subject:cc:to:from:dkim-signature:ironport-sdr:dkim-signature; bh=A/hFe8VzQ+WAZFLAlQOc+1ctZ4qDLYi2vjRGrBJnth0=; b=Mf9x7WxODFzH3ZFw6hWtLVaL/9G1AxEarp1d8CBevAIIpDgjRgTPCieQUqLN9oVLDv WYupna7nteR7tWMhS5hcIqWlmmLOm95Wpy2SZLxWMsZGp/WkHj2s3PGgMuJf6uDhyzrK Y9HETj2S3p+47nzmGwOU+wMy3KhX/ANtM5Kar9xXCjlMW2sY5/xAaGXkxmOG04z2Mvhr tXlsQsEnauOrCPgPawFbRaqo/K4EXEvgRy9UF3BcHT+Py7PHCIJ2Od/4vjQkAq9aJqno 1FvUOdRSyvROvP2pZ10WumFHdTiVVlO8ZBqriWSloaDxUcpJeXXRetYTD0YbpLvENHCm koKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=UY4QIiFZ; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector2-sharedspace-onmicrosoft-com header.b=UwD7ktSW; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si5636880otp.147.2020.03.09.04.03.08; Mon, 09 Mar 2020 04:03:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=UY4QIiFZ; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector2-sharedspace-onmicrosoft-com header.b=UwD7ktSW; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbgCILCt (ORCPT + 99 others); Mon, 9 Mar 2020 07:02:49 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:59095 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbgCILCt (ORCPT ); Mon, 9 Mar 2020 07:02:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1583751769; x=1615287769; h=from:to:cc:subject:date:message-id:mime-version; bh=wCcLcuE+2nS2H/HLQ/3IzI8Yp3Nu8DKv6sZOIdeteGY=; b=UY4QIiFZiK/UauA1tz6lUX9xYFEWGF5JIo1cP+OR10De/oiuVO4DE8GJ aq4iX/677pu1+IfHJlQa1nIH5FkmYujYQi9BcTGz5v4M4v8EBFzo7ZHHi Rk+QrutktAxRXW/I8QO7qYcdE20Zh5F4zE1xtzJExYMhIeRhMpc0aRC8S JiAUDDJOCYLRSxwC4X5Kh/iJRr1/wC+GgZsnIw4gjA+MtbeNTk+UR3Ndx cgzJEcWGafzCsZpR7hGmryrb5BdV7OG6pYw6jkBn8PAQ36J7I49I1PNwx 2cdKVbFSfTEZO2wpCVd6xF5i71FDB9H2aLMBwsbqFun9MTQD4Nzy0/UmH A==; IronPort-SDR: M4BkTxj10tFmtgKFxchSF6ktnYgtKAoVHNCCIaTus3diu1On3qRcR0RDiwj9lqxvUNx7OX77k1 Y5U7iqNxQ/NIvGz1s+eVQjP4CL1Le6C1rkOb/lWmRzLM4WL8gYXFlXyrzZLykzcGreRChzt6JE A4x/I3cOVjpP8YSgH9Xt1n92w+jQVv68dVoVo/LV6D4Ojbc50OhCxCtU0oWChW7jlN5xP3bvRO x+2zqV0wTAsimSihtPyoCsQ7AlfPf0rv1x3NumUf670GFICNlWqkoB6VolYs7mYDUJnx+e9Kuo YNY= X-URL-LookUp-ScanningError: 1 X-IronPort-AV: E=Sophos;i="5.70,533,1574092800"; d="scan'208";a="132431307" Received: from mail-mw2nam12lp2043.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.43]) by ob1.hgst.iphmx.com with ESMTP; 09 Mar 2020 19:02:43 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VE26+YdQH+JYkSB9LTJdrHJnf1AgojVHkfpff6Bam3AFwtGq+EnmeOM3vmRQ0WA+TkRW4Vm11m0BRUvDqRoYfiIhoRQmK5YZrKPI+S3Y/Ay7F+nN/yw5fckVVuAJe60fXVvwFOxbWV3CN6athfIowJjpM+FNfIuEC337fDBcTnFJivTvjBryGndP3rq7fqvMiOtsNpaZx9j0WVnGV5SgSM7FkhnOWMll3IBfxeGcJps0sHagv9ymkomnwuDUfi6aK055Yk1ByjiKy14QMNwN6tzS3BRdEMxd9ZDnFuMhXo4ucVp8F2fXq/pXPSYRmaIBGmrkiC18qnnUEY7FXlt9CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A/hFe8VzQ+WAZFLAlQOc+1ctZ4qDLYi2vjRGrBJnth0=; b=kIHqGUxZgA3yUzL8rqUUtSIDgBETE4D9oea7kE81KFZVY2wNSdJ4e6ZldmwzVo3xrY5DplFlnRHOO9fQWlXnLjn0U60KGkgRIgACAPkFYaQw4NV0YdZv/s8FHl1yzxZN151tyEjM0Vn3y9wjQzJ3oiAahegszqEuDTfK9YXCCEREis/IIfy/WeirqvkYUBg1WSfjHCGqAUlHiVFiD+qBQwmC8hE3CIflIx76cIZgNN1WzLUfA/aO3FlHJsPDW8iJDJOK1l+7sTzjzengAiSRXE0Y+lwSIo+8UejDxBCc9IocDNtB7SC2Zyn2XiA1Occ/Fuiaoq6vQBd5XhALzfn0Ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A/hFe8VzQ+WAZFLAlQOc+1ctZ4qDLYi2vjRGrBJnth0=; b=UwD7ktSWICI9bxe82wbAtvdi6HJcDNaOAd7S7LcaWJQiehZi5qLBxgK9rNZdqUDFTaifcIlLIPM3YrSbBCMCOaQWvrHszBWYyJTASbBDP8czKKyqz6Vfj3FN49mh0oBSHoHIYUxQ0ylAZMxcsWd4T75hBA/OdJY+okgyeSnqPxY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; Received: from MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) by MN2PR04MB5517.namprd04.prod.outlook.com (2603:10b6:208:d6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Mon, 9 Mar 2020 11:02:42 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::159d:10c9:f6df:64c8]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::159d:10c9:f6df:64c8%6]) with mapi id 15.20.2793.013; Mon, 9 Mar 2020 11:02:42 +0000 From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Albert Ou , Daniel Lezcano , Thomas Gleixner , Jason Cooper , Marc Zyngier Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel Subject: [PATCH v4 0/5] New RISC-V Local Interrupt Controller Driver Date: Mon, 9 Mar 2020 16:32:06 +0530 Message-Id: <20200309110211.91130-1-anup.patel@wdc.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: MAXPR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::13) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from wdc.com (106.51.22.61) by MAXPR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:49::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11 via Frontend Transport; Mon, 9 Mar 2020 11:02:36 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [106.51.22.61] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 139dcd0a-ac2f-4989-d3e7-08d7c419638e X-MS-TrafficTypeDiagnostic: MN2PR04MB5517: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: WDCIPOUTBOUND: EOP-TRUE X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0337AFFE9A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4636009)(39860400002)(376002)(136003)(396003)(366004)(346002)(189003)(199004)(8886007)(86362001)(26005)(1076003)(55236004)(1006002)(6666004)(5660300002)(44832011)(4326008)(966005)(55016002)(478600001)(36756003)(54906003)(110136005)(81156014)(186003)(8676002)(81166006)(16526019)(7416002)(8936002)(7696005)(316002)(66556008)(956004)(66946007)(66476007)(2616005)(2906002)(52116002)(32040200004);DIR:OUT;SFP:1102;SCL:1;SRVR:MN2PR04MB5517;H:MN2PR04MB6061.namprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +gkPnxeXMtvAI74km+LNuwm/WA5FN9uRYAoC9RXi5vttoqRL5WIAhr21dtu9Mi8Z+i8I6RN40TYhnwdEBT/1s1AYs6r/+8niNwvq+pO3OFpnw9yEAmi4P54CTTy3b0ukJqgDBdeiYj1L6cuf9zpIkp2IRUk86TxiStthXPxmT0pu2NTlzKGbWbLGzE+bdoLVUH36jqsXi+33tqzfXwso5r8bep+75WqzIdzeNt+H0S3RXBnqK4BNElVdreRpXfPeo+QfjapCpTtPv2FYFLhoZdjIQpYHNqm1oa+zc7fb3lw/tJDdrXfT6PpDnzRDtLq2TMLlBEgkywQLx7FEaBkU4RU3xSvOXY3A9SQHiKg6oPxFo/WR9zxbfBdcECuJNWZ5hr8L2NwUw++1K6SywMIF1XqaIjLF7BFyxGXSDckfLNzaL3EoEPSfGO6mYDdZ2uTXeJxsC0gT///catWzjNlQ2vW9QXwhF++4TaMfmZPcCXtfOfjYalUcSDllJ5aBvyPf5dHoqCRpagsnBOxjFOGmFuop++/rs3NpH6nbCPvKlAeG0G8q81oVXTmOOJJG7q1ifN3h7uhUXIsv2ItnHMdGQw== X-MS-Exchange-AntiSpam-MessageData: uvTnbZiho9UFjB+Z5qkqfgHBX1cc98PhczvC3JDas54XBN09nKfU189UUGVKYhnEStdldxovtIcuOOxM1H4CizTjFAnyaRAkiwLOxIDrsgmU8a80mEHGPIeG1qNEn2ISQkGpT+GQUVuECVXhYUdFug== X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 139dcd0a-ac2f-4989-d3e7-08d7c419638e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2020 11:02:42.1984 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5x2GosQ3B/mYkWiBFomDCMUJmD8YgqsrSFHZMLamd9uoktaV8xv/tO6iPJbD+nNee3VgCaYq19VF95GUWgOeUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5517 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset provides a new RISC-V Local Interrupt Controller Driver for managing per-CPU local interrupts. The overall approach is inspired from the way per-CPU local interrupts are handled by Linux ARM64 and ARM GICv3 driver. Few advantages of this new driver over previous one are: 1. It registers all local interrupts as per-CPU interrupts 2. The KVM RISC-V can use this driver to implement interrupt handler for per-HART guest external interrupt defined by the RISC-V H-Extension 3. In future, we can develop drivers for devices with per-HART interrupts without changing arch code or this driver With this patchset, output of "cat /proc/interrupts" looks as follows: CPU0 CPU1 CPU2 CPU3 2: 379 0 0 0 SiFive PLIC 10 ttyS0 3: 591 0 0 0 SiFive PLIC 8 virtio0 5: 5079 10821 8435 12984 RISC-V INTC 5 riscv-timer IPI0: 2045 2537 891 870 Rescheduling interrupts IPI1: 9 269 91 168 Function call interrupts IPI2: 0 0 0 0 CPU stop interrupts The patchset is based up Linux-5.6-rc5 and can be found at riscv_intc_v4 branch of: https://github.com/avpatel/linux.git Changes since v3: - Rebased to Linux-5.6-rc5 and Atish's PLIC patches - Added separate patch to rename and move plic_find_hart_id() to arch directory - Use riscv_of_parent_hartid() in riscv_intc_init() instead of atomic counter Changes since v2: - Dropped PATCH2 since it was merged long-time back - Rebased series from Linux-4.19-rc2 to Linux-5.6-rc2 Changes since v1: - Removed changes related to puggable IPI triggering - Separate patch for self-contained IPI handling routine - Removed patch for GENERIC_IRQ kconfig options - Added patch to remove do_IRQ() function - Rebased upon Atish's SMP patches Anup Patel (5): RISC-V: self-contained IPI handling routine RISC-V: Rename and move plic_find_hart_id() to arch directory irqchip: RISC-V Per-HART Local Interrupt Controller Driver clocksource: timer-riscv: Make timer interrupt as a per-CPU interrupt RISC-V: Remove do_IRQ() function arch/riscv/Kconfig | 1 + arch/riscv/include/asm/irq.h | 5 -- arch/riscv/include/asm/processor.h | 1 + arch/riscv/include/asm/smp.h | 3 + arch/riscv/kernel/cpu.c | 16 ++++ arch/riscv/kernel/entry.S | 4 +- arch/riscv/kernel/irq.c | 33 +------ arch/riscv/kernel/smp.c | 11 ++- arch/riscv/kernel/traps.c | 2 - drivers/clocksource/timer-riscv.c | 79 +++++++++++------ drivers/irqchip/Kconfig | 13 +++ drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-riscv-intc.c | 134 +++++++++++++++++++++++++++++ drivers/irqchip/irq-sifive-plic.c | 40 ++++----- include/linux/cpuhotplug.h | 1 + 15 files changed, 256 insertions(+), 88 deletions(-) create mode 100644 drivers/irqchip/irq-riscv-intc.c -- 2.17.1