From patchwork Thu Aug 10 12:52:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Gross X-Patchwork-Id: 9893677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBFC160236 for ; Thu, 10 Aug 2017 12:55:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD80A28ABA for ; Thu, 10 Aug 2017 12:55:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A259328ACB; Thu, 10 Aug 2017 12:55:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 289C828ABA for ; Thu, 10 Aug 2017 12:55:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfmxS-0007db-Lv; Thu, 10 Aug 2017 12:53:02 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfmxQ-0007d9-K0 for xen-devel@lists.xenproject.org; Thu, 10 Aug 2017 12:53:00 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id C1/70-04533-B275C895; Thu, 10 Aug 2017 12:52:59 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKLMWRWlGSWpSXmKPExsVyuP0Ov652eE+ kwb3FfBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bUzduZCi6LVuyd+oK9gfG6YBcjJ4eEgJHE 24n/mLoYuTiEBBYySuz8cYUNJMEmoCqx4fopVhBbRCBIYkNHK1gRs8AqRonHG5qYQBLCAqYSn 15cZgaxWYAadm64AhbnFTCWeLt2FRPEBnmJjgOTWUBsTgETia9L9jOC2EJANX9fPGObwMi9gJ FhFaNGcWpRWWqRrpGxXlJRZnpGSW5iZo6uoYGxXm5qcXFiempOYlKxXnJ+7iZGoIfrGRgYdzD 27fU7xCjJwaQkylv8qTtSiC8pP6UyI7E4I76oNCe1+BCjDAeHkgTvu9CeSCHBotT01Iq0zBxg qMGkJTh4lER4jUHSvMUFibnFmekQqVOM9hwbVq//wsTRMePnNyaOVxP+A8mm7x+/Mwmx5OXnp UqJ8y4FaRMAacsozYMbCouNS4yyUsK8jAwMDEI8BalFuZklqPKvGMU5GJWAKsKApvBk5pXA7X 4FdBYT0FkRvp0gZ5UkIqSkGhgZo8odJu+pffdLisOmYOHWyT9a5qkG3rK6rhMW4jH3TVlOZFi uxbMLj38sXejGobk6kjF+x1KhfcrnJnp8dFh93uuMjIDW3fjCvYJ9iT8tex1PteW9upcQJPm+ QqksPlP2q9nks1mbtNk5ft16rNiwxIjnbcekbuPIuXNnZO3+dO6mxMJvKUFKLMUZiYZazEXFi QBI4vDbiAIAAA== X-Env-Sender: jgross@suse.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1502369579!104870404!1 X-Originating-IP: [195.135.220.15] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44020 invoked from network); 10 Aug 2017 12:52:59 -0000 Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by server-13.tower-31.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 10 Aug 2017 12:52:59 -0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7F4F0AE5C; Thu, 10 Aug 2017 12:52:58 +0000 (UTC) From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org Date: Thu, 10 Aug 2017 14:52:52 +0200 Message-Id: <20170810125254.1347-2-jgross@suse.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170810125254.1347-1-jgross@suse.com> References: <20170810125254.1347-1-jgross@suse.com> Cc: Juergen Gross , lguest@lists.ozlabs.org, rusty@rustcorp.com.au, mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH 1/3] paravirt,xen: remove xen_patch() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Xen's paravirt patch function xen_patch() does some special casing for irq_ops functions to apply relocations when those functions can be patched inline instead of calls. Unfortunately none of the special case function replacements is small enough to be patches inline, so the special case never applies. As xen_patch() will call paravirt_patch_default() in all cases it can be just dropped. Signed-off-by: Juergen Gross --- arch/x86/xen/enlighten_pv.c | 59 +-------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 811e4ddb3f37..98491521bb43 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -981,59 +981,6 @@ void __ref xen_setup_vcpu_info_placement(void) } } -static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf, - unsigned long addr, unsigned len) -{ - char *start, *end, *reloc; - unsigned ret; - - start = end = reloc = NULL; - -#define SITE(op, x) \ - case PARAVIRT_PATCH(op.x): \ - if (xen_have_vcpu_info_placement) { \ - start = (char *)xen_##x##_direct; \ - end = xen_##x##_direct_end; \ - reloc = xen_##x##_direct_reloc; \ - } \ - goto patch_site - - switch (type) { - SITE(pv_irq_ops, irq_enable); - SITE(pv_irq_ops, irq_disable); - SITE(pv_irq_ops, save_fl); - SITE(pv_irq_ops, restore_fl); -#undef SITE - - patch_site: - if (start == NULL || (end-start) > len) - goto default_patch; - - ret = paravirt_patch_insns(insnbuf, len, start, end); - - /* Note: because reloc is assigned from something that - appears to be an array, gcc assumes it's non-null, - but doesn't know its relationship with start and - end. */ - if (reloc > start && reloc < end) { - int reloc_off = reloc - start; - long *relocp = (long *)(insnbuf + reloc_off); - long delta = start - (char *)addr; - - *relocp += delta; - } - break; - - default_patch: - default: - ret = paravirt_patch_default(type, clobbers, insnbuf, - addr, len); - break; - } - - return ret; -} - static const struct pv_info xen_info __initconst = { .shared_kernel_pmd = 0, @@ -1043,10 +990,6 @@ static const struct pv_info xen_info __initconst = { .name = "Xen", }; -static const struct pv_init_ops xen_init_ops __initconst = { - .patch = xen_patch, -}; - static const struct pv_cpu_ops xen_cpu_ops __initconst = { .cpuid = xen_cpuid, @@ -1244,7 +1187,7 @@ asmlinkage __visible void __init xen_start_kernel(void) /* Install Xen paravirt ops */ pv_info = xen_info; - pv_init_ops = xen_init_ops; + pv_init_ops.patch = paravirt_patch_default; pv_cpu_ops = xen_cpu_ops; x86_platform.get_nmi_reason = xen_get_nmi_reason;