OProfile: change IBS interrupt initialization

Previous thread: x86/oprofile: separating the IBS handler by Linux Kernel Mailing List on Monday, October 13, 2008 - 11:11 am. (1 message)

Next thread: OProfile: Fix build error in op_model_athlon.c by Linux Kernel Mailing List on Monday, October 13, 2008 - 11:11 am. (1 message)
From: Linux Kernel Mailing List
Date: Monday, October 13, 2008 - 11:11 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d77f2...
Commit:     7d77f2dcae37cf232950cd0181fb0a2cddb18130
Parent:     7939d2bf7e30353d40d14f967b7fe2b2a7be5bd9
Author:     Robert Richter <robert.richter@amd.com>
AuthorDate: Tue Jul 22 21:08:57 2008 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat Jul 26 11:48:07 2008 +0200

    OProfile: change IBS interrupt initialization
    
    Signed-off-by: Robert Richter <robert.richter@amd.com>
    Cc: oprofile-list <oprofile-list@lists.sourceforge.net>
    Cc: Barry Kasindorf <barry.kasindorf@amd.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/oprofile/op_model_athlon.c |   84 ++++++++++++++++++++++------------
 1 files changed, 54 insertions(+), 30 deletions(-)

diff --git a/arch/x86/oprofile/op_model_athlon.c b/arch/x86/oprofile/op_model_athlon.c
index a2c8e2e..90193b1 100644
--- a/arch/x86/oprofile/op_model_athlon.c
+++ b/arch/x86/oprofile/op_model_athlon.c
@@ -356,9 +356,11 @@ static void op_amd_shutdown(struct op_msrs const * const msrs)
 	}
 }
 
+static u8 ibs_eilvt_off;
+
 static inline void apic_init_ibs_nmi_per_cpu(void *arg)
 {
-	setup_APIC_eilvt_ibs(0, APIC_EILVT_MSG_NMI, 0);
+	ibs_eilvt_off = setup_APIC_eilvt_ibs(0, APIC_EILVT_MSG_NMI, 0);
 }
 
 static inline void apic_clear_ibs_nmi_per_cpu(void *arg)
@@ -366,45 +368,67 @@ static inline void apic_clear_ibs_nmi_per_cpu(void *arg)
 	setup_APIC_eilvt_ibs(0, APIC_EILVT_MSG_FIX, 1);
 }
 
+static int pfm_amd64_setup_eilvt(void)
+{
+#define IBSCTL_LVTOFFSETVAL		(1 << 8)
+#define IBSCTL				0x1cc
+	struct pci_dev *cpu_cfg;
+	int nodes;
+	u32 value = 0;
+
+	/* per CPU setup */
+	on_each_cpu(apic_init_ibs_nmi_per_cpu, NULL, 0, 1);
+
+	nodes = 0;
+	cpu_cfg = NULL;
+	do {
+		cpu_cfg = pci_get_device(PCI_VENDOR_ID_AMD,
+					 PCI_DEVICE_ID_AMD_10H_NB_MISC,
+					 cpu_cfg);
+		if (!cpu_cfg)
+			break;
+		++nodes;
+		pci_write_config_dword(cpu_cfg, ...
Previous thread: x86/oprofile: separating the IBS handler by Linux Kernel Mailing List on Monday, October 13, 2008 - 11:11 am. (1 message)

Next thread: OProfile: Fix build error in op_model_athlon.c by Linux Kernel Mailing List on Monday, October 13, 2008 - 11:11 am. (1 message)