Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1670860rwb; Thu, 10 Nov 2022 21:18:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf6uTGXqAX7WSw0P3XfL/BNRLKUhXPw/ICwo4yaHple8y91SOAciRoS0yKg+6tAPC6LnT9Pl X-Received: by 2002:a17:906:6a18:b0:7a5:e944:9e48 with SMTP id qw24-20020a1709066a1800b007a5e9449e48mr691437ejc.109.1668143914782; Thu, 10 Nov 2022 21:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668143914; cv=none; d=google.com; s=arc-20160816; b=ZJVB6JASHKSJVNkg4R+o+Dw/2TTNV+7BHS6mFb4jmkNGFElhSlfAzi4s/pTxT7RqkT lQRK6UJX5VVo/ESY9sFHggRACw14DqQKk0sYUJTILVlISa1LCvVpAFkg0/2dPCVPtiqW ziuJCHarWxlBj8dG1pUWv8hTp5jRSBDFZ59cIjcmwpyYy9OUu423B9cipOy04sUvKvJl RhJWTadpSduuTHkLFU8NGu8R7uFh+oiBVTSciq4zuNGwCvEPcfoqAoJkX66E39RzzIbh VFNNG57z1BlpaBJuoNSUnoBLdjXKUk+LYQCjKSZbuE7aT7KaRV7C+YbcLRb0ULkALbM9 lqKA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=5rRCdDoP4ucuHJTu4Dp35ZlpfeELCSDaYd2hKM7VLR8=; b=WpAHzd7lDXgI+WYtukVOMn+dXUewnYcJZ+3Hs7AeQ/+N26CvhhfWUdtz1ZhLb3cTcb tT6U0W9JUswloOVeCQsAw5Qh+ii6WIkkZG5HpNyB5Wt8A13le2oDs4mxQ1Az25qXycEu +TgX3DIzmBwtVqAz8JlvkFAQ/PGNCGgiNJGddY0gS1XeOOKaALMeqmFD5DIanjaxw/HQ bg+PQaXFUcmH5mpukxdurRHImTHyQU5HHCN1CBMzGqb5fFz/S+aGQOTPRpclqX70Cacv ZTTtFs4RwwCZ214WlAU4+v0beVPzGqUcoYCLgz6iUUci6gxA+XXHQH8whH/eB6MvxiKa AMbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Ah9ALclY; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i24-20020a05640200d800b00461fc07a835si1100746edu.18.2022.11.10.21.18.06; Thu, 10 Nov 2022 21:18:34 -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=@ventanamicro.com header.s=google header.b=Ah9ALclY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232778AbiKKEms (ORCPT + 92 others); Thu, 10 Nov 2022 23:42:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiKKEmp (ORCPT ); Thu, 10 Nov 2022 23:42:45 -0500 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54B5A6A6B5 for ; Thu, 10 Nov 2022 20:42:44 -0800 (PST) Received: by mail-oi1-x230.google.com with SMTP id n205so3995407oib.1 for ; Thu, 10 Nov 2022 20:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5rRCdDoP4ucuHJTu4Dp35ZlpfeELCSDaYd2hKM7VLR8=; b=Ah9ALclYD+mRrHhK5dzn2/JkJ5HxliwwDYtD/JQV6/7PU5gcF/nGWIceSm5kyLSF/x F+vAiZT8lVqGvGO8CeWYjDrqAVQGySjalFTLunBFcc88mR33+D+KrXWbFkLIqgFgxMPo k8KqKhA9zaokx2Ly0yz/gukqPpKK6jxQMYstYdMZo3rEAzPtwTactGy1IByOBla6SwAF G+RFXRFFLhYKU9e/fX17c6LbTom4Gv4BrvXeMMxKJrAaPbB7Q6gfbxEzaTYhJ4HWHacb f9HTXX4q5//06+49rHn+TktjO+G6Gby1C7CCe3pW9ZTFNJc7SihrcVrzlLlG36awoZRd +m0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5rRCdDoP4ucuHJTu4Dp35ZlpfeELCSDaYd2hKM7VLR8=; b=oa+0e6UJhUEcq/C5wP0QXOfBIbtkXyHHDBrgcgN+buVTZqem3CCUuWdMBPoC5h5O02 LNc+VF4s6lAz2UNQ+D+xZS088YnDBLre/19HBSdYN+7bJVd1CXwaSfcYCc1wTUV5qFYD +860fzRTHcXFJuDwY4eqC7TpFhFEdkG6COvSrDIYVtzGt5fwHRKoPWjaeJFOsGfwt38R H6WM3YM3wtgUL7l5e2pfAtdgxdGKxhZRSpV7oVehlC9WQKKNqre4OI74wCyxPkER05pZ GWO/nmYM7+Y8PmeVeEaygcdjLQnZO96q7bAtYY1MczmKROKR46ihkbP/XhFHA3PsfZIG +usQ== X-Gm-Message-State: ACrzQf0lS5OlmOvLVWPD3LLI/Bl/Nr71MuEBZ+Q1edMp0JI20Q0disTY P3cwcsGr7kIG3BeQe7zygeTyjw== X-Received: by 2002:aca:f241:0:b0:35a:1a81:1961 with SMTP id q62-20020acaf241000000b0035a1a811961mr2787471oih.251.1668141763441; Thu, 10 Nov 2022 20:42:43 -0800 (PST) Received: from anup-ubuntu64-vm.. ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id k14-20020a056870350e00b0013d9bd4ad2esm787353oah.12.2022.11.10.20.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 20:42:43 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski Cc: Atish Patra , Alistair Francis , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [PATCH 0/9] Linux RISC-V AIA Support Date: Fri, 11 Nov 2022 10:11:58 +0530 Message-Id: <20221111044207.1478350-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=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 The RISC-V AIA specification is now frozen as-per the RISC-V international process. The latest frozen specifcation can be found at: https://github.com/riscv/riscv-aia/releases/download/1.0-RC1/riscv-interrupts-1.0-RC1.pdf At a high-level, the AIA specification adds three things: 1) AIA CSRs - Improved local interrupt support 2) Incoming Message Signaled Interrupt Controller (IMSIC) - Per-HART MSI controller - Support MSI virtualization - Support IPI along with virtualization 3) Advanced Platform-Level Interrupt Controller (APLIC) - Wired interrupt controller - In MSI-mode, converts wired interrupt into MSIs (i.e. MSI generator) - In Direct-mode, injects external interrupts directly into HARTs For an overview of the AIA specification, refer the recent AIA virtualization talk at KVM Forum 2022: https://static.sched.com/hosted_files/kvmforum2022/a1/AIA_Virtualization_in_KVM_RISCV_final.pdf https://www.youtube.com/watch?v=r071dL8Z0yo This series adds required Linux irqchip drivers for AIA and it depends on the recent "RISC-V IPI Improvements". (Refer, https://lore.kernel.org/lkml/20221101143400.690000-1-apatel@ventanamicro.com/t/) To test this series, use QEMU v7.1 (or higher) and OpenSBI v1.1 (or higher). These patches can also be found in the riscv_aia_v1 branch at: https://github.com/avpatel/linux.git Anup Patel (9): RISC-V: Add AIA related CSR defines RISC-V: Detect AIA CSRs from ISA string irqchip/riscv-intc: Add support for RISC-V AIA dt-bindings: Add RISC-V incoming MSI controller bindings irqchip: Add RISC-V incoming MSI controller driver dt-bindings: Add RISC-V advanced PLIC bindings irqchip: Add RISC-V advanced PLIC driver RISC-V: Select APLIC and IMSIC drivers for QEMU virt machine MAINTAINERS: Add entry for RISC-V AIA drivers .../interrupt-controller/riscv,aplic.yaml | 136 ++ .../interrupt-controller/riscv,imsic.yaml | 174 +++ MAINTAINERS | 12 + arch/riscv/Kconfig.socs | 2 + arch/riscv/include/asm/csr.h | 92 ++ arch/riscv/include/asm/hwcap.h | 8 + arch/riscv/kernel/cpu.c | 2 + arch/riscv/kernel/cpufeature.c | 2 + drivers/irqchip/Kconfig | 32 +- drivers/irqchip/Makefile | 2 + drivers/irqchip/irq-riscv-aplic.c | 656 +++++++++ drivers/irqchip/irq-riscv-imsic.c | 1207 +++++++++++++++++ drivers/irqchip/irq-riscv-intc.c | 37 +- include/linux/irqchip/riscv-aplic.h | 117 ++ include/linux/irqchip/riscv-imsic.h | 92 ++ 15 files changed, 2564 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/riscv,imsic.yaml create mode 100644 drivers/irqchip/irq-riscv-aplic.c create mode 100644 drivers/irqchip/irq-riscv-imsic.c create mode 100644 include/linux/irqchip/riscv-aplic.h create mode 100644 include/linux/irqchip/riscv-imsic.h -- 2.34.1