Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123475
b: refs/heads/master
c: fe615cb
h: refs/heads/master
i:
  123473: c162df7
  123471: 26a300d
v: v3
  • Loading branch information
Robert Richter committed Dec 10, 2008
1 parent 05f7ef5 commit c51aa49
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fa6812dbab9207f7af52c3d0417f1f9eb89c386
refs/heads/master: fe615cbf34fc6a1c53c359417da4696328a488ed
32 changes: 17 additions & 15 deletions trunk/arch/x86/oprofile/op_model_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ struct ibs_op_sample {
unsigned int ibs_dc_phys_high;
};

/*
* unitialize the APIC for the IBS interrupts if needed on AMD Family10h+
*/
static void clear_ibs_nmi(void);

static int ibs_allowed; /* AMD Family10h and later */

struct op_ibs_config {
Expand Down Expand Up @@ -390,7 +385,7 @@ 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)
static int init_ibs_nmi(void)
{
#define IBSCTL_LVTOFFSETVAL (1 << 8)
#define IBSCTL 0x1cc
Expand Down Expand Up @@ -438,28 +433,35 @@ static int pfm_amd64_setup_eilvt(void)
return 0;
}

/* uninitialize the APIC for the IBS interrupts if needed */
static void clear_ibs_nmi(void)
{
if (ibs_allowed)
on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1);
}

/* initialize the APIC for the IBS interrupts if available */
static void setup_ibs(void)
static void ibs_init(void)
{
ibs_allowed = boot_cpu_has(X86_FEATURE_IBS);

if (!ibs_allowed)
return;

if (pfm_amd64_setup_eilvt()) {
if (init_ibs_nmi()) {
ibs_allowed = 0;
return;
}

printk(KERN_INFO "oprofile: AMD IBS detected\n");
}


/* uninitialize the APIC for the IBS interrupts if needed */
static void clear_ibs_nmi(void)
static void ibs_exit(void)
{
if (ibs_allowed)
on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1);
if (!ibs_allowed)
return;

clear_ibs_nmi();
}

static int (*create_arch_files)(struct super_block *sb, struct dentry *root);
Expand Down Expand Up @@ -509,15 +511,15 @@ static int setup_ibs_files(struct super_block *sb, struct dentry *root)

static int op_amd_init(struct oprofile_operations *ops)
{
setup_ibs();
ibs_init();
create_arch_files = ops->create_files;
ops->create_files = setup_ibs_files;
return 0;
}

static void op_amd_exit(void)
{
clear_ibs_nmi();
ibs_exit();
}

#else
Expand Down

0 comments on commit c51aa49

Please sign in to comment.