diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2009-04-03 10:43:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-07 07:36:35 -0400 |
commit | 150f5164c1258e05b7dea16f29e592f354c48f34 (patch) | |
tree | 5b90728e0bc23182ae1a152d9cb8ff4e9e819afa /arch/x86/kernel/ds_selftest.c | |
parent | 608780a9048efa3e85fbc4d8649b26805cc588aa (diff) |
x86, ds: allow small debug store buffers
Check the buffer size more precisely to allow buffers for exactly
one element provided the base address is already properly aligned.
Add a debug store selftest.
Reported-by: Stephane Eranian <eranian@googlemail.com>
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Cc: roland@redhat.com
Cc: eranian@googlemail.com
Cc: oleg@redhat.com
Cc: juan.villacis@intel.com
Cc: ak@linux.jf.intel.com
LKML-Reference: <20090403144606.139137000@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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/ds_selftest.c b/arch/x86/kernel/ds_selftest.c index a40b2533c71e..5f104a0ace66 100644 --- a/arch/x86/kernel/ds_selftest.c +++ b/arch/x86/kernel/ds_selftest.c | |||
@@ -16,8 +16,8 @@ | |||
16 | #include <asm/ds.h> | 16 | #include <asm/ds.h> |
17 | 17 | ||
18 | 18 | ||
19 | #define BUFFER_SIZE 521 /* Intentionally chose an odd size. */ | 19 | #define BUFFER_SIZE 521 /* Intentionally chose an odd size. */ |
20 | 20 | #define SMALL_BUFFER_SIZE 24 /* A single bts entry. */ | |
21 | 21 | ||
22 | struct ds_selftest_bts_conf { | 22 | struct ds_selftest_bts_conf { |
23 | struct bts_tracer *tracer; | 23 | struct bts_tracer *tracer; |
@@ -381,7 +381,7 @@ int ds_selftest_bts(void) | |||
381 | conf.suspend = ds_suspend_bts_noirq; | 381 | conf.suspend = ds_suspend_bts_noirq; |
382 | conf.resume = ds_resume_bts_noirq; | 382 | conf.resume = ds_resume_bts_noirq; |
383 | conf.tracer = | 383 | conf.tracer = |
384 | ds_request_bts_task(current, buffer, BUFFER_SIZE, | 384 | ds_request_bts_task(current, buffer, SMALL_BUFFER_SIZE, |
385 | NULL, (size_t)-1, BTS_KERNEL); | 385 | NULL, (size_t)-1, BTS_KERNEL); |
386 | local_irq_save(irq); | 386 | local_irq_save(irq); |
387 | ds_selftest_bts_cpu(&conf); | 387 | ds_selftest_bts_cpu(&conf); |