Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4723647pxj; Tue, 8 Jun 2021 23:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzucMTZDZ2EHFwQRs8hpy+0F5CgrF+LKli0ZIlTKvIKwb22pKeUEHXeiH6i4zN2eY4L0ycH X-Received: by 2002:a17:906:e44:: with SMTP id q4mr26878410eji.120.1623221019158; Tue, 08 Jun 2021 23:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623221019; cv=none; d=google.com; s=arc-20160816; b=Qcwe3MqAfKCCk1LL1dQVS9SH4P/kXJLGMbDAQ5koRL5GB2P49acWW7P36EXpZ4PiBv rd061qkmD5G45AhjTTa3jiLykHPYHRjetJX05D36VFjl1W67Q08dWUrDFIacwpOXLDr5 63AZXLHA1RgVTjYxcnu5RsefKPBmSFhlbmoqKvckQhMmCcO8kJWbdTUU0aJhJp3oOna/ CG5z9OpjATwYCWPDhXEwlsb/tbz9kuuTfjLT101NOVQeT2erkTmg9Y4vPXUWZuHIIPSb 9w5DtWP6PZ8cFxT2iAcwXmQeonBgjg3eIl/LONjocIn3RZHL60DApekOu40pTQRBTp/i 6nKw== 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=gdt4JghUB3/7yWBfA2YVguJPrCC6pOa4/tpNkl/xRaw=; b=J9dIiBCq1H/cIDzOKq7enrnHW9oZBMVCoIEORCIzKjdyqllWOc24zUblpiCzNOthLl 0Q6Oj/Ve5U4KIu2R6jkzNNTiJimbY9KFaG/cIIkOxXLO4VRhkL2GqIHUBFzMUWDpEgHe rkDciEp2+SYqGKZh9WoVTl/w88snGPSnDCI5xYY1nCEmH59vgg3TDMurO5l9PuJaG47W QT46ScReQkIFLADUU3+zzhbLLOpeug2u4EFi6igiPcaI0gdItdHGMrfFvdhV2OeWd/NO E+4DRnl2XFKZOCKVx2Twk+Noby9xNq2hnlhonvPODsG6B6V++yAwo10R+G4PLgheqlas CCiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=U1mWIsbV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si1722251ejm.412.2021.06.08.23.43.16; Tue, 08 Jun 2021 23:43:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=U1mWIsbV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233693AbhFHRvn (ORCPT + 99 others); Tue, 8 Jun 2021 13:51:43 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:56213 "EHLO mail-pj1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233082AbhFHRvl (ORCPT ); Tue, 8 Jun 2021 13:51:41 -0400 Received: by mail-pj1-f48.google.com with SMTP id k7so12356545pjf.5 for ; Tue, 08 Jun 2021 10:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gdt4JghUB3/7yWBfA2YVguJPrCC6pOa4/tpNkl/xRaw=; b=U1mWIsbVQwUvyUewrceBoWKWWMBrOcc5Obhhmq2UySkeBn67aN8GoM+KzPFENv9d93 AtqaX9qtmoxBnW9T0TflIGlf5xTnoslmvMgrHLWpOF/5DK1F0UGM0veB77SH5PJl1CIM yTf/W0K/rwx/8HsvPUYjZbHQ3ajmkYCNZXt31U7GFkFmBjWLM9Ii45fz0nZH8SIqSuuI 5t1jUPptTKB40Jltzjhq4WjR+OwFkK7/YFW6HUdqUejLxeWg0TLt/xFeMaTdjxtpwWrb M45GQtOm82NZjFZPsnjbGURDqv/GHOZNws+O+W08jqwDJLkyHoh68BfeUlNBluemMRH7 VpHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gdt4JghUB3/7yWBfA2YVguJPrCC6pOa4/tpNkl/xRaw=; b=OSg6z3y7qv4xCm2NstN+QxWNoii7E/07HhObctL9ywdps6ERMBOu+FLmetkorSNPn3 t4es97HwMHdemNM2ga/JWt65wStTzwYCHPVvJZboA8ffPuumHZkxp8nRZGW0sjGEfnDn PLahGwdinZ8CdSE5zpG3i1EmKW5yWyvfkNEnOtlhRHnB8ujOQE9TubbnhjGPh7sd6Ckk cxyD2sjwx1K3+JtrFhOwG24iIa9DZ1e6eWE05N5Xrq+NqYiDyo6+ujnnwgbJk7dt8JT1 LEOP/3z9K7DM+iPupjZLh/LqOVBcL4cGHgw8zDx1qIE6qz2DCxB+/yePFmxB7dMOi//g Grow== X-Gm-Message-State: AOAM530r0TGyVSSfPrIyKEhG2xckOzyLIZVt7jxsGDa7+EdNZOAXCjnz ml3eiEe6VEi/T2t+m5EmCyEfPg== X-Received: by 2002:a17:902:edcf:b029:10c:768:b657 with SMTP id q15-20020a170902edcfb029010c0768b657mr836025plk.56.1623174528484; Tue, 08 Jun 2021 10:48:48 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id h186sm11187688pfe.4.2021.06.08.10.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 10:48:48 -0700 (PDT) Date: Tue, 8 Jun 2021 17:48:44 +0000 From: Sean Christopherson To: Dave Hansen Cc: Kuppuswamy Sathyanarayanan , Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , linux-kernel@vger.kernel.org Subject: Re: [RFC v2 08/32] x86/traps: Add #VE support for TDX guest Message-ID: References: <8a1d6930f784cb57c957cf20cea870947db91e05.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021, Dave Hansen wrote: > On 4/26/21 11:01 AM, Kuppuswamy Sathyanarayanan wrote: > > +#ifdef CONFIG_INTEL_TDX_GUEST > > +DEFINE_IDTENTRY(exc_virtualization_exception) > > +{ > > + struct ve_info ve; > > + int ret; > > + > > + RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU"); > > + > > + /* > > + * Consume #VE info before re-enabling interrupts. It will be > > + * re-enabled after executing the TDGETVEINFO TDCALL. > > + */ > > + ret = tdg_get_ve_info(&ve); > > Is it safe to have *anything* before the tdg_get_ve_info()? For > instance, say that RCU_LOCKDEP_WARN() triggers. Will anything in there > do MMIO? I doubt it's safe, anything that's doing printing has the potential to trigger #VE. Even if we can prove it's safe for all possible paths, I can't think of a reason to allow anything that's not absolutely necessary before retrieving the #VE info.