Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753318AbdHXSAS (ORCPT ); Thu, 24 Aug 2017 14:00:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45544 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753078AbdHXSAQ (ORCPT ); Thu, 24 Aug 2017 14:00:16 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 986D940430A Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=david@redhat.com Subject: Re: [PATCH 2/3] KVM: x86: simplify handling of PKRU To: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: junkang.fjk@alibaba-inc.com, yang.zhang.wz@gmail.com References: <1503569573-55057-1-git-send-email-pbonzini@redhat.com> <1503569573-55057-3-git-send-email-pbonzini@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <2a26e2e2-4866-4ac8-7bb3-4c2158479328@redhat.com> Date: Thu, 24 Aug 2017 20:00:13 +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: <1503569573-55057-3-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 24 Aug 2017 18:00:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 509 Lines: 17 On 24.08.2017 12:12, Paolo Bonzini wrote: > Move it to struct kvm_arch_vcpu, replacing guest_pkru_valid with a > simple comparison against the host value of the register. The write of > PKRU in addition can be skipped if the guest has not enabled the feature. > Once we do this, we need not test OSPKE in the host anymore, because > guest_CR4.PKE=1 implies host_CR4.PKE=1. > > The static PKU test is kept to elide the code on older CPUs. >From what I can tell, this looks good to me! -- Thanks, David