From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [RFC PATCH v2] Fix: x86: Add missing core serializing instruction on migration Date: Mon, 13 Nov 2017 10:51:47 +1100 Message-ID: <1510530707.12797.42.camel@au1.ibm.com> References: <20171111150357.26072-1-mathieu.desnoyers@efficios.com> <1510529164.12797.41.camel@kernel.crashing.org> Reply-To: benh-8fk3Idey6ehBDgjK7y7TUQ@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1510529164.12797.41.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mathieu Desnoyers , Andy Lutomirski , Peter Zijlstra , "H. Peter Anvin" Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Paul E . McKenney" , Boqun Feng , Andrew Hunter , Maged Michael , Avi Kivity , Paul Mackerras , Michael Ellerman , Dave Watson , Thomas Gleixner , Ingo Molnar , Andrea Parri , Russell King , Greg Hackmann , Will Deacon , David Sehr , Linus Torvalds , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: linux-arch.vger.kernel.org On Mon, 2017-11-13 at 10:26 +1100, Benjamin Herrenschmidt wrote: > On Sat, 2017-11-11 at 10:03 -0500, Mathieu Desnoyers wrote: > > x86 has a missing core serializing instruction in migration scenarios. > > > > Given that x86-32 can return to user-space with sysexit, and x86-64 > > through sysretq and sysretl, which are not core serializing, the > > following user-space self-modifiying code (JIT) scenario can occur: > > Is this about load/store consistency ? In this case, don't you also > have problems with get/put_user and not just going to userspace ? Ah forget it, I saw Linus earlier messages. Cheers, Ben. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48410 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbdKLXv7 (ORCPT ); Sun, 12 Nov 2017 18:51:59 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vACNpKsu024395 for ; Sun, 12 Nov 2017 18:51:59 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e6nyf472w-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 12 Nov 2017 18:51:58 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 12 Nov 2017 23:51:55 -0000 Subject: Re: [RFC PATCH v2] Fix: x86: Add missing core serializing instruction on migration From: Benjamin Herrenschmidt Reply-To: benh@au1.ibm.com Date: Mon, 13 Nov 2017 10:51:47 +1100 In-Reply-To: <1510529164.12797.41.camel@kernel.crashing.org> References: <20171111150357.26072-1-mathieu.desnoyers@efficios.com> <1510529164.12797.41.camel@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: <1510530707.12797.42.camel@au1.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Mathieu Desnoyers , Andy Lutomirski , Peter Zijlstra , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, "Paul E . McKenney" , Boqun Feng , Andrew Hunter , Maged Michael , Avi Kivity , Paul Mackerras , Michael Ellerman , Dave Watson , Thomas Gleixner , Ingo Molnar , Andrea Parri , Russell King , Greg Hackmann , Will Deacon , David Sehr , Linus Torvalds , x86@kernel.org, linux-arch@vger.kernel.org, stable@kernel.org Message-ID: <20171112235147.1ae-9od_oApXsCEG-30WmES_rnlel9qLchQTO4laNno@z> On Mon, 2017-11-13 at 10:26 +1100, Benjamin Herrenschmidt wrote: > On Sat, 2017-11-11 at 10:03 -0500, Mathieu Desnoyers wrote: > > x86 has a missing core serializing instruction in migration scenarios. > > > > Given that x86-32 can return to user-space with sysexit, and x86-64 > > through sysretq and sysretl, which are not core serializing, the > > following user-space self-modifiying code (JIT) scenario can occur: > > Is this about load/store consistency ? In this case, don't you also > have problems with get/put_user and not just going to userspace ? Ah forget it, I saw Linus earlier messages. Cheers, Ben.