From patchwork Wed Sep 21 16:57:09 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: 9343951 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 53749607D4 for ; Wed, 21 Sep 2016 16:59:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 554672A80D for ; Wed, 21 Sep 2016 16:59:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49E592A80E; Wed, 21 Sep 2016 16:59:54 +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, 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 37BA92A80C for ; Wed, 21 Sep 2016 16:59:51 +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 1bmkq6-0000M3-Ej; Wed, 21 Sep 2016 16:57:42 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmkq4-0000KW-Rn for xen-devel@lists.xenproject.org; Wed, 21 Sep 2016 16:57:40 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id 9D/38-01343-40CB2E75; Wed, 21 Sep 2016 16:57:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsXSO6nOVZd5z6N wg6YrKhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a11fcZCz6KV3SeXMDSwHhGpIuRi0NIYCKT xMQLr5ggnC+MErtXfmKEcDYySixpWwvlzGKUOPZ7DVsXIwcHm4CJxJtVjl2MnBwiAhESfVNfM 4LYzAK+EreevWIGsYUFgiVWTfvADmKzCKhK/DtwigXE5hVwk3i+bi8zyBgJAXmJZ7frQcKcAu 4SH99tZwEJCwGVLPiRChKWEDCU+LxxKfMERr4FjAyrGDWKU4vKUot0DQ31kooy0zNKchMzc3Q NDUz1clOLixPTU3MSk4r1kvNzNzECw4QBCHYwrmx3PsQoycGkJMrbveVRuBBfUn5KZUZicUZ8 UWlOavEhRhkODiUJ3tpdQDnBotT01Iq0zBxgwMKkJTh4lER4fUHSvMUFibnFmekQqVOMilLiv NtBEgIgiYzSPLg2WJRcYpSVEuZlBDpEiKcgtSg3swRV/hWjOAejkjCv7m6gKTyZeSVw018BLW YCWrzl5wOQxSWJCCmpBsZ5b1aJcZlPN73Y6pZWsUtwV4b07vSfBjdSvd8fOVjN9PbluejvKhf /X+l1jK2KXrumpijmRKxVZvkeb1vfBZn7PjXKPJl47c6mdScNIvb8F/wTOGGjd8XrPy7nZ1hw 9ry5kim9xi+ZS33toaUH3bM/vVjxg/nKwR0iBzKfnVc7unHRp22pfnfDlFiKMxINtZiLihMBJ f/Ah40CAAA= X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1474477058!43598187!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 17507 invoked from network); 21 Sep 2016 16:57:39 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Sep 2016 16:57:39 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8LGvZ55003405 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Sep 2016 16:57:35 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u8LGvYNf002663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 21 Sep 2016 16:57:34 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u8LGvSLx029805; Wed, 21 Sep 2016 16:57:34 GMT Received: from localhost.localdomain.localdomain (/172.58.216.202) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Sep 2016 09:57:23 -0700 From: Konrad Rzeszutek Wilk To: konrad@kernel.org, xen-devel@lists.xenproject.org, ross.lagerwall@citrix.com Date: Wed, 21 Sep 2016 12:57:09 -0400 Message-Id: <1474477030-10722-5-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1474477030-10722-1-git-send-email-konrad.wilk@oracle.com> References: <1474477030-10722-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] Cc: andrew.cooper3@citrix.com, Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v7 4/5] livepatch: Drop _jmp from arch_livepatch_[apply, revert]_jmp 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 With "livepatch: NOP if func->new_addr is zero." that name makes no more sense as we also NOP now. Suggested-by: Jan Beulich Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- 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 d5e7174..b0d81d7 100644 --- a/xen/arch/x86/livepatch.c +++ b/xen/arch/x86/livepatch.c @@ -46,7 +46,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)]; @@ -75,7 +75,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);