Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3748114imm; Mon, 11 Jun 2018 00:45:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKICWfW3cijAjNha6emh/AAPJlfu+QznWBsG8gQCDop8TBje+fTBIRe2JsErB8crHlQikQyQ X-Received: by 2002:a62:cf44:: with SMTP id b65-v6mr16314579pfg.80.1528703155782; Mon, 11 Jun 2018 00:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528703155; cv=none; d=google.com; s=arc-20160816; b=drh917xOiMq5zrt56L3m/KjIUw0oweIeMMLCdZTHeLUBIpi+5+g0p65sJXJ7sSRYYf 4p6dT0QX4nzyU7WsFpJcv25/rZLhC0Afa+0AYJYLfxBw3bNtWulLwmn6QigrRIBlyvrI PnE9faoVbhNz0BUCoAemQqC0rQ6m17c5+tLKtpChP5XGh9LuDPtRtshGCcdSqy1MfIhC NQBuQgoABX9hlIHLYn16m2pUg0FS4t6QOSTtqRV+KGGXVZ+/oGzWr5PWdQrUFU54QIAh xNbr7SMx3bC/hdViDP+6looB21eeNF6yrftrwUzrdqj5ZDnwupAOCOIg+y1GXQ7979i1 DWMQ== 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:dkim-signature:arc-authentication-results; bh=J90GsHWbmiMUP60WHu7W/BPoqlHG5vrbzrKoQ+f5kWM=; b=x2M7V1DBvMiFCCa2WJP6pG/H6v6j7x1WrJjBocuLdoADMqSBumNzepc+WQFGaWMrBr 5HS/E4bbVoIgA0SH6YbPSUoQ14yNSMHoKcPeR9R+CUESeb/zg/A72D5Iayv/oAD2xF6B 6SdBpnbz3lyjqjTaJgrl7fn4XCpSDxIQeHGgTHyrj+kG1W9dGHa7xXx1l0BMXSwNKewO VC9edSaMIuBmWSUHwHgT3aHIxpnRvJJ9iWfpOj3PUjanZh1k39rQBjDXMSphOqjJ5fEL /iknmWq7gDKfLqEIOXFbPV0yYD3BHZ1/Wxfqf7c6v0EZa4z2AXoGA6vXRd8w2XoHRuxW iAhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=m0KeBFD5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f186-v6si26255219pfg.194.2018.06.11.00.45.41; Mon, 11 Jun 2018 00:45:55 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=m0KeBFD5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754087AbeFKHpP (ORCPT + 99 others); Mon, 11 Jun 2018 03:45:15 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37156 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964AbeFKHpO (ORCPT ); Mon, 11 Jun 2018 03:45:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=J90GsHWbmiMUP60WHu7W/BPoqlHG5vrbzrKoQ+f5kWM=; b=m0KeBFD5c5hPIDsPbBpIEHOGd JW/UwWQ9XXImqVbiOGIiU+0m6C5dgDVoJgy2oNEGQ62rYCCXhPV1xyu5t9HccVF2HCbXsov83vt6N C9zJzr8x3tgW8Sw1i02ekV+UykjVCEC91qVlqm4Mf0f5JK0YEiWvPmoV4lyBD/i71DTwCfPgW9qzz JHI/ZYsu9yeN7BO6OFQ3RSUdXEudaj7R9irg/uV/mGRL8a48C0e0bRPcdASJCC7d7q0zIEiDwZS82 ivCNZDYkneO5gBYlg/7dxgQvpHSyy/PblrOn6HD75zwzfcKYlPBwEURNpPyJrozCXMfyK7T9czzd6 BqnQcxfbg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSHVl-0004Uw-9n; Mon, 11 Jun 2018 07:45:09 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 85FD6201EA7B1; Mon, 11 Jun 2018 09:45:07 +0200 (CEST) Date: Mon, 11 Jun 2018 09:45:07 +0200 From: Peter Zijlstra To: Nadav Amit Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Juergen Gross , Alok Kataria , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , virtualization@lists.linux-foundation.org Subject: Re: [PATCH v3 6/9] x86: prevent inline distortion by paravirt ops Message-ID: <20180611074507.GP12258@hirez.programming.kicks-ass.net> References: <20180610141911.52948-1-namit@vmware.com> <20180610141911.52948-7-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180610141911.52948-7-namit@vmware.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 10, 2018 at 07:19:08AM -0700, Nadav Amit wrote: > +/* > + * This generates an indirect call based on the operation type number. > + * The type number, computed in PARAVIRT_PATCH, is derived from the > + * offset into the paravirt_patch_template structure, and can therefore be > + * freely converted back into a structure offset. > + */ > +.macro PARAVIRT_ALT type:req clobber:req pv_opptr:req Unlike the marcro maze you replaced, this has the CALL hardcoded in. So maybe name this PARAVIRT_CALL instead of PARAVIRT_ALT ? > +771: ANNOTATE_RETPOLINE_SAFE > + call *\pv_opptr > +772: .pushsection .parainstructions,"a" > + _ASM_ALIGN > + _ASM_PTR 771b > + .byte \type > + .byte 772b-771b > + .short \clobber > + .popsection > +.endm