Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7495012ybp; Wed, 16 Oct 2019 09:28:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqx95Tq92FhOsasIkkjUfA4tuFV3pir3whoplNz8dLXzt8MnT693P1W4ttR3Jm9a6O7PjCx2 X-Received: by 2002:aa7:d341:: with SMTP id m1mr40566367edr.57.1571243307307; Wed, 16 Oct 2019 09:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571243307; cv=none; d=google.com; s=arc-20160816; b=EH9j3t7k14oDZ+Hrpljp+KKaTSJMnYX+emKZc3/yXgbNBvkkKMJgDDA9ef3gwrTXE2 VhFhnBiqlhelVKBswWyXExzskxf3mN2rUuR7KLeqyOZdYzMm3FI8kba8jahD+txr/18A UnlGyVNOz30mNa5teBs0G/Kf/6kZuR7XR8EHZIGx3Xsr0Jdw8flQnGpIvMjfQ8Ig4/wq 8SZAerotuGYxwo4/lX++8mgEuuB7mNqkGlDqKxd5Ok3g5kv/B2yxckPMtK9ePivwxAPY tJmmeQftzOQkgOeKnmo91P6v27dsl0JIL8dFGRwDbmUWzTkd8zjXAlbCZyexAVBPzJ8E N+ag== 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; bh=TkQJMmQnkQbLwPtXBoqOmSQkN85cuUgUxErxX7/9wII=; b=MNfsz51n3v1FSVqrDIp6liub9CjMLEZzlybLsuPACPmlgk2NHsX9gGKaPeEqIrs8NC FdWjtAa7ylL76rtpVufTkLp9uY/LPS+h9ZElY4RoDOfA05Ea+NSxGRLdqw2tOrNDBNfZ aiAMqIFI4RcILEUo6GHHEhY8uy0aEFzqUocWAyZyM6UQpbzottjAZCnJL/tl+2F8VDAt B//ou60dtoNdYYbru8xTUJYldwJPIF9HAR3BonaaC1mWzCKeb2rPGJ0dc4h4d41pVru0 CmeYNlRZFgdJbuz6aHAHXS/UIPYDk3BXmKIjiwktynOrjfdQYhDAbHFrpBub6PdZYEFf goVQ== 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 h14si20170602edk.315.2019.10.16.09.28.05; Wed, 16 Oct 2019 09:28:27 -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 S2404761AbfJPOnq (ORCPT + 99 others); Wed, 16 Oct 2019 10:43:46 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:50458 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727291AbfJPOnq (ORCPT ); Wed, 16 Oct 2019 10:43:46 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iKkWM-0006wq-TK; Wed, 16 Oct 2019 16:43:26 +0200 Date: Wed, 16 Oct 2019 16:43:26 +0200 (CEST) From: Thomas Gleixner To: Xiaoyao Li cc: Paolo Bonzini , Sean Christopherson , Fenghua Yu , Ingo Molnar , Borislav Petkov , H Peter Anvin , Peter Zijlstra , Andrew Morton , Dave Hansen , Radim Krcmar , Ashok Raj , Tony Luck , Dan Williams , Sai Praneeth Prakhya , Ravi V Shankar , linux-kernel , x86 , kvm@vger.kernel.org Subject: Re: [PATCH v9 09/17] x86/split_lock: Handle #AC exception for split lock In-Reply-To: <8808c9ac-0906-5eec-a31f-27cbec778f9c@intel.com> Message-ID: References: <1560897679-228028-1-git-send-email-fenghua.yu@intel.com> <1560897679-228028-10-git-send-email-fenghua.yu@intel.com> <20190626203637.GC245468@romley-ivt3.sc.intel.com> <20190925180931.GG31852@linux.intel.com> <3ec328dc-2763-9da5-28d6-e28970262c58@redhat.com> <57f40083-9063-5d41-f06d-fa1ae4c78ec6@redhat.com> <8808c9ac-0906-5eec-a31f-27cbec778f9c@intel.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, 16 Oct 2019, Xiaoyao Li wrote: > On 10/16/2019 7:26 PM, Paolo Bonzini wrote: > > Old guests are prevalent enough that enabling split-lock detection by > > default would be a big usability issue. And even ignoring that, you > > would get the issue you describe below: > > Right, whether enabling split-lock detection is made by the administrator. The > administrator is supposed to know the consequence of enabling it. Enabling it > means don't want any split-lock happens in userspace, of course VMM softwares > are under control. I have no idea what you are talking about, but the whole thing is trivial enough to describe in a decision matrix: N | #AC | #AC enabled | SMT | Ctrl | Guest | Action R | available | on host | | exposed | #AC | --|-----------|-------------|-----|---------|-------|--------------------- | | | | | | 0 | N | x | x | N | x | None | | | | | | 1 | Y | N | x | N | x | None | | | | | | 2 | Y | Y | x | Y | Y | Forward to guest | | | | | | 3 | Y | Y | N | Y | N | A) Store in vCPU and | | | | | | toggle on VMENTER/EXIT | | | | | | | | | | | | B) SIGBUS or KVM exit code | | | | | | 4 | Y | Y | Y | Y | N | A) Disable globally on | | | | | | host. Store in vCPU/guest | | | | | | state and evtl. reenable | | | | | | when guest goes away. | | | | | | | | | | | | B) SIGBUS or KVM exit code [234] need proper accounting and tracepoints in KVM [34] need a policy decision in KVM Now there are a two possible state transitions: #AC enabled on host during runtime Existing guests are not notified. Nothing changes. #AC disabled on host during runtime That only affects state #2 from the above table and there are two possible solutions: 1) Do nothing. 2) Issue a notification to the guest. This would be doable at least for Linux guests because any guest kernel which handles #AC is at least the same generation as the host which added #AC. Whether it's worth it, I don't know, but it makes sense at least for consistency reasons. For a first step I'd go for 'Do nothing' SMT state transitions could be handled in a similar way, but I don't think it's worth the trouble. The above should cover everything at least on a best effort basis. Thanks, tglx