linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc: Fix compile issue with force DAWR
Date: Tue, 14 May 2019 16:55:55 +1000	[thread overview]
Message-ID: <eae1df7b0d329f2be6da0322210026c711d38bdc.camel@neuling.org> (raw)
In-Reply-To: <2561c888-1ab5-1cd7-2fe2-509d8d71cae4@c-s.fr>


> > > > --
> > > > v2:
> > > >     Fixes based on Christophe Leroy's comments:
> > > >     - Fix commit message formatting
> > > >     - Move more DAWR code into dawr.c
> > > > ---
> > > >    arch/powerpc/Kconfig                     |  5 ++
> > > >    arch/powerpc/include/asm/hw_breakpoint.h | 20 ++++---
> > > >    arch/powerpc/kernel/Makefile             |  1 +
> > > >    arch/powerpc/kernel/dawr.c               | 75
> > > > ++++++++++++++++++++++++
> > > >    arch/powerpc/kernel/hw_breakpoint.c      | 56 ------------------
> > > >    arch/powerpc/kvm/Kconfig                 |  1 +
> > > >    6 files changed, 94 insertions(+), 64 deletions(-)
> > > >    create mode 100644 arch/powerpc/kernel/dawr.c
> > > > 
> > > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > > > index 2711aac246..f4b19e48cc 100644
> > > > --- a/arch/powerpc/Kconfig
> > > > +++ b/arch/powerpc/Kconfig
> > > > @@ -242,6 +242,7 @@ config PPC
> > > >    	select SYSCTL_EXCEPTION_TRACE
> > > >    	select THREAD_INFO_IN_TASK
> > > >    	select VIRT_TO_BUS			if !PPC64
> > > > +	select PPC_DAWR_FORCE_ENABLE		if PPC64 || PERF
> > > 
> > > What's PERF ? Did you mean PERF_EVENTS ?
> > > 
> > > Then what you mean is:
> > > - Selected all the time for PPC64
> > > - Selected for PPC32 when PERF is also selected.
> > > 
> > > Is that what you want ? At first I thought it was linked to P9.
> > 
> > This is wrong.  I think we just want PPC64. PERF is a red herring.
> 
> Are you sure ? Michael suggested PERF || KVM as far as I remember.

It was mpe but I think it was wrong.

We could make it more selective with something like:
   PPC64 && (HW_BREAK || PPC_ADV_DEBUG_REGS || PERF)
but I think that will end up back in the larger mess of
  https://github.com/linuxppc/issues/issues/128

I don't think the minor size gain is is worth delving in that mess, hence I made
it simply PPC64 which is hopefully an improvement on what we have since it
eliminates 32bit.

> > > >    #else	/* CONFIG_HAVE_HW_BREAKPOINT */
> > > >    static inline void hw_breakpoint_disable(void) { }
> > > >    static inline void thread_change_pc(struct task_struct *tsk,
> > > >    					struct pt_regs *regs) { }
> > > > -static inline bool dawr_enabled(void) { return false; }
> > > > +
> > > >    #endif	/* CONFIG_HAVE_HW_BREAKPOINT */
> > > > +
> > > > +extern bool dawr_force_enable;
> > > > +
> > > > +#ifdef CONFIG_PPC_DAWR_FORCE_ENABLE
> > > > +extern bool dawr_enabled(void);
> > > 
> > > Functions should not be 'extern'. I'm sure checkpatch --strict will tell
> > > you.
> > 
> > That's not what's currently being done in this header file.  I'm keeping
> > with
> > the style of that file.
> 
> style is not defined on a per file basis. There is the style from the 
> past and the nowadays style. If you keep old style just because the file 
> includes old style statements, then the code will never improve.
> 
> All new patches should come with clean 'checkpatch' report and follow 
> new style. Having mixed styles in a file is not a problem, that's the 
> way to improvement. See arch/powerpc/mm/mmu_decl.h as an exemple.

I'm not sure that's mpe's policy.

mpe?

> > > > +
> > > > +static ssize_t dawr_write_file_bool(struct file *file,
> > > > +				    const char __user *user_buf,
> > > > +				    size_t count, loff_t *ppos)
> > > > +{
> > > > +	struct arch_hw_breakpoint null_brk = {0, 0, 0};
> > > > +	size_t rc;
> > > > +
> > > > +	/* Send error to user if they hypervisor won't allow us to write
> > > > DAWR */
> > > > +	if ((!dawr_force_enable) &&
> > > > +	    (firmware_has_feature(FW_FEATURE_LPAR)) &&
> > > > +	    (set_dawr(&null_brk) != H_SUCCESS))
> > > 
> > > The above is not real clear.
> > > set_dabr() returns 0, H_SUCCESS is not used there.
> > 
> > It pseries_set_dawr() will return a hcall number.
> 
> Right, then it maybe means set_dawr() should be fixes ?

Sorry, I don't understand this.

> > This code hasn't changed. I'm just moving it.
> 
> Right, but could be an improvment for another patch.
> As far as I remember you are the one who wrote that code at first place, 
> arent't you ?

Yep, classic crap Mikey code :-)

Mikey

  reply	other threads:[~2019-05-14  6:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13  7:17 [PATCH v2] powerpc: Fix compile issue with force DAWR Michael Neuling
2019-05-13  9:08 ` Christophe Leroy
2019-05-14  4:47   ` Michael Neuling
2019-05-14  5:26     ` Christophe Leroy
2019-05-14  6:55       ` Michael Neuling [this message]
2019-05-14  7:06         ` Christophe Leroy

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=eae1df7b0d329f2be6da0322210026c711d38bdc.camel@neuling.org \
    --to=mikey@neuling.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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).