Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1172272imm; Wed, 4 Jul 2018 13:08:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd4am45Y5U+nvl3O8UXgcpapr+EVSxezqZE5obCGYGskIGSmEBhkiGi0E0B2bR7/GK1YML/ X-Received: by 2002:a17:902:4d:: with SMTP id 71-v6mr3366774pla.317.1530734919846; Wed, 04 Jul 2018 13:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530734919; cv=none; d=google.com; s=arc-20160816; b=JDncHuDhjJtJ1Q5sGMS0+CzPwdwRtcMi0rxfYmxzyaF7ZAnFrKYPSj91IzsPT+EnU0 9xFX+F0JsoCVJNeFqe1thrxu1yDETV4RvrvN2ba4isk6GDsista/Wcrx4bbs0XuOL5mx 0hEq7GLow5ZXfoccbWkCOMBakQsTbCq9B8b0gh1OrIcpuXf/oPfZSz3dCG1hWZhRCEOR B7TQpPGabFPrpOvEMca03e4G2LRFlj0kCAlFclJkEQXxAIFvYtixGNrdZXa7ijXS3Lav CXZwJDSM043BL8XoBdP5GWAXMiUYe4M76xdrhosc4IVXD6QkLRDNWP3Nznj9GKSfNqql Bgkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=8fHURC2KEe94tf5xS+Ogw4dnjBnHv+H1s/pI3PF0LrM=; b=u/gODsOZoN5lsFi4uNPx/nLZ8CQk8eLlWWOQSGediPSVOEEMFoFcJYbThfbCPsjCzz xht5FGibHwNMXF0vXvImaSPZsC2hkFEv02489GMLd23qdfUXw+R2QlmqYKPbUoLlEAgS zkYQ7z+zzWhCMOQqTMg4cXjJbDAD7uCdaq0k+4corYdUuqNcXdmVYBxqDWzwsOnCLgDA e+UEK/GrwoWOYomHAqx0A+SJb3IwoxtYtoNGh2x2eCI5y97EVCb3AxLAlXWMKmDt8fLn sgXUt4zaadY+jHxehXqlUZF3/rcyL4TsIHnPHC5mhAvmiv9ZGNogtwuKJsUlST4PAYhW kt4Q== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12-v6si4339923pft.235.2018.07.04.13.08.23; Wed, 04 Jul 2018 13:08:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997AbeGDUHq (ORCPT + 99 others); Wed, 4 Jul 2018 16:07:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38370 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752719AbeGDUHp (ORCPT ); Wed, 4 Jul 2018 16:07:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC86B5D5EE; Wed, 4 Jul 2018 20:07:44 +0000 (UTC) Received: from localhost (ovpn-116-35.gru2.redhat.com [10.97.116.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A6DB611A1; Wed, 4 Jul 2018 20:07:43 +0000 (UTC) Date: Wed, 4 Jul 2018 17:07:42 -0300 From: Eduardo Habkost To: Thomas Gleixner Cc: Dave Hansen , Fenghua Yu , Ingo Molnar , H Peter Anvin , Ashok Raj , Alan Cox , Peter Zijlstra , Rafael Wysocki , Tony Luck , Ravi V Shankar , linux-kernel , x86 Subject: Re: [PATCH v2 1/4] x86/split_lock: Enumerate #AC exception for split locked access feature Message-ID: <20180704200742.GD7451@localhost.localdomain> References: <1530282807-66555-1-git-send-email-fenghua.yu@intel.com> <1530282807-66555-2-git-send-email-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fnord: you can see the fnord User-Agent: Mutt/1.9.2 (2017-12-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 04 Jul 2018 20:07:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 06:23:35PM +0200, Thomas Gleixner wrote: > On Fri, 29 Jun 2018, Dave Hansen wrote: > > On 06/29/2018 07:33 AM, Fenghua Yu wrote: > > > +/* Detect feature of #AC for split lock by probing bit 29 in MSR_TEST_CTL. */ > > > +void detect_ac_split_lock(void) > > > +{ > > > + u64 val, orig_val; > > > + int ret; > > > + > > > + /* Attempt to read the MSR. If the MSR doesn't exist, reading fails. */ > > > + ret = rdmsrl_safe(MSR_TEST_CTL, &val); > > > + if (ret) > > > + return; > > > > This is a bit fast and loose with how the feature is detected, which > > might be OK, but can we call out why we are doing this, please? > > > > Is this MSR not really model-specific? Is it OK to go poking at it on > > all x86 variants? Or, do we at _least_ need a check for Intel cpus in here? > > That definitely needs a vendor check. Also the whole code needs to be > compiled out if CONFIG_INTEL=n. > > Aside of that this wants to be enumerated. CPUID or MISC_FEATURES and not > this guess work detection logic. Why do I have to ask for that for every > other new feature thingy? Yes, please. KVM hosts normally expect guests to not touch MSRs unless we explicitly tell them the MSR is available (normally through CPUID). This is important to ensure live migration between different host kernel versions works reliably. -- Eduardo