Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9345297rwp; Thu, 20 Jul 2023 03:37:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFoOQ01kIF26nRqZVFfdMcYGEsLV7wxRLk22PaS21X1RdIsVUdGjZPRNi2AhUntbg0CJI7a X-Received: by 2002:a19:910d:0:b0:4fb:61ea:95dc with SMTP id t13-20020a19910d000000b004fb61ea95dcmr2211172lfd.7.1689849460625; Thu, 20 Jul 2023 03:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689849460; cv=none; d=google.com; s=arc-20160816; b=R5d28rDC/38c0H7gGfHsThKx2DdzR4QOKbb8IVs0DlHifMXA4CE/uahdS+eVitvUwi 4vDhtwtHpYSKQje3PtopJf9ydbQ8JaGCcN7zZMEpf5HuHpiHZoD9wXTyqRTnuKJW9PxU NXqh+c60nuFuVPsDy3yc+50cn7dnTaA8uTo6GB6UUlkQGnpgIn20myCx2qRYoeAhZ40n PDly7wJE7JNwt9k9XJD+qnysoF7DyckClk4+VDTA7e5cv2iZ8oD1wVeo7sHQuwNRxGEa DfvJwL1o1J00zEIRdlqcBga2qICLeoK0ROHMNM1LRuNr2P+fJh/dH8YEcAsSQyDlMM7a BpwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AqcliHaF/X2rsoH6SIbvP8MSE536dI0mI+IfCi2VH/o=; fh=tN/usU5Wuff3Zw38QrMHaVALdKaPmxlYLIUCKXUZd9s=; b=n2L40Wx5IZWL5Icaaprbu1Pe6KS5vD4uHyBDXqpTyKy8sZbLXhvAA+IGkGG31vGc82 KmcnEtWjkDod9xIAlheHJFizbk4/NGk0D6AMRRNPpnA5rIqRGHVVoJqFBPxFrkY9+LEp 1ZUm53Fyv1ifH0LNwUQWqPHLIPQfKNkTlZVBRNooPrlWV7UDufkFMzcQFXlhBX/sbc9e EhrPtDPfZupbmcjPDg5yFuby9ePY21a5YaAHUKXZENmxcVZQXyJOHFyn/MDzY6Oyl/8/ 8jtN1tpHipg2WksSQm8oROq+dNFTHEhqNAuE9mYP4aCG5EpsFSZQty5km4lvfFvuA248 GFGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=SYePtDrB; 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 m21-20020aa7d355000000b0051dd3d4d029si616698edr.510.2023.07.20.03.37.15; Thu, 20 Jul 2023 03:37:40 -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=20221208 header.b=SYePtDrB; 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 S230289AbjGTJ2y (ORCPT + 99 others); Thu, 20 Jul 2023 05:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjGTJ2N (ORCPT ); Thu, 20 Jul 2023 05:28:13 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43876D881; Thu, 20 Jul 2023 02:14:20 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-57026f4bccaso6480967b3.2; Thu, 20 Jul 2023 02:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689844459; x=1690449259; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AqcliHaF/X2rsoH6SIbvP8MSE536dI0mI+IfCi2VH/o=; b=SYePtDrBDFLA2TLZD31sbGiudHb0dQnGlwyfqVwP7YPnTUL1oxk8HK7eb9bxQvjLRX MhXe1S2W5uWASEqJaERZvCPZofX85Hv/TPBTl89HAGnCwsxs734Dpv9EVSvMPLfVdDxW HvmxJz6NaiNtquMLZAl6P9xF8wiawnX71jjQZcAWcHnLCi28uY/ShUbqYFSARbN7qwrl PT7cNQ4uv2KNuem1JWko1g19ouOOyVEX8BxVx+REe61RoQ5HOOyx2T44vK9JZRuQDKYo Ar912uP38MNK1nzDlwxN7jLjXHiPWoh8sIj53byMyV7lBc+sA6xduNHvQuRTQ5yAvmjn c/fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689844459; x=1690449259; h=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=AqcliHaF/X2rsoH6SIbvP8MSE536dI0mI+IfCi2VH/o=; b=AF9YCoGMqff8OZ7lncpsgNcXNn8PeC0vX329uBplp9c268avcQleZK5vPywJXiveKW TbzQCzcFjXWPrL6Ff+o8XX2E2IbA1lYAj0dvtQugcPtpkuloybSoCrloROLo9jwWaUjV P3nW86/NlA95NBc/hUnpF0Am3PbuCDTfK3ieECwXZXNFUtngz6fq4q73qvNuGhC8bYQx Q/q64bfLdJgQa9Ymtk3sctHQog2JXQNLmELCiGJOFPNIetj7MJw+9L4tSywbRNrZcgCL 0oRjJvL8ysvvgAmF0msVhav/29k+8Yk98stS4W3f6fybNg81oyEfo2ca/Oo0OZtjck1x MtbA== X-Gm-Message-State: ABy/qLaSQQj0LSkE3aKfbPKX4dhDsAPzhqWey+6Nb19JtZa4C1zYu3KH /4OJ6de3meNb8x2Mxm/1vbQ+Wc24naD+C4f2UVo= X-Received: by 2002:a81:6d13:0:b0:56d:1f62:7793 with SMTP id i19-20020a816d13000000b0056d1f627793mr1651543ywc.46.1689844459258; Thu, 20 Jul 2023 02:14:19 -0700 (PDT) MIME-Version: 1.0 References: <147246fc-79a2-3bb5-f51f-93dfc1cffcc0@intel.com> <20230719203658.GE3529734@hirez.programming.kicks-ass.net> <20230720080357.GA3569127@hirez.programming.kicks-ass.net> <20230720080947.GA3570477@hirez.programming.kicks-ass.net> In-Reply-To: <20230720080947.GA3570477@hirez.programming.kicks-ass.net> From: Pankaj Gupta Date: Thu, 20 Jul 2023 11:14:08 +0200 Message-ID: Subject: Re: [PATCH v3 00/21] Enable CET Virtualization To: Peter Zijlstra Cc: Sean Christopherson , Weijiang Yang , pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, rppt@kernel.org, binbin.wu@linux.intel.com, rick.p.edgecombe@intel.com, john.allen@amd.com, Chao Gao , Andrew Cooper Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 > > > Trying to understand more what prevents SSS to enable in pre FRED, Is > > > it better #CP exception > > > handling with other nested exceptions? > > > > SSS took the syscall gap and made it worse -- as in *way* worse. > > > > To top it off, the whole SSS busy bit thing is fundamentally > > incompatible with how we manage to survive nested exceptions in NMI > > context. > > > > Basically, the whole x86 exception / stack switching logic was already > > borderline impossible (consider taking an MCE in the early NMI path > > where we set up, but have not finished, the re-entrancy stuff), and > > SSS > > > pushed it over the edge and set it on fire. ah I see. SSS takes it to the next level. > > > > And NMI isn't the only problem, the various new virt exceptions #VC and > > #HV are on their own already near impossible, adding SSS again pushes > > the whole thing into clear insanity. > > > > There's a good exposition of the whole trainwreck by Andrew here: > > > > https://www.youtube.com/watch?v=qcORS8CN0ow > > > > (that is, sorry for the youtube link, but Google is failing me in > > finding the actual Google Doc that talk is based on, or even the slide > > deck :/) I think I got the link: https://docs.google.com/document/d/1hWejnyDkjRRAW-JEsRjA5c9CKLOPc6VKJQsuvODlQEI/edit?pli=1 > > > > > > > > FRED solves all that by: > > > > - removing the stack gap, cc/ip/ss/sp/ssp/gs will all be switched > > atomically and consistently for every transition. > > > > - removing the non-reentrant IST mechanism and replacing it with stack > > levels > > > > - adding an explicit NMI latch > > > > - re-organising the actual shadow stacks and doing away with that busy > > bit thing (I need to re-read the FRED spec on this detail again). > > Thank you for explaining. I will also study the FRED spec and corresponding kernel patches posted in the mailing list. > > > > > > Crazy as we are, we're not touching legacy/IDT SSS with a ten foot pole, > > sorry. ya, interesting. Best regards, Pankaj