From patchwork Thu Jun 1 19:44:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Mattson X-Patchwork-Id: 9761015 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 3A76C602BC for ; Thu, 1 Jun 2017 19:45:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 351B422376 for ; Thu, 1 Jun 2017 19:45:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2830028517; Thu, 1 Jun 2017 19:45:05 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 03F3D22376 for ; Thu, 1 Jun 2017 19:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240AbdFATpC (ORCPT ); Thu, 1 Jun 2017 15:45:02 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:34327 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdFATpB (ORCPT ); Thu, 1 Jun 2017 15:45:01 -0400 Received: by mail-pf0-f180.google.com with SMTP id 9so35878250pfj.1 for ; Thu, 01 Jun 2017 12:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EqWrgwfex8thK+z9/ASnD1JVEwyPh8E3/bJyhI+tzQ0=; b=uYxIS73oDhXVaKiz+Xox0O7m8ltgNGloHTsw6H3clLy55dWFCzbEhuNojAj986FcKR O1NhEJ9OTS/yfwa5c+rCsTcLQIqI9VJ2I7tC8bKbzJ4ocY33mAG8EtbYefYh3u/ZDIny JWV/9Nmeg2yGDOxfa+g/7bjPWN7isASYJTRhWtqU8YWZn95Zs8JbAkECiBjB+rbpZcnW 3WoUIlpt03rjrx1jQcBv427o7s64QP15RRnaWIPRRsA0VphQpAt0p3bBUfNjXoDK39NX TFDAa9cx0pKTkvn3G+BEeJ00kc8DGSrsEvt0hvgUhE6Lx3ZHKTZU9fD0BqAaRUYBYYZg BRrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EqWrgwfex8thK+z9/ASnD1JVEwyPh8E3/bJyhI+tzQ0=; b=b1WWBYFm93KZOIb6Cn7tNZLKXG1cAalqUCesVrh8sO3wlsxpXtZZaRIznzXqM0iUuK T8uuW1g1mOf4tJbo7LbVqxQTECu6kcKsydjIu3f/hDd3IrJyELDVa7klY+eoILD3/kXj h/QlwMY28u05VbiszNftCCaOB5UhNwVKThuLLPkZIn4kx2BCYqU5tEA0AM43VEuUIY3X 93xOVSSiZ7VBHffI6ShM9rB/acD472Su3M2NVeostxMoVNz+U26EqwDwUXyePZ7JN16h odY3KTBA7sTfJ1nimMHhH2fhqIGf7O7xD1PFI7ChKFZy70CJbOi7vQVv8unvVzUGMWdS 1Nwg== X-Gm-Message-State: AODbwcBDZKRaa5BCbTFPbv4ThCui8StqNIBKj/K2tC81etNUXsnLi6Zj PtVJ4I7OkpBDwdU+ksb4Qg== X-Received: by 10.98.82.77 with SMTP id g74mr2613748pfb.115.1496346300407; Thu, 01 Jun 2017 12:45:00 -0700 (PDT) Received: from turtle.sea.corp.google.com ([172.31.88.24]) by smtp.gmail.com with ESMTPSA id y74sm3849822pfg.3.2017.06.01.12.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Jun 2017 12:44:59 -0700 (PDT) From: Jim Mattson To: kvm@vger.kernel.org, Jan Dakinevich Cc: Jim Mattson Subject: [PATCH] KVM: nVMX: Update vmcs12->guest_linear_address on nested VM-exit Date: Thu, 1 Jun 2017 12:44:46 -0700 Message-Id: <20170601194446.188113-1-jmattson@google.com> X-Mailer: git-send-email 2.13.0.219.gdb65acc882-goog Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The guest-linear address field is set for VM exits due to attempts to execute LMSW with a memory operand and VM exits due to attempts to execute INS or OUTS for which the relevant segment is usable, regardless of whether or not EPT is in use. Fixes: 119a9c01a5922 ("KVM: nVMX: pass valid guest linear-address to the L1") Signed-off-by: Jim Mattson --- arch/x86/kvm/vmx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c12336087850..ae66ebc7fb82 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -10710,8 +10710,7 @@ static void sync_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) vmcs12->guest_pdptr3 = vmcs_read64(GUEST_PDPTR3); } - if (nested_cpu_has_ept(vmcs12)) - vmcs12->guest_linear_address = vmcs_readl(GUEST_LINEAR_ADDRESS); + vmcs12->guest_linear_address = vmcs_readl(GUEST_LINEAR_ADDRESS); if (nested_cpu_has_vid(vmcs12)) vmcs12->guest_intr_status = vmcs_read16(GUEST_INTR_STATUS);