Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1876545rwb; Sun, 6 Aug 2023 05:11:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7GJ5h81OoSJNvrZEvkE/JXCnvDJphpf1YPqEtoMNxwGm8qK8twOX8mzIZdzgkV7ntOXpA X-Received: by 2002:a19:7913:0:b0:4f3:b588:48d0 with SMTP id u19-20020a197913000000b004f3b58848d0mr3432494lfc.14.1691323867364; Sun, 06 Aug 2023 05:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691323867; cv=none; d=google.com; s=arc-20160816; b=O2bm2QP6bXXmu2xqZCDz6fL1YrssYycW4YPEPaQKIuqPS0w1/5Ug10wHwjkwe+km7R ZGZ2Jd7hWugZO31adstfFbJI8Hds0gVz9mjk83BhMRO+DCYk8YruXVAL6GJR/TuMgSGu 9rB2sXpDobKuXkfrO3lqkdOzb4UUosdtF9zeYjQ4f6zlsDbc2uXsjjyfrToZmhB2rFc6 +UpOfMgg5Di/iz+DrgXlD+FpLJyD4r1aqY+Hk8sOx+6e6VKQiH7EvTcLyVVCSzLc5rQy 1GlI/TMNgyl0LNYICAkPrh5hlC3eRIW5EhVYEU4d9XNA4z5PsvzdlHZSKkUzEiuq9PzA zO9Q== 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=N+ceDaz5Hz6FkX8xhPR3zTdpn8PTRbZZVZWKU53WKaI=; fh=zN2JBeE3ky/Xz5p/ZSHHDMuLiv0fZP/68F4Zs1KJnZc=; b=iuHHSP+flQX7/ztuGzWbCvzpU67V72WIXPc9/auN40KL/JXskuBdqV0fu1mAAfTb/B 7Tdh3NAgT3gWkxfEIue67/2dheIfZ2AdgZ0L7dtt54iV5TkvINgIsUfBpUFJnGBpT9yN dV0W/RlGV0DXjbReS/QbMdasmMysoCTcsIuSImh3qYAGJ5rdkU4mzX/xZX06R3KpKeXk /6XQUs6RIXp3nTVVYvKMVa0jkKKXo5h0usWjLN40ZGWBGhIUoGKTlv6FIWk+Anp/O6iX vTdz3KpQZFZRN47RmS2T/pasPQH8ERlw3WyEKRWbaMAfIQDnops24F7fiQ2yLzgmcFXS Bmyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cbd5M8L4; 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 i3-20020aa7dd03000000b00521656f855dsi567225edv.110.2023.08.06.05.10.39; Sun, 06 Aug 2023 05:11:07 -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=Cbd5M8L4; 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 S229848AbjHFLlj (ORCPT + 99 others); Sun, 6 Aug 2023 07:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbjHFLli (ORCPT ); Sun, 6 Aug 2023 07:41:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0F8BE50 for ; Sun, 6 Aug 2023 04:41: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=1691322097; x=1722858097; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=XrZMQmI6MoNirDc2KHAZ0SOGCMPeMfTWWbIJA4afiow=; b=Cbd5M8L4vXfIKFfYZ6D6HBliWF3A9/b86rWx9TLr1sb6veDoqmOSx5AP wAPTZniaIj6aCGWc8pwEjGZemKXigXEaGvVY7AT+K8ozvh2ABgnQCNxdf bRiJuZo75a/gRuYfl5JF2k1CEWXv6r/aEvtHuNbcMn2djRq4AWYVuf0+b vp43ECXuO1EEwElpY8Tl8MjTEiMXI2Uz0TaHQQauQjPDHbEyX6nYahWUl XiWIxYEZrs0gHbRRbPYRaAq7YGnCbaxlXGZQZyuODrBJpckBH0Sdqw6Y/ JP3e1S2vUEHHXqKF38bpOCe+pr8gl1Lyt40aPBFeSCANQ4buMyRr043XA w==; X-IronPort-AV: E=McAfee;i="6600,9927,10793"; a="373128360" X-IronPort-AV: E=Sophos;i="6.01,259,1684825200"; d="scan'208";a="373128360" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2023 04:41:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10793"; a="760136661" X-IronPort-AV: E=Sophos;i="6.01,259,1684825200"; d="scan'208";a="760136661" Received: from mvalka-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.63.122]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2023 04:41:34 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 5D26510A117; Sun, 6 Aug 2023 14:41:31 +0300 (+03) Date: Sun, 6 Aug 2023 14:41:31 +0300 From: kirill.shutemov@linux.intel.com To: Kai Huang Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, 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 Subject: Re: [PATCH v3 11/12] x86/virt/tdx: Allow SEAMCALL to handle #UD and #GP Message-ID: <20230806114131.2ilofgmxhdaa2u6b@box.shutemov.name> References: <659b10910c206cb4a8de314fcf7cd58814279aa6.1690369495.git.kai.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <659b10910c206cb4a8de314fcf7cd58814279aa6.1690369495.git.kai.huang@intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 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. -- Kiryl Shutsemau / Kirill A. Shutemov