cachepc

Prime+Probe cache-based side-channel attack on AMD SEV-SNP protected virtual machines
git clone https://git.sinitax.com/sinitax/cachepc
Log | Files | Refs | Submodules | README | sfeed.txt

commit 0d4f62bcc065026390dd1f19b0bb462d07dcf9ff
parent 1715c9d6e1aa977b407081fb3164edbf1534fb5c
Author: Louis Burda <quent.burda@gmail.com>
Date:   Fri,  3 Feb 2023 12:08:28 -0600

Simplify target gfn stepping by tracking a single page

Diffstat:
Mcachepc/cachepc.h | 10----------
Mcachepc/kvm.c | 3++-
2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/cachepc/cachepc.h b/cachepc/cachepc.h @@ -60,16 +60,6 @@ struct cpc_track_steps { uint64_t target_gfn; bool stepping; bool use_filter; - - /* simplified page tracking without singlestep resolve, since we - * only care about when we reach the target page, not accuracy.. - * in contrast to page_track, we keep two pages tracked at all times - * this helps prevent it looking like a A is tracked after B - * when in reality we just untracked A too early on a A -> B boundary */ - bool prev_avail; - uint64_t prev_gfn; - bool cur_avail; - uint64_t cur_gfn; }; static_assert(sizeof(struct cpc_cl) == L1_LINESIZE, "Bad cacheline struct"); diff --git a/cachepc/kvm.c b/cachepc/kvm.c @@ -525,7 +525,8 @@ cpc_track_mode_ioctl(void __user *arg_user) cpc_singlestep_reset = true; cpc_track_steps.stepping = true; } else { - cpc_track_all(vcpu, KVM_PAGE_TRACK_EXEC); + cpc_track_single(vcpu, cpc_track_steps.target_gfn, + KVM_PAGE_TRACK_EXEC); cpc_track_steps.stepping = false; } break;