Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp42143imu; Thu, 10 Jan 2019 17:36:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN6To6hvLygnrgpdEDQbU7PGVQo6JUipl82A4AMfzjwrWCMwNdPz6PCDVXAFGWf3GCCj8B6o X-Received: by 2002:a63:b543:: with SMTP id u3mr11433472pgo.420.1547170607949; Thu, 10 Jan 2019 17:36:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547170607; cv=none; d=google.com; s=arc-20160816; b=roYtrupzyA66UTBBLvVvqqNTLSMvCaC126grKNxWJit2TV2SJn7hHxdhKYEe+Kfv9T hF6/YmMtD1bkpDBLtehwMkdRqq0yTmjKsWfv7he7dpvrpsp+TcLeYV43UK3CMk7bk6fv 7KfBDIUtHKZ5UlytmplN5MTm8yZdtg2wtB3lkIVTnreY9kJfHw29iOgFcUQuNMGaOWgP /0jRwrySBc9nkgmLNmyBJ/6K981FPkwfz1GitaW+MuaAS/f/EiMty1FMUr3gT3l9OIu3 KzBwgSVBGrALB/JTg6aeBNM2eiwDY6R293fAHEJMBchzFCv9ogpW9lbkSXQI0NkscA5j TUsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ObAWYe3RZPxfL0dsxEp0bfWnXZ54NejbsCHJZnzvhbI=; b=Ijp3bru202qOsZjPLtZtaRbIg07xsBKuKlEI/yAS6C7BibUSee2E6iCd2H96X/fcve 6tY9JJXfL96tuOCRo4/gZ1f/IsETz/49lr/N/pwI+Jk3HpjiW0GV+qydujmJTmPNYr/5 RoW4qi1OVrHhxEcV9dBRrw4vlzsvuesIg4VAz/evZ0wTGHgincFwKfi6ZOKteK0+B12P F1OSO6GHjtOwIuCNWM1l1mlhd5V48fsSiKCi4TH/ZRY59tE+ZCy0EF0aPCIzxKXpXF0V l3HhTUdGy7ACcVLu/r5MnzCjIxMCmQcBvcT/Rdq5n5oU4W7q/Xe6nXxvhxiWGHbFpqRW 3zJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si51786043pgl.209.2019.01.10.17.36.27; Thu, 10 Jan 2019 17:36:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729446AbfAKBeX (ORCPT + 99 others); Thu, 10 Jan 2019 20:34:23 -0500 Received: from mga01.intel.com ([192.55.52.88]:15757 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729329AbfAKBeW (ORCPT ); Thu, 10 Jan 2019 20:34:22 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2019 17:34:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,463,1539673200"; d="scan'208";a="290661265" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by orsmga005.jf.intel.com with ESMTP; 10 Jan 2019 17:34:21 -0800 Date: Thu, 10 Jan 2019 17:34:21 -0800 From: Sean Christopherson To: hpa@zytor.com Cc: Steven Rostedt , Josh Poimboeuf , Nadav Amit , X86 ML , LKML , Ard Biesheuvel , Andy Lutomirski , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Subject: Re: [PATCH v3 5/6] x86/alternative: Use a single access in text_poke() where possible Message-ID: <20190111013421.GD2365@linux.intel.com> References: <279b8003f7f0a6831d090ab822d37bc958f974de.1547073843.git.jpoimboe@redhat.com> <8138A1EE-359D-4CD2-8E96-5BF00313AB3B@vmware.com> <20190110172004.wuh45xoafynfm2df@treble> <20190110123243.3b9e0856@gandalf.local.home> <20190110174257.GE16556@linux.intel.com> <1955E727-BF68-4C00-A8C2-54FA9487A5A6@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1955E727-BF68-4C00-A8C2-54FA9487A5A6@zytor.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 04:59:55PM -0800, hpa@zytor.com wrote: > On January 10, 2019 9:42:57 AM PST, Sean Christopherson wrote: > >On Thu, Jan 10, 2019 at 12:32:43PM -0500, Steven Rostedt wrote: > >> On Thu, 10 Jan 2019 11:20:04 -0600 > >> Josh Poimboeuf wrote: > >> > >> > >> > > While I can't find a reason for hypervisors to emulate this > >instruction, > >> > > smarter people might find ways to turn it into a security > >exploit. > >> > > >> > Interesting point... but I wonder if it's a realistic concern. > >BTW, > >> > text_poke_bp() also relies on undocumented behavior. > >> > >> But we did get an official OK from Intel that it will work. Took a > >bit > >> of arm twisting to get them to do so, but they did. And it really is > >> pretty robust. > > > >Did we (they?) list any caveats for this behavior? E.g. I'm fairly > >certain atomicity guarantees go out the window if WC memtype is used. > > If you run code from non-WB memory, all bets are off and you better > not be doing cross-modifying code. I wasn't thinking of running code from non-WB, but rather running code in WB while doing a CMC write via WC.