On 07/18/2018 01:26 PM, Sean Christopherson wrote:
The TPR thresold field stores its value in bits 3:0, while the vTPR's
effective value is in bits 7:4. Shift the threshold value accordingly
when generating an "interesting" vTPR, otherwise we'll always use an
effective vTPR of 0, which is...uninteresting.
Cc: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx>
Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
---
x86/vmx_tests.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index ab6e089..c4803a3 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -4010,9 +4010,9 @@ static void test_invalid_event_injection(void)
*/
static void test_vtpr_values(unsigned threshold)
{
- try_tpr_threshold_and_vtpr(threshold, threshold - 1);
- try_tpr_threshold_and_vtpr(threshold, threshold);
- try_tpr_threshold_and_vtpr(threshold, threshold + 1);
+ try_tpr_threshold_and_vtpr(threshold, (threshold - 1) << 4);
+ try_tpr_threshold_and_vtpr(threshold, threshold << 4);
+ try_tpr_threshold_and_vtpr(threshold, (threshold + 1) << 4);
}
static void try_tpr_threshold(unsigned threshold)
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx>