From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure Date: Tue, 17 Oct 2017 10:05:47 -0400 Message-ID: <6f2a54e3-84f7-c04b-ae3c-cad6969d6652@oracle.com> References: <39743c79546ede3073586403d0836a4f93519b0a.1507128293.git.jpoimboe@redhat.com> <3b9fd404-6912-3b58-db29-36202631b438@oracle.com> <20171006143259.rs3zh7k5tmsgesqy@treble> <5a49e43a-8d6b-512a-ec5a-641be7bae41d@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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: Brian Gerst Cc: Juergen Gross , Mike Galbraith , "H. Peter Anvin" , Peter Zijlstra , Andrew Cooper , Rusty Russell , Linux Virtualization , the arch/x86 maintainers , Linux Kernel Mailing List , Chris Wright , live-patching@vger.kernel.org, Linus Torvalds , Borislav Petkov , Andy Lutomirski , Josh Poimboeuf , Ingo Molnar , xen-devel@lists.xenproject.org, Thomas Gleixner , Sasha Levin , Jiri Slaby , Alok Kataria List-Id: virtualization@lists.linuxfoundation.org On 10/17/2017 09:10 AM, Brian Gerst wrote: > On Mon, Oct 16, 2017 at 2:18 PM, Boris Ostrovsky > wrote: >> >> Replacing the macro with >> >> #define PV_INDIRECT(addr) *addr // well, it's not so much >> indirect anymore >> >> makes things work. Or maybe it can be adjusted top be kept truly indirect. > That is still an indirect call, just using absolute addressing for the > pointer instead of RIP-relative. Oh, right, I've got my terminology all wrong. -boris > Alternatives has very limited > relocation capabilities. It will only handle a single call or jmp > replacement. Using absolute addressing is slightly less efficient > (takes one extra byte to encode, and needs a relocation for KASLR), > but it works just as well. You could also relocate the instruction > manually by adding the delta between the original and replacement code > to the displacement.