Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4052693ybc; Thu, 21 Nov 2019 18:44:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzfsKorGoJMLRYICGKLJsQFhTKtXFpdeu1DkzeSeNVC6l2pHrsxMXHLs0EY6W4Cnfbrl3aS X-Received: by 2002:a17:906:a989:: with SMTP id jr9mr18059184ejb.160.1574390667562; Thu, 21 Nov 2019 18:44:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574390667; cv=none; d=google.com; s=arc-20160816; b=raiquhRbkXwxAvp2KpcyAI6cfgRd8rOxNNcH13k6YwSW1zV2Y01SjzWd2P0k63yVhn XlwAXhflhpZIvevPQl08GfgD3gH1VfKj9KHRodMi/GQkSCMUJXNJiFcPYIKp+pnI/hEE WjlUwGQR0Ewxnloqp/Vd6ZyN8fKDPVzAQNcVS8oBumx7jEj1yXqTlzTyhbWax1H96r9P 6SEe8nkfS5RY/zC8SiTIAw9UApDoD/uMOtAUp0RBrsX97Me+j1kjUck9w9FC083QFurp ylYwnDIuGhLwANySckoej65FlA4lgvumZS9dnqdICchmgAiwRRA+WEqakJpsqIvb/mNP TL6w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ul/iDGdxRH+Zx+ZRXq43MiOW7skYKkK+lNuyKRyV0+4=; b=FsZ9BPHgD0ZjezGlJCvPn/3BHicSHx+oTgsror3RpEirG3bFAZWBfIB1Zr1Z/u7wKq f54OHcXxFz8F97y5GcRfBApnYZs8pX2Hky2HTjDwk8nW0P/XyiHullOcCgMFIKaaV5wU EXGbM3fK5poqpXVAwq/cu/HFvmf+c8iruSbUpAzGEGWTCiZVGR9Nm6AjgWIVMr96eRLi WxCiiXLsrix9pc0WSlKLX8hWUPeXbqXlJFxmAJjzJWV4i8Bxa9oQAr+j9WmtXUUmTHEI oUVMAAp5K0GE7CwUybpbhE1UoKssCWU4aKCiSNKbAPRriAkLte4xeZWBoBTRBAX3x6Ek OWrA== 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 b26si3712341edc.25.2019.11.21.18.44.02; Thu, 21 Nov 2019 18:44:27 -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 S1726690AbfKVCje (ORCPT + 99 others); Thu, 21 Nov 2019 21:39:34 -0500 Received: from mga06.intel.com ([134.134.136.31]:33816 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfKVCje (ORCPT ); Thu, 21 Nov 2019 21:39:34 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 18:39:34 -0800 X-IronPort-AV: E=Sophos;i="5.69,228,1571727600"; d="scan'208";a="201353334" Received: from xiaoyaol-mobl.ccr.corp.intel.com (HELO [10.239.13.123]) ([10.239.13.123]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 21 Nov 2019 18:39:31 -0800 Subject: Re: [PATCH v10 6/6] x86/split_lock: Enable split lock detection by kernel parameter To: Andy Lutomirski , Sean Christopherson Cc: Fenghua Yu , "Luck, Tony" , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , "Raj, Ashok" , "Shankar, Ravi V" , linux-kernel , x86 References: <20191122015225.GG16617@linux.intel.com> <81CEB9B7-79EA-4B02-A79C-C9113331A28A@amacapital.net> From: Xiaoyao Li Message-ID: Date: Fri, 22 Nov 2019 10:39:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <81CEB9B7-79EA-4B02-A79C-C9113331A28A@amacapital.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/22/2019 10:21 AM, Andy Lutomirski wrote: > >> On Nov 21, 2019, at 5:52 PM, Sean Christopherson wrote: >> >> On Thu, Nov 21, 2019 at 03:53:29PM -0800, Fenghua Yu wrote: >>>> On Thu, Nov 21, 2019 at 03:18:46PM -0800, Andy Lutomirski wrote: >>>> >>>>> On Nov 21, 2019, at 2:29 PM, Luck, Tony wrote: >>>>> >>>>>> It would be really, really nice if we could pass this feature through to a VM. Can we? >>>>> >>>>> It's hard because the MSR is core scoped rather than thread scoped. So on an HT >>>>> enabled system a pair of logical processors gets enabled/disabled together. >>>>> >>>> >>>> Well that sucks. >>>> >>>> Could we pass it through if the host has no HT? Debugging is *so* much >>>> easier in a VM. And HT is a bit dubious these days anyway. >>> >>> I think it's doable to pass it through to KVM. The difficulty is to disable >>> split lock detection in KVM because that will disable split lock on the whole >>> core including threads for the host. Without disabling split lock in KVM, >>> it's doable to debug split lock in KVM. >>> >>> Sean and Xiaoyao are working on split lock for KVM (in separate patch set). >>> They may have insight on how to do this. >> >> Yes, with SMT off KVM could allow the guest to enable split lock #AC, but >> for the initial implementation we'd want to allow it if and only if split >> lock #AC is disabled in the host kernel. Otherwise we have to pull in the >> logic to control whether or not a guest can disable split lock #AC, what >> to do if a split lock #AC happens when it's enabled by the host but >> disabled by the guest, etc... > > What’s the actual issue? There’s a window around entry and exit when a split lock in the host might not give #AC, but as long as no user code is run, this doesn’t seem like a big problem. > The problem is that guest can trigger split locked memory access just by disabling split lock #AC even when host has it enabled. In this situation, there is bus lock held on the hardware without #AC triggered, which is conflict with the purpose that host enables split lock #AC