From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751055AbdLaOOS (ORCPT ); Sun, 31 Dec 2017 09:14:18 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:35507 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbdLaOOR (ORCPT ); Sun, 31 Dec 2017 09:14:17 -0500 Date: Sun, 31 Dec 2017 15:14:12 +0100 (CET) From: Thomas Gleixner To: Mathieu Desnoyers cc: linux-kernel , Andy Lutomirski , Peter Zijlstra , Borislav Petkov , Dave Hansen , Hugh Dickins , Linus Torvalds Subject: Re: Review of KPTI patchset In-Reply-To: <513331052.45894.1514729355641.JavaMail.zimbra@efficios.com> Message-ID: References: <2080549061.45775.1514659556107.JavaMail.zimbra@efficios.com> <1311401854.45816.1514666587545.JavaMail.zimbra@efficios.com> <513331052.45894.1514729355641.JavaMail.zimbra@efficios.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 31 Dec 2017, Mathieu Desnoyers wrote: > > Granted, it's not obvious and ideally we convert those this_cpu_read/writes > > to __this_cpu_read/writes() to get the immediate fail reported on the first > > access. > > Indeed, if this function is expected to be called from non-preempt context, > the __this_cpu_*() would be appropriate. > > Moreover, clear_asid_other() could use a "static" definition, given that it's only ever > used from arch/x86/mm/tlb.c:choose_new_asid(). Otherwise nothing prevents other users > from unrelated areas of the kernel from calling it, and then we should document that > preemption needs to be disabled around its invocation. > > While we are there (discussing preemption and migration), I'm puzzled about the > preempt_disable/enable in __native_flush_tlb(). First, it should cover the > invalidate_user_asid() call too. Also, if the __ prefixed functions in this header You're late to that discussion. That has been fixed already.... Thanks, tglx