From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE58DC2D0DB for ; Fri, 31 Jan 2020 21:33:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF37F215A4 for ; Fri, 31 Jan 2020 21:33:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=amacapital-net.20150623.gappssmtp.com header.i=@amacapital-net.20150623.gappssmtp.com header.b="DB34FYS0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726443AbgAaVdX (ORCPT ); Fri, 31 Jan 2020 16:33:23 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:35747 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgAaVdW (ORCPT ); Fri, 31 Jan 2020 16:33:22 -0500 Received: by mail-pl1-f196.google.com with SMTP id g6so3262744plt.2 for ; Fri, 31 Jan 2020 13:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=v0cY8r600PZeMMg003zbfyKoArFu5BkniPYK/6FLwIM=; b=DB34FYS0GbdREz9MgbfN6GuhgdDTZlKITxD0isHLtPED+4N8iQRLPGGtlunQ0K4Ob+ NWPbi9TxN1YqENBQKIifltqOpSzi4F+U6/mEVXYtuKxZlh0U/eL6omVSAS9R98bOTolz yg0XC8KBPGgb6NZcpOiEpVi/9NALs3R97S4//yxss0Lnb/6RPxcy4a14Hv0R/Crsxhg+ Fma29ZkKatlSvg/biTbuUo/sPAvkwG8Xm0NHuhbDEZDzRoOXXkYMtshnPho8eF7fyuRy r824XGik5cjUwfxU/DsZkZGwtO98sb30s8v3UprW8aUPV/HQud1sPFWrAmQHjlPbnMoP J/XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=v0cY8r600PZeMMg003zbfyKoArFu5BkniPYK/6FLwIM=; b=hKCECc8kh+wTyGky3i8wXfB6+3ik8D4bolYJvhqFbA3iD0k1cYzUDH63MvCopdTLGT vAjIv1aYfglamM9b4pXM3+G5m9KyhfSpIcd8OxrRX0nEYvnAiLROH6D0ex5XGw/7zc8L +i1TZOl4wcYdOkLvn92kbbTyhjWSAw60KLtA/nMHQ8n6nAzK1SdYQYY4xwP0ibbiu+tV x898BUPvAcJvamwdriMHuTZDh27aXiyKnS8XQXamO/aROsCLcApGUAWNVwRT0BeiiSVa WdrJckz6l6mnhJf+IN9Tdfloggij2QmVHJ7vns+TbiYLOEm7tgPCLaRDT0lGf0Rgg7oG D+ig== X-Gm-Message-State: APjAAAXHhyHueO5kpp1r/jp9wYcHiwZRsj2BH200FDi4KS7tHNnioVEH OxYk8REwlFgr6U6NvWjLD4zC7g== X-Google-Smtp-Source: APXvYqxUZPWDZetpRBZGKWvETiPTJY3F2228m8xWzfN+cNxLwgMODZHx1RESWs9RO0c/orFHJv/Dkg== X-Received: by 2002:a17:902:bd90:: with SMTP id q16mr12159154pls.34.1580506402075; Fri, 31 Jan 2020 13:33:22 -0800 (PST) Received: from ?IPv6:2600:1010:b010:9631:69c2:3ecc:ab84:f45c? ([2600:1010:b010:9631:69c2:3ecc:ab84:f45c]) by smtp.gmail.com with ESMTPSA id m22sm12003610pgn.8.2020.01.31.13.33.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Jan 2020 13:33:21 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 2/2] KVM: VMX: Extend VMX's #AC handding Date: Fri, 31 Jan 2020 13:33:17 -0800 Message-Id: References: <20200131210424.GG18946@linux.intel.com> Cc: Xiaoyao Li , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Paolo Bonzini , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org In-Reply-To: <20200131210424.GG18946@linux.intel.com> To: Sean Christopherson X-Mailer: iPhone Mail (17C54) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 31, 2020, at 1:04 PM, Sean Christopherson wrote: >=20 > =EF=BB=BFOn Fri, Jan 31, 2020 at 12:57:51PM -0800, Andy Lutomirski wrote: >>=20 >>>> On Jan 31, 2020, at 12:18 PM, Sean Christopherson wrote: >>>=20 >>> This is essentially what I proposed a while back. KVM would allow enabl= ing >>> split-lock #AC in the guest if and only if SMT is disabled or the enable= bit >>> is per-thread, *or* the host is in "warn" mode (can live with split-lock= #AC >>> being randomly disabled/enabled) and userspace has communicated to KVM t= hat >>> it is pinning vCPUs. >>=20 >> How about covering the actual sensible case: host is set to fatal? In th= is >> mode, the guest gets split lock detection whether it wants it or not. How= do >> we communicate this to the guest? >=20 > KVM doesn't advertise split-lock #AC to the guest and returns -EFAULT to t= he > userspace VMM if the guest triggers a split-lock #AC. >=20 > Effectively the same behavior as any other userspace process, just that KV= M > explicitly returns -EFAULT instead of the process getting a SIGBUS. Which helps how if the guest is actually SLD-aware? I suppose we could make the argument that, if an SLD-aware guest gets #AC at= CPL0, it=E2=80=99s a bug, but it still seems rather nicer to forward the #A= C to the guest instead of summarily killing it. ISTM, on an SLD-fatal host with an SLD-aware guest, the host should tell the= guest =E2=80=9Chey, you may not do split locks =E2=80=94 SLD is forced on=E2= =80=9D and the guest should somehow acknowledge it so that it sees the archi= tectural behavior instead of something we made up. Hence my suggestion.=