From patchwork Thu Apr 25 10:39:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 792009 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1312823wrq; Thu, 25 Apr 2024 03:45:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUymtEmP3L/ai/IhewfeRiRn5pjr/Z5EwZMOLplIZI+iQaUSowD7HU/R0VVgThZI5mnaSEg1EKtnaQi5mwpUu9c X-Google-Smtp-Source: AGHT+IGFj40wXE0Qi3HIbxrdenCOm37oQtcDblEkfo22mde1QR8Pk5rZP38UB5TFff6RPvisp5Uk X-Received: by 2002:a05:622a:1649:b0:43a:4292:dcaf with SMTP id y9-20020a05622a164900b0043a4292dcafmr1802900qtj.35.1714041911337; Thu, 25 Apr 2024 03:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714041911; cv=none; d=google.com; s=arc-20160816; b=HNR50OhlBSXlsyGpir9hvie5GaZBdAWGCRTdlM8ltdESBxIcQbS1VArXFUlWQyfHA7 JO1OhEgGN45gmDwFSpsjWxtJU12VOP3TAAsHOPp87Ssexlw5G/FLlEVPc93F9ByJrF+u r5vopaHGrfBOgVHpi/VA5jWFdRdquordRCFlwe6ne40adIepui51mzaRao/kEvqS83yT DYMmIQwp3d4XS48ndlmmd9sVOEKRtqKJ2ImJq3lTBwUkP4OkJb2hIS0iE9fnYG26e6lJ 0MYl0XlSbbxOb8UTAHT6XFiiwAukz5Oqr7Uv9JMG/vRo1y2xr6Ojdo/UUo7IpgThqQf6 oBPA== 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=0tEoEynUn/Blzafott1YrsfCl8+TNo9nbqDoRZ2ImKI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=V1O5RWCMYkrkyb8EJGLBcXurWKNY8jFeOxvDlEtnEQjgakrNTkKIw234JNaSOY/1mN 8O50UcuQWNYVPZVy/gTYydgQ6z8yNiN/lP6opJmPjITI82B8bXFfokXSYDUeujOIkWWX Sz2zobuXkvSci4vEXctnLaotFAGjaRMqzOVraG8epQTrhZOLrMO5oe4e3dg7hWBeOgPY yOGHMdXCrfvRHw/y762dEec9uZxge9PXWADdjlYwZ2SW4WcGomV4mCTvtCZcUV0/R2SK mv/aINtoXccSrmHJTmsF2zv/rc9xONiQCWJ4ZLU5gpdUE9hzKH8Wy/Owq3HzYE35KNLb uRCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GnwWQCiS; 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 e17-20020a05622a111100b0043a23afa053si3273239qty.622.2024.04.25.03.45.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 03:45:11 -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=GnwWQCiS; 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 1rzwWb-00028D-0F; Thu, 25 Apr 2024 06:40:21 -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 1rzwWW-00022P-2K for qemu-devel@nongnu.org; Thu, 25 Apr 2024 06:40:16 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwWT-0007DF-4i for qemu-devel@nongnu.org; Thu, 25 Apr 2024 06:40:15 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-41a72f3a20dso5214235e9.0 for ; Thu, 25 Apr 2024 03:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714041611; x=1714646411; 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=0tEoEynUn/Blzafott1YrsfCl8+TNo9nbqDoRZ2ImKI=; b=GnwWQCiSt30pKDvUa+OPs5eQeBsLtIJm00FASUyiKqw19/HnB8jseaFOm+yvSrzxzU C1DgKwR5MpsDuNGC9r2YeQUloCOfIKW9P+ERRzIfg1c+R+Ypiiy3FbkXfsOPThpAa6nu 3nrKaJnV2VLmzq3MfmdU7tEdf2/QQPFnWaTizP7GOs2J3hkUGY6EHlhfOcx2Uaoll8TH dafgPkBQug2MFIjpG8i5l9cbtaBPkGJsOcVhQUTZX1X+5bk+ygE2cPQhOBC5cNZFylm3 TZFqzkhwzbJnIe7CaA8n2I/IQOyomGF9topcIPXSXVzFNVLKeA1lJs8NhbTMDTzDJx13 NERA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714041611; x=1714646411; 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=0tEoEynUn/Blzafott1YrsfCl8+TNo9nbqDoRZ2ImKI=; b=f8Boo4yy1UfUP612q7m4/4BBwAMstLbdtjplpwOhVmB85phuqCymIQ++rAijKoCgC7 gGvwiUjidwMg+rsMeA/pRY2/a/eG7CFxv3OML3Ad/6B0aM+edoGK99uZeI5DxyE6HfBm 4muZhEld2FqwMQXOBF6WZ5XlOUPSifHBFTK0BVgyPOGsNfxVFk40afoCLIkso8GX9kA3 i5vPXRQiXcCoxPR7C44xS1eRU9V/4GIhNd0sT9UDisc1CCy6EOhnHctQF8TNs9Epzjt3 Uey2IXXQgMtfgsvZeARlIu0Xjkz11Agh91TagKZmwyfjxpluluu+2pmFqOFWZaDSmXu5 zCHw== X-Gm-Message-State: AOJu0Yw9jKjoO5rBkYAt/UBErpVRmorbJ61QRjYr5PDPYpPxv11xojVo cEGtLcD+XQRziucawLJ8qDKNNtBREtAqe/SHLkcEAxpzPtVpWxk7QzWB/knGsg/EJlC0bJoPKy+ L X-Received: by 2002:a7b:c406:0:b0:418:2a57:380c with SMTP id k6-20020a7bc406000000b004182a57380cmr4339476wmi.26.1714041611583; Thu, 25 Apr 2024 03:40:11 -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.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 03:40:11 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/37] hw/intc/arm_gicv3: Report the VINMI interrupt Date: Thu, 25 Apr 2024 11:39:43 +0100 Message-Id: <20240425103958.3237225-23-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::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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 In vCPU Interface, if the vIRQ has the non-maskable property, report vINMI to the corresponding vPE. Signed-off-by: Jinjie Ruan Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell Message-id: 20240407081733.3231820-23-ruanjinjie@huawei.com Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_cpuif.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index 2cf232d099c..bdb13b00e98 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -481,6 +481,7 @@ void gicv3_cpuif_virt_irq_fiq_update(GICv3CPUState *cs) int idx; int irqlevel = 0; int fiqlevel = 0; + int nmilevel = 0; idx = hppvi_index(cs); trace_gicv3_cpuif_virt_update(gicv3_redist_affid(cs), idx, @@ -498,9 +499,17 @@ void gicv3_cpuif_virt_irq_fiq_update(GICv3CPUState *cs) uint64_t lr = cs->ich_lr_el2[idx]; if (icv_hppi_can_preempt(cs, lr)) { - /* Virtual interrupts are simple: G0 are always FIQ, and G1 IRQ */ + /* + * Virtual interrupts are simple: G0 are always FIQ, and G1 are + * IRQ or NMI which depends on the ICH_LR_EL2.NMI to have + * non-maskable property. + */ if (lr & ICH_LR_EL2_GROUP) { - irqlevel = 1; + if (lr & ICH_LR_EL2_NMI) { + nmilevel = 1; + } else { + irqlevel = 1; + } } else { fiqlevel = 1; } @@ -510,6 +519,7 @@ void gicv3_cpuif_virt_irq_fiq_update(GICv3CPUState *cs) trace_gicv3_cpuif_virt_set_irqs(gicv3_redist_affid(cs), fiqlevel, irqlevel); qemu_set_irq(cs->parent_vfiq, fiqlevel); qemu_set_irq(cs->parent_virq, irqlevel); + qemu_set_irq(cs->parent_vnmi, nmilevel); } static void gicv3_cpuif_virt_update(GICv3CPUState *cs)