Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7497507ybl; Tue, 24 Dec 2019 03:44:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyxWYppY9yk4b8EfaaFe1sDVHwuHjdcIHHmHziSJVwf+YZv3uHmZQmr5ZfMk2u7cumirJn1 X-Received: by 2002:a05:6830:3054:: with SMTP id p20mr37094477otr.121.1577187849639; Tue, 24 Dec 2019 03:44:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577187849; cv=none; d=google.com; s=arc-20160816; b=papYXD4C19HeRhIzmAv1epaHWvi+AYPxiXnvefJulJfyIJXWnypDBMbPTOSXqkjZx9 W8yAw2PN6N69Kgu0YQy5tvLfYgeNw6X701B1TJaVJQdIqOZBYHKJ5FY6b6VdhR0kXj+A d5MWVoBMUV1AL5IaWMGVlhg4KVkz0WIGGQFVmwnvGPMpsYW8J1Kl+DLlrbnXfotoZByD jddU5ZM7EnSCfA0wG3rcGLC5qf5der79HpCiMX0VaG9XbPbDD8ZpZ/oc5Rh1IdJgH2jM u3JvN3Nfml/9An0m6oFwrm2UlMPMj3Ku7T3iGm+QJCLR/ACGOfLdDF0xaMf6Cxra2gEi Ipuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ExD3Q2MbLfGN96eTtGKm5UxRZ1cym2FzTWTOAK0EmPk=; b=itnvSAvAJ1jJ+RiD4by181Ymx1PPMIyaS3AHw3jBnRGeKUYqxsin01pPCukGo+4e/T 8DUrfCy4oiNhNY4Z9+W98LrMAzw6pPT6BMZNbKLnQESKpvE3vl0VNmsBl94dMTHmQH4w EMn2TZsxgZaMDlKm4jx+BqMhoZOvaMF106DtmAly4WGrNj0aXq8a4XuklhG0SE8ZKy+B av6ovOayWBNTI3QdToxh1VDGb1Qqh1yV0Uyxotu/eSviEwVjObSfMaVOzmixSRGD/gZ7 cPTxrg6t3yDVcUiP6I6pcO2gaYQD/TNDNJntyIPCOTchIbqXUjwfwlVW/8pP+n/a6xJ9 9VPQ== ARC-Authentication-Results: i=1; mx.google.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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si3452245oti.29.2019.12.24.03.43.58; Tue, 24 Dec 2019 03:44:09 -0800 (PST) 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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727150AbfLXLnX (ORCPT + 99 others); Tue, 24 Dec 2019 06:43:23 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:55243 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726206AbfLXLnW (ORCPT ); Tue, 24 Dec 2019 06:43:22 -0500 Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:DHE-RSA-AES128-GCM-SHA256:128) (Exim 4.80) (envelope-from ) id 1iji6I-000169-Js; Tue, 24 Dec 2019 12:11:43 +0100 From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose , Thomas Gleixner , Jason Cooper , Lorenzo Pieralisi , Andrew Murray , Zenghui Yu , Robert Richter Subject: [PATCH v3 32/32] KVM: arm64: GICv4.1: Expose HW-based SGIs in debugfs Date: Tue, 24 Dec 2019 11:10:55 +0000 Message-Id: <20191224111055.11836-33-maz@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191224111055.11836-1-maz@kernel.org> References: <20191224111055.11836-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, eric.auger@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, tglx@linutronix.de, jason@lakedaemon.net, lorenzo.pieralisi@arm.com, Andrew.Murray@arm.com, yuzenghui@huawei.com, rrichter@marvell.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vgic-state debugfs file could do with showing the pending state of the HW-backed SGIs. Plug it into the low-level code. Signed-off-by: Marc Zyngier --- virt/kvm/arm/vgic/vgic-debug.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic/vgic-debug.c b/virt/kvm/arm/vgic/vgic-debug.c index cc12fe9b2df3..b13a9e3f99dd 100644 --- a/virt/kvm/arm/vgic/vgic-debug.c +++ b/virt/kvm/arm/vgic/vgic-debug.c @@ -178,6 +178,8 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq, struct kvm_vcpu *vcpu) { char *type; + bool pending; + if (irq->intid < VGIC_NR_SGIS) type = "SGI"; else if (irq->intid < VGIC_NR_PRIVATE_IRQS) @@ -190,6 +192,16 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq, if (irq->intid ==0 || irq->intid == VGIC_NR_PRIVATE_IRQS) print_header(s, irq, vcpu); + pending = irq->pending_latch; + if (irq->hw && vgic_irq_is_sgi(irq->intid)) { + int err; + + err = irq_get_irqchip_state(irq->host_irq, + IRQCHIP_STATE_PENDING, + &pending); + WARN_ON_ONCE(err); + } + seq_printf(s, " %s %4d " " %2d " "%d%d%d%d%d%d%d " @@ -201,7 +213,7 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq, "\n", type, irq->intid, (irq->target_vcpu) ? irq->target_vcpu->vcpu_id : -1, - irq->pending_latch, + pending, irq->line_level, irq->active, irq->enabled, -- 2.20.1