From patchwork Mon Sep 19 20:44:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9340475 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 D8E2C607D0 for ; Mon, 19 Sep 2016 20:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB04B298BF for ; Mon, 19 Sep 2016 20:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD9B0298BA; Mon, 19 Sep 2016 20:47:04 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM,UNPARSEABLE_RELAY 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 A2BCD298BA for ; Mon, 19 Sep 2016 20:47:03 +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 1bm5QW-0001iQ-RG; Mon, 19 Sep 2016 20:44:32 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm5QV-0001iK-Se for xen-devel@lists.xenproject.org; Mon, 19 Sep 2016 20:44:31 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 11/64-12285-F2E40E75; Mon, 19 Sep 2016 20:44:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRWlGSWpSXmKPExsXSO6nOVVfP70G 4wa4PShbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aCNetZCrpkK+6cPcTYwPhGoouRi0NIYDKT xPtZDewQzhdGicVHFkI5Gxkluq/uhXI6GSVmtjezdjFycrAIqEpc2TGDqYuRg4NNwETizSpHk LCIgLJE76/fLCA2s0CxxIafmxhBbGEBV4kfl8+BtfIKmEl87zrGCjHzJJPE9as/2SESghInZz 6BataSuPHvJdh8ZgFpieX/OEDCnALWEj/OXgUrEQXa1TDjATOILSFgLNH+9iLbBEbBWUgmzUI yaRbCpAWMzKsY1YtTi8pSi3Qt9ZKKMtMzSnITM3N0DQ1M9XJTi4sT01NzEpOK9ZLzczcxAsOW AQh2MK5tdT7EKMnBpCTKK8f3IFyILyk/pTIjsTgjvqg0J7X4EKMMB4eSBG+OL1BOsCg1PbUiL TMHGEEwaQkOHiUR3myQNG9xQWJucWY6ROoUo6KUOG8JSEIAJJFRmgfXBovaS4yyUsK8jECHCP EUpBblZpagyr9iFOdgVBLmtQOZwpOZVwI3/RXQYiagxYw990EWlyQipKQaGM1Orcw/d9Dl7MW 92fW6jqsbJJc6/Jc/eCjn1tIuz9MxfI9M34iK8mqpxJsl1vz6FlKjZHq8LvyXzZV76QlXy9fW 80uXlHQHy646v2zjBs4Oy/8WfXMDZviqfN/Trs10RjVt+WvxzR3XHy9JURQ8zcE3MSNRx9Upt lG5Llns6E6e8CtPPXb8UGIpzkg01GIuKk4EAHPmBmjVAgAA X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1474317869!58723566!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35913 invoked from network); 19 Sep 2016 20:44:30 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-5.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 19 Sep 2016 20:44:30 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8JKiNcB026107 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Sep 2016 20:44:23 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u8JKiNag027988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Sep 2016 20:44:23 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u8JKiGbf010144; Mon, 19 Sep 2016 20:44:22 GMT Received: from x230.dumpdata.com (/10.154.139.13) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Sep 2016 13:44:11 -0700 Date: Mon, 19 Sep 2016 16:44:08 -0400 From: Konrad Rzeszutek Wilk To: Jan Beulich Message-ID: <20160919204407.GB31190@x230.dumpdata.com> References: <1474039754-25816-1-git-send-email-konrad.wilk@oracle.com> <1474039754-25816-4-git-send-email-konrad.wilk@oracle.com> <57DFC514020000780010FDBF@prv-mh.provo.novell.com> <20160919161158.GC9860@localhost.localdomain> <57E02EFB020000780011041A@prv-mh.provo.novell.com> <20160919170233.GC30790@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160919170233.GC30790@localhost.localdomain> User-Agent: Mutt/1.6.1 (2016-04-27) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org, ross.lagerwall@citrix.com Subject: Re: [Xen-devel] [PATCH v6 3/6] livepatch: NOP if func->new_addr is zero. 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP > > > Ooh, good idea. But I think it maybe better as a seperate patch (as it > > > also touches the ARM code). > > > > That's in the other series, isn't it? > > It expands the existing ones. Right now in 'staging' branch we have an > arch/arm/livepatch.c which has these functions in it. > > Granted nothing compiles them, so I could break it in this patch. > > But I already cobbled up the patch so may as well use it? > Tested version: From 0b0ee8f270219f5c9092960ed8560d8e039332a9 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 19 Sep 2016 12:20:27 -0400 Subject: [PATCH] livepatch: Drop _jmp from arch_livepatch_[apply,revert]_jmp With "livepatch: NOP if func->new_addr is zero." that name makes no more sense. Suggested-by: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk --- v7: New submission --- xen/arch/arm/livepatch.c | 4 ++-- xen/arch/x86/livepatch.c | 4 ++-- xen/common/livepatch.c | 4 ++-- xen/include/xen/livepatch.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/livepatch.c b/xen/arch/arm/livepatch.c index 755f596..7f067a0 100644 --- a/xen/arch/arm/livepatch.c +++ b/xen/arch/arm/livepatch.c @@ -21,11 +21,11 @@ int arch_livepatch_verify_func(const struct livepatch_func *func) return -ENOSYS; } -void arch_livepatch_apply_jmp(struct livepatch_func *func) +void arch_livepatch_apply(struct livepatch_func *func) { } -void arch_livepatch_revert_jmp(const struct livepatch_func *func) +void arch_livepatch_revert(const struct livepatch_func *func) { } diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c index 118770e..36bbc5f 100644 --- a/xen/arch/x86/livepatch.c +++ b/xen/arch/x86/livepatch.c @@ -47,7 +47,7 @@ int arch_livepatch_verify_func(const struct livepatch_func *func) return 0; } -void arch_livepatch_apply_jmp(struct livepatch_func *func) +void arch_livepatch_apply(struct livepatch_func *func) { uint8_t *old_ptr; uint8_t insn[sizeof(func->opaque)]; @@ -76,7 +76,7 @@ void arch_livepatch_apply_jmp(struct livepatch_func *func) memcpy(old_ptr, insn, len); } -void arch_livepatch_revert_jmp(const struct livepatch_func *func) +void arch_livepatch_revert(const struct livepatch_func *func) { memcpy(func->old_addr, func->opaque, livepatch_insn_len(func)); } diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c index ed41f39..9d2e86d 100644 --- a/xen/common/livepatch.c +++ b/xen/common/livepatch.c @@ -1033,7 +1033,7 @@ static int apply_payload(struct payload *data) } for ( i = 0; i < data->nfuncs; i++ ) - arch_livepatch_apply_jmp(&data->funcs[i]); + arch_livepatch_apply(&data->funcs[i]); arch_livepatch_revive(); @@ -1062,7 +1062,7 @@ static int revert_payload(struct payload *data) } for ( i = 0; i < data->nfuncs; i++ ) - arch_livepatch_revert_jmp(&data->funcs[i]); + arch_livepatch_revert(&data->funcs[i]); arch_livepatch_revive(); diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h index 174af06..b7f66d4 100644 --- a/xen/include/xen/livepatch.h +++ b/xen/include/xen/livepatch.h @@ -86,8 +86,8 @@ unsigned int livepatch_insn_len(const struct livepatch_func *func) int arch_livepatch_quiesce(void); void arch_livepatch_revive(void); -void arch_livepatch_apply_jmp(struct livepatch_func *func); -void arch_livepatch_revert_jmp(const struct livepatch_func *func); +void arch_livepatch_apply(struct livepatch_func *func); +void arch_livepatch_revert(const struct livepatch_func *func); void arch_livepatch_post_action(void); void arch_livepatch_mask(void);