From owner-freebsd-current@freebsd.org Sun Jun 25 22:04:29 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38FB0D9B3A8 for ; Sun, 25 Jun 2017 22:04:29 +0000 (UTC) (envelope-from AWilcox@Wilcox-Tech.com) Received: from mail.wilcox-tech.com (mail.wilcox-tech.com [45.32.83.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.wilcox-tech.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 228077F5F7 for ; Sun, 25 Jun 2017 22:04:28 +0000 (UTC) (envelope-from AWilcox@Wilcox-Tech.com) Received: (qmail 5895 invoked from network); 25 Jun 2017 21:53:59 -0000 Received: from ip68-13-242-69.ok.ok.cox.net (HELO ?10.1.1.57?) (awilcox@wilcox-tech.com@68.13.242.69) by mail.wilcox-tech.com with ESMTPA; 25 Jun 2017 21:53:59 -0000 Subject: Re: Skylake/Kabylake Intel Bug? To: freebsd-current@freebsd.org References: From: "A. Wilcox" X-Enigmail-Draft-Status: N1110 Message-ID: <595030E7.1030400@Wilcox-Tech.com> Date: Sun, 25 Jun 2017 16:53:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oWrui7sighJOoOaDG4ciP7MC2HroSsFJr" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jun 2017 22:04:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --oWrui7sighJOoOaDG4ciP7MC2HroSsFJr Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 25/06/17 12:56, Pete Wright wrote: > Came across this post today via HN regarding a issue with Hyperthreadin= g > causing unpredictable behavior on these CPU's >=20 > https://lists.debian.org/debian-devel/2017/06/msg00308.html >=20 > I really wish there was more info on this in the email, for example > examples of programs being effected by this bug. Anywho - was wonderin= g > if any devs here had more info on this issue and could provide better > context? >=20 > Cheers, >=20 > -pete >=20 The linked OCaml issue goes quite in-depth with the mechanisms behind this bug and the risks behind not patching the microcode: https://caml.inria.fr/mantis/view.php?id=3D7452 Basically, if a HyperThreaded core is running a tight loop accessing %rax and %ah (or %rbx and %bh, etc) in quick succession, on both threads of the same physical core, it can corrupt/poison L1d cache. AIUI, OCaml manages to generate this code by manipulating tagged memory addresses and the corresponding tag (the address is in %rax, and the tag is at %ah). I'd really love to see if this affects write-through-no-allocate cache or only write-behind, but I haven't seen any program besides OCaml actually manage to get GCC to generate the insn pattern that is needed, and I don't have a Skylake or Kaby Lake CPU to test with anyway. Fun little hardware bug. Hope this helps you, --arw --=20 A. Wilcox (awilfox) Open-source programmer (C, C++, Python) https://code.foxkit.us/u/awilfox/ --oWrui7sighJOoOaDG4ciP7MC2HroSsFJr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZUDDoAAoJEMspy1GSK50UjTwP/RY1Vm2PsJcVFVrMccqPHVJZ PxvYL6KZrZOj4yfSIJYpB3LAPlrsIqhy6oxWEvF+2aP3FHlIIvswY4v3mAwlNQhc xlwrLQDf1kQARBsVdlGx0Y8jd8SO9Ux2UdHPh7fLqzkGgg0MmRvQH9phfG43CDRk C8qfhgGhwDy2e+RoQ0WahBGhnKtkkVxXB/NEdkouPG5eS9q4nkxBaFuc3IRQOhTh okpaDvHDWVIHt8t68fZKKM2uUm4x8Qpis6iE1LdyzTRNAebmZisIqqvdbDGb4zTb P0rxpKIMQWRBlqbfpTkguy24zXKv5410bxP28bKRGSa6JntkXNB+Wo8bunRWyaQI x0LT2XlpamX2AO9ngjaxjaXgFEVR6+HnyJ3c5tg+WBqI0lWHY71903nYOxkNqKS5 7rIro4DOprursSnusIGxHUV5cinvNGJRBssmA/ZMD6XNRx0xi5EiX8/yQYZEY7zr f2m7VOE0J3GvYZuBaGoMynDYAhehs5voN82VMqYz+AiCI4SNyOHKskJY/Wz/gZIB oKy54jRK14ztnUDTl4tOsvgBBihtoIyzqZlDDYHZ3ThJ6W9D2DQcC44c4scfQww7 6nXks8G9gkpG5DrzfKpsqR5ncppjSssJK+fKQESt8JB9ImRV2YXGAA1YP5fL0V0q cfhi60uHC/EMI01soStK =LCro -----END PGP SIGNATURE----- --oWrui7sighJOoOaDG4ciP7MC2HroSsFJr--