Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1573015imm; Thu, 12 Jul 2018 04:24:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpekEgHsxVBmBkx8792il4/VeyhEHVqn4W3Kn9/ahSn1sCxtGNWQLCpYteEOwMMq4cYCF7tn X-Received: by 2002:a65:5545:: with SMTP id t5-v6mr1729478pgr.157.1531394643365; Thu, 12 Jul 2018 04:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531394643; cv=none; d=google.com; s=arc-20160816; b=yk7gdOu2hmLnNgIWCkPqr0WouskpUI5awSet2esJ8GjiDnNP+KX2a2mYOPRY2z8CuJ FA94EgEVCHUUij7V+p5AKM1Th1i7qjX/VOdut80GzpgHkikk1AkSvyE8GJZ/OLfWbu0Q AXI334yBIdo75Aoqr6ivA6aychTWY8tjfk6AcBKByEUvF+0y3Ix0nCUAdlEIn2H34v6t PuZBJHLNvmgUVd8XWtECQJeku8uV0rxj3Hrf2gILOT8qj16ASqKJFPuU0r2yOIcD/iSo ip3nxHU72gaaqCPD62r9YCfUqfj4k7pq6zmBEvFsadfNYiAkNzUssvAHbfZGanVPq7cS 5X9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=4yvJxEzkzgnQnnaTiy2SqB0ZsdmnUCgpgGc08yoaVbE=; b=RYa4M1qWgix/4xfRshkb3ny+0DSx0CHykMemCDNIuiR7S2wpTwoIS4lqR3qEjAWtgp f9j16vfC3gLUQXdWpAg6nTp1loroXmriJU0k1zcoTO4e8k9jUF3bffHuQzCHavL4S4ae S4C+8mNWBeKEI1nIEoPx9LFS+K8PsO5YawyYrky17llKKFZnHtlpBfQY+pcwsMQc1Txc lxsfkAbTpmAPQ5wKt/Iu4z0ott9GeXAj6EFdrtadYVKoSrxVjVFyM3Xpr9v8N+kRDJhZ mox1jQwjoOHaH7B5J6ZvNv04t3wKHSUVTpXDUEX+tUFSAqS7yyaeR+b4YBWiv3duk5ub Qkdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2-v6si4452766pfi.212.2018.07.12.04.23.47; Thu, 12 Jul 2018 04:24:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbeGLLcT (ORCPT + 99 others); Thu, 12 Jul 2018 07:32:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46286 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726492AbeGLLcT (ORCPT ); Thu, 12 Jul 2018 07:32:19 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07F3981663FF; Thu, 12 Jul 2018 11:23:12 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9020116874; Thu, 12 Jul 2018 11:23:10 +0000 (UTC) From: Vitaly Kuznetsov To: Wanpeng Li Cc: kvm , Paolo Bonzini , Radim Krcmar , "the arch\/x86 maintainers" , Andy Lutomirski , ldv@altlinux.org, yamato@redhat.com, LKML Subject: Re: [PATCH] x86/kvm/vmx: don't read current->thread.{fs,gs}base of legacy tasks References: <20180711173718.8850-1-vkuznets@redhat.com> <877em0ztoi.fsf@vitty.brq.redhat.com> Date: Thu, 12 Jul 2018 13:23:09 +0200 In-Reply-To: <877em0ztoi.fsf@vitty.brq.redhat.com> (Vitaly Kuznetsov's message of "Thu, 12 Jul 2018 11:31:41 +0200") Message-ID: <87h8l4y9ya.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 12 Jul 2018 11:23:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 12 Jul 2018 11:23:12 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkuznets@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vitaly Kuznetsov writes: > Wanpeng Li writes: > >> Test suite: MSR switch >> PASS: VM entry MSR load >> PASS: VM exit MSR store >> PASS: VM exit MSR load >> FAIL: VM entry MSR load: try to load FS_BASE >> SUMMARY: 4 tests, 1 unexpected failures >> >> kvm-unit-tests fails w/ and w/o the patch, maybe it is another issue, >> i didn't dig further, you can have a look if you are interested in. :) > > The patch only changes the behavior for legacy userspaces and I can > reproduce the failure on native x86_64, it is something different. I'm, > however, interested so stay tuned :-) Yes, the regression was introduced by commit e79f245ddec17bbd89d73cd0169dba4be46c9b55 Author: KarimAllah Ahmed Date: Sat Apr 14 05:10:52 2018 +0200 X86/KVM: Properly update 'tsc_offset' to represent the running guest basically, when nested_vmx_load_msr() fails we don't set exit_qualification accordingly. The fix is simple: @@ -11720,8 +11721,10 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu) msr_entry_idx = nested_vmx_load_msr(vcpu, vmcs12->vm_entry_msr_load_addr, vmcs12->vm_entry_msr_load_count); - if (msr_entry_idx) + if (msr_entry_idx) { + exit_qual = msr_entry_idx; goto fail; + } /* * Note no nested_vmx_succeed or nested_vmx_fail here. At this point I'll be sending a patch out shortly. But this is completely orthogonal to the 'legacy' issue ;-) -- Vitaly