From patchwork Fri Dec 9 07:02:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang Li X-Patchwork-Id: 9467641 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 656B1607D6 for ; Fri, 9 Dec 2016 07:17:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5695628580 for ; Fri, 9 Dec 2016 07:17:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48369285ED; Fri, 9 Dec 2016 07:17:51 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BB922853B for ; Fri, 9 Dec 2016 07:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932380AbcLIHRq (ORCPT ); Fri, 9 Dec 2016 02:17:46 -0500 Received: from mga04.intel.com ([192.55.52.120]:7840 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752855AbcLIHRq (ORCPT ); Fri, 9 Dec 2016 02:17:46 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 08 Dec 2016 23:17:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="15783719" Received: from ll.sh.intel.com (HELO localhost) ([10.239.13.123]) by orsmga002.jf.intel.com with ESMTP; 08 Dec 2016 23:17:44 -0800 From: Liang Li To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, Liang Li Subject: [PATCH] kvm/mmu: small fix for reserved bits check Date: Fri, 9 Dec 2016 15:02:23 +0800 Message-Id: <1481266943-27827-1-git-send-email-liang.z.li@intel.com> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use '||' is more efficient than '|' at this point. Signed-off-by: Liang Li --- arch/x86/kvm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d9c7e98..16c0b00 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3315,7 +3315,7 @@ static gpa_t nonpaging_gva_to_gpa_nested(struct kvm_vcpu *vcpu, gva_t vaddr, { int bit7 = (pte >> 7) & 1, low6 = pte & 0x3f; - return (pte & rsvd_check->rsvd_bits_mask[bit7][level-1]) | + return (pte & rsvd_check->rsvd_bits_mask[bit7][level-1]) || ((rsvd_check->bad_mt_xwr & (1ull << low6)) != 0); }