lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20161206180157.GB2870@hector.attlocal.net>
Date:   Tue, 6 Dec 2016 12:01:57 -0600
From:   Andy Gross <andy.gross@...aro.org>
To:     Will Deacon <will.deacon@....com>
Cc:     jesper.nilsson@...s.com, lorenzo.pieralisi@....com,
        heiko@...ech.de, linux-rockchip@...ts.infradead.org,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux@...linux.org.uk, matthias.bgg@...il.com,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        lars.persson@...s.com, p.zabel@...gutronix.de,
        niklas.cassel@...s.com, ck.hu@...iatek.com,
        linux-mediatek@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Kevin Hilman <khilman@...libre.com>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/2] arm: kernel: Add SMC structure parameter

On Tue, Dec 06, 2016 at 11:55:08AM +0000, Will Deacon wrote:
> Hi Andy,
> 
> On Tue, Nov 29, 2016 at 01:44:22AM -0600, Andy Gross wrote:
> > This patch adds a quirk parameter to the arm_smccc_smc call.  The quirk
> > structure allows for specialized SMC operations due to SoC specific
> > requirements.
> > 
> > This patch also fixes up all the current users of the arm_smccc_smc API.
> > 
> > This patch and partial implementation was suggested by Will Deacon.
> > 
> > Signed-off-by: Andy Gross <andy.gross@...aro.org>
> > ---
> >  arch/arm/kernel/smccc-call.S         |  3 ++-
> >  arch/arm/mach-artpec/board-artpec6.c |  2 +-
> >  arch/arm64/kernel/asm-offsets.c      |  7 +++++--
> >  arch/arm64/kernel/smccc-call.S       |  3 ++-
> >  drivers/clk/rockchip/clk-ddr.c       |  6 +++---
> >  drivers/devfreq/rk3399_dmc.c         |  6 +++---
> >  drivers/firmware/meson/meson_sm.c    |  2 +-
> >  drivers/firmware/psci.c              |  2 +-
> >  drivers/firmware/qcom_scm-64.c       |  4 ++--
> >  drivers/gpu/drm/mediatek/mtk_hdmi.c  |  2 +-
> >  include/linux/arm-smccc.h            | 18 ++++++++++++++++--
> >  11 files changed, 37 insertions(+), 18 deletions(-)
> 
> Thanks for respinning this; I'd forgotten about it!
> 
> > diff --git a/arch/arm/kernel/smccc-call.S b/arch/arm/kernel/smccc-call.S
> > index 37669e7..e77950a 100644
> > --- a/arch/arm/kernel/smccc-call.S
> > +++ b/arch/arm/kernel/smccc-call.S
> > @@ -47,7 +47,8 @@ UNWIND(	.fnend)
> >  /*
> >   * void smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
> >   *		  unsigned long a3, unsigned long a4, unsigned long a5,
> > - *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
> > + *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
> > + *		  struct arm_smccc_quirk *quirk)
> 
> I'd not thought of doing it like this -- I envisaged embedding the quirk
> structure into arm_smccc_res, but this works too. I wonder if we could avoid
> having to pass NULL everywhere if we renamed arm_smccc_{hvc.smc} and added
> a default wrapper around them?
> 
> For example, rename arm_smccc_smc to __arm_smccc_smc, add a macro called
> arm_smccc_smc that passes a NULL argument for the quirk, then finally add
> a macro arm_smccc_smc_quirk that takes the additional parameter?

This would work pretty well.  I'll send another version with this
implementation.

Regards,
Andy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ