Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbdIKKBO (ORCPT ); Mon, 11 Sep 2017 06:01:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38498 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751612AbdIKKBM (ORCPT ); Mon, 11 Sep 2017 06:01:12 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DE93835F4D3 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH 0/3] KVM, pkeys: fix handling of PKRU across migration To: Quan Xu , Yang Zhang Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, junkang.fjk@alibaba-inc.com References: <1503569573-55057-1-git-send-email-pbonzini@redhat.com> <8d8ce265-2417-122b-9b5a-7a5dd0d3f0fd@gmail.com> From: Paolo Bonzini Message-ID: <9acf0ff2-01c7-d5d2-f2f7-8b716555954f@redhat.com> Date: Mon, 11 Sep 2017 12:01:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 11 Sep 2017 10:01:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2088 Lines: 68 On 28/08/2017 03:32, Quan Xu wrote: > > Paolo, I have verified this patch set.. Thanks! In the end I managed to use QEMU's SVM emulation to convince myself that the code was correct, so it is already included in Linux 4.13. Paolo > Tested-by: Quan Xu > > > 2017-08-25 8:43 GMT+08:00 Yang Zhang >: > > On 2017/8/24 18:12, Paolo Bonzini wrote: > > The host pkru is restored right after vcpu exit (commit 1be0e61), so > KVM_GET_XSAVE will return the host PKRU value instead. In general, > the PKRU value in vcpu->arch.guest_fpu.state cannot be trusted. > > Series as follows: > > 1) fix independent bug which would cause an oops > > 2) remove an unnecessary abstraction > > 3) fix the bug > > Please test the patches, as I don't have the affected hardware. > Note > that I need the results before tomorrow in order to send these > patches > to Linus before going on vacation. > > > hi Quan > > Can you help to test Paolo's patch? > > > Thanks, > > Paolo > > > Paolo Bonzini (3): > KVM: x86: block guest protection keys unless the host has > them enabled > KVM: x86: simplify handling of PKRU > KVM, pkeys: do not use PKRU value in vcpu->arch.guest_fpu.state > > arch/x86/include/asm/fpu/internal.h | 6 +++--- > arch/x86/include/asm/kvm_host.h | 1 + > arch/x86/kvm/cpuid.c | 2 +- > arch/x86/kvm/kvm_cache_regs.h | 5 ----- > arch/x86/kvm/mmu.h | 2 +- > arch/x86/kvm/svm.c | 7 ------- > arch/x86/kvm/vmx.c | 25 ++++++++----------------- > arch/x86/kvm/x86.c | 17 ++++++++++++++--- > 8 files changed, 28 insertions(+), 37 deletions(-) > > > > -- > Yang > Alibaba Cloud Computing > >