From patchwork Wed Feb 17 16:37:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 8341021 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03BEEC0553 for ; Wed, 17 Feb 2016 16:40:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDDCF203C0 for ; Wed, 17 Feb 2016 16:40:01 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2741B202EB for ; Wed, 17 Feb 2016 16:40:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW56U-0005q4-9K; Wed, 17 Feb 2016 16:37:26 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW56S-0005pY-UA for xen-devel@lists.xenproject.org; Wed, 17 Feb 2016 16:37:25 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id FF/23-31443-4C1A4C65; Wed, 17 Feb 2016 16:37:24 +0000 X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-16.tower-31.messagelabs.com!1455727041!15648948!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44614 invoked from network); 17 Feb 2016 16:37:23 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-16.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 17 Feb 2016 16:37:23 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Wed, 17 Feb 2016 09:37:21 -0700 Message-Id: <56C4AFD102000078000D34AD@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Wed, 17 Feb 2016 09:37:21 -0700 From: "Jan Beulich" To: "xen-devel" References: <56C4AC2802000078000D3473@prv-mh.provo.novell.com> In-Reply-To: <56C4AC2802000078000D3473@prv-mh.provo.novell.com> Mime-Version: 1.0 Cc: Kevin Tian , Jun Nakajima Subject: [Xen-devel] [PATCH 4/5] VMX: fold redundant code X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No need to do this in two slightly different ways, possibly keeping the compiler from folding the code for us. Signed-off-by: Jan Beulich VMX: fold redundant code No need to do this in two slightly different ways, possibly keeping the compiler from folding the code for us. Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -3103,6 +3103,7 @@ void vmx_vmexit_handler(struct cpu_user_ && vector != TRAP_nmi && vector != TRAP_machine_check ) { + default: perfc_incr(realmode_exits); v->arch.hvm_vmx.vmx_emulate = 1; HVMTRACE_0D(REALMODE_EMULATE); @@ -3121,12 +3122,6 @@ void vmx_vmexit_handler(struct cpu_user_ case EXIT_REASON_INVEPT: case EXIT_REASON_INVVPID: break; - - default: - v->arch.hvm_vmx.vmx_emulate = 1; - perfc_incr(realmode_exits); - HVMTRACE_0D(REALMODE_EMULATE); - return; } } Reviewed-by: Andrew Cooper Acked-by: Kevin Tian --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -3103,6 +3103,7 @@ void vmx_vmexit_handler(struct cpu_user_ && vector != TRAP_nmi && vector != TRAP_machine_check ) { + default: perfc_incr(realmode_exits); v->arch.hvm_vmx.vmx_emulate = 1; HVMTRACE_0D(REALMODE_EMULATE); @@ -3121,12 +3122,6 @@ void vmx_vmexit_handler(struct cpu_user_ case EXIT_REASON_INVEPT: case EXIT_REASON_INVVPID: break; - - default: - v->arch.hvm_vmx.vmx_emulate = 1; - perfc_incr(realmode_exits); - HVMTRACE_0D(REALMODE_EMULATE); - return; } }