x86, ds: fix bounds check in ds selftest
authorMarkus Metzger <markus.t.metzger@intel.com>
Fri, 3 Apr 2009 14:43:43 +0000 (16:43 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 7 Apr 2009 11:36:24 +0000 (13:36 +0200)
Fix a bad bounds check in the debug store selftest.

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: <20090403144558.450027000@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/ds_selftest.c

index e1ba5101b57653b8fdab4265eb94b848142a3c17..cccc19a38f6d03969cafd825ce969d642eb5f27a 100644 (file)
@@ -47,8 +47,13 @@ static int ds_selftest_bts_consistency(const struct bts_trace *trace)
                printk(KERN_CONT "bad bts buffer setup...");
                error = -1;
        }
+       /*
+        * We allow top in [begin; end], since its not clear when the
+        * overflow adjustment happens: after the increment or before the
+        * write.
+        */
        if ((trace->ds.top < trace->ds.begin) ||
-           (trace->ds.end <= trace->ds.top)) {
+           (trace->ds.end < trace->ds.top)) {
                printk(KERN_CONT "bts top out of bounds...");
                error = -1;
        }