Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4419379pja; Thu, 21 Nov 2019 19:02:09 -0800 (PST) X-Google-Smtp-Source: APXvYqykeZna40JQuUqeB1AUOiNdEyrPAdyityQmpTTEY2VQqZRDSAF+SuF0z38v9U4dpnOYADAC X-Received: by 2002:a17:906:e0c8:: with SMTP id gl8mr18396003ejb.49.1574391729519; Thu, 21 Nov 2019 19:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574391729; cv=none; d=google.com; s=arc-20160816; b=zeDRMynKpa5BmfZRsQB6ot6bvf8PPbjqmXScj5ogr0mX9LVYgOmCeWJAIZCJh082Io J1BHfs9JYm8tftjaNsSLkSoA5hulNBDpZnm1b0S64g5WKJ7vdeNfx1uT4I6Z4wdjMpW6 5msFwpzOhnlLll2qKxffYvMmqs+abJgJi3z4WbX5fK0qyP7gvB5T1Eh2+HqAvny4Rn2L w7w17KU7tjYnu/oLQS46urhh3buy8owt8kAoyWDlpwr/NspVDBaf44BBn2h/Ad7zGQtc q9AL+rt8MJmA9gJrUCOG/tKRB+pWEGQUjfA93ASwdmrIvnQMiBL105EyHZKuc15bn/VT FFmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=biLVQ1AkvF5aueMS3h63jwqjzMqooy/ltImr9VK7zXA=; b=AgWsgv+/QeCTWX7AIwSPQkX1A6nSNrIZnW0MKVKuNQaY0599hwVZmMvtslGAll97/J Ma4SWfKdNY46ou7PkKGkg9wbFtBOIFh4pA3EPuWg31ifpGtEbFpwWO4xiKIma7rh7gVt Sow7O1InFb1A4XziXqHstcsI9zgkq0lAgDXUbiP6qTvFtEq22pZOp3QbBbWjUebSYff5 0dK3PaWtE5zs2+FBGRZgN8xbLDYim16zDMJVUpuDcOELzZHO4w8hGyPxPFtrXqFo35EU 83IPDW78ccH57DTFFxZ8CJuEEbsQdqNAoZv5P7TlRqfE4jy1b38F43HfQJIJ5RVsqQG8 25HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=iihz00c2; 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 o25si3119560ejc.52.2019.11.21.19.01.45; Thu, 21 Nov 2019 19:02:09 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=iihz00c2; 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 S1726760AbfKVC5s (ORCPT + 99 others); Thu, 21 Nov 2019 21:57:48 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36464 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbfKVC5s (ORCPT ); Thu, 21 Nov 2019 21:57:48 -0500 Received: by mail-pg1-f194.google.com with SMTP id k13so2649830pgh.3 for ; Thu, 21 Nov 2019 18:57:47 -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=biLVQ1AkvF5aueMS3h63jwqjzMqooy/ltImr9VK7zXA=; b=iihz00c2qO6qdKXF25QKRNnIzZ3qfhPH+FVj0sOPRn/AkAsMGEgMoJWHFhq1APm8e9 mlY2bdkSMK3bfFqemMBu4IZwF8378ceynXZuw1qdbLvs0GdMreYxkyLx136jmSrfEHtv ML++5hzkuZpeOm77Z3Pbih3YgyLAWmPvtjyBFVdY9V7hSN4GAS7vWEEIB359GQn0G+NX IcsFhT8F7QqIKqymepUFuLMx3f9xzFesX+BqevZn07g7z0Dh9KQ0d546sfvl+2mUaOZ2 YSUuItpMaVOTO5qIyt71P4r9ONIp87cRSFIP0gVAEMUYCvP7KEEhiuhVc1xwd37F8D53 22dg== 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=biLVQ1AkvF5aueMS3h63jwqjzMqooy/ltImr9VK7zXA=; b=lUoZ6RUw0pKep3qvCIpuP9FMpSHJNKfwDHWuX7qp7vGGQ4wiUpxNA0wlvfjc6BzHOL oLnOZGkKZRwcDLQtmIN0H0aIc7TG1U8Ld6InrLIsh9RHPQ7yFC8jsYwHwTGKALtTEpKS /mRv+eoEdRipfJ3Kg711jg0cvOmoTZibKbGosLu+N4ODpD4TjE2DmitAAlgMSG1TqGMX ek5yR1UIOnjojTHPEAx26U0ZEdiwYEZ1tsml6rEhioydAes5xdQFTNQgOsfjc2VLtSGO 5SoVZ1gas/SGU7xTKXqUK9nxv7ewVA3hj0TnXA3zcaE9F3tEs7ILHM1UDo0xTP0VGadH 72Fw== X-Gm-Message-State: APjAAAXqBvvxr9krxTS7e5ab9hzyt5zF/aA/hKvnnnmoCl9lJkwccIlK zb2PnMzi/ZuLGq/UvRYZkEWxBA== X-Received: by 2002:a63:ed4a:: with SMTP id m10mr13154193pgk.255.1574391467192; Thu, 21 Nov 2019 18:57:47 -0800 (PST) Received: from [100.111.14.2] (50.sub-174-194-197.myvzw.com. [174.194.197.50]) by smtp.gmail.com with ESMTPSA id a6sm877767pja.30.2019.11.21.18.57.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Nov 2019 18:57:46 -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 v10 6/6] x86/split_lock: Enable split lock detection by kernel parameter Date: Thu, 21 Nov 2019 18:57:44 -0800 Message-Id: <863BD058-5DB8-4C87-B799-29CCB5376FE2@amacapital.net> References: Cc: Sean Christopherson , 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 In-Reply-To: To: Xiaoyao Li X-Mailer: iPhone Mail (17A878) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 21, 2019, at 6:39 PM, Xiaoyao Li wrote: >=20 > =EF=BB=BFOn 11/22/2019 10:21 AM, Andy Lutomirski wrote: >>>> On Nov 21, 2019, at 5:52 PM, Sean Christopherson wrote: >>>=20 >>> =EF=BB=BFOn 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: >>>>>=20 >>>>>> On Nov 21, 2019, at 2:29 PM, Luck, Tony wrote: >>>>>>=20 >>>>>>> It would be really, really nice if we could pass this feature throug= h to a VM. Can we? >>>>>>=20 >>>>>> It's hard because the MSR is core scoped rather than thread scoped. S= o on an HT >>>>>> enabled system a pair of logical processors gets enabled/disabled tog= ether. >>>>>>=20 >>>>>=20 >>>>> Well that sucks. >>>>>=20 >>>>> Could we pass it through if the host has no HT? Debugging is *so* muc= h >>>>> easier in a VM. And HT is a bit dubious these days anyway. >>>>=20 >>>> I think it's doable to pass it through to KVM. The difficulty is to dis= able >>>> 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 KV= M, >>>> it's doable to debug split lock in KVM. >>>>=20 >>>> Sean and Xiaoyao are working on split lock for KVM (in separate patch s= et). >>>> They may have insight on how to do this. >>>=20 >>> Yes, with SMT off KVM could allow the guest to enable split lock #AC, bu= t >>> for the initial implementation we'd want to allow it if and only if spli= t >>> lock #AC is disabled in the host kernel. Otherwise we have to pull in t= he >>> 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=E2=80=99s the actual issue? There=E2=80=99s a window around entry a= nd exit when a split lock in the host might not give #AC, but as long as no u= ser code is run, this doesn=E2=80=99t seem like a big problem. > The problem is that guest can trigger split locked memory access just by d= isabling split lock #AC even when host has it enabled. In this situation, th= ere is bus lock held on the hardware without #AC triggered, which is conflic= t with the purpose that host enables split lock #AC Fair enough. You need some way to get this enabled in guests eventually, tho= ugh.=