Paolo Ciarrocchi | d441373 | 2008-02-19 23:51:27 +0100 | [diff] [blame] | 1 | /* |
Robert Richter | 6852fd9 | 2008-07-22 21:09:08 +0200 | [diff] [blame] | 2 | * @file op_model_amd.c |
Barry Kasindorf | bd87f1f | 2007-12-18 18:05:58 +0100 | [diff] [blame] | 3 | * athlon / K7 / K8 / Family 10h model-specific MSR operations |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | * |
Robert Richter | ae735e9 | 2008-12-25 17:26:07 +0100 | [diff] [blame] | 5 | * @remark Copyright 2002-2009 OProfile authors |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * @remark Read the file COPYING |
| 7 | * |
| 8 | * @author John Levon |
| 9 | * @author Philippe Elie |
| 10 | * @author Graydon Hoare |
Robert Richter | adf5ec0 | 2008-07-22 21:08:48 +0200 | [diff] [blame] | 11 | * @author Robert Richter <robert.richter@amd.com> |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 12 | * @author Barry Kasindorf <barry.kasindorf@amd.com> |
| 13 | * @author Jason Yeh <jason.yeh@amd.com> |
| 14 | * @author Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> |
Robert Richter | ae735e9 | 2008-12-25 17:26:07 +0100 | [diff] [blame] | 15 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
| 17 | #include <linux/oprofile.h> |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 18 | #include <linux/device.h> |
| 19 | #include <linux/pci.h> |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 20 | #include <linux/percpu.h> |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include <asm/ptrace.h> |
| 23 | #include <asm/msr.h> |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 24 | #include <asm/nmi.h> |
Paolo Ciarrocchi | d441373 | 2008-02-19 23:51:27 +0100 | [diff] [blame] | 25 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #include "op_x86_model.h" |
| 27 | #include "op_counter.h" |
| 28 | |
Robert Richter | 4c168ea | 2008-09-24 11:08:52 +0200 | [diff] [blame] | 29 | #define NUM_COUNTERS 4 |
| 30 | #define NUM_CONTROLS 4 |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 31 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX |
| 32 | #define NUM_VIRT_COUNTERS 32 |
| 33 | #define NUM_VIRT_CONTROLS 32 |
| 34 | #else |
| 35 | #define NUM_VIRT_COUNTERS NUM_COUNTERS |
| 36 | #define NUM_VIRT_CONTROLS NUM_CONTROLS |
| 37 | #endif |
| 38 | |
Robert Richter | 3370d35 | 2009-05-25 15:10:32 +0200 | [diff] [blame] | 39 | #define OP_EVENT_MASK 0x0FFF |
Robert Richter | 42399ad | 2009-05-25 17:59:06 +0200 | [diff] [blame] | 40 | #define OP_CTR_OVERFLOW (1ULL<<31) |
Robert Richter | 3370d35 | 2009-05-25 15:10:32 +0200 | [diff] [blame] | 41 | |
| 42 | #define MSR_AMD_EVENTSEL_RESERVED ((0xFFFFFCF0ULL<<32)|(1ULL<<21)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 44 | static unsigned long reset_value[NUM_VIRT_COUNTERS]; |
Robert Richter | 852402c | 2008-07-22 21:09:06 +0200 | [diff] [blame] | 45 | |
| 46 | #ifdef CONFIG_OPROFILE_IBS |
| 47 | |
Robert Richter | 87f0bac | 2008-07-22 21:09:03 +0200 | [diff] [blame] | 48 | /* IbsFetchCtl bits/masks */ |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 49 | #define IBS_FETCH_RAND_EN (1ULL<<57) |
| 50 | #define IBS_FETCH_VAL (1ULL<<49) |
| 51 | #define IBS_FETCH_ENABLE (1ULL<<48) |
| 52 | #define IBS_FETCH_CNT_MASK 0xFFFF0000ULL |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 53 | |
Robert Richter | 87f0bac | 2008-07-22 21:09:03 +0200 | [diff] [blame] | 54 | /*IbsOpCtl bits */ |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 55 | #define IBS_OP_CNT_CTL (1ULL<<19) |
| 56 | #define IBS_OP_VAL (1ULL<<18) |
| 57 | #define IBS_OP_ENABLE (1ULL<<17) |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 58 | |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 59 | #define IBS_FETCH_SIZE 6 |
| 60 | #define IBS_OP_SIZE 12 |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 61 | |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 62 | static int has_ibs; /* AMD Family10h and later */ |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 63 | |
| 64 | struct op_ibs_config { |
| 65 | unsigned long op_enabled; |
| 66 | unsigned long fetch_enabled; |
| 67 | unsigned long max_cnt_fetch; |
| 68 | unsigned long max_cnt_op; |
| 69 | unsigned long rand_en; |
| 70 | unsigned long dispatched_ops; |
| 71 | }; |
| 72 | |
| 73 | static struct op_ibs_config ibs_config; |
Paolo Ciarrocchi | d441373 | 2008-02-19 23:51:27 +0100 | [diff] [blame] | 74 | |
Robert Richter | 852402c | 2008-07-22 21:09:06 +0200 | [diff] [blame] | 75 | #endif |
| 76 | |
Robert Richter | 6657fe4 | 2008-07-22 21:08:50 +0200 | [diff] [blame] | 77 | /* functions for op_amd_spec */ |
Robert Richter | dfa1542 | 2008-07-22 21:08:49 +0200 | [diff] [blame] | 78 | |
Robert Richter | 6657fe4 | 2008-07-22 21:08:50 +0200 | [diff] [blame] | 79 | static void op_amd_fill_in_addresses(struct op_msrs * const msrs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | { |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 81 | int i; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | |
Paolo Ciarrocchi | d441373 | 2008-02-19 23:51:27 +0100 | [diff] [blame] | 83 | for (i = 0; i < NUM_COUNTERS; i++) { |
Robert Richter | 4c168ea | 2008-09-24 11:08:52 +0200 | [diff] [blame] | 84 | if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i)) |
| 85 | msrs->counters[i].addr = MSR_K7_PERFCTR0 + i; |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 86 | else |
| 87 | msrs->counters[i].addr = 0; |
| 88 | } |
| 89 | |
Paolo Ciarrocchi | d441373 | 2008-02-19 23:51:27 +0100 | [diff] [blame] | 90 | for (i = 0; i < NUM_CONTROLS; i++) { |
Robert Richter | 4c168ea | 2008-09-24 11:08:52 +0200 | [diff] [blame] | 91 | if (reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i)) |
| 92 | msrs->controls[i].addr = MSR_K7_EVNTSEL0 + i; |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 93 | else |
| 94 | msrs->controls[i].addr = 0; |
| 95 | } |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 96 | |
| 97 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX |
| 98 | for (i = 0; i < NUM_VIRT_COUNTERS; i++) { |
Robert Richter | 5e766e3 | 2009-07-08 14:54:17 +0200 | [diff] [blame] | 99 | int hw_counter = i % NUM_COUNTERS; |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 100 | if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i)) |
| 101 | msrs->multiplex[i].addr = MSR_K7_PERFCTR0 + hw_counter; |
| 102 | else |
| 103 | msrs->multiplex[i].addr = 0; |
| 104 | } |
| 105 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Robert Richter | ef8828d | 2009-05-25 19:31:44 +0200 | [diff] [blame] | 108 | static void op_amd_setup_ctrs(struct op_x86_model_spec const *model, |
| 109 | struct op_msrs const * const msrs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | { |
Robert Richter | 3370d35 | 2009-05-25 15:10:32 +0200 | [diff] [blame] | 111 | u64 val; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | int i; |
Paolo Ciarrocchi | d441373 | 2008-02-19 23:51:27 +0100 | [diff] [blame] | 113 | |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 114 | /* setup reset_value */ |
| 115 | for (i = 0; i < NUM_VIRT_COUNTERS; ++i) { |
| 116 | if (counter_config[i].enabled) { |
| 117 | reset_value[i] = counter_config[i].count; |
| 118 | } else { |
| 119 | reset_value[i] = 0; |
| 120 | } |
| 121 | } |
| 122 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | /* clear all counters */ |
Robert Richter | 6e63ea4 | 2009-07-07 19:25:39 +0200 | [diff] [blame] | 124 | for (i = 0; i < NUM_CONTROLS; ++i) { |
Robert Richter | 217d3cf | 2009-06-04 02:36:44 +0200 | [diff] [blame] | 125 | if (unlikely(!msrs->controls[i].addr)) |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 126 | continue; |
Robert Richter | 3370d35 | 2009-05-25 15:10:32 +0200 | [diff] [blame] | 127 | rdmsrl(msrs->controls[i].addr, val); |
| 128 | val &= model->reserved; |
| 129 | wrmsrl(msrs->controls[i].addr, val); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | } |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 131 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | /* avoid a false detection of ctr overflows in NMI handler */ |
Robert Richter | 4c168ea | 2008-09-24 11:08:52 +0200 | [diff] [blame] | 133 | for (i = 0; i < NUM_COUNTERS; ++i) { |
Robert Richter | 217d3cf | 2009-06-04 02:36:44 +0200 | [diff] [blame] | 134 | if (unlikely(!msrs->counters[i].addr)) |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 135 | continue; |
Robert Richter | bbc5986 | 2009-05-25 17:38:19 +0200 | [diff] [blame] | 136 | wrmsrl(msrs->counters[i].addr, -1LL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | /* enable active counters */ |
Robert Richter | 4c168ea | 2008-09-24 11:08:52 +0200 | [diff] [blame] | 140 | for (i = 0; i < NUM_COUNTERS; ++i) { |
Robert Richter | d8471ad | 2009-07-16 13:04:43 +0200 | [diff] [blame^] | 141 | int virt = op_x86_phys_to_virt(i); |
| 142 | if (!counter_config[virt].enabled) |
| 143 | continue; |
| 144 | if (!msrs->counters[i].addr) |
| 145 | continue; |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 146 | |
Robert Richter | d8471ad | 2009-07-16 13:04:43 +0200 | [diff] [blame^] | 147 | /* setup counter registers */ |
| 148 | wrmsrl(msrs->counters[i].addr, -(u64)reset_value[virt]); |
| 149 | |
| 150 | /* setup control registers */ |
| 151 | rdmsrl(msrs->controls[i].addr, val); |
| 152 | val &= model->reserved; |
| 153 | val |= op_x86_get_ctrl(model, &counter_config[virt]); |
| 154 | wrmsrl(msrs->controls[i].addr, val); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | } |
| 156 | } |
| 157 | |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 158 | |
| 159 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX |
| 160 | |
| 161 | static void op_amd_switch_ctrl(struct op_x86_model_spec const *model, |
| 162 | struct op_msrs const * const msrs) |
| 163 | { |
| 164 | u64 val; |
| 165 | int i; |
| 166 | |
| 167 | /* enable active counters */ |
| 168 | for (i = 0; i < NUM_COUNTERS; ++i) { |
Robert Richter | d8471ad | 2009-07-16 13:04:43 +0200 | [diff] [blame^] | 169 | int virt = op_x86_phys_to_virt(i); |
| 170 | if (!counter_config[virt].enabled) |
| 171 | continue; |
| 172 | rdmsrl(msrs->controls[i].addr, val); |
| 173 | val &= model->reserved; |
| 174 | val |= op_x86_get_ctrl(model, &counter_config[virt]); |
| 175 | wrmsrl(msrs->controls[i].addr, val); |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 176 | } |
| 177 | } |
| 178 | |
| 179 | #endif |
| 180 | |
| 181 | |
Robert Richter | 852402c | 2008-07-22 21:09:06 +0200 | [diff] [blame] | 182 | #ifdef CONFIG_OPROFILE_IBS |
| 183 | |
Robert Richter | 7939d2b | 2008-07-22 21:08:56 +0200 | [diff] [blame] | 184 | static inline int |
| 185 | op_amd_handle_ibs(struct pt_regs * const regs, |
| 186 | struct op_msrs const * const msrs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | { |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 188 | u64 val, ctl; |
Robert Richter | 1acda87 | 2009-01-05 10:35:31 +0100 | [diff] [blame] | 189 | struct op_entry entry; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 191 | if (!has_ibs) |
Jaswinder Singh Rajput | 21e7087 | 2009-06-18 17:09:27 +0530 | [diff] [blame] | 192 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | |
Robert Richter | 7939d2b | 2008-07-22 21:08:56 +0200 | [diff] [blame] | 194 | if (ibs_config.fetch_enabled) { |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 195 | rdmsrl(MSR_AMD64_IBSFETCHCTL, ctl); |
| 196 | if (ctl & IBS_FETCH_VAL) { |
| 197 | rdmsrl(MSR_AMD64_IBSFETCHLINAD, val); |
| 198 | oprofile_write_reserve(&entry, regs, val, |
Robert Richter | 14f0ca8 | 2009-01-07 21:50:22 +0100 | [diff] [blame] | 199 | IBS_FETCH_CODE, IBS_FETCH_SIZE); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 200 | oprofile_add_data64(&entry, val); |
| 201 | oprofile_add_data64(&entry, ctl); |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 202 | rdmsrl(MSR_AMD64_IBSFETCHPHYSAD, val); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 203 | oprofile_add_data64(&entry, val); |
Robert Richter | 14f0ca8 | 2009-01-07 21:50:22 +0100 | [diff] [blame] | 204 | oprofile_write_commit(&entry); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 205 | |
Robert Richter | fd13f6c | 2008-10-19 21:00:09 +0200 | [diff] [blame] | 206 | /* reenable the IRQ */ |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 207 | ctl &= ~(IBS_FETCH_VAL | IBS_FETCH_CNT_MASK); |
| 208 | ctl |= IBS_FETCH_ENABLE; |
| 209 | wrmsrl(MSR_AMD64_IBSFETCHCTL, ctl); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 210 | } |
| 211 | } |
| 212 | |
Robert Richter | 7939d2b | 2008-07-22 21:08:56 +0200 | [diff] [blame] | 213 | if (ibs_config.op_enabled) { |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 214 | rdmsrl(MSR_AMD64_IBSOPCTL, ctl); |
| 215 | if (ctl & IBS_OP_VAL) { |
| 216 | rdmsrl(MSR_AMD64_IBSOPRIP, val); |
| 217 | oprofile_write_reserve(&entry, regs, val, |
Robert Richter | 14f0ca8 | 2009-01-07 21:50:22 +0100 | [diff] [blame] | 218 | IBS_OP_CODE, IBS_OP_SIZE); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 219 | oprofile_add_data64(&entry, val); |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 220 | rdmsrl(MSR_AMD64_IBSOPDATA, val); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 221 | oprofile_add_data64(&entry, val); |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 222 | rdmsrl(MSR_AMD64_IBSOPDATA2, val); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 223 | oprofile_add_data64(&entry, val); |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 224 | rdmsrl(MSR_AMD64_IBSOPDATA3, val); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 225 | oprofile_add_data64(&entry, val); |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 226 | rdmsrl(MSR_AMD64_IBSDCLINAD, val); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 227 | oprofile_add_data64(&entry, val); |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 228 | rdmsrl(MSR_AMD64_IBSDCPHYSAD, val); |
Robert Richter | 51563a0 | 2009-06-03 20:54:56 +0200 | [diff] [blame] | 229 | oprofile_add_data64(&entry, val); |
Robert Richter | 14f0ca8 | 2009-01-07 21:50:22 +0100 | [diff] [blame] | 230 | oprofile_write_commit(&entry); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 231 | |
| 232 | /* reenable the IRQ */ |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 233 | ctl &= ~IBS_OP_VAL & 0xFFFFFFFF; |
| 234 | ctl |= IBS_OP_ENABLE; |
| 235 | wrmsrl(MSR_AMD64_IBSOPCTL, ctl); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | return 1; |
| 240 | } |
| 241 | |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 242 | static inline void op_amd_start_ibs(void) |
| 243 | { |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 244 | u64 val; |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 245 | if (has_ibs && ibs_config.fetch_enabled) { |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 246 | val = (ibs_config.max_cnt_fetch >> 4) & 0xFFFF; |
| 247 | val |= ibs_config.rand_en ? IBS_FETCH_RAND_EN : 0; |
| 248 | val |= IBS_FETCH_ENABLE; |
| 249 | wrmsrl(MSR_AMD64_IBSFETCHCTL, val); |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | if (has_ibs && ibs_config.op_enabled) { |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 253 | val = (ibs_config.max_cnt_op >> 4) & 0xFFFF; |
| 254 | val |= ibs_config.dispatched_ops ? IBS_OP_CNT_CTL : 0; |
| 255 | val |= IBS_OP_ENABLE; |
| 256 | wrmsrl(MSR_AMD64_IBSOPCTL, val); |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 257 | } |
| 258 | } |
| 259 | |
| 260 | static void op_amd_stop_ibs(void) |
| 261 | { |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 262 | if (has_ibs && ibs_config.fetch_enabled) |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 263 | /* clear max count and enable */ |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 264 | wrmsrl(MSR_AMD64_IBSFETCHCTL, 0); |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 265 | |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 266 | if (has_ibs && ibs_config.op_enabled) |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 267 | /* clear max count and enable */ |
Robert Richter | c572ae4 | 2009-06-03 20:10:39 +0200 | [diff] [blame] | 268 | wrmsrl(MSR_AMD64_IBSOPCTL, 0); |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | #else |
| 272 | |
| 273 | static inline int op_amd_handle_ibs(struct pt_regs * const regs, |
Jaswinder Singh Rajput | 21e7087 | 2009-06-18 17:09:27 +0530 | [diff] [blame] | 274 | struct op_msrs const * const msrs) |
| 275 | { |
| 276 | return 0; |
| 277 | } |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 278 | static inline void op_amd_start_ibs(void) { } |
| 279 | static inline void op_amd_stop_ibs(void) { } |
| 280 | |
Robert Richter | 852402c | 2008-07-22 21:09:06 +0200 | [diff] [blame] | 281 | #endif |
| 282 | |
Robert Richter | 7939d2b | 2008-07-22 21:08:56 +0200 | [diff] [blame] | 283 | static int op_amd_check_ctrs(struct pt_regs * const regs, |
| 284 | struct op_msrs const * const msrs) |
| 285 | { |
Robert Richter | 42399ad | 2009-05-25 17:59:06 +0200 | [diff] [blame] | 286 | u64 val; |
Robert Richter | 7939d2b | 2008-07-22 21:08:56 +0200 | [diff] [blame] | 287 | int i; |
| 288 | |
Robert Richter | 6e63ea4 | 2009-07-07 19:25:39 +0200 | [diff] [blame] | 289 | for (i = 0; i < NUM_COUNTERS; ++i) { |
Robert Richter | d8471ad | 2009-07-16 13:04:43 +0200 | [diff] [blame^] | 290 | int virt = op_x86_phys_to_virt(i); |
| 291 | if (!reset_value[virt]) |
Robert Richter | 7939d2b | 2008-07-22 21:08:56 +0200 | [diff] [blame] | 292 | continue; |
Robert Richter | 42399ad | 2009-05-25 17:59:06 +0200 | [diff] [blame] | 293 | rdmsrl(msrs->counters[i].addr, val); |
| 294 | /* bit is clear if overflowed: */ |
| 295 | if (val & OP_CTR_OVERFLOW) |
| 296 | continue; |
Robert Richter | d8471ad | 2009-07-16 13:04:43 +0200 | [diff] [blame^] | 297 | oprofile_add_sample(regs, virt); |
| 298 | wrmsrl(msrs->counters[i].addr, -(u64)reset_value[virt]); |
Robert Richter | 7939d2b | 2008-07-22 21:08:56 +0200 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | op_amd_handle_ibs(regs, msrs); |
| 302 | |
| 303 | /* See op_model_ppro.c */ |
| 304 | return 1; |
| 305 | } |
Paolo Ciarrocchi | d441373 | 2008-02-19 23:51:27 +0100 | [diff] [blame] | 306 | |
Robert Richter | 6657fe4 | 2008-07-22 21:08:50 +0200 | [diff] [blame] | 307 | static void op_amd_start(struct op_msrs const * const msrs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | { |
Robert Richter | dea3766 | 2009-05-25 18:11:52 +0200 | [diff] [blame] | 309 | u64 val; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | int i; |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 311 | |
Robert Richter | 6e63ea4 | 2009-07-07 19:25:39 +0200 | [diff] [blame] | 312 | for (i = 0; i < NUM_COUNTERS; ++i) { |
Robert Richter | d8471ad | 2009-07-16 13:04:43 +0200 | [diff] [blame^] | 313 | if (!reset_value[op_x86_phys_to_virt(i)]) |
| 314 | continue; |
| 315 | rdmsrl(msrs->controls[i].addr, val); |
| 316 | val |= ARCH_PERFMON_EVENTSEL0_ENABLE; |
| 317 | wrmsrl(msrs->controls[i].addr, val); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | } |
Robert Richter | 852402c | 2008-07-22 21:09:06 +0200 | [diff] [blame] | 319 | |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 320 | op_amd_start_ibs(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 321 | } |
| 322 | |
Robert Richter | 6657fe4 | 2008-07-22 21:08:50 +0200 | [diff] [blame] | 323 | static void op_amd_stop(struct op_msrs const * const msrs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | { |
Robert Richter | dea3766 | 2009-05-25 18:11:52 +0200 | [diff] [blame] | 325 | u64 val; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | int i; |
| 327 | |
Robert Richter | fd13f6c | 2008-10-19 21:00:09 +0200 | [diff] [blame] | 328 | /* |
| 329 | * Subtle: stop on all counters to avoid race with setting our |
| 330 | * pm callback |
| 331 | */ |
Robert Richter | 6e63ea4 | 2009-07-07 19:25:39 +0200 | [diff] [blame] | 332 | for (i = 0; i < NUM_COUNTERS; ++i) { |
Robert Richter | d8471ad | 2009-07-16 13:04:43 +0200 | [diff] [blame^] | 333 | if (!reset_value[op_x86_phys_to_virt(i)]) |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 334 | continue; |
Robert Richter | dea3766 | 2009-05-25 18:11:52 +0200 | [diff] [blame] | 335 | rdmsrl(msrs->controls[i].addr, val); |
| 336 | val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE; |
| 337 | wrmsrl(msrs->controls[i].addr, val); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 338 | } |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 339 | |
Robert Richter | 9063759 | 2009-03-10 19:15:57 +0100 | [diff] [blame] | 340 | op_amd_stop_ibs(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 341 | } |
| 342 | |
Robert Richter | 6657fe4 | 2008-07-22 21:08:50 +0200 | [diff] [blame] | 343 | static void op_amd_shutdown(struct op_msrs const * const msrs) |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 344 | { |
| 345 | int i; |
| 346 | |
Robert Richter | 6e63ea4 | 2009-07-07 19:25:39 +0200 | [diff] [blame] | 347 | for (i = 0; i < NUM_COUNTERS; ++i) { |
Robert Richter | 217d3cf | 2009-06-04 02:36:44 +0200 | [diff] [blame] | 348 | if (msrs->counters[i].addr) |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 349 | release_perfctr_nmi(MSR_K7_PERFCTR0 + i); |
| 350 | } |
Robert Richter | 5e766e3 | 2009-07-08 14:54:17 +0200 | [diff] [blame] | 351 | for (i = 0; i < NUM_CONTROLS; ++i) { |
Robert Richter | 217d3cf | 2009-06-04 02:36:44 +0200 | [diff] [blame] | 352 | if (msrs->controls[i].addr) |
Don Zickus | cb9c448 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 353 | release_evntsel_nmi(MSR_K7_EVNTSEL0 + i); |
| 354 | } |
| 355 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | |
Robert Richter | 9fa6812 | 2008-11-24 14:21:03 +0100 | [diff] [blame] | 357 | #ifdef CONFIG_OPROFILE_IBS |
Robert Richter | a4c408a | 2008-07-22 21:09:02 +0200 | [diff] [blame] | 358 | |
Robert Richter | 7d77f2d | 2008-07-22 21:08:57 +0200 | [diff] [blame] | 359 | static u8 ibs_eilvt_off; |
| 360 | |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 361 | static inline void apic_init_ibs_nmi_per_cpu(void *arg) |
| 362 | { |
Robert Richter | 7d77f2d | 2008-07-22 21:08:57 +0200 | [diff] [blame] | 363 | ibs_eilvt_off = setup_APIC_eilvt_ibs(0, APIC_EILVT_MSG_NMI, 0); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 364 | } |
| 365 | |
| 366 | static inline void apic_clear_ibs_nmi_per_cpu(void *arg) |
| 367 | { |
| 368 | setup_APIC_eilvt_ibs(0, APIC_EILVT_MSG_FIX, 1); |
| 369 | } |
| 370 | |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 371 | static int init_ibs_nmi(void) |
Robert Richter | 7d77f2d | 2008-07-22 21:08:57 +0200 | [diff] [blame] | 372 | { |
| 373 | #define IBSCTL_LVTOFFSETVAL (1 << 8) |
| 374 | #define IBSCTL 0x1cc |
| 375 | struct pci_dev *cpu_cfg; |
| 376 | int nodes; |
| 377 | u32 value = 0; |
| 378 | |
| 379 | /* per CPU setup */ |
Robert Richter | ebb535d | 2008-07-22 21:08:59 +0200 | [diff] [blame] | 380 | on_each_cpu(apic_init_ibs_nmi_per_cpu, NULL, 1); |
Robert Richter | 7d77f2d | 2008-07-22 21:08:57 +0200 | [diff] [blame] | 381 | |
| 382 | nodes = 0; |
| 383 | cpu_cfg = NULL; |
| 384 | do { |
| 385 | cpu_cfg = pci_get_device(PCI_VENDOR_ID_AMD, |
| 386 | PCI_DEVICE_ID_AMD_10H_NB_MISC, |
| 387 | cpu_cfg); |
| 388 | if (!cpu_cfg) |
| 389 | break; |
| 390 | ++nodes; |
| 391 | pci_write_config_dword(cpu_cfg, IBSCTL, ibs_eilvt_off |
| 392 | | IBSCTL_LVTOFFSETVAL); |
| 393 | pci_read_config_dword(cpu_cfg, IBSCTL, &value); |
| 394 | if (value != (ibs_eilvt_off | IBSCTL_LVTOFFSETVAL)) { |
Robert Richter | 83bd924 | 2008-12-15 15:09:50 +0100 | [diff] [blame] | 395 | pci_dev_put(cpu_cfg); |
Robert Richter | 7d77f2d | 2008-07-22 21:08:57 +0200 | [diff] [blame] | 396 | printk(KERN_DEBUG "Failed to setup IBS LVT offset, " |
| 397 | "IBSCTL = 0x%08x", value); |
| 398 | return 1; |
| 399 | } |
| 400 | } while (1); |
| 401 | |
| 402 | if (!nodes) { |
| 403 | printk(KERN_DEBUG "No CPU node configured for IBS"); |
| 404 | return 1; |
| 405 | } |
| 406 | |
| 407 | #ifdef CONFIG_NUMA |
| 408 | /* Sanity check */ |
| 409 | /* Works only for 64bit with proper numa implementation. */ |
| 410 | if (nodes != num_possible_nodes()) { |
| 411 | printk(KERN_DEBUG "Failed to setup CPU node(s) for IBS, " |
| 412 | "found: %d, expected %d", |
| 413 | nodes, num_possible_nodes()); |
| 414 | return 1; |
| 415 | } |
| 416 | #endif |
| 417 | return 0; |
| 418 | } |
| 419 | |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 420 | /* uninitialize the APIC for the IBS interrupts if needed */ |
| 421 | static void clear_ibs_nmi(void) |
| 422 | { |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 423 | if (has_ibs) |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 424 | on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1); |
| 425 | } |
| 426 | |
Robert Richter | fd13f6c | 2008-10-19 21:00:09 +0200 | [diff] [blame] | 427 | /* initialize the APIC for the IBS interrupts if available */ |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 428 | static void ibs_init(void) |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 429 | { |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 430 | has_ibs = boot_cpu_has(X86_FEATURE_IBS); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 431 | |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 432 | if (!has_ibs) |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 433 | return; |
| 434 | |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 435 | if (init_ibs_nmi()) { |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 436 | has_ibs = 0; |
Robert Richter | 852402c | 2008-07-22 21:09:06 +0200 | [diff] [blame] | 437 | return; |
| 438 | } |
| 439 | |
| 440 | printk(KERN_INFO "oprofile: AMD IBS detected\n"); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 441 | } |
| 442 | |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 443 | static void ibs_exit(void) |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 444 | { |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 445 | if (!has_ibs) |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 446 | return; |
| 447 | |
| 448 | clear_ibs_nmi(); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 449 | } |
| 450 | |
Robert Richter | 25ad291 | 2008-09-05 17:12:36 +0200 | [diff] [blame] | 451 | static int (*create_arch_files)(struct super_block *sb, struct dentry *root); |
Robert Richter | 270d3e1 | 2008-07-22 21:09:01 +0200 | [diff] [blame] | 452 | |
Robert Richter | 25ad291 | 2008-09-05 17:12:36 +0200 | [diff] [blame] | 453 | static int setup_ibs_files(struct super_block *sb, struct dentry *root) |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 454 | { |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 455 | struct dentry *dir; |
Robert Richter | 270d3e1 | 2008-07-22 21:09:01 +0200 | [diff] [blame] | 456 | int ret = 0; |
| 457 | |
| 458 | /* architecture specific files */ |
| 459 | if (create_arch_files) |
| 460 | ret = create_arch_files(sb, root); |
| 461 | |
| 462 | if (ret) |
| 463 | return ret; |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 464 | |
Robert Richter | fc81be8 | 2008-12-18 00:28:27 +0100 | [diff] [blame] | 465 | if (!has_ibs) |
Robert Richter | 270d3e1 | 2008-07-22 21:09:01 +0200 | [diff] [blame] | 466 | return ret; |
| 467 | |
| 468 | /* model specific files */ |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 469 | |
| 470 | /* setup some reasonable defaults */ |
| 471 | ibs_config.max_cnt_fetch = 250000; |
| 472 | ibs_config.fetch_enabled = 0; |
| 473 | ibs_config.max_cnt_op = 250000; |
| 474 | ibs_config.op_enabled = 0; |
| 475 | ibs_config.dispatched_ops = 1; |
Robert Richter | 2d55a47 | 2008-07-18 17:56:05 +0200 | [diff] [blame] | 476 | |
| 477 | dir = oprofilefs_mkdir(sb, root, "ibs_fetch"); |
| 478 | oprofilefs_create_ulong(sb, dir, "enable", |
| 479 | &ibs_config.fetch_enabled); |
| 480 | oprofilefs_create_ulong(sb, dir, "max_count", |
| 481 | &ibs_config.max_cnt_fetch); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 482 | oprofilefs_create_ulong(sb, dir, "rand_enable", |
| 483 | &ibs_config.rand_en); |
Robert Richter | 2d55a47 | 2008-07-18 17:56:05 +0200 | [diff] [blame] | 484 | |
Robert Richter | ccd755c | 2008-07-29 16:57:10 +0200 | [diff] [blame] | 485 | dir = oprofilefs_mkdir(sb, root, "ibs_op"); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 486 | oprofilefs_create_ulong(sb, dir, "enable", |
Robert Richter | 2d55a47 | 2008-07-18 17:56:05 +0200 | [diff] [blame] | 487 | &ibs_config.op_enabled); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 488 | oprofilefs_create_ulong(sb, dir, "max_count", |
Robert Richter | 2d55a47 | 2008-07-18 17:56:05 +0200 | [diff] [blame] | 489 | &ibs_config.max_cnt_op); |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 490 | oprofilefs_create_ulong(sb, dir, "dispatched_ops", |
Robert Richter | 2d55a47 | 2008-07-18 17:56:05 +0200 | [diff] [blame] | 491 | &ibs_config.dispatched_ops); |
Robert Richter | fc2bd73 | 2008-07-22 21:09:00 +0200 | [diff] [blame] | 492 | |
| 493 | return 0; |
Barry Kasindorf | 56784f1 | 2008-07-22 21:08:55 +0200 | [diff] [blame] | 494 | } |
| 495 | |
Robert Richter | adf5ec0 | 2008-07-22 21:08:48 +0200 | [diff] [blame] | 496 | static int op_amd_init(struct oprofile_operations *ops) |
| 497 | { |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 498 | ibs_init(); |
Robert Richter | 270d3e1 | 2008-07-22 21:09:01 +0200 | [diff] [blame] | 499 | create_arch_files = ops->create_files; |
| 500 | ops->create_files = setup_ibs_files; |
Robert Richter | adf5ec0 | 2008-07-22 21:08:48 +0200 | [diff] [blame] | 501 | return 0; |
| 502 | } |
| 503 | |
| 504 | static void op_amd_exit(void) |
| 505 | { |
Robert Richter | fe615cb | 2008-11-24 14:58:03 +0100 | [diff] [blame] | 506 | ibs_exit(); |
Robert Richter | adf5ec0 | 2008-07-22 21:08:48 +0200 | [diff] [blame] | 507 | } |
| 508 | |
Robert Richter | 9fa6812 | 2008-11-24 14:21:03 +0100 | [diff] [blame] | 509 | #else |
| 510 | |
| 511 | /* no IBS support */ |
| 512 | |
| 513 | static int op_amd_init(struct oprofile_operations *ops) |
| 514 | { |
| 515 | return 0; |
| 516 | } |
| 517 | |
| 518 | static void op_amd_exit(void) {} |
| 519 | |
| 520 | #endif /* CONFIG_OPROFILE_IBS */ |
Robert Richter | a4c408a | 2008-07-22 21:09:02 +0200 | [diff] [blame] | 521 | |
Robert Richter | 6657fe4 | 2008-07-22 21:08:50 +0200 | [diff] [blame] | 522 | struct op_x86_model_spec const op_amd_spec = { |
Robert Richter | c92960f | 2008-09-05 17:12:36 +0200 | [diff] [blame] | 523 | .num_counters = NUM_COUNTERS, |
| 524 | .num_controls = NUM_CONTROLS, |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 525 | .num_virt_counters = NUM_VIRT_COUNTERS, |
| 526 | .num_virt_controls = NUM_VIRT_CONTROLS, |
Robert Richter | 3370d35 | 2009-05-25 15:10:32 +0200 | [diff] [blame] | 527 | .reserved = MSR_AMD_EVENTSEL_RESERVED, |
| 528 | .event_mask = OP_EVENT_MASK, |
| 529 | .init = op_amd_init, |
| 530 | .exit = op_amd_exit, |
Robert Richter | c92960f | 2008-09-05 17:12:36 +0200 | [diff] [blame] | 531 | .fill_in_addresses = &op_amd_fill_in_addresses, |
| 532 | .setup_ctrs = &op_amd_setup_ctrs, |
| 533 | .check_ctrs = &op_amd_check_ctrs, |
| 534 | .start = &op_amd_start, |
| 535 | .stop = &op_amd_stop, |
Robert Richter | 3370d35 | 2009-05-25 15:10:32 +0200 | [diff] [blame] | 536 | .shutdown = &op_amd_shutdown, |
Jason Yeh | 4d4036e | 2009-07-08 13:49:38 +0200 | [diff] [blame] | 537 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX |
| 538 | .switch_ctrl = &op_amd_switch_ctrl, |
| 539 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 540 | }; |