From: Sean Christopherson <seanjc@google.com>
To: Li kunyu <kunyu@nfschina.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm: kvm_main: Remove unnecessary (void*) conversions
Date: Fri, 16 Dec 2022 16:56:47 +0000 [thread overview]
Message-ID: <Y5yjT2Xu0Jd8ueQ2@google.com> (raw)
In-Reply-To: <20221213080236.3969-1-kunyu@nfschina.com>
On Tue, Dec 13, 2022, Li kunyu wrote:
> void * pointer assignment does not require a forced replacement.
>
> Signed-off-by: Li kunyu <kunyu@nfschina.com>
> ---
> virt/kvm/kvm_main.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index fab4d3790578..1682b269ad4a 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -3861,7 +3861,7 @@ static int create_vcpu_fd(struct kvm_vcpu *vcpu)
> #ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS
> static int vcpu_get_pid(void *data, u64 *val)
> {
> - struct kvm_vcpu *vcpu = (struct kvm_vcpu *) data;
> + struct kvm_vcpu *vcpu = data;
> *val = pid_nr(rcu_access_pointer(vcpu->pid));
Unrelated to your patch: doesn't this need proper RCU protection? E.g. if
KVM_RUN changes vcpu->pid between the read and dereference in pid_nr(), and puts
the last reference to the old pid.
next prev parent reply other threads:[~2022-12-16 16:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 8:02 [PATCH] kvm: kvm_main: Remove unnecessary (void*) conversions Li kunyu
2022-12-16 16:56 ` Sean Christopherson [this message]
2023-03-24 23:35 ` Sean Christopherson
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=Y5yjT2Xu0Jd8ueQ2@google.com \
--to=seanjc@google.com \
--cc=kunyu@nfschina.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.