From: Paolo Bonzini <pbonzini@redhat.com>
To: Anthony Harivel <aharivel@redhat.com>, qemu-devel@nongnu.org
Cc: mtosatti@redhat.com, berrange@redhat.com
Subject: Re: [PATCH v2 2/3] tools: build qemu-vmsr-helper
Date: Wed, 1 Nov 2023 15:32:17 +0100 [thread overview]
Message-ID: <e688ba46-08b8-4115-a39f-37a019c393fa@redhat.com> (raw)
In-Reply-To: <20231031144605.64822-3-aharivel@redhat.com>
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
next prev parent reply other threads:[~2023-11-01 14:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 14:46 [PATCH v2 0/3] Add support for RAPL MSRs series Anthony Harivel
2023-10-31 14:46 ` [PATCH v2 1/3] qio: add support for SO_PEERCRED for socket channel Anthony Harivel
2023-11-01 10:20 ` Daniel P. Berrangé
2023-11-01 14:23 ` Paolo Bonzini
2023-10-31 14:46 ` [PATCH v2 2/3] tools: build qemu-vmsr-helper Anthony Harivel
2023-11-01 10:36 ` Daniel P. Berrangé
2023-11-01 10:52 ` Daniel P. Berrangé
2023-11-01 14:32 ` Paolo Bonzini [this message]
2023-10-31 14:46 ` [PATCH v2 3/3] Add support for RAPL MSRs in KVM/Qemu Anthony Harivel
2023-11-01 11:24 ` Daniel P. Berrangé
2023-11-01 14:33 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e688ba46-08b8-4115-a39f-37a019c393fa@redhat.com \
--to=pbonzini@redhat.com \
--cc=aharivel@redhat.com \
--cc=berrange@redhat.com \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).