From patchwork Wed Apr 26 15:54:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9701699 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 03F316032C for ; Wed, 26 Apr 2017 16:18:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA0CD285F8 for ; Wed, 26 Apr 2017 16:18:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEB3328600; Wed, 26 Apr 2017 16:18:52 +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 71B5C285F8 for ; Wed, 26 Apr 2017 16:18:52 +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 1d3PcO-0000qA-U5; Wed, 26 Apr 2017 16:16:40 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3PcN-0000q3-Iq for xen-devel@lists.xenproject.org; Wed, 26 Apr 2017 16:16:39 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id 1B/56-03869-6E7C0095; Wed, 26 Apr 2017 16:16:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXitHSDve6z4wy RBlf3iFh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBkXVu5jLfjAVjFr9zS2BsYprF2MnBwSAv4S Xff2s4DYbALKEj87e9lAbBEBPYmmA88ZQWxmAUWJU7dnMIPYwgIeEi/7u4F6OThYBFQl1h6KA gnzClhKzP27kRlipLzErraLYOM5geLv9k0DGykkYCHxeH4zlK0g0TH9GBNEr6DEyZlPWCBWSU gcfPGCeQIj7ywkqVlIUgsYmVYxahSnFpWlFukaGeglFWWmZ5TkJmbm6BoamOnlphYXJ6an5iQ mFesl5+duYgSGDgMQ7GD8tSzgEKMkB5OSKO/6FQyRQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4 lx0DygkWpaanVqRl5gCDGCYtwcGjJMJrDJLmLS5IzC3OTIdInWLU5Zhz7+t7JiGWvPy8VClx3 ukgRQIgRRmleXAjYBF1iVFWSpiXEegoIZ6C1KLczBJU+VeM4hyMSsK8OsD4FOLJzCuB2/QK6A gmoCNYXMCOKElESEk1MIZv1WQMiPfoYfO+tSPtf2rmkr5ld0Lfdf6Je612fk6b767fWlrJKZF rd/Om+Sjp7072ddAK0Ei/GSsgFq4zJ2WTtEl5id/+wpLPARpZT/bditl7b35r8flNQs8/Zp7j fZDzS1H+ykNxO03+YCGdSTGmLxdee5wsLlagvCjziDAL646PtdkHlViKMxINtZiLihMBO64lU qMCAAA= X-Env-Sender: prvs=28229795a=wei.liu2@citrix.com X-Msg-Ref: server-10.tower-21.messagelabs.com!1493223396!58842706!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46246 invoked from network); 26 Apr 2017 16:16:38 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 26 Apr 2017 16:16:38 -0000 X-IronPort-AV: E=Sophos;i="5.37,255,1488844800"; d="scan'208";a="429872797" From: Wei Liu To: Xen-devel Date: Wed, 26 Apr 2017 16:54:57 +0100 Message-ID: <20170426155457.10799-13-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170426155457.10799-1-wei.liu2@citrix.com> References: <20170426155457.10799-1-wei.liu2@citrix.com> MIME-Version: 1.0 Cc: Wei Liu Subject: [Xen-devel] [PATCH for-next v3 12/12] x86/pv/domain: clean up switch_compat 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 Remove the redundant is_pv_domain check. Rearrange setup_compat calls. Signed-off-by: Wei Liu Acked-by: Jan Beulich --- xen/arch/x86/pv/domain.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c index a01e3516ca..f55d41587a 100644 --- a/xen/arch/x86/pv/domain.c +++ b/xen/arch/x86/pv/domain.c @@ -65,16 +65,12 @@ int switch_compat(struct domain *d) return 0; d->arch.has_32bit_shinfo = 1; - if ( is_pv_domain(d) ) - d->arch.is_32bit_pv = 1; + d->arch.is_32bit_pv = 1; for_each_vcpu( d, v ) { - rc = setup_compat_arg_xlat(v); - if ( !rc ) - rc = setup_compat_l4(v); - - if ( rc ) + if ( (rc = setup_compat_arg_xlat(v)) || + (rc = setup_compat_l4(v)) ) goto undo_and_fail; }