Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3190160rwb; Mon, 7 Aug 2023 09:28:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyr+ZbTi6yUPPZHs7wQkwUIasxXVFDANRaLmju4v3CEXTkS9RDnivmn+dI3YHAQuSVkoGa X-Received: by 2002:a05:6a20:938f:b0:134:2b44:decf with SMTP id x15-20020a056a20938f00b001342b44decfmr10528959pzh.21.1691425726966; Mon, 07 Aug 2023 09:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691425726; cv=none; d=google.com; s=arc-20160816; b=PowIIR5LiHACOUK97knHradB26sBgdP/ilonraYkaYWa9ViKcH1XrXXD6I95dYuzwi Vo3qMxS5Q8PM2cHod3My82Ip1cOGoIPL0aQ+DUno6s0uYy7whZ9DKLHwbxlzdT6rMlRI R8141iQnBoHG6MhTz7wUEozZ6uusRyTpbQt6S+roJsh17mP7iTPJgVxzJMm9NkJP73Zl A6mB9kIqQd6et855cUpCzssMybCx8Rl9rUYRnE3Y6SakRTYWz+bFGUpUSQKlwTn7AEnf WND96/zEXy8xmvmguoCKcol3n64H7kTlyxESVHy1LRySeHpknTdqoVezI+brfCKWAWf6 I26g== 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=L0DrUJCadt6WQwoHRWSiflc1tXgQKjr24/5U3oHkJWE=; fh=0dpUM1ZMRseMabaayv1Nxy42jzba9Tyis0sM/x7GtWw=; b=oVMxg+JeGRcbVFm9iVxr/Z8kOBRr1Q07c+gJDu1mXlpAnOVeGIDDcNGGWdS8nrSTF6 +gnmfM4TGDSaJJhRw8YPj8EwmvYVhvQ293smKem1mOMaNT5EVwJh5DT75pwzYYWyl7am 1I3ZcZNBqsoIn6kkgly1YigVG/ycMlLEhouKhb+mCbfEl+43BMiCHiS4iLGixQe/qvP1 Fy5lTO4pzx3D9qhS2BZU0/Q4pfjbNbfbxmYa9iJtZjCfAM6YZEeUrUASkBK1Omd67xet SMtew44OEswXSa042qMuwH650W6hqavy1CrHMCXCfMFubO9KgfQsUtQc8QWvifEbcHA8 d4sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=anX2q+ts; 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 a2-20020a655c82000000b00563aa631e74si5957983pgt.542.2023.08.07.09.28.35; Mon, 07 Aug 2023 09:28:46 -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=anX2q+ts; 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 S234763AbjHGOqs (ORCPT + 99 others); Mon, 7 Aug 2023 10:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbjHGOqr (ORCPT ); Mon, 7 Aug 2023 10:46:47 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96C5210DC for ; Mon, 7 Aug 2023 07:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691419606; x=1722955606; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=JNLS8jFBfRx4CXMitXxjjSQjaruvMYX/p2Luw7f8D3s=; b=anX2q+tsTubMmUz0cIQqbR7zJcbV+c+MPlX8BxKfglkrs8Z1Wkenh7fM +JlFhSB7g5dnzz6TFMpBlRmOCgiHnm9RTWlgglcakqlLZWni0cMaT7beN P+QaDDt9YA1fNYq1unjx2MJb4A1VIgGGyg5dYeASIu2W59Msuw0lTKS8V /5CAQbVo29UEL2JSG41JsPpEVi2pH+Tsi4MqoqyvNs7eByYt6ovJcEbTQ yff6syCdl5e7YQDybMlXRBw+OK0xaT0aPMG3VzrJAh8YEA0NKoPRX/3cA 9JOkuMYcwrSZRMWmSXed4LSE6PnhfS054MFPqqHJf8FXvkU17id1BjrTn g==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="368018482" X-IronPort-AV: E=Sophos;i="6.01,262,1684825200"; d="scan'208";a="368018482" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 07:46:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="680827500" X-IronPort-AV: E=Sophos;i="6.01,262,1684825200"; d="scan'208";a="680827500" Received: from abhatia-mobl2.amr.corp.intel.com (HELO [10.212.249.113]) ([10.212.249.113]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 07:46:45 -0700 Message-ID: Date: Mon, 7 Aug 2023 07:46:45 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 11/12] x86/virt/tdx: Allow SEAMCALL to handle #UD and #GP Content-Language: en-US To: kirill.shutemov@linux.intel.com, Kai Huang Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, seanjc@google.com, pbonzini@redhat.com, isaku.yamahata@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, n.borisov.lkml@gmail.com References: <659b10910c206cb4a8de314fcf7cd58814279aa6.1690369495.git.kai.huang@intel.com> <20230806114131.2ilofgmxhdaa2u6b@box.shutemov.name> From: Dave Hansen In-Reply-To: <20230806114131.2ilofgmxhdaa2u6b@box.shutemov.name> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 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_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 8/6/23 04:41, kirill.shutemov@linux.intel.com wrote: > On Wed, Jul 26, 2023 at 11:25:13PM +1200, Kai Huang wrote: >> @@ -20,6 +21,9 @@ >> #define TDX_SW_ERROR (TDX_ERROR | GENMASK_ULL(47, 40)) >> #define TDX_SEAMCALL_VMFAILINVALID (TDX_SW_ERROR | _UL(0xFFFF0000)) >> >> +#define TDX_SEAMCALL_GP (TDX_SW_ERROR | X86_TRAP_GP) >> +#define TDX_SEAMCALL_UD (TDX_SW_ERROR | X86_TRAP_UD) > Is there any explantion how these error codes got chosen? Looks very > arbitrary and may collide with other error codes in the future. If they collide, we can just fix it then. So, please, do comment what the limitations are and what must be avoided in the future, but I don't think we need to go mucking with this at all.