Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=124d395fd05efb65d00ca23c7bcc86c272bd8813
Commit:     124d395fd05efb65d00ca23c7bcc86c272bd8813
Parent:     71b31233a215be27e2efbcc0e739cbebb0bde078
Author:     Stephane Eranian <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 20:35:04 2007 +0200
Committer:  Thomas Gleixner <[EMAIL PROTECTED]>
CommitDate: Fri Oct 19 20:35:04 2007 +0200

    i386: do not BUG_ON() when MSR is unknown
    
    Here is a small patch to change the behavior of the PMU msr allocator
    to avoid BUG_ON() when the MSR is unknwon. Instead, it now returns
    ok, which means "I do not manage". The current allocator is not
    yet managing the full set of PMU registers (e.g., GLOBAL_* on Core 2).
    
    [watchdog] do not BUG_ON() in the MSR allocator if MSR is unknown, return ok
    instead
    
    Signed-off-by: Stephane Eranian <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/kernel/cpu/perfctr-watchdog.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c 
b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 54cdbf1..c02541e 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -120,7 +120,9 @@ int reserve_perfctr_nmi(unsigned int msr)
        unsigned int counter;
 
        counter = nmi_perfctr_msr_to_bit(msr);
-       BUG_ON(counter > NMI_MAX_COUNTER_BITS);
+       /* register not managed by the allocator? */
+       if (counter > NMI_MAX_COUNTER_BITS)
+               return 1;
 
        if (!test_and_set_bit(counter, perfctr_nmi_owner))
                return 1;
@@ -132,7 +134,9 @@ void release_perfctr_nmi(unsigned int msr)
        unsigned int counter;
 
        counter = nmi_perfctr_msr_to_bit(msr);
-       BUG_ON(counter > NMI_MAX_COUNTER_BITS);
+       /* register not managed by the allocator? */
+       if (counter > NMI_MAX_COUNTER_BITS)
+               return;
 
        clear_bit(counter, perfctr_nmi_owner);
 }
@@ -142,7 +146,9 @@ int reserve_evntsel_nmi(unsigned int msr)
        unsigned int counter;
 
        counter = nmi_evntsel_msr_to_bit(msr);
-       BUG_ON(counter > NMI_MAX_COUNTER_BITS);
+       /* register not managed by the allocator? */
+       if (counter > NMI_MAX_COUNTER_BITS)
+               return 1;
 
        if (!test_and_set_bit(counter, evntsel_nmi_owner))
                return 1;
@@ -154,7 +160,9 @@ void release_evntsel_nmi(unsigned int msr)
        unsigned int counter;
 
        counter = nmi_evntsel_msr_to_bit(msr);
-       BUG_ON(counter > NMI_MAX_COUNTER_BITS);
+       /* register not managed by the allocator? */
+       if (counter > NMI_MAX_COUNTER_BITS)
+               return;
 
        clear_bit(counter, evntsel_nmi_owner);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to