Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2366783imb; Mon, 4 Mar 2019 03:22:04 -0800 (PST) X-Google-Smtp-Source: APXvYqyCljHEb8FDVkGV+a/HCmlqc+sugLW5/wvx7Xw6M+PlZPcg9vofNDqWlOudQrb1FSH3MrFY X-Received: by 2002:a17:902:9008:: with SMTP id a8mr20017945plp.38.1551698524483; Mon, 04 Mar 2019 03:22:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551698524; cv=none; d=google.com; s=arc-20160816; b=D0HFgDPIYr8tt4Z75q64NmVPPXXDr/h0Jwh7PpDUqjDTBcwshxrwiHyjR+wYYx8k80 rRYJMRifWV/Y6Yq5EUnjKbAdcEHeupFDCsXQiW8tThupvB9L/zDjwjDmMp4NUQnjK3FZ 8VU5IpZDB09vcn0DqAW8CxEsyoR9XgBfI+d3B7jsX2ivuab0rTMvFhkNmDMWk0OsO6x6 1kaYXAVaqytLWjTjCNkzlrYW4gP17gmoaAckY+7+BQr8LCvQI5vulta0LTrwN3dLy322 KxWw93fmp+yhZbC9tEN9nixbBSvsgvgBqE9PyRnUX28yu7q0738Lq3U0azGgx2wzDUYh +ojg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=4Vy6TaH7EGyj1caJXnS19jnJ4Q5Wr3QGieeOciXJics=; b=jlLfJcQM3zTd5ZEEuO86l4jeqxUyqilEJ9yY60LmwvG0eTU+kA21qNnoISNKpeckXQ YAd5UfCMMhZDB8gR6kL6zaS3uiUmZy+ui+e16sxUAfYct32Txk61Ys+eNUxPQBMwPaYt mBobpbdaeb3NRMMgyTtJ6Er0YZrdwpNp9dRMjXXWwUemiQS2JDhxuX+8i78E8FeT9nyT 44zIqlDx7m8D7/fc8c9gxsshmzKn6NVViVgHZQZTwOyIa7VROnm1XO3j8SLPwgidHXMW rTr/5EEt6jgHQRETPYVkiehE6S5li8RzQ2pzNDAQ9COEE6KN0BEdCHkRuecZBH4T/rMx UW7w== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g98si5588221plb.11.2019.03.04.03.21.47; Mon, 04 Mar 2019 03:22:04 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbfCDLVG (ORCPT + 99 others); Mon, 4 Mar 2019 06:21:06 -0500 Received: from mga12.intel.com ([192.55.52.136]:20101 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbfCDLVG (ORCPT ); Mon, 4 Mar 2019 06:21:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Mar 2019 03:21:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,439,1544515200"; d="scan'208";a="304211955" Received: from lxy-dell.sh.intel.com ([10.239.159.147]) by orsmga005.jf.intel.com with ESMTP; 04 Mar 2019 03:21:03 -0800 Message-ID: <5a9b82659ace27ea03b3c16fc91fdad03fbc32ea.camel@linux.intel.com> Subject: Re: [PATCH v4 15/17] kvm: x86: Report CORE_CAPABILITY on GET_SUPPORTED_CPUID From: Xiaoyao Li To: Paolo Bonzini , Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Dave Hansen , Ashok Raj , Peter Zijlstra , Ravi V Shankar Cc: linux-kernel , x86 , kvm@vger.kernel.org Date: Mon, 04 Mar 2019 19:21:06 +0800 In-Reply-To: References: <1551494711-213533-1-git-send-email-fenghua.yu@intel.com> <1551494711-213533-16-git-send-email-fenghua.yu@intel.com> <697ee0bd-a5f6-7712-017e-455eed5bc185@redhat.com> <79b659fb-1c16-463d-aa74-f1b3d8a9db5d@redhat.com> <08b44b2b7aede11a350f234768d5c17f8445984e.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-03-04 at 12:14 +0100, Paolo Bonzini wrote: > On 04/03/19 12:10, Xiaoyao Li wrote: > > Like you said before, I think we don't need the condition judgment > > "if(boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT))", but to set > > F(CORE_CAPABILITY) > > always for guest since MSR_IA32_CORE_CAPABILITY is emulated. > > > > And we should set the right emulated value of MSR_IA32_CORE_CAPABILITY for > > guest > > in function kvm_get_core_capability() based on whether > > boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT) just as you commented in the > > next > > patch. > > Yes, that would certainly be better. However, you'd also have to move > MSR_IA32_CORE_CAPABILITY handling to x86.c, because you'd have to enable > X86_FEATURE_CORE_CAPABILITY for AMD. > > Paolo Thanks for your comments and advises. I'll do it in next version. Xiaoyao