From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA147C43331 for ; Fri, 6 Sep 2019 09:15:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD93120854 for ; Fri, 6 Sep 2019 09:15:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="p6GJr2Au" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391041AbfIFJPg (ORCPT ); Fri, 6 Sep 2019 05:15:36 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52034 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728356AbfIFJPf (ORCPT ); Fri, 6 Sep 2019 05:15:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=A7pQ/2obJSu6glFAN/iZb0WmVvetjWy1D+ZDyW159q0=; b=p6GJr2Au6TrWlxxqLStxIRds3 7iFWkUB02Kd6586GkS4LwCk+4pdf5Jt/2Gj/B3rmkyeRULXcns1HeHJlDlGqlDZzXpBPNh1brGotx 7PsSj7im9GKrqgL45P5+Ha5uS1MVfyXlLTI6+uV7Mqb1F5+p58D/OlqSyzA8ZDJtApIs2nhF8vIDw qx488sDprcKbJPSiCOum3mRkXLGiCE7aABCz1ljlJq7WoXky41y1BHMskIzL3tkj0hC0gqbhq4Kaa DQ5anAnYz8PPvARMepjD/L8d/dNOmHjpKJY1exF82Q/Am4cxqinCxD5WcntHqcyG9E1vTB9kJOVIX Ww+lODi/w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i6AKm-0004yn-IX; Fri, 06 Sep 2019 09:15:12 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9BC19301A5D; Fri, 6 Sep 2019 11:14:33 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F2DA429E2C316; Fri, 6 Sep 2019 11:15:10 +0200 (CEST) Date: Fri, 6 Sep 2019 11:15:10 +0200 From: Peter Zijlstra To: Masami Hiramatsu Cc: Ingo Molnar , Josh Poimboeuf , Andrew Cooper , Randy Dunlap , Borislav Petkov , Juergen Gross , Boris Ostrovsky , Stefano Stabellini , x86@kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Subject: Re: [PATCH -tip v3 1/2] x86: xen: insn: Decode Xen and KVM emulate-prefix signature Message-ID: <20190906091510.GV2349@hirez.programming.kicks-ass.net> References: <156773433821.31441.2905951246664148487.stgit@devnote2> <156773434815.31441.12739136439382289412.stgit@devnote2> <20190906073436.GS2349@hirez.programming.kicks-ass.net> <20190906174519.699b83f08d81b55203212fa1@kernel.org> <20190906175143.469287501610cbca73f0abbb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906175143.469287501610cbca73f0abbb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 05:51:43PM +0900, Masami Hiramatsu wrote: > On Fri, 6 Sep 2019 17:45:19 +0900 > Masami Hiramatsu wrote: > > > > > > > How about we make this asm/virt_prefix.h or something and include: > > > > > > /* > > > * Virt escape sequences to trigger instruction emulation; > > > * ideally these would decode to 'whole' instruction and not destroy > > > * the instruction stream; sadly this is not true for the 'kvm' one :/ > > > */ > > > > > > #define __XEN_EMULATE_PREFIX 0x0f,0x0b,0x78,0x65,0x6e /* ud2 ; .ascii "xen" */ > > > #define __KVM_EMULATE_PREFIX 0x0f,0x0b,0x6b,0x76,0x6d /* ud2 ; .ascii "kvm" */ > > BTW, what should we call it, "emulate prefix" or "virt prefix"? > "virt prefix" sounds too generic to me. So I rather like emulate_prefix.h. Works for me; and yeah, just see what is best for the other things. I only started down that road because the Xen and KVM 'prefixes' were initialized so inconsistently. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E21CC43331 for ; Fri, 6 Sep 2019 09:15:47 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2367220842 for ; Fri, 6 Sep 2019 09:15:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="p6GJr2Au" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2367220842 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6AL5-0004mx-4J; Fri, 06 Sep 2019 09:15:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i6AL4-0004ms-12 for xen-devel@lists.xenproject.org; Fri, 06 Sep 2019 09:15:30 +0000 X-Inumbo-ID: d8f387aa-d086-11e9-978d-bc764e2007e4 Received: from merlin.infradead.org (unknown [2001:8b0:10b:1231::1]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d8f387aa-d086-11e9-978d-bc764e2007e4; Fri, 06 Sep 2019 09:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=A7pQ/2obJSu6glFAN/iZb0WmVvetjWy1D+ZDyW159q0=; b=p6GJr2Au6TrWlxxqLStxIRds3 7iFWkUB02Kd6586GkS4LwCk+4pdf5Jt/2Gj/B3rmkyeRULXcns1HeHJlDlGqlDZzXpBPNh1brGotx 7PsSj7im9GKrqgL45P5+Ha5uS1MVfyXlLTI6+uV7Mqb1F5+p58D/OlqSyzA8ZDJtApIs2nhF8vIDw qx488sDprcKbJPSiCOum3mRkXLGiCE7aABCz1ljlJq7WoXky41y1BHMskIzL3tkj0hC0gqbhq4Kaa DQ5anAnYz8PPvARMepjD/L8d/dNOmHjpKJY1exF82Q/Am4cxqinCxD5WcntHqcyG9E1vTB9kJOVIX Ww+lODi/w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i6AKm-0004yn-IX; Fri, 06 Sep 2019 09:15:12 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9BC19301A5D; Fri, 6 Sep 2019 11:14:33 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F2DA429E2C316; Fri, 6 Sep 2019 11:15:10 +0200 (CEST) Date: Fri, 6 Sep 2019 11:15:10 +0200 From: Peter Zijlstra To: Masami Hiramatsu Message-ID: <20190906091510.GV2349@hirez.programming.kicks-ass.net> References: <156773433821.31441.2905951246664148487.stgit@devnote2> <156773434815.31441.12739136439382289412.stgit@devnote2> <20190906073436.GS2349@hirez.programming.kicks-ass.net> <20190906174519.699b83f08d81b55203212fa1@kernel.org> <20190906175143.469287501610cbca73f0abbb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190906175143.469287501610cbca73f0abbb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Xen-devel] [PATCH -tip v3 1/2] x86: xen: insn: Decode Xen and KVM emulate-prefix signature X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Andrew Cooper , Randy Dunlap , x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , Josh Poimboeuf , xen-devel@lists.xenproject.org, Boris Ostrovsky , Ingo Molnar Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" T24gRnJpLCBTZXAgMDYsIDIwMTkgYXQgMDU6NTE6NDNQTSArMDkwMCwgTWFzYW1pIEhpcmFtYXRz dSB3cm90ZToKPiBPbiBGcmksIDYgU2VwIDIwMTkgMTc6NDU6MTkgKzA5MDAKPiBNYXNhbWkgSGly YW1hdHN1IDxtaGlyYW1hdEBrZXJuZWwub3JnPiB3cm90ZToKPiAKPiA+ID4gCj4gPiA+IEhvdyBh Ym91dCB3ZSBtYWtlIHRoaXMgYXNtL3ZpcnRfcHJlZml4Lmggb3Igc29tZXRoaW5nIGFuZCBpbmNs dWRlOgo+ID4gPiAKPiA+ID4gLyoKPiA+ID4gICogVmlydCBlc2NhcGUgc2VxdWVuY2VzIHRvIHRy aWdnZXIgaW5zdHJ1Y3Rpb24gZW11bGF0aW9uOwo+ID4gPiAgKiBpZGVhbGx5IHRoZXNlIHdvdWxk IGRlY29kZSB0byAnd2hvbGUnIGluc3RydWN0aW9uIGFuZCBub3QgZGVzdHJveQo+ID4gPiAgKiB0 aGUgaW5zdHJ1Y3Rpb24gc3RyZWFtOyBzYWRseSB0aGlzIGlzIG5vdCB0cnVlIGZvciB0aGUgJ2t2 bScgb25lIDovCj4gPiA+ICAqLwo+ID4gPiAKPiA+ID4gI2RlZmluZSBfX1hFTl9FTVVMQVRFX1BS RUZJWCAgMHgwZiwweDBiLDB4NzgsMHg2NSwweDZlICAvKiB1ZDIgOyAuYXNjaWkgInhlbiIgKi8K PiA+ID4gI2RlZmluZSBf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