From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v3 6/9] x86: prevent inline distortion by paravirt ops Date: Mon, 11 Jun 2018 09:45:07 +0200 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-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20180610141911.52948-7-namit@vmware.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Nadav Amit Cc: Juergen Gross , x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Ingo Molnar , "H. Peter Anvin" , Alok Kataria , Thomas Gleixner List-Id: virtualization@lists.linuxfoundation.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