Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2366265iob; Fri, 20 May 2022 07:52:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW8512n3uMYxFtqvXxa9Xb9LqCel/ucKsP+ldsT/uTbNp3DV1BAay6KwYqAz9v2LcCUUty X-Received: by 2002:a17:907:7f8e:b0:6f4:2c01:5565 with SMTP id qk14-20020a1709077f8e00b006f42c015565mr9244494ejc.234.1653058374694; Fri, 20 May 2022 07:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653058374; cv=none; d=google.com; s=arc-20160816; b=TUJaiwZmDf1MTjk39/S9p+eCFKhAHAofclFFm8xKEv66Hk3kTq65D42UXtmyF1e9Fi aXbe1CLvuMZUUcqnhGTDMuMiBQljpOzvh3dF0fov0i27ZyTf2CcbzpqeSViaH6yKWpJ7 chVZaXtTusQIqXcTHiHr4nGC8TgLaRy1kJw8lfXF0Q7W2mD3b0s6fWFmAO7fjOk5u6SH IDQRC0xAN06vZT9q0JQDZ/uT9WyrQc/GgtDwG60D4GPsPnqnvzjHuTbRO9C4yFZtSd0D cLOJyXBPEe9NeZidpMNbMHxJoxXikVsoWcMcBgZUk45U0ZHjNbyAbXmthk8H04+sJYq9 SuQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mn+bWqaR1TKbWnMJcVsldhTMcPG7hztP4mLLNIzIrE0=; b=Ytik/okVpxqoVNbNpmRUhJ+HMDurN7TtLyD58Aw49lt9IJvBSB3qH4n0XM5/ViSTvF upOiZlufFtfMbIefCPND0gzZgXWVNZuwWjcEnCrW3laJQOVnsrVKLj8g9Wg/8cmwJn2r KZCsa7joOTXe/wMyfmQYPPAMbkX2Z5klgCGIRgueFkLJnQJqMliJLWmSCZCKYQuyVi6L Jr4M91gEq586fc7Af9BuccSdp4hlHnTMLb5lezbFu0DPw6boYK9npremgtA0R2Zsjy8D 2TSmR/pdCgnXGPpsNr6/2mWPdo14YdRfeCS6svkFBTZYPasWdxYwNCrxzkSME+Ks8UJA MR4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z7I17IN9; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a056402088300b0042ad0479a11si8052547edy.90.2022.05.20.07.52.27; Fri, 20 May 2022 07:52:54 -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=@intel.com header.s=Intel header.b=Z7I17IN9; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244038AbiESSfk (ORCPT + 99 others); Thu, 19 May 2022 14:35:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232411AbiESSfi (ORCPT ); Thu, 19 May 2022 14:35:38 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9435F56F90 for ; Thu, 19 May 2022 11:35:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652985337; x=1684521337; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=eXy8i7Ms7pnGUruejXu3xQWWY8IlWM67DQ4+m49di/A=; b=Z7I17IN99mh60Nk3/aUlG65zFFxAyZKiucb1333YXXcAlYQ0Eg/+VnfF UVNnnxK2vtRB7oidC4cNU+FEZUbwZzTXK8RZ0QGeEPhj8mFq4VNjAmgVg Nefagc3HAQDB8TRwKeAukhMnUtzgmbrSmvSaH8jPbS3vVPFohmAl2QqI8 pwcyGo04A5JdzOJGiwvgGMFY/oU9mYoOuxjZQqVx5Bdf+n79VAqpU+FWD NR4G9w3ZCR7ag5PLPHc007c6skJTSh708kXZRndLVoYJ2psFTsXe1wx+f uAObKTH77Bm/BYM/d9VNbHNCTTZllZ65V5d2jNcqJRnZPosJdh7FqOCaQ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10352"; a="335371984" X-IronPort-AV: E=Sophos;i="5.91,237,1647327600"; d="scan'208";a="335371984" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2022 11:35:37 -0700 X-IronPort-AV: E=Sophos;i="5.91,237,1647327600"; d="scan'208";a="606624216" Received: from rlsharma-mobl.amr.corp.intel.com (HELO [10.212.180.228]) ([10.212.180.228]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2022 11:35:36 -0700 Message-ID: Date: Thu, 19 May 2022 11:35:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page Content-Language: en-US To: "Kirill A. Shutemov" , Sean Christopherson Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, luto@kernel.org, peterz@infradead.org, sathyanarayanan.kuppuswamy@linux.intel.com, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, thomas.lendacky@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org References: <20220517153021.11116-1-kirill.shutemov@linux.intel.com> <20220517174042.v6s7wm3u5j2ebaoq@black.fi.intel.com> <20220517201710.ixbpsaga5jzvokvy@black.fi.intel.com> <083519ab-752f-9815-7741-22b3fcc03322@intel.com> <20220519181958.libitxp2jws4prcr@black.fi.intel.com> From: Dave Hansen In-Reply-To: <20220519181958.libitxp2jws4prcr@black.fi.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 5/19/22 11:19, Kirill A. Shutemov wrote: >>>> The SDM has a breakdown: >>>> >>>> 27.2.5 Information for VM Exits Due to Instruction Execution >>>> >>>> I didn't realize it came from VMREAD. I guess I assumed it came from >>>> some TDX module magic. Silly me. >>>> >>>> The SDM makes it sound like we should be more judicious about using >>>> 've->instr_len' though. "All VM exits other than those listed in the >>>> above items leave this field undefined." Looking over >>>> virt_exception_kernel(), we've got five cases from CPU instructions that >>>> cause unconditional VMEXITs: >> Ideally, what the SDM says wouldn't matter at all. The TDX module spec really >> should be the authorative source in this case, but it just punts to the SDM: >> >> The 32-bit value that would have been saved into the VMCS as VM-exit instruction >> length if a legacy VM exit had occurred instead of the virtualization exception. >> >> Even if the TDX spec wants to punt to the SDM, it would save a lot of headache and >> SDM reading if it also said something to the effect of: >> >> The INSTRUCTION_LENGTH and INSTRUCTION_INFORMATION fields are valid for all >> #VEs injected by the Intel TDX Module. The fields are undefined for #VEs >> injected by the CPU due to EPT Violations. > I initiated update to the spec, but it will take time. Understood, and thanks for doing that. For now, let's just declare what we *expect* the spec will say and show it to the folks doing the spec itself. They will then have a chance to balk at our interpretation if we got something wrong.