Received: by 10.223.176.46 with SMTP id f43csp746795wra; Wed, 24 Jan 2018 05:25:31 -0800 (PST) X-Google-Smtp-Source: AH8x226NtDSUDgdct9Vj6CzluC+PZdsrGeGIlKlCrR4T75vrY2b3AvjNHzEV5Ml3MiqwdFk4AaZk X-Received: by 10.98.8.86 with SMTP id c83mr13096383pfd.84.1516800330957; Wed, 24 Jan 2018 05:25:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516800330; cv=none; d=google.com; s=arc-20160816; b=a9gfF2da257XM1LdAT67QMw0OAVwYsNo2XGQy2VrePkfi57ZQZdub2ZlP5OVOcU6wS NLuRMxoybER1FgWl1k053GwXSczDSXUfbymyMgPWtbTqGH08xq7IOqUPKysNHu0ZmA2p Uy7+8zY7kwASspXlL+UlOnOVlLG2B4BlvpQFASARSmrAXwI3OsgdHAMv2vfBlajnEaz0 FQWHZghX8Ob6CnhNXE/tFdIGhADDCxMKl1BOWgPMaocy9lWTsuT2D3kqyEURCElxIXVE mf/oHIl+3F9GfYxWYF9G8gDMN46384NqkfMR76Uz8V8x16t5GvqWkEORceQQW63Abud0 gqBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=2J06SklzpJ80Y8b5m0xhOoNmLCJglbsP8slgcByERbQ=; b=lu5POOFtFkU2Eg9CBc98ntL/Rg7WUslnl5PyjdG0G+sulzyUah9fCaCoZGPjeR2Ezn 9UHg8sln28SuxxMk0bqAi/HVxK1wAlsi3oXnlr0He96GTZtYVUfAoCSAWZsgM86qq5PI 4kB9uZ7tGv4WzpyLKGXUe3owEXelaSORw/5XQPEuKFWVNzjGbi5Gvnm8uhGZm3g8XWwa DVJQl1bKSpEh0yzZmZ7tvqTLJZeHKiIBIP/YsDxaM/k1txE9UfJ5Ygfik9G5wvZzjy97 rxOJQwBVdYS2zBNJl2bpLRT+q7T11Mk3FrKzFahbwPlzhnq/WwCBbfX2qiiXt7IpOX5b sbqw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si147126pgo.495.2018.01.24.05.25.16; Wed, 24 Jan 2018 05:25:30 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933940AbeAXNYS (ORCPT + 99 others); Wed, 24 Jan 2018 08:24:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933556AbeAXNYQ (ORCPT ); Wed, 24 Jan 2018 08:24:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13D7AC0587F5; Wed, 24 Jan 2018 13:24:16 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CF836562D; Wed, 24 Jan 2018 13:24:11 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, x86@kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley (EOSG)" , Andy Lutomirski , Mohammed Gamal , Cathy Avery , Roman Kagan , linux-kernel@vger.kernel.org, devel@linuxdriverproject.org Subject: [PATCH v4 5/7] x86/irq: Count Hyper-V reenlightenment interrupts Date: Wed, 24 Jan 2018 14:23:35 +0100 Message-Id: <20180124132337.30138-6-vkuznets@redhat.com> In-Reply-To: <20180124132337.30138-1-vkuznets@redhat.com> References: <20180124132337.30138-1-vkuznets@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 24 Jan 2018 13:24:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hyper-V reenlightenment interrupts arrive when the VM is migrated, we're not supposed to see many of them. However, it may be important to know that the event has happened in case we have L2 nested guests. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Thomas Gleixner --- arch/x86/hyperv/hv_init.c | 2 ++ arch/x86/include/asm/hardirq.h | 3 +++ arch/x86/kernel/irq.c | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index e4377e2f2a10..a3adece392f1 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -147,6 +147,8 @@ __visible void __irq_entry hyperv_reenlightenment_intr(struct pt_regs *regs) { entering_ack_irq(); + inc_irq_stat(irq_hv_reenlightenment_count); + schedule_delayed_work(&hv_reenlightenment_work, HZ/10); exiting_irq(); diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 51cc979dd364..7c341a74ec8c 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h @@ -38,6 +38,9 @@ typedef struct { #if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) unsigned int irq_hv_callback_count; #endif +#if IS_ENABLED(CONFIG_HYPERV) + unsigned int irq_hv_reenlightenment_count; +#endif } ____cacheline_aligned irq_cpustat_t; DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 68e1867cca80..45fb4d2565f8 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -141,6 +141,15 @@ int arch_show_interrupts(struct seq_file *p, int prec) irq_stats(j)->irq_hv_callback_count); seq_puts(p, " Hypervisor callback interrupts\n"); } +#endif +#if IS_ENABLED(CONFIG_HYPERV) + if (test_bit(HYPERV_REENLIGHTENMENT_VECTOR, system_vectors)) { + seq_printf(p, "%*s: ", prec, "HRE"); + for_each_online_cpu(j) + seq_printf(p, "%10u ", + irq_stats(j)->irq_hv_reenlightenment_count); + seq_puts(p, " Hyper-V reenlightenment interrupts\n"); + } #endif seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); #if defined(CONFIG_X86_IO_APIC) -- 2.14.3