From patchwork Mon Jun 3 12:25:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 10972837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 740A976 for ; Mon, 3 Jun 2019 12:29:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63BBA2015F for ; Mon, 3 Jun 2019 12:29:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57E74284F1; Mon, 3 Jun 2019 12:29:17 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E0F952015F for ; Mon, 3 Jun 2019 12:29:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hXm3f-0002iH-Qx; Mon, 03 Jun 2019 12:27:23 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hXm3e-0002i0-AQ for xen-devel@lists.xenproject.org; Mon, 03 Jun 2019 12:27:22 +0000 X-Inumbo-ID: ef61dfa3-85fa-11e9-8980-bc764e045a96 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id ef61dfa3-85fa-11e9-8980-bc764e045a96; Mon, 03 Jun 2019 12:27:21 +0000 (UTC) Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL01.citrite.net Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:23.29.105.83 ip4:162.221.156.50 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL01.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: crs1FslT3zE6b2V/cXzj73zLbpgWfeKCZTP/X1z0psQ6M9g3LkeiUNVPT31v3aP2M6/VsaaHiZ d3ibihag/3qMDlHfVVjvOIw5gM+EehVf+/ZeHJN638Vk44ic08dUKAfya+K1yBZrnglUgiTove vABf3cpvn3bAw235qYodlWNOzZZ3Roc3BgCh2c7PhoxhaPxb2ZZNHeY1tBKGra/GPO+y540nmD s3mBOj4NttjnF5DkIF6tp7SxreFoNRdrsHx+q2mmpfVweOH4bkovjVUDzBLtxTYH6x2eUQbIkI XDg= X-SBRS: 2.7 X-MesageID: 1206004 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,546,1549947600"; d="scan'208";a="1206004" From: Andrew Cooper To: Xen-devel Date: Mon, 3 Jun 2019 13:25:24 +0100 Message-ID: <1559564728-17167-2-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1559564728-17167-1-git-send-email-andrew.cooper3@citrix.com> References: <1559564728-17167-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/5] xen/vm-event: Drop unused u_domctl parameter from vm_event_domctl() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Petre Pircalabu , Andrew Cooper , Tamas K Lengyel , Razvan Cojocaru Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This parameter isn't used at all. Futhermore, elide the copyback in failing cases, as it is only successful paths which generate data which needs sending back to the caller. Finally, drop a redundant d == NULL check, as that logic is all common at the begining of do_domctl(). No functional change. Signed-off-by: Andrew Cooper Acked-by: Razvan Cojocaru Acked-by: Jan Beulich --- CC: Razvan Cojocaru CC: Tamas K Lengyel CC: Petre Pircalabu --- xen/common/domctl.c | 6 +++--- xen/common/vm_event.c | 6 +----- xen/include/xen/vm_event.h | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index bade9a6..72a4495 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -1018,9 +1018,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) break; case XEN_DOMCTL_vm_event_op: - ret = vm_event_domctl(d, &op->u.vm_event_op, - guest_handle_cast(u_domctl, void)); - copyback = 1; + ret = vm_event_domctl(d, &op->u.vm_event_op); + if ( ret == 0 ) + copyback = true; break; #ifdef CONFIG_MEM_ACCESS diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c index 74a4755..902e152 100644 --- a/xen/common/vm_event.c +++ b/xen/common/vm_event.c @@ -583,8 +583,7 @@ void vm_event_cleanup(struct domain *d) #endif } -int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec, - XEN_GUEST_HANDLE_PARAM(void) u_domctl) +int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec) { int rc; @@ -594,9 +593,6 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec, return 0; } - if ( unlikely(d == NULL) ) - return -ESRCH; - rc = xsm_vm_event_control(XSM_PRIV, d, vec->mode, vec->op); if ( rc ) return rc; diff --git a/xen/include/xen/vm_event.h b/xen/include/xen/vm_event.h index 7f6fb6d..3cc2b20 100644 --- a/xen/include/xen/vm_event.h +++ b/xen/include/xen/vm_event.h @@ -64,8 +64,7 @@ void vm_event_cancel_slot(struct domain *d, struct vm_event_domain *ved); void vm_event_put_request(struct domain *d, struct vm_event_domain *ved, vm_event_request_t *req); -int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec, - XEN_GUEST_HANDLE_PARAM(void) u_domctl); +int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec); void vm_event_vcpu_pause(struct vcpu *v); void vm_event_vcpu_unpause(struct vcpu *v);