Patch "KVM: Do not incorporate page offset into gfn=>pfn cache user address" has been added to the 5.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    KVM: Do not incorporate page offset into gfn=>pfn cache user address

to the 5.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-do-not-incorporate-page-offset-into-gfn-pfn-cach.patch
and it can be found in the queue-5.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ea59497b46e7a2ab3f493caa24e211a155376ac1
Author: Sean Christopherson <seanjc@xxxxxxxxxx>
Date:   Fri Apr 29 21:00:22 2022 +0000

    KVM: Do not incorporate page offset into gfn=>pfn cache user address
    
    [ Upstream commit 3ba2c95ea180740b16281fa43a3ee5f47279c0ed ]
    
    Don't adjust the userspace address in the gfn=>pfn cache by the page
    offset from the gpa.  KVM should never use the user address directly, and
    all KVM operations that translate a user address to something else
    require the user address to be page aligned.  Ignoring the offset will
    allow the cache to reuse a gfn=>hva translation in the unlikely event
    that the page offset of the gpa changes, but the gfn does not.  And more
    importantly, not having to (un)adjust the user address will simplify a
    future bug fix.
    
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
    Message-Id: <20220429210025.3293691-6-seanjc@xxxxxxxxxx>
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/virt/kvm/pfncache.c b/virt/kvm/pfncache.c
index 40cbe90d52e0..05cb0bcbf662 100644
--- a/virt/kvm/pfncache.c
+++ b/virt/kvm/pfncache.c
@@ -179,8 +179,6 @@ int kvm_gfn_to_pfn_cache_refresh(struct kvm *kvm, struct gfn_to_pfn_cache *gpc,
 			ret = -EFAULT;
 			goto out;
 		}
-
-		gpc->uhva += page_offset;
 	}
 
 	/*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux