From patchwork Fri Oct 25 02:01:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 11211199 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4047813BD for ; Fri, 25 Oct 2019 02:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C50721929 for ; Fri, 25 Oct 2019 02:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389614AbfJYCAy (ORCPT ); Thu, 24 Oct 2019 22:00:54 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:49186 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725860AbfJYCAy (ORCPT ); Thu, 24 Oct 2019 22:00:54 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id F0C5DB9DC0999ECE50E2; Fri, 25 Oct 2019 10:00:51 +0800 (CST) Received: from huawei.com (10.175.105.18) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Fri, 25 Oct 2019 10:00:45 +0800 From: Miaohe Lin To: , , , , , , , , , , CC: , , , Subject: [PATCH] KVM: x86: get rid of odd out jump label in pdptrs_changed Date: Fri, 25 Oct 2019 10:01:18 +0800 Message-ID: <1571968878-10437-1-git-send-email-linmiaohe@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.105.18] X-CFilter-Loop: Reflected Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The odd out jump label is really not needed. Get rid of it by check r >= 0. Signed-off-by: Miaohe Lin --- arch/x86/kvm/x86.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ff395f812719..b6235872fd58 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -737,10 +737,9 @@ bool pdptrs_changed(struct kvm_vcpu *vcpu) offset = (kvm_read_cr3(vcpu) & 0xffffffe0ul) & (PAGE_SIZE - 1); r = kvm_read_nested_guest_page(vcpu, gfn, pdpte, offset, sizeof(pdpte), PFERR_USER_MASK | PFERR_WRITE_MASK); - if (r < 0) - goto out; - changed = memcmp(pdpte, vcpu->arch.walk_mmu->pdptrs, sizeof(pdpte)) != 0; -out: + if (r >= 0) + changed = memcmp(pdpte, vcpu->arch.walk_mmu->pdptrs, + sizeof(pdpte)) != 0; return changed; }