|
From: | Paolo Bonzini |
Subject: | Re: [PATCH v2 2/3] tools: build qemu-vmsr-helper |
Date: | Wed, 1 Nov 2023 15:32:17 +0100 |
User-agent: | Mozilla Thunderbird |
On 10/31/23 15:46, Anthony Harivel wrote:
+ +static uint64_t vmsr_read_msr(uint32_t reg, unsigned int cpu_id) +{ + int fd; + uint64_t data; + + char path[MAX_PATH_LEN]; + snprintf(path, MAX_PATH_LEN, "/dev/cpu/%u/msr", cpu_id);
If you allow any CPU here, the thread id is really unused. You can however call sched_getaffinity(), and check that the CPU id is included in the thread's affinity. sched_getaffinity() does not need any extra capability.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |