summaryrefslogtreecommitdiffstats
path: root/sevstep/uspt.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-10-05 16:49:09 +0200
committerLouis Burda <quent.burda@gmail.com>2022-10-05 16:49:09 +0200
commitd4c8266836e9a4e6fa073667e4edfbbbb61e8666 (patch)
treed519ac6ec8f03762bfa15cd48b73cba99b4721e2 /sevstep/uspt.c
parentda76c11f2059a8696a3df41844d49f82e6988843 (diff)
downloadcachepc-d4c8266836e9a4e6fa073667e4edfbbbb61e8666.tar.gz
cachepc-d4c8266836e9a4e6fa073667e4edfbbbb61e8666.zip
Sevstep and cachepc refactoring
Diffstat (limited to 'sevstep/uspt.c')
-rw-r--r--sevstep/uspt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sevstep/uspt.c b/sevstep/uspt.c
index f7b329d..ff011a6 100644
--- a/sevstep/uspt.c
+++ b/sevstep/uspt.c
@@ -225,7 +225,7 @@ _perf_state_setup_retired_instructions(void)
retired_instructions_perf_config.EventSelect = 0x0c0;
retired_instructions_perf_config.UintMask = 0x0;
retired_instructions_perf_config.En = 0x1;
- write_ctl(&retired_instructions_perf_config,batch_track_state.perf_cpu, CTL_MSR_0);
+ write_ctl(&retired_instructions_perf_config, batch_track_state.perf_cpu, CTL_MSR_0);
}
@@ -236,17 +236,17 @@ _perf_state_update_and_get_delta(uint64_t current_event_idx)
{
uint64_t current_value;
- // check if value is "cached"
+ /* check if value is "cached" */
if (perf_state.delta_valid_idx == current_event_idx) {
if (current_event_idx == 0) {
read_ctr(CTR_MSR_0, batch_track_state.perf_cpu, &current_value);
perf_state.idx_for_last_perf_reading = current_event_idx;
- perf_state.last_perf_reading = current_event_idx;
+ perf_state.last_perf_reading = current_value;
}
return perf_state.delta;
}
- // otherwise update, but logic is only valid for two consecutive events
+ /* otherwise update, but logic is only valid for two consecutive events */
if (current_event_idx != perf_state.idx_for_last_perf_reading+1) {
printk_ratelimited(KERN_CRIT "_perf_state_update_and_get_delta: "
"last reading was for idx %llu but was queried for %llu\n",
@@ -377,7 +377,7 @@ uspt_batch_tracking_handle_retrack(struct kvm_vcpu* vcpu,
/* made progress, retrack everything in backlog and reset idx */
for (i = 0; i < batch_track_state.gfn_retrack_backlog_next_idx; i++) {
- __track_single_page(vcpu,
+ sevstep_track_single_page(vcpu,
batch_track_state.gfn_retrack_backlog[i],
batch_track_state.tracking_type);
}