Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759885Ab2BJSvn (ORCPT ); Fri, 10 Feb 2012 13:51:43 -0500 Received: from plane.gmane.org ([80.91.229.3]:51179 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759724Ab2BJSvm (ORCPT ); Fri, 10 Feb 2012 13:51:42 -0500 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Simon Farnsworth Subject: Re: Do the x86 kernel entry points need an xabort on TSX cpus? Date: Fri, 10 Feb 2012 18:51:13 +0000 Message-ID: References: <4F35517F.9070904@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 110.100.155.90.in-addr.arpa User-Agent: KNode/4.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2072 Lines: 49 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andy Lutomirski wrote: > On Fri, Feb 10, 2012 at 9:18 AM, H. Peter Anvin > wrote: >> On 02/09/2012 11:40 PM, Andy Lutomirski wrote: >>> >>> [...] >>> >>> - Ring transitions: SYSENTER, SYSCALL, SYSEXIT, and SYSRET. >>> >>> I suspect that many bits of the kernel expect that things they do >>> won't unhappen. For example, it could be fun to do: >>> >> >> That's why entering the kernel will cause an abort. In other words, you >> will ALWAYS abort when you do a read(), and you will never reach your >> _xabort(). > > Is that architecturally guaranteed? (My manual suggests that it's > specifically *not* guaranteed, which is surprising.) > > --Andy My understanding of the architecture manual's wording (which is a bit clumsy) is that they want to leave themselves wiggle room just in case they work out a way to do any of these things without requiring an abort. If, for example, Intel add an MSR for SYSENTER that's used to go to a different entrypoint if you're mid-transaction, you've suddenly broken all code that assumes that SYSENTER triggers an abort - instead, some SYSENTERs trigger an abort (as the kernel does the XABORT), while others don't. Current implementations appear to always abort on ring transition, though. - -- Simon Farnsworth -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJPNWclAAoJEIKsye9/dtRWNoAH/j6H6mUzk+eS4yeZlcfd1DbG cIicIJWGJNfm/TWAGb2ABrFgyDS+568ODFUogtAoLFcaxUieVVmuopjfgdjfiLdr GoANhzyzohknQnHyiQetyTOzmkQVYCrMuRt/qplMO+k5DuvuN0FNxGW990B4jwQL kFC2KSDMi2QKUnla2XbVsHR7xqe8gRJMEVB5DREkFiVhJGaf4Eyj0Rh4yLfSu9Ka IngcU7Q6dmSlwCzmt/r+5BJeMvzfDa76+NxdStYDxe2FcZx7BdHeUwM9YyRPcrFp Cgosn+C8Aiea15Ti/xYpd+M8LWGK8bq4XiV9a8D9WSagGngBrO1u1iCnx2hYKdI= =hHwE -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/