Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1106167imm; Wed, 4 Jul 2018 11:41:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfKazIVGuoezegcC4DIinVISzaf2ybmSLJ86s104AuhY/cU82N4Rhyp8C2oiYDOK9kLR8Tf X-Received: by 2002:a62:a312:: with SMTP id s18-v6mr3237134pfe.13.1530729662421; Wed, 04 Jul 2018 11:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530729662; cv=none; d=google.com; s=arc-20160816; b=Ax3TpJ2WNkfk8d2SB0j673YmWbSJtIpGdizIx9XS4hFpI4d/Th0nYtyJbmjAm9YuFo QTJYNFqCqbC2UBd4xZu4Fw46q/4oOi9i/afhCgRoZXNONUkDaKllwd2lzeqTU1P2hdUm 9vG50JoNKRJd/kyic6W5QDtuR75y6ZfUiR+L9euvgTVuCe78vBTKwsbJx8SNxmhthUX/ CmLW928K8vrhNh3pBXyHXx12ININ1NUww59e2LpDHD1M1fvjxKFV+as/nYdY69jfyc6i i2KSEo+hlTs3C2UlsGGQ3YVgCz66ctVl3fn305CRK7G/CgZ/4Kv0Gxnxxxnf/cNhgq8k jtcg== 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:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=miyzgOzjddWiYL2toETEpTKJDiVOKY2nfOYQR4yo1kU=; b=pKmFjfZjz8nbJqu+gsDVE/W3LOVwuE365XTyjOrJr6pyqzG8NeQ2KBgmXDldkHYJuT U9QSpuWwVgoq+O9TreIIuaXqGnOwETxOjwrt1xRn+sigH8qb+p+nfNC1AVyX+uUBq883 5nrjfZdFrIS+/qgnp3gxbzrg9jbpD2uzSpHU95q6IBChTxv0bJvZ4M4WXajHiPN2qKd1 vBQXERcVZNLM/7K/J0xWGycPwnyQ48RikQih/QnlJgXppVA0IJjh/ZQufXkSFwXe/O2n 44FpbglHbe7wfm8pzBgeNlx2FUaMX8bSTdcXNLn0ryeIshnaVnrTNGuRORgtQ1HPBhLx GR9g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si3961959plj.411.2018.07.04.11.40.46; Wed, 04 Jul 2018 11:41:02 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbeGDSkF (ORCPT + 99 others); Wed, 4 Jul 2018 14:40:05 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:48398 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbeGDSkE (ORCPT ); Wed, 4 Jul 2018 14:40:04 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1famh0-00045a-7y; Wed, 04 Jul 2018 20:39:54 +0200 Date: Wed, 4 Jul 2018 20:39:50 +0200 (CEST) From: Thomas Gleixner To: Paolo Bonzini cc: Jingqi Liu , rkrcmar@redhat.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, wei.w.wang@intel.com, Robert Hoo Subject: Re: [PATCH v2] KVM: Expose the split lock detection feature to guest VM In-Reply-To: Message-ID: References: <1530709593-87702-1-git-send-email-jingqi.liu@intel.com> <7813a04b-8058-538b-8c9b-cdd01ce119ac@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Jul 2018, Paolo Bonzini wrote: > On 04/07/2018 16:51, Thomas Gleixner wrote: > > There is no rush for this to be in KVM/QEMU now because all what exists for > > this new split lock thing is 'silicon' running on an emulator. And w/o > > support in the kernel proper this is completely useless. > > That's good. I assumed it was IceLake, in which case the feature would > block the definition of a standard IceLake CPU model in QEMU. > > > So this needs the following things: > > > > 1) Proper enumeration via CPUID or MISC_FEATURES. The current detection > > hack is just broken. > > Yes please. > > > 2) A proper host side implementation, which then automatically makes the > > stuff usable in a guest once it is exposed. > > If the CPUID bit or MISC_FEATURES is added, you don't even need the host > side for the guests to use it. It's only needed now because of the ugly > MSR-based detection. > > > 3) A proper way how to expose MSR_TEST_CTL to the guest, but surely not > > with extra split_lock_ctrl voodoo. It's an MSR nothing else. KVM/QEMU > > have standartized ways to deal with MSRs and the required selective > > bitwise access control. > > That part is pretty much standard, I'm not worried about it. We have > one variable in struct kvm_vcpu_arch for each MSR (or set of MSRs) that > we expose, so that's the split_lock_ctrl voodoo. :) > > Once the detection is sorted out, KVM is easy. That's what I thought and even if it was IceLeak then they still can flip a CPUID/MISC FEATURE bit in their binary BIOS blob or ucode. We really need to push back hard on these half baken features which need voodoo programming to detect. Thanks, tglx