Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp860875rwp; Thu, 13 Jul 2023 02:09:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHDZeIhFzKU/hResRO7IcKlQ+f+7QrnzeeV9PEC7e+qa+YcohAvziOzFj1sfo7ePXiVeN1s X-Received: by 2002:a05:6402:2037:b0:51d:92bf:e6b9 with SMTP id ay23-20020a056402203700b0051d92bfe6b9mr1148684edb.34.1689239393329; Thu, 13 Jul 2023 02:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689239393; cv=none; d=google.com; s=arc-20160816; b=f8SQ47roDYD0UF6KvrL2qY6Yu+tXG1P2lkSIJZLoyMBjy6shw+wT1N9aYxT6gNAbPr BJUujmdVpbDVXLKd/6anxVNKQVoTLJHFVLQlE8jRCk6YxNTObvsqqJ+Rjv9/1DtTn7XU 8BezzNw6Kcr6rG9AqyDSnfqEVDMprRv1LXQfjQ8MB9RsAl44Q4KrsBRiSUtumRALNQC3 72UEv2rA1iVJqykpBSTb28Bwn17hAT3qTz/vc+LibTvAVEbTkgSSL8xLjsmgykYHFe6a 9GNKtpw0K/YW2jQLcWIbCurWmRrPsfDfP2a9GDktNVtKH74oHereTtu5EfuQ77jb611f Yimw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0iE4oWpU34GZzmhlu1waBjlWtnlO5JVQSNcDSOmRsIg=; fh=N+OK3Z4UlsoYtYFjfiw+LF5DCixo9u8YyFGQpJCZL3w=; b=Kcq49rcoVLMx9FfMX9ePdj334DUD58iQ1HPOTq/Yv1BQ0LjjSK5t4TFPYotexGa9Hn paDPD9sfC4cb3zNP8NkfJyyrkqzNdz6YAGAFAuuGIsQLLrhmZbCJYQzTkgNzgGK1hkoy EZn6j0M58jhtGQeu8+siX9WXiEbIhQQY5i6FyOnrWfxC6l13ByhxLSd/gSC2D6kyzwni OaMlea4xvlXx8M7a766wIGxBn1c9SJs8+YBFTkyp6ZqqWKZl1wlztaLdbyi46jqkyqqr m5rA3pGsigMFB1McYp0hc4JXcry1IYw7Ir1tFsZu2uLnLGdNUc3KnYl6ee1XZqzFV5Xt Wt9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=ecaen0Dz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a056402074d00b0051da08decbdsi7255786edy.636.2023.07.13.02.09.29; Thu, 13 Jul 2023 02:09:53 -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=@infradead.org header.s=desiato.20200630 header.b=ecaen0Dz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234396AbjGMIrR (ORCPT + 99 others); Thu, 13 Jul 2023 04:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234272AbjGMIqy (ORCPT ); Thu, 13 Jul 2023 04:46:54 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B254DE4D; Thu, 13 Jul 2023 01:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0iE4oWpU34GZzmhlu1waBjlWtnlO5JVQSNcDSOmRsIg=; b=ecaen0Dzkg0jUwk8kFciiVMftL lt/rrfffKIkKOckxgnWejkdB5+MDIpm7M6xbud7JVed+lhnoVdf036fS2GSlvpxGiBHfg8XW4wEdg zz2rff7hK/aXHkwb5VK2KndXVJANoZ5ve/aqiQFEHmzbLlUaAu7CsXfmQcEI+ZF2Yv0oDJAIMHFuK Gz0vTSwAz5KGYFoDkdYEE4rh0x9UrYkKFFG41YCqdT16QjkUcKftvOmMSipXhjmdB6o6dTQNbW22D 4USso2k62rfkr5eiCb3tfd6bO0g35LCyTedKO/BE18othXXu8UWkqlFkrq1+gNlS0XF9rfr2pAEkM QFAKhE1w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qJryD-004Zb3-1G; Thu, 13 Jul 2023 08:46:41 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 09ECD30007E; Thu, 13 Jul 2023 10:46:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E7689245CA116; Thu, 13 Jul 2023 10:46:40 +0200 (CEST) Date: Thu, 13 Jul 2023 10:46:40 +0200 From: Peter Zijlstra To: "Huang, Kai" Cc: "Hansen, Dave" , "Christopherson,, Sean" , "bp@alien8.de" , "x86@kernel.org" , "hpa@zytor.com" , "mingo@redhat.com" , "kirill.shutemov@linux.intel.com" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "pbonzini@redhat.com" , "Yamahata, Isaku" , "kvm@vger.kernel.org" , "sathyanarayanan.kuppuswamy@linux.intel.com" Subject: Re: [PATCH 07/10] x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs Message-ID: <20230713084640.GB3138667@hirez.programming.kicks-ass.net> References: <20230712165336.GA3115257@hirez.programming.kicks-ass.net> <6489a835da0d21c7637d071b7ef40ae1cda87237.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6489a835da0d21c7637d071b7ef40ae1cda87237.camel@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Thu, Jul 13, 2023 at 07:48:20AM +0000, Huang, Kai wrote: > I found below comment in KVM code: > > > + * See arch/x86/kvm/vmx/vmenter.S: > > + * > > + * In theory, a L1 cache miss when restoring register from stack > > + * could lead to speculative execution with guest's values. > > And KVM explicitly does XOR for the registers that gets "pop"ed almost > instantly, so I followed. > > But to be honest I don't quite understand this. :-) Urgh, I suppose that actually makes sense. Since pop is a load it might continue speculation with the previous value. Whereas the xor-clear idiom is impossible to speculate through. Oh well...