aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ds_selftest.c
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2009-04-24 03:43:09 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-24 04:18:51 -0400
commit782cc5ae6331d63b4febaa312c9d14493aafa9b8 (patch)
tree765e8f0a294876d198b88051a29b74140b0c3b45 /arch/x86/kernel/ds_selftest.c
parent416dfdcdb894432547ead4fcb9fa6a36b396059e (diff)
x86, ds: fix buffer alignment in debug store selftest
The debug store selftest code uses a stack-allocated buffer, which is not necessarily correctly aligned. For tests using a buffer to hold a single entry, the buffer that is passed to ds_request must already be suitably aligned. Pass a suitably aligned portion of the bigger buffer. [ Impact: fix hw-branch-tracer self-test failure ] Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Cc: markus.t.metzger@gmail.com LKML-Reference: <20090424094309.A30145@sedona.ch.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/ds_selftest.c')
-rw-r--r--arch/x86/kernel/ds_selftest.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/ds_selftest.c b/arch/x86/kernel/ds_selftest.c
index 5f104a0ace66..6bc7c199ab99 100644
--- a/arch/x86/kernel/ds_selftest.c
+++ b/arch/x86/kernel/ds_selftest.c
@@ -323,13 +323,15 @@ static int ds_selftest_bts_bad_request_task(void *buffer)
323int ds_selftest_bts(void) 323int ds_selftest_bts(void)
324{ 324{
325 struct ds_selftest_bts_conf conf; 325 struct ds_selftest_bts_conf conf;
326 unsigned char buffer[BUFFER_SIZE]; 326 unsigned char buffer[BUFFER_SIZE], *small_buffer;
327 unsigned long irq; 327 unsigned long irq;
328 int cpu; 328 int cpu;
329 329
330 printk(KERN_INFO "[ds] bts selftest..."); 330 printk(KERN_INFO "[ds] bts selftest...");
331 conf.error = 0; 331 conf.error = 0;
332 332
333 small_buffer = (unsigned char *)ALIGN((unsigned long)buffer, 8) + 8;
334
333 get_online_cpus(); 335 get_online_cpus();
334 for_each_online_cpu(cpu) { 336 for_each_online_cpu(cpu) {
335 conf.suspend = ds_suspend_bts_wrap; 337 conf.suspend = ds_suspend_bts_wrap;
@@ -381,7 +383,7 @@ int ds_selftest_bts(void)
381 conf.suspend = ds_suspend_bts_noirq; 383 conf.suspend = ds_suspend_bts_noirq;
382 conf.resume = ds_resume_bts_noirq; 384 conf.resume = ds_resume_bts_noirq;
383 conf.tracer = 385 conf.tracer =
384 ds_request_bts_task(current, buffer, SMALL_BUFFER_SIZE, 386 ds_request_bts_task(current, small_buffer, SMALL_BUFFER_SIZE,
385 NULL, (size_t)-1, BTS_KERNEL); 387 NULL, (size_t)-1, BTS_KERNEL);
386 local_irq_save(irq); 388 local_irq_save(irq);
387 ds_selftest_bts_cpu(&conf); 389 ds_selftest_bts_cpu(&conf);