From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT Date: Tue, 15 May 2012 00:27:31 -0300 Message-ID: <20120515032731.GC19552@amt.cnet> References: <20120515022014.GA16859@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eric Northup , "kvm@vger.kernel.org" To: "Mao, Junjie" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42882 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757757Ab2EODcR (ORCPT ); Mon, 14 May 2012 23:32:17 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 15, 2012 at 03:28:13AM +0000, Mao, Junjie wrote: > > -----Original Message----- > > From: Marcelo Tosatti [mailto:mtosatti@redhat.com] > > Sent: Tuesday, May 15, 2012 10:20 AM > > To: Mao, Junjie > > Cc: Eric Northup; kvm@vger.kernel.org > > Subject: Re: [PATCH] KVM: x86: Implement PCID/INVPCID for guests with EPT > > > > On Mon, May 14, 2012 at 07:15:18AM +0000, Mao, Junjie wrote: > > > > On Wed, May 9, 2012 at 5:32 PM, Mao, Junjie > > wrote: > > > > > This patch handles PCID/INVPCID for guests. > > > > > > > > > > Process-context identifiers (PCIDs) are a facility by which a logical > > processor may cache information for multiple linear-address spaces so that the > > processor may retain cached information when software switches to a > > different linear-address space. Refer to section 4.10.1 in IA32 Intel Software > > Developer's Manual Volume 3A for details. > > > > > > > > > > For guests with EPT, the PCID feature is enabled and INVPCID behaves as > > running natively. > > > > > For guests without EPT, the PCID feature is disabled and INVPCID triggers > > #UD. > > > > > > > > > Do I understand correctly that this means it is impossible to migrate a > > guest which is using PCID from a host with EPT to a host without EPT (by > > passing enable_ept=0 to the module, for example) ? > > > > > > I think you are right. Guests using PCID/INVPCID cannot migrate to a host > > without it, and EPT is a precondition of this feature. > > > > Are there processors that support PCI/INVPCID for the host but lack support > > for SECONDARY_EXEC_ENABLE_INVPCID? > > There're some with PCID but without INVPCID. For those processors support INVPCID, SECONDARY_EXEC_ENABLE_INVPCID support should be present. As PCID has little benefits without INVPCID, these two features are exposed/hidden as a whole. That means migration control should check INVPCID host support before deciding whether to migrate. Thanks