[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161215172015.GZ3124@twins.programming.kicks-ass.net>
Date: Thu, 15 Dec 2016 18:20:15 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Kyle Huey <khuey@...ehuey.com>,
Andy Lutomirski <luto@...nel.org>
Subject: Re: [patch 1/3] x86/process: Optimize TIF checks in switch_to_extra()
On Thu, Dec 15, 2016 at 04:44:02PM -0000, Thomas Gleixner wrote:
> void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
> struct tss_struct *tss)
> {
> struct thread_struct *prev, *next;
> + unsigned long tifp, tifn;
>
> prev = &prev_p->thread;
> next = &next_p->thread;
>
> + tifn = task_thread_info(next_p)->flags;
> + tifp = task_thread_info(prev_p)->flags;
> + switch_to_bitmap(tss, prev, next, tifp, tifn);
> +
> + propagate_user_return_notify(prev_p, next_p);
> +
> + if ((tifp ^ tifn) & _TIF_BLOCKSTEP) {
> unsigned long debugctl = get_debugctlmsr();
>
> debugctl &= ~DEBUGCTLMSR_BTF;
> + if (tifn & _TIF_BLOCKSTEP)
> debugctl |= DEBUGCTLMSR_BTF;
> update_debugctlmsr(debugctl);
> }
Going by the toggle patter you have elsewhere, wouldn't that then be:
if ((tifp ^ tifn) & _TIF_BLOCKSTEP) {
unsigned long debugctl = get_debugctlmsr();
debugctl ^= DEBUGCTLMSR_BTF;
update_debugctlmsr(debugctl);
}
?
Powered by blists - more mailing lists