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]
Date:   Fri, 21 Apr 2023 10:34:44 +0100
From:   Conor Dooley <conor.dooley@...rochip.com>
To:     Drew Fustini <dfustini@...libre.com>
CC:     Conor Dooley <conor@...nel.org>, <linux-riscv@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        Palmer Dabbelt <palmer@...belt.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Atish Patra <atishp@...osinc.com>,
        Björn Töpel <bjorn@...osinc.com>,
        James Morse <james.morse@....com>,
        Kornel Dulęba <mindal@...ihalf.com>,
        Adrien Ricciardi <aricciardi@...libre.com>
Subject: Re: [RFC PATCH 2/2] RISC-V: Add support for sqoscfg CSR

On Mon, Apr 17, 2023 at 01:04:11PM -0700, Drew Fustini wrote:
> On Mon, Apr 17, 2023 at 08:10:20PM +0100, Conor Dooley wrote:
> > On Sun, Apr 09, 2023 at 09:36:46PM -0700, Drew Fustini wrote:

> > >  #ifdef CONFIG_FPU
> > >  extern void __fstate_save(struct task_struct *save_to);
> > > @@ -79,6 +80,7 @@ do {							\
> > >  	if (has_fpu())					\
> > >  		__switch_to_aux(__prev, __next);	\
> > >  	((last) = __switch_to(__prev, __next));		\
> > > +	qos_sched_in(__next);				\
> > 
> > Both FPU and vector do:
> > |	if (has_fpu())					\
> > |		__switch_to_fpu(__prev, __next);	\
> > |	if (has_vector())				\
> > |		__switch_to_vector(__prev, __next);	\
> > 
> > Is it just my OCD that wants ssqosid to be the same?
> 
> Thanks, I had not noticed those changes from the vector patch series [1]
> until you pointed it out. The handling of sqoscfg could be converted to
> that pattern too.
> 
> > It'd also do away with that seems a bit weird to me: having
> > qos_sched_in() and __qos_sched_in().
> > Even if you don't make them similar, what's the rationale behind not
> > inverting the extension check & returning early from a single function.
> 
> The goal was so the inline qos_sched_in() would turn into a nop when
> Ssqosid extensions not present. If Ssqosid was present, then the "real"
> function __qos_sched_in() would be called.
> 
> However, having looked at the handling of fpu and vector in the vector
> series, I think will redo the sqoscfg handling to follow that pattern.

Aye. With the way they do it, if !CONFIG_..._SSQOSID, DCE should
remove the function call entirely & the has_extension_[un]likely() stuff
will give you your nop for kernels with CONFIG_..._SSQOSID but no
hardware support.

I think it looks "nicer"/more obvious if you copy what the fpu/vector
stuff does /shrug

Cheers,
Conor.

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ