From patchwork Thu Apr 25 10:39:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 792011 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1313041wrq; Thu, 25 Apr 2024 03:45:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUv7lXurfCPTaoUyY3BUtza1FBQS+hEDLOej2S6Cb1a6C6qJ0WFuCWaFpxGRceUP3AD6o5YsYSFkuh2RCbok8OV X-Google-Smtp-Source: AGHT+IHsILlMZpkm9syPd6ORycdqS/UtNGIA0vbvk2a3yC+RGzLoJrrFxKRCjsALqHTPCvewL/uG X-Received: by 2002:ac8:7e8e:0:b0:437:bc88:e4cb with SMTP id w14-20020ac87e8e000000b00437bc88e4cbmr6469152qtj.14.1714041941885; Thu, 25 Apr 2024 03:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714041941; cv=none; d=google.com; s=arc-20160816; b=p8vYDs9VcSmSgIkwad09vBMcUcAfcZUScWuZOt49Ydsy57epyQDhjfcC0U+eq6RaS2 xB+OPQEdM9Ieg4YsGSzPrfXy2l5HZuTkNUUeSyyQTIOUdMZsrhNwnnKeS3QqxCLqn/tg bCyBCPHUb+z32JgWP3095KeRPtujnatMCqpprVvSwh23RQrxxsXEv5YSmHpuD+VSLott vX+eMoLLgWjaHF292wH3jNRAREJsnxGvYZpbwp5ZnSc2ubeViX2pWKcvrClK+2xFcYNg oc6cU+3JlpizKQ0YC7BJb0pBAOFBbnqUww5og8ppHCKBP4apujN4OdHiKgWFS9zNWZ0n JohA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=W1vuqdUJDiebxiqtPqaJPfGS9dPS4E9rgVyHYzZb3+c=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XKdZQmQatVzHP8dg7L5OrojKT5850TTTOUurkW1Gn2FZlb1rFTYywa3S4a5WbW5g6y LXaAejxC8upmrwtf06NjKmtx/6ajTWcg9YGWqwS+UVprHddI0HkqJT2k5p1XJE5oTUtb LNe6wHiRae4cdNbIzTaPEVZfp6bsaPpQKgg20SOmyMU8P/HxOuOVQnaNCU8gFdLzO1qk osZVR0CGRabodNiscjeXeuIfk2IoXs8rT5PEVwf7Qt8vFtmZPok1lj8wrEWsOSIj4Xjp xw/L4z8ULOAiz4++h8//T+7BL2D9oTwN/KACWKp9h6gkUPw0MwtANkl6mm+SfRMGtNR+ 0WVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8grnZL1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e20-20020ac85994000000b0043780b2b25bsi17249888qte.167.2024.04.25.03.45.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 03:45:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8grnZL1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzwWT-00021N-QW; Thu, 25 Apr 2024 06:40:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzwWP-0001zZ-RE for qemu-devel@nongnu.org; Thu, 25 Apr 2024 06:40:10 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwWN-0007Af-G0 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 06:40:09 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41b5e74f7d1so1547975e9.3 for ; Thu, 25 Apr 2024 03:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714041606; x=1714646406; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=W1vuqdUJDiebxiqtPqaJPfGS9dPS4E9rgVyHYzZb3+c=; b=p8grnZL1z3qbL89vrf5wkWOCirFMBQrxvEiCmeb4uenZSyJU1/SuJoEWAvzgP1Q2FM XNPsgAcHEnGXhKSZItRfAsrg9bgIviaBIhNqqz4WDVl8Stk5S5LBmrq/wW4Z2oI/XVLn bqVSl3DF1knP3pm1XR4GN4l5zyOIWDlzFv/xLJSiXWzq4kg2mXbrksr1/a1iIhsKRGJO /TN+v6mRODPqDgHpTDrlSK5KoehleuVFXfBeU/R4z9e04m8vXEItRQaueZZY5xfsqeym 7eq7RJRQwPY7RBp1MoNKuqSPhRHI4ugRv1yVay3bLBOHIIFMBSCFwnFFBpY+0acz8YXQ RgGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714041606; x=1714646406; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W1vuqdUJDiebxiqtPqaJPfGS9dPS4E9rgVyHYzZb3+c=; b=cbtghypzAj847iwI0M8sfGQNTfhzh0UFzl3pbXGypuVxfQcKxuZGO2aejSYVAiVHhU a8RLPUMEAi3Y4LEmC0zjaEuyBinSl2/StzDuYBMoBQ4lDYrmdv45dbEZtb6pH8R8a/za WEX7AldeKuJ8GcrzgTCVAdJoKYp1ZOBcKIgEar1wq8/Ka3A4ZRQZn0mXFsMBU0gwdc3R T0eUPCgbDmWlGe3MfoiIHkjrVCV2nhhRuan9FgEVhbGI1efT+CP38ONhbPzw91DsAcVO MSnsAtNC8U3gCExb4CgL5fIrB1fSW8W3Re5fDhVj17ho9vs0jmzjLGYRYMXEb6QZ8bPw zbAQ== X-Gm-Message-State: AOJu0YyGi9VSK+kYo21BmC3eCarmZ4DFi2L1TtmFJSQ9fuXTYa1VTWG8 IBLFTRp1M21sAiuQlkyWyhrFc0SpcFEr+HsQeJHuKghsDPqumXOWKtb2jEN6d2vMWjMjiu90GQb n X-Received: by 2002:a05:600c:35d4:b0:418:f184:53f8 with SMTP id r20-20020a05600c35d400b00418f18453f8mr4732350wmq.36.1714041605985; Thu, 25 Apr 2024 03:40:05 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id h15-20020a056000000f00b003434c764f01sm19485768wrx.107.2024.04.25.03.40.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 03:40:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/37] hw/intc/arm_gicv3: Add external IRQ lines for NMI Date: Thu, 25 Apr 2024 11:39:31 +0100 Message-Id: <20240425103958.3237225-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425103958.3237225-1-peter.maydell@linaro.org> References: <20240425103958.3237225-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jinjie Ruan Augment the GICv3's QOM device interface by adding one new set of sysbus IRQ line, to signal NMI to each CPU. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell Message-id: 20240407081733.3231820-11-ruanjinjie@huawei.com Signed-off-by: Peter Maydell --- include/hw/intc/arm_gic_common.h | 2 ++ include/hw/intc/arm_gicv3_common.h | 2 ++ hw/intc/arm_gicv3_common.c | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/include/hw/intc/arm_gic_common.h b/include/hw/intc/arm_gic_common.h index 70803750081..97fea4102d3 100644 --- a/include/hw/intc/arm_gic_common.h +++ b/include/hw/intc/arm_gic_common.h @@ -71,6 +71,8 @@ struct GICState { qemu_irq parent_fiq[GIC_NCPU]; qemu_irq parent_virq[GIC_NCPU]; qemu_irq parent_vfiq[GIC_NCPU]; + qemu_irq parent_nmi[GIC_NCPU]; + qemu_irq parent_vnmi[GIC_NCPU]; qemu_irq maintenance_irq[GIC_NCPU]; /* GICD_CTLR; for a GIC with the security extensions the NS banked version diff --git a/include/hw/intc/arm_gicv3_common.h b/include/hw/intc/arm_gicv3_common.h index 4e2fb518e72..7324c7d983f 100644 --- a/include/hw/intc/arm_gicv3_common.h +++ b/include/hw/intc/arm_gicv3_common.h @@ -155,6 +155,8 @@ struct GICv3CPUState { qemu_irq parent_fiq; qemu_irq parent_virq; qemu_irq parent_vfiq; + qemu_irq parent_nmi; + qemu_irq parent_vnmi; /* Redistributor */ uint32_t level; /* Current IRQ level */ diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c index cb55c726810..c52f060026a 100644 --- a/hw/intc/arm_gicv3_common.c +++ b/hw/intc/arm_gicv3_common.c @@ -299,6 +299,12 @@ void gicv3_init_irqs_and_mmio(GICv3State *s, qemu_irq_handler handler, for (i = 0; i < s->num_cpu; i++) { sysbus_init_irq(sbd, &s->cpu[i].parent_vfiq); } + for (i = 0; i < s->num_cpu; i++) { + sysbus_init_irq(sbd, &s->cpu[i].parent_nmi); + } + for (i = 0; i < s->num_cpu; i++) { + sysbus_init_irq(sbd, &s->cpu[i].parent_vnmi); + } memory_region_init_io(&s->iomem_dist, OBJECT(s), ops, s, "gicv3_dist", 0x10000);