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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220124100704.GC22849@worktop.programming.kicks-ass.net>
Date:   Mon, 24 Jan 2022 11:07:04 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Mark Rutland <mark.rutland@....com>
Cc:     mingo@...hat.com, tglx@...utronix.de, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, linux-api@...r.kernel.org, x86@...nel.org,
        pjt@...gle.com, posk@...gle.com, avagin@...gle.com,
        jannh@...gle.com, tdelisle@...terloo.ca, posk@...k.io
Subject: Re: [RFC][PATCH v2 5/5] sched: User Mode Concurency Groups

On Mon, Jan 24, 2022 at 11:03:06AM +0100, Peter Zijlstra wrote:

> > Either way, it looks like we'd need helpers along the lines of:
> > 
> > | static __always_inline void umcg_enter_from_user(struct pt_regs *regs)
> > | {
> > | 	if (current->flags & PF_UMCG_WORKER)
> > | 		umcg_sys_enter(regs, -1);
> > | }
> > | 
> > | static __always_inline void umcg_exit_to_user(struct pt_regs *regs)
> > | {
> > | 	if (current->flags & PF_UMCG_WORKER)
> > | 		umcg_sys_exit(regs);
> > | }
> 
> Would something like:
> 
> #ifndef arch_irqentry_irq_enter
> static __always_inline bool arch_irqentry_irq_enter(struct pt_regs *regs)
> {
> 	if (!regs_irqs_disabled(regs)) {
> 		local_irq_enable();
> 		return true;
> 	}
> 	return false;
> }
> #endif
> 
> static __always_inline void irqentry_irq_enter(struct pt_regs *regs)
> {
> 	if (arch_irqentry_irq_inherit(regs)) {
> 		if (user_mode(regs) && (current->flags & PF_UMCG_WORKER))
> 			umcg_sys_enter(regs, -1);
> 	}
> }
> 
> Work? Then arm64 can do:
> 
> static __always_inline bool arch_irqentry_irq_enter(struct pt_regs *regs)
> {
> 	local_daif_inherit();
> 	return interrupts_enabled(regs);
> }
> 
> or somesuch...

Ah,.. just read your other email, so your concern is about the
user_mode() thing due to ARM64 taking a different exception path for
from-user vs from-kernel ?

I don't mind too much if arm64 decides to open-code the umcg hooks, but
please do it such that's hard to forget a spot.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ