Re: [PATCH v2 2/3] tools: build qemu-vmsr-helper

2023-11-01 Thread Paolo Bonzini
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 unus

Re: [PATCH v2 2/3] tools: build qemu-vmsr-helper

2023-11-01 Thread Daniel P . Berrangé
On Tue, Oct 31, 2023 at 03:46:02PM +0100, Anthony Harivel wrote: > Introduce a privileged helper to access RAPL MSR. > > The privileged helper tool, qemu-vmsr-helper, is designed to provide > virtual machines with the ability to read specific RAPL (Running Average > Power Limit) MSRs without requi

Re: [PATCH v2 2/3] tools: build qemu-vmsr-helper

2023-11-01 Thread Daniel P . Berrangé
On Tue, Oct 31, 2023 at 03:46:02PM +0100, Anthony Harivel wrote: > Introduce a privileged helper to access RAPL MSR. > > The privileged helper tool, qemu-vmsr-helper, is designed to provide > virtual machines with the ability to read specific RAPL (Running Average > Power Limit) MSRs without requi

[PATCH v2 2/3] tools: build qemu-vmsr-helper

2023-10-31 Thread Anthony Harivel
Introduce a privileged helper to access RAPL MSR. The privileged helper tool, qemu-vmsr-helper, is designed to provide virtual machines with the ability to read specific RAPL (Running Average Power Limit) MSRs without requiring CAP_SYS_RAWIO privileges or relying on external, out-of-tree patches.