Skip to contentSkip to conversation

KVM: Fix some obsolete comments

PATCH linmiaohe 2 participants 2 messages Feb 26, 2020 KVM

lore
Share & tools
lore

linmiaohe

author
#0 lore raw
Quoted 33 lines · Vitaly Kuznetsov
Quoted 2 lines · linmiaohe

From: Miaohe Lin <[email protected]>

Thank you for the cleanup, I looked at nested_svm_intercept() and I see room for improvement, e.g. (completely untested!)

arch/x86/kvm/svm.c +6 -7
@@ -3280,42 +3280,36 @@ static int nested_svm_intercept(struct vcpu_svm *svm)
       case SVM_EXIT_IOIO:
               vmexit = nested_svm_intercept_ioio(svm);
               break;
-       case SVM_EXIT_READ_CR0 ... SVM_EXIT_WRITE_CR8: {
-               u32 bit = 1U << (exit_code - SVM_EXIT_READ_CR0);
-               if (svm->nested.intercept_cr & bit)
+       case SVM_EXIT_READ_CR0 ... SVM_EXIT_WRITE_CR8:
+               if (svm->nested.intercept_cr &
+                   BIT(exit_code - SVM_EXIT_READ_CR0))
-       default: {
-               u64 exit_bits = 1ULL << (exit_code - SVM_EXIT_INTR);
-               if (svm->nested.intercept & exit_bits)
+       default:
+               if (svm->nested.intercept & BIT_ULL(exit_code - 
+ SVM_EXIT_INTR))
                       vmexit = NESTED_EXIT_DONE;
       }
-       }
 
       return vmexit;
 }
 
Quoted 1 line

Feel free to pick stuff you like and split your changes to this function in a separate patch.

Sounds good, many thanks for your improvement suggestion. Will do in a separate patch.

Quoted 6 lines
Quoted 4 lines

u32 exit_code = svm->vmcb->control.exit_code; diff --git
throws
- * #UD or #GP.
+ * #UD, #GP or #SS.

Oxford comma, anyone? :-)))

I have no strong preference. ^_^

Quoted 7 lines
Quoted 2 lines

*/
int get_vmx_mem_address(struct kvm_vcpu *vcpu, unsigned long exit_qualification,

All your changes look correct, so

Many thanks for your review, and nice suggestion again!

#1 lore raw
Quoted 9 lines · linmiaohe
Quoted 6 lines · Vitaly Kuznetsov
Quoted 3 lines · linmiaohe

throws
- * #UD or #GP.
+ * #UD, #GP or #SS.

Oxford comma, anyone? :-)))

I have no strong preference. ^_^

I'm also a fan of the Oxford comma when it comes to describing code.