All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: [PATCH 1/5] x86/traps: Collect PERFC_exceptions stats for IST vectors too
Date: Fri, 19 Nov 2021 18:21:02 +0000	[thread overview]
Message-ID: <20211119182106.14868-2-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20211119182106.14868-1-andrew.cooper3@citrix.com>

This causes NMIs, #DB and #MC to be counted, rather than being reported as 0.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
---
 xen/arch/x86/x86_64/entry.S | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index d5998acf8806..3caa5654768d 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -1005,6 +1005,13 @@ handle_ist_exception:
 #endif
         movq  %rsp,%rdi
         movzbl UREGS_entry_vector(%rsp),%eax
+
+#ifdef CONFIG_PERF_COUNTERS
+        lea   per_cpu__perfcounters(%rip), %rcx
+        add   STACK_CPUINFO_FIELD(per_cpu_offset)(%r14), %rcx
+        incl  ASM_PERFC_exceptions * 4(%rcx, %rax, 4)
+#endif
+
         leaq  exception_table(%rip),%rdx
         mov   (%rdx, %rax, 8), %rdx
         INDIRECT_CALL %rdx
-- 
2.11.0



  reply	other threads:[~2021-11-19 18:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 18:21 [PATCH 0/5] x86/traps: Drop exception_table[] Andrew Cooper
2021-11-19 18:21 ` Andrew Cooper [this message]
2021-11-22  8:50   ` [PATCH 1/5] x86/traps: Collect PERFC_exceptions stats for IST vectors too Jan Beulich
2021-11-19 18:21 ` [PATCH 2/5] x86/traps: Drop dummy_nmi_callback() Andrew Cooper
2021-11-22  8:51   ` Jan Beulich
2021-11-19 18:21 ` [PATCH 3/5] x86/crash: Drop manual hooking of exception_table[] Andrew Cooper
2021-11-22  8:57   ` Jan Beulich
2021-11-22 13:48     ` Andrew Cooper
2021-11-22 14:51       ` Jan Beulich
2021-11-19 18:21 ` [PATCH 4/5] x86/traps: Drop exception_table[] and use if/else dispatching Andrew Cooper
2021-11-22  9:04   ` Jan Beulich
2021-11-22 16:16     ` Andrew Cooper
2021-11-22 16:28       ` Jan Beulich
2021-11-23  9:05   ` Jan Beulich
2021-11-19 18:21 ` [PATCH 5/5] x86/traps: Clean up diagnostics Andrew Cooper
2021-11-22  9:08   ` Jan Beulich
2021-11-22 16:26     ` Andrew Cooper
2021-11-22 16:34       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119182106.14868-2-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.