From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933768AbcCISK3 (ORCPT ); Wed, 9 Mar 2016 13:10:29 -0500 Received: from mail.skyhub.de ([78.46.96.112]:45324 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933326AbcCISKU (ORCPT ); Wed, 9 Mar 2016 13:10:20 -0500 Date: Wed, 9 Mar 2016 19:10:03 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: Huang Rui , Peter Zijlstra , spg_linux_kernel@amd.com, X86 ML , LKML Subject: Re: [RFC PATCH] x86/delay: Do not use cpu_tss in preemptible ctxt in delay_mwaitx() Message-ID: <20160309181003.GF6564@pd.tnic> References: <1457523473-3285-1-git-send-email-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 09, 2016 at 09:56:39AM -0800, Andy Lutomirski wrote: > On Mar 9, 2016 3:38 AM, "Borislav Petkov" wrote: > > > > From: Borislav Petkov > > > > So Andy had a good idea about using a cacheline-aligned, seldomly used > > per-cpu var as the MONITORX target but we can't use it in preemptible > > context. The first simple idea I have is to disable preemption around us > > dereffing it. > > What's the actual problem? Is it the preempt warnings and, if so, > would raw_cpu_ptr fix it? Yeah, it is the warning: [ 1.565876] BUG: using smp_processor_id() in preemptible [00000000] code: udevd/312 [ 1.566123] caller is delay_mwaitx+0x40/0xa0 and yes, I think so. I don't think we care about being in preemptible context since we're going idle anyway and doesn't matter which cpu_tss we touch. Yeah, I'll use raw_cpu_ptr... > It may pay to move it into the loop, though. ... and won't need to do that. Thanks for the idea. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.