From: Greg KH <gregkh@linuxfoundation.org>
To: wang.yi59@zte.com.cn
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
xue.zhihong@zte.com.cn, up2wing@gmail.com,
wang.liang82@zte.com.cn
Subject: Re: [PATCH] kvm: x86: Use DEFINE_DEBUGFS_ATTRIBUTE for debugfs files
Date: Wed, 18 Sep 2019 14:03:52 +0200 [thread overview]
Message-ID: <20190918120352.GB1901208@kroah.com> (raw)
In-Reply-To: <201909180819440437759@zte.com.cn>
On Wed, Sep 18, 2019 at 08:19:44AM +0800, wang.yi59@zte.com.cn wrote:
> Hi Paolo,
>
> > On 22/07/19 09:33, Yi Wang wrote:
> > > We got these coccinelle warning:
> > > ./arch/x86/kvm/debugfs.c:23:0-23: WARNING: vcpu_timer_advance_ns_fops
> > > should be defined with DEFINE_DEBUGFS_ATTRIBUTE
> > > ./arch/x86/kvm/debugfs.c:32:0-23: WARNING: vcpu_tsc_offset_fops should
> > > be defined with DEFINE_DEBUGFS_ATTRIBUTE
> > > ./arch/x86/kvm/debugfs.c:41:0-23: WARNING: vcpu_tsc_scaling_fops should
> > > be defined with DEFINE_DEBUGFS_ATTRIBUTE
> > > ./arch/x86/kvm/debugfs.c:49:0-23: WARNING: vcpu_tsc_scaling_frac_fops
> > > should be defined with DEFINE_DEBUGFS_ATTRIBUTE
> > >
> > > Use DEFINE_DEBUGFS_ATTRIBUTE() rather than DEFINE_SIMPLE_ATTRIBUTE()
> > > to fix this.
> > >
> > > Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
> >
> > It sucks though that you have to use a function with "unsafe" in the name.
>
> Yes, it does, but I found some patches in the git log:
> https://git.kernel.org/pub/scm/virt/kvm/kvm.git/log/?qt=grep&q=DEFINE_DEBUGFS_ATTRIBUTE+
>
> And, do you think the function name "debugfs_create_file_unsafe" is not proper?
Only if you _KNOW_ you are creating/removing these files in a way that
is safe is it ok to use these calls. Hint, what is your locking
strategy for when these files are removed?
Is that the case here? If not, please stick with what is there today,
as we know it works, and it is "safe" to do so.
thanks,
greg k-h
prev parent reply other threads:[~2019-09-18 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 7:33 [PATCH] kvm: x86: Use DEFINE_DEBUGFS_ATTRIBUTE for debugfs files Yi Wang
2019-09-17 17:18 ` Paolo Bonzini
2019-09-17 18:12 ` Greg Kroah-Hartman
2019-09-17 19:34 ` Paolo Bonzini
[not found] ` <201909180819440437759@zte.com.cn>
2019-09-18 12:03 ` Greg KH [this message]
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=20190918120352.GB1901208@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=up2wing@gmail.com \
--cc=wang.liang82@zte.com.cn \
--cc=wang.yi59@zte.com.cn \
--cc=x86@kernel.org \
--cc=xue.zhihong@zte.com.cn \
/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