Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4800064rwl; Mon, 3 Apr 2023 09:43:58 -0700 (PDT) X-Google-Smtp-Source: AKy350bFJ5rUadcNvyZJtcslX5c69fuuaCtGkIoX728X/CRHnh3UnlcKzf6NBe5IFVeqyVybSCXm X-Received: by 2002:a17:906:801:b0:92e:efa:b9b4 with SMTP id e1-20020a170906080100b0092e0efab9b4mr41992477ejd.22.1680540237966; Mon, 03 Apr 2023 09:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680540237; cv=none; d=google.com; s=arc-20160816; b=OyjsTnYuDryC7P1j50JYZDS8fH79WQoeJkWQE8jX6EKncuTGJqRHAunllQj7TcWGuL Gj2XjExUyOW1uM81MtPXhjorGN1Mac/aW6yxKj4mu7UkQFEM7b1FfyMYOHR9gKtOc8kk tx93QdYwocRdKRKmdj4uKfHeTvVIt4CDkZyVZSqsKpP5hJ8WTHdefRwrgzZ8kslg1GGj bMgxPWZhaCEpc36mNA5O7y27X60eUirIfAHTCEo7OzGz1GGtVn43TwlW8yxX8vXAst1D r1YNc3HTwMcuB7dJK3AaWhvAlW3guzPpYL3HoXv9KA4I7ssusJN+3kJmhj5Q8m6XtTAD FyEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/JyY9VZwYc39EnA1aZWuXOPQGLxKvuatHXzEFodZCZQ=; b=Er5lrwn0LrlKYu8hBfoh0VK1KQ2MTAf6PHUDUpLPIY/KAuM/UaLrOouQLOkEIENrna PmfzZJ1no2/bDE4rKqUEJOuGAg7Jozni4pLndL5icii6KItPTy+YwX/IfufD7QoJM4Ja osw1Mms641084xCtVcqOKGpwG6ryqcrz2N62G1Vxspx4TpYajXa1gRPVsDBzXD3ujqT3 ceq8B3+hKetz8WJ92BAO1JEiSD/JG9gs+Pt/d6x1+6v/7GNjCvyKWozKU9KSW5PG4E+T Me/iwSmJrUINCOTsCYb0njk9f9agGol1Fk8Z1C3Fj2bj7bjF2gl0Z+7V4DqAFlzUaMhl xakw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FACJfAv6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh8-20020a1709076e8800b00947f7baf08asi6695425ejc.102.2023.04.03.09.43.33; Mon, 03 Apr 2023 09:43:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FACJfAv6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232685AbjDCQdQ (ORCPT + 99 others); Mon, 3 Apr 2023 12:33:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232869AbjDCQdM (ORCPT ); Mon, 3 Apr 2023 12:33:12 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A51B61997; Mon, 3 Apr 2023 09:33:08 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id ix20so28602481plb.3; Mon, 03 Apr 2023 09:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680539588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/JyY9VZwYc39EnA1aZWuXOPQGLxKvuatHXzEFodZCZQ=; b=FACJfAv6gr+vK3e3XeLN4xvpkGnKPBmnv+fv9jvnfnCHgf1bczHB6AYubASZaeKnWO rNNLZE8IYRJ8BRbD/fGBhWTtRFr3kbxLQ2xZm5LIjwTrnobuLcRsF8oLHPd9FFDE798F xwQG589j0RfUlH8NV2IT1h5SUeHtadiEVA1anBsEmyeoUrEP9NQoL2K1rl0CH2YyBYQX iosbiKl+uG6JEkZ0gGwW2PZhs5seT17+QAjCwCRmZqpEsomA3wV9DiXEKnPA0Q8gFISG BbZtS2wxXdRwc5mpG6kJxKWbjjDpI9JOyMmNvUEM2h8g5h+Sv/L25nAcudz8NqBFkMpL R7jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680539588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/JyY9VZwYc39EnA1aZWuXOPQGLxKvuatHXzEFodZCZQ=; b=zFendd71o5w/I1uyQsCZh+626pPfKau5PGtWEg/KYMx49mfBZV55m0vAiYNTgMgdpW QSCYyEBKF2ZxIeSwMwndjTLq+uzM8lQftObxFIGoXkqdbV3RaaQZ35K4BepCEXQv3y91 8RqKkZwAmPLyvpJj1Na2eyWkoJ8hjgRT/wt0nZ431O7gpTY6v1zxYexAcE/Ezv49/7QC N4LJvI4SU3MNZYU7OvmYuaF2E7zSf1SfSxx73ArhTSV/w8jwWxIPMTENIPt9Pdyw75Ma plK4zCWwbYXrBcbL724fO+nrq7UAx6La5kvlIsVVLbLGewq06HFpwc06cVUIt53I1FNe F4OQ== X-Gm-Message-State: AAQBX9e43qGHgsRORiGDcsCl9bu7MfqF6glBVx9s0EykL62c69kZECCJ cI+0TZ7eCv+pGZ6b5Jisqu+Yq7lQgfZkXMNMPXM= X-Received: by 2002:a17:902:ef94:b0:1a1:c109:3700 with SMTP id iz20-20020a170902ef9400b001a1c1093700mr12819974plb.7.1680539587819; Mon, 03 Apr 2023 09:33:07 -0700 (PDT) MIME-Version: 1.0 References: <20230403140605.540512-1-jiangshanlai@gmail.com> <700a9c1b-5967-4e0c-0a15-8e2ab968dac6@intel.com> In-Reply-To: <700a9c1b-5967-4e0c-0a15-8e2ab968dac6@intel.com> From: Lai Jiangshan Date: Tue, 4 Apr 2023 00:32:55 +0800 Message-ID: Subject: Re: [RFC PATCH 0/7] x86/entry: Atomic statck switching for IST To: Dave Hansen Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , "H. Peter Anvin" , Andi Kleen , Andrew Cooper , Andy Lutomirski , Asit Mallick , Cfir Cohen , Dan Williams , David Kaplan , David Rientjes , Erdem Aktas , Jan Kiszka , Jiri Slaby , Joerg Roedel , Juergen Gross , Kees Cook , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Linus Torvalds , Mike Stunes , Peter Zijlstra , Raj Ashok , Sean Christopherson , Thomas Gleixner , Tom Lendacky , Tony Luck , kvm@vger.kernel.org, linux-coco@lists.linux.dev, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 3, 2023 at 10:23=E2=80=AFPM Dave Hansen = wrote: > > On 4/3/23 07:05, Lai Jiangshan wrote: > > 2.3 #VE > > ------- > > > > The approach for fixing the kernel mode #VE recursion issue is to just > > NOT use IST for #VE although #VE is also considered to be one of the > > super exceptions and had raised some worries: > > https://lore.kernel.org/lkml/YCEQiDNSHTGBXBcj@hirez.programming.kicks-a= ss.net/ > > https://lore.kernel.org/lkml/CALCETrU9XypKbj-TrXLB3CPW6=3DMZ__5ifLz0ckb= B=3Dc=3DMyegn9Q@mail.gmail.com/ > > https://lore.kernel.org/lkml/1843debc-05e8-4d10-73e4-7ddce3b3eae2@intel= .com/ > > > > To remit the worries, SEPT_VE_DISABLE is forced used currently and > > also disables its abilities (accept-on-demand or memory balloon which > > is critical to lightweight VMs like Kata Containers): > > https://lore.kernel.org/lkml/YCb0%2FDg28uI7TRD%2F@google.com/ > > You don't need #VE for accept-on-demand. Pages go through _very_ > well-defined software choke points before they get used *and* before > they get ballooned. Thus: > > > https://lore.kernel.org/lkml/20230330114956.20342-3-kirill.shutemov@lin= ux.intel.com/ > Thanks for the information. I will have a look to see how it supports memory balloons. And if accept-on-demand were supported, do we still need this CONFIG_UNACCEPTED_MEMORY? > BTW, _who_ considers #VE to be a "super exception"? Can you explain how > it is any more "super" than #PF? #PF can recurse. You can take #PF in > the entry paths. > > I kinda don't think you should be using TDX and #VE as part of the > justification for this series. You are right, #VE is not a super exception anymore since SEPT_VE_DISABLE is forced set in the Linux kernel and it is nothing to do with this series. But #VE was once thought to be a super exception (I will correct the sentence in the cover letter), so it is worth mentioning it. And since SEPT_VE_DISABLE is configurable, it would allow some paranoids to have a try with SEPT_VE_DISABLE=3Dfalse even without FRED. The paranoids can try it with IST #VE. Thanks Lai