|
@@ -120,7 +120,9 @@ int reserve_perfctr_nmi(unsigned int msr)
|
|
unsigned int counter;
|
|
unsigned int counter;
|
|
|
|
|
|
counter = nmi_perfctr_msr_to_bit(msr);
|
|
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))
|
|
if (!test_and_set_bit(counter, perfctr_nmi_owner))
|
|
return 1;
|
|
return 1;
|
|
@@ -132,7 +134,9 @@ void release_perfctr_nmi(unsigned int msr)
|
|
unsigned int counter;
|
|
unsigned int counter;
|
|
|
|
|
|
counter = nmi_perfctr_msr_to_bit(msr);
|
|
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);
|
|
clear_bit(counter, perfctr_nmi_owner);
|
|
}
|
|
}
|
|
@@ -142,7 +146,9 @@ int reserve_evntsel_nmi(unsigned int msr)
|
|
unsigned int counter;
|
|
unsigned int counter;
|
|
|
|
|
|
counter = nmi_evntsel_msr_to_bit(msr);
|
|
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))
|
|
if (!test_and_set_bit(counter, evntsel_nmi_owner))
|
|
return 1;
|
|
return 1;
|
|
@@ -154,7 +160,9 @@ void release_evntsel_nmi(unsigned int msr)
|
|
unsigned int counter;
|
|
unsigned int counter;
|
|
|
|
|
|
counter = nmi_evntsel_msr_to_bit(msr);
|
|
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);
|
|
clear_bit(counter, evntsel_nmi_owner);
|
|
}
|
|
}
|