lkml.org 
[lkml]   [2023]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v13 045/113] KVM: x86/tdp_mmu: Sprinkle __must_check
    Date
    From: Isaku Yamahata <isaku.yamahata@intel.com>

    TDP MMU allows tdp_mmu_set_spte_atomic() and tdp_mmu_zap_spte_atomic() to
    return -EBUSY or -EAGAIN error. The caller must check the return value and
    retry. Sprinkle __must_check to guarantee it.

    Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
    ---
    arch/x86/kvm/mmu/tdp_mmu.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
    index 3e2575128739..67bc6084b497 100644
    --- a/arch/x86/kvm/mmu/tdp_mmu.c
    +++ b/arch/x86/kvm/mmu/tdp_mmu.c
    @@ -628,9 +628,9 @@ static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,
    * no side-effects other than setting iter->old_spte to the last
    * known value of the spte.
    */
    -static inline int tdp_mmu_set_spte_atomic(struct kvm *kvm,
    - struct tdp_iter *iter,
    - u64 new_spte)
    +static inline int __must_check tdp_mmu_set_spte_atomic(struct kvm *kvm,
    + struct tdp_iter *iter,
    + u64 new_spte)
    {
    u64 *sptep = rcu_dereference(iter->sptep);

    @@ -658,8 +658,8 @@ static inline int tdp_mmu_set_spte_atomic(struct kvm *kvm,
    return 0;
    }

    -static inline int tdp_mmu_zap_spte_atomic(struct kvm *kvm,
    - struct tdp_iter *iter)
    +static inline int __must_check tdp_mmu_zap_spte_atomic(struct kvm *kvm,
    + struct tdp_iter *iter)
    {
    int ret;

    --
    2.25.1
    \
     
     \ /
      Last update: 2023-03-27 00:55    [W:4.056 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site