Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp687204iog; Fri, 24 Jun 2022 11:44:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vBgTqWDZNN0vuJHhRqGp/66eD0uzAbQ6yeL3FmdY8zlx0qlAyulePJoAcGSnCLYGg90xRH X-Received: by 2002:a63:4a4e:0:b0:401:baa6:d695 with SMTP id j14-20020a634a4e000000b00401baa6d695mr221367pgl.259.1656096294624; Fri, 24 Jun 2022 11:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656096294; cv=none; d=google.com; s=arc-20160816; b=w7/TOTzuq7Trqmxhu4kgwpObOf87GHYyTU4jxT+Rgwg+7ZAmLqcJv9ptL2sBuK5MMW IMZMm5nQFnc3EcgZHzusFtaLAv9bywMPkZGax5FToELCU65GWXuQhQLun2A+huuJbTMp vLkIiedZuXSrHGuaVDo1esI0EYwETuIgBbrIu/65VglMIwtWyE/1A/CPTOTfM0Luu0lx 0EvlxFyjP8ChC3a+VnQKcEYIpdU9Y1DARlPqy/WCEHOXIrfQOpv4EB0OTlp0zdxlu7su DUezjCPb2lw3NxbbnvIHiUQOt4zt5g/Xh7T1PSra7B/CG/y5qP72PoR1paVMgssUnmyo 2zmQ== 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=frtdyvca1CNLvbr+WXzY079h7wuW315OBnBNClsHsYs=; b=ywY/IJWma8E3XSW3PYb22zEpgnGEhZ837Oeh1EnMGe7YREoY4xUj9auqF23bVJgZmF MOHo5Xvd8328FHZxSlHROwwi7P0aUkZlYNrxbir7t5MErySDNgnY4H+Spaoz/xjpAbbr G6IyR0jowysMMnIP6A88xcfYjFM15TwBha7n6PWcBp0GLDA0n7iPkeww6pJjUEceDRBK P75rjn4rnZuRlPWPJH2KIii4+4/L6bEA+qnsuP8U4QSdpT+BO1p81cpOaxvnj2VFxqEs dXg7eLuY0Uv9185XUn5Dc4+1hQ4+BRcoSCqYfML9W1qtZpA25/tUJcCfMSQRnBYKzImh EF4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jjrYJi/4"; 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 m7-20020a170902db0700b0016a4516bd6asi4870514plx.34.2022.06.24.11.44.42; Fri, 24 Jun 2022 11:44: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="jjrYJi/4"; 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 S231448AbiFXSio (ORCPT + 99 others); Fri, 24 Jun 2022 14:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbiFXSin (ORCPT ); Fri, 24 Jun 2022 14:38:43 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 733E354BEC; Fri, 24 Jun 2022 11:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656095922; x=1687631922; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=B9kU50pQRrH8ip6M39PDMdwIkR+/caDx8kDBNekEpWE=; b=jjrYJi/4mhwFgPC21byaVdTjQOFHvOU3/wdSVWd6C8pDkTMPTvWlExiI QIhQZxCXW4YYNp2uUZ7yo/XbrVWmPspJl47VwpYTuSmgeBPHAJGeCXTfW nFlv26/FO7AHmbJ3JVNR8A68wbCz/BK40uwO/mtJgajAKeU4zBQCR2SmT DS+k0yt0cq4+ZinndVzxLEmR3MiOHQSKmRxqQyXFnP53MUnzSZssHZjhU tped6dmE92y9rQPXgibTOK9iLbtouY57gPCBvyEpDytgYMpIKcihOA4Fo qt9ZAJV59wHCmKDX3x5CJPJdFxD4mZmJlPWiYKv9lDQL0zeikUBqa7yvD A==; X-IronPort-AV: E=McAfee;i="6400,9594,10388"; a="278609698" X-IronPort-AV: E=Sophos;i="5.92,220,1650956400"; d="scan'208";a="278609698" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2022 11:38:42 -0700 X-IronPort-AV: E=Sophos;i="5.92,220,1650956400"; d="scan'208";a="731426029" Received: from mdedeogl-mobl.amr.corp.intel.com (HELO [10.209.126.186]) ([10.209.126.186]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2022 11:38:41 -0700 Message-ID: <069a062e-a4a6-09af-7b74-7f4929f2ec0b@intel.com> Date: Fri, 24 Jun 2022 11:38:06 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v5 07/22] x86/virt/tdx: Implement SEAMCALL function Content-Language: en-US To: Kai Huang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: seanjc@google.com, pbonzini@redhat.com, len.brown@intel.com, tony.luck@intel.com, rafael.j.wysocki@intel.com, reinette.chatre@intel.com, dan.j.williams@intel.com, peterz@infradead.org, ak@linux.intel.com, kirill.shutemov@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, isaku.yamahata@intel.com References: <095e6bbc57b4470e1e9a9104059a5238c9775f00.1655894131.git.kai.huang@intel.com> From: Dave Hansen In-Reply-To: <095e6bbc57b4470e1e9a9104059a5238c9775f00.1655894131.git.kai.huang@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 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_HI,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 6/22/22 04:16, Kai Huang wrote: > SEAMCALL instruction causes #GP when SEAMRR isn't enabled, and #UD when > CPU is not in VMX operation. The TDX_MODULE_CALL macro doesn't handle > SEAMCALL exceptions. Leave to the caller to guarantee those conditions > before calling __seamcall(). I was trying to make the argument earlier that you don't need *ANY* detection for TDX, other than the ability to make a SEAMCALL. Basically, patch 01/22 could go away. You are right that: The TDX_MODULE_CALL macro doesn't handle SEAMCALL exceptions. But, it's also not hard to make it *able* to handle exceptions. So what does patch 01/22 buy us? One EXTABLE entry?