From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752254AbdHJHF1 (ORCPT ); Thu, 10 Aug 2017 03:05:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:41401 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752168AbdHJHFX (ORCPT ); Thu, 10 Aug 2017 03:05:23 -0400 Subject: Re: [PATCH v4 1/2] x86/unwind: add ORC unwinder To: Josh Poimboeuf Cc: Peter Zijlstra , Andy Lutomirski , Linus Torvalds , "Levin, Alexander (Sasha Levin)" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "live-patching@vger.kernel.org" , Jiri Slaby , Ingo Molnar , "H. Peter Anvin" , Mike Galbraith References: <20170729035437.fmnxmeedrq55bpwm@treble> <20170808185809.qaug762cj7nw3bcd@treble> <20170808191344.kw5nlicmq4g6fpii@treble> <79d6e04a-0a1d-592d-5e35-e4d6e7c7526b@suse.com> <20170809091648.p57ircm64t63mejj@hirez.programming.kicks-ass.net> <29fcd05f-3a0d-c20e-f20a-ee2019eea73c@suse.com> <20170809093511.oorxaiau5dtgfjxr@hirez.programming.kicks-ass.net> <20170809201506.izoiy3almhtnrljg@treble> From: Juergen Gross Message-ID: <213d818c-0e15-3379-57c0-66035af28a71@suse.com> Date: Thu, 10 Aug 2017 09:05:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170809201506.izoiy3almhtnrljg@treble> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/08/17 22:15, Josh Poimboeuf wrote: > On Wed, Aug 09, 2017 at 11:55:35AM +0200, Juergen Gross wrote: >> On 09/08/17 11:35, Peter Zijlstra wrote: >>> On Wed, Aug 09, 2017 at 11:24:07AM +0200, Juergen Gross wrote: >>>> On 09/08/17 11:16, Peter Zijlstra wrote: >>>>> On Wed, Aug 09, 2017 at 10:49:43AM +0200, Juergen Gross wrote: >>>>>>> ALTERNATIVE "pushfq; popq %rax", "callq *pv_irq_ops.save_fl", >>>>>>> X86_FEATURE_GODDAMN_PV_IRQ_OPS >>>>>> >>>>>> You are aware that at least some of the Xen irq pvops functionality is >>>>>> patched inline? Your modification would slow down pv guests quite a >>>>>> bit, I guess. >>>>> >>>>> Where does that live? I know of the inline patching for native, but >>>>> didn't know the guests did any of that too. >>>> >>>> See arch/x86/xen/enlighten_pv.c xen_patch(). >>> >>> 'obvious' name that :-) I see that the actual code that's patched in >>> lives in xen-asm.S which unlike the native case doesn't appear to have >>> its own section. So that might make things even more difficult. >> >> I don't see why this couldn't be changed. > > I'm wondering why xen_patch() even exists. The main difference between > xen_patch() and native_patch() seems to be that xen_patch() does some > relocs when doing an inline patch after calling paravirt_patch_insns(). > > But I can't see how that code path would ever run, because the > replacement functions are all larger than the size of the call > instruction to be replaced (7 bytes). So they would never fit, and > instead the paravirt_patch_default() case would always run. Or am I > missing something? Hmm, interesting. Just checked it and it seems you are right. > If we could get rid of the hypervisor-specific patching functions > (pv_init_ops) -- including possibly removing the lguest and vsmp code, > if nobody cares about them anymore -- that might make it easier to > consolidate all the patching things into a single place. I'll send some patches to: - remove xen_patch() - remove lguest - remove vsmp In case nobody objects to apply those patches we can possibly simplify some more code. I'd love that. :-) Juergen