From af8e9be96ac096e97d3d34af3e5178fe3adf4dca Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Wed, 1 Feb 2023 11:24:26 -0600 Subject: Properly initialize locks --- README | 2 +- cachepc/event.c | 1 + cachepc/kvm.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README b/README index 37e36a1..4e35d64 100644 --- a/README +++ b/README @@ -105,7 +105,7 @@ Advanced > North Bridge Configuration > SEV-SNP Support = Enabled Advanced > North Bridge Configuration > Memory Configuration > TSME = Disabled The host kernel is built using the AMDESE/AMDSEV repo on branch sev-snp-devel -at commmit a480a51. Build and install the the host kernel and qemu by running: +at commmit a480a51. Build and install the host kernel and qemu by running: # ./bulid.sh --package # cd snp-release-`date "+%Y-%m-%d"` diff --git a/cachepc/event.c b/cachepc/event.c index 53f70b7..b37416a 100644 --- a/cachepc/event.c +++ b/cachepc/event.c @@ -36,6 +36,7 @@ cpc_events_init(void) cpc_eventbuf = NULL; cpc_eventbuf_len = 0; cpc_event_batching = false; + rwlock_init(&cpc_event_lock); cpc_events_reset(); } diff --git a/cachepc/kvm.c b/cachepc/kvm.c index cba2015..f746f2f 100644 --- a/cachepc/kvm.c +++ b/cachepc/kvm.c @@ -647,6 +647,8 @@ cpc_setup_test(void *p) spinlock_t lock; int cpu; + spin_lock_init(&lock); + cpu = get_cpu(); CPC_INFO("Running on core %i\n", cpu); -- cgit v1.2.3-71-gd317