Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp737410rwi; Wed, 2 Nov 2022 18:02:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6219iY/MyqBtAYSmG12Xn/OBc19gEj2zadh7rVoG0s9JIJcz4UUdrAWL+bXbO5MGey8O3v X-Received: by 2002:a17:906:5dae:b0:78e:302f:4218 with SMTP id n14-20020a1709065dae00b0078e302f4218mr27905677ejv.22.1667437368616; Wed, 02 Nov 2022 18:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667437368; cv=none; d=google.com; s=arc-20160816; b=wxYfY9xAY87sFWhJOQPntiOKmOy8qzYOg4AobjLZ5+AFVYN20LAcFMwkpvWQZxCMyT YiDstSAg09F+zsLpoTwKNnDsALTfw5B/+IydAWcwxg2OdyqtBXLyXZY151rVTlqLaGB5 PlUZJCpnc5BJ8pKo01yPhQhB8f29d9gYduM2jFPk9OVpLxy0j6FwQiqfrEzC1+C7+sd+ 0N8l0t8AqCC9tqpZy2i4MBGoXhO4z1xLxAFXo31cWuZ0wjs3A8ufQl/z4d3OUCw+5+/Q eMZOEHH3LpDnBCWSjIunV4A1/Q4lXIKXf/9pEVuLHAABzYue45aEZ3GWNmF80ocIU/WZ DGbA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gN1mKfLTOfiBIachHef1NvCz2+Mp1pI1D3scxDhbX2Q=; b=eddF3l2byBTtD+Ga0rc9V+mlaA7VECUZnHpxYUChc6vqOCgYgkBjFgqMFF4/am4VfH /Qqp2HcZH57H+LOzKoeyHcckh4WDOwWl6Y3iSVb/9SDM3NGAzTMvXcAnrOivLWPR5Nsu osFIPZk/06jbBmEzLO9qed0J/SJtHptijh9fhCKblXG97CIFRVAZch21FpRMUZkEky9E 1XEbRoCfgzbwlXFq0jh4ytZV3KymgapU2r5BJ3tVPcLmlPnLUFJllkVUUZZ1lDrZwb2P 9esTZZoz6+rBpnl5/PBpnMAjZNbscAZx+/Tpa3lfrOi7GPLSkuH5lASGbjUQbNmzniI+ BDkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VoMoH5s1; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a50cd49000000b00452dfa2bb27si17863875edj.134.2022.11.02.18.02.25; Wed, 02 Nov 2022 18:02:48 -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=@gmail.com header.s=20210112 header.b=VoMoH5s1; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231208AbiKCAFf (ORCPT + 98 others); Wed, 2 Nov 2022 20:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbiKCAFd (ORCPT ); Wed, 2 Nov 2022 20:05:33 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 502DA2678; Wed, 2 Nov 2022 17:05:32 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id v28so135083pfi.12; Wed, 02 Nov 2022 17:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=gN1mKfLTOfiBIachHef1NvCz2+Mp1pI1D3scxDhbX2Q=; b=VoMoH5s1BaOgvMgxmxoaPSwIJ8csJ12qeDMhgkAZfx8dggO8aBmKyGFJonnw5N6UAG uOyMsPS8VtwD9n0cMlotq0o8rXdSvdDihbRJv8fdd44k6IvqOu3iiqi2vkH/59wOnESa YmgBDkdpDxqVv06Pcx3IaPrLjCgM6zzJKIA+LyqViCr64R3kbryML579QXUXMVq9j6N8 nJEO8kUqLntVvB9FMuX3dW0JCOmIuHZRzQRQj791lZdM99vhP/1f5vDsiImKbwM9oLRJ KNtkrhOBSsXZ2bjFUnZhPWWCRDpIVGUZlPaSV3VmIZ3QDGCN5qzRxtstIYDwcew2bZJ0 dMyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gN1mKfLTOfiBIachHef1NvCz2+Mp1pI1D3scxDhbX2Q=; b=O67LWDHl9Xv/bEWja18lw8QC6ySVxdwQkpFUsxNFbeb47qUz2uCpT/uS+6MtNPyaId /keFOZh16/queb7IcGW2bNidBIf/mE5xJ1PMrJCpAJZ8Q1jVf0Jxpv/XVTHEYPPI3Rxs hN4bt/EWy3z3SSsgHzbFu8eryGT+fH8/f8t9ji6n9EvlHyyYA3FUnqeoZirUPDkacs+r 5CzSzwQZneWmua8HpcZR/o0vxgoVtGIsBRVYWKU1UbHoMCpJphIKcmzi0KGohJWhzTRW 7UiKiPiygPibXksZdPDGQaCzfwyCfW5WH5s+/eXs9wmUMMu00+sDwsa47rS4Pz7vUI7x jovQ== X-Gm-Message-State: ACrzQf2v78JFz7tLEuv09XvSJHZ94/zALD7wgt5T9ubYuKZ7I7KCxeH8 SbdSa/sFSYpDRLDM1hzG1TFwwxj0pp4= X-Received: by 2002:a63:1f5c:0:b0:469:d0e6:dac0 with SMTP id q28-20020a631f5c000000b00469d0e6dac0mr23190352pgm.427.1667433931649; Wed, 02 Nov 2022 17:05:31 -0700 (PDT) Received: from localhost ([192.55.54.55]) by smtp.gmail.com with ESMTPSA id s16-20020a170902ea1000b001837b19ebb8sm8955062plg.244.2022.11.02.17.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 17:05:30 -0700 (PDT) Date: Wed, 2 Nov 2022 17:05:30 -0700 From: Isaku Yamahata To: Binbin Wu Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , David Matlack , Sean Christopherson Subject: Re: [PATCH v10 010/108] KVM: TDX: Add TDX "architectural" error codes Message-ID: <20221103000530.GA954260@ls.amr.corp.intel.com> References: <679bb45187dc54b82ebc9df5381a7d5de0b782d5.1667110240.git.isaku.yamahata@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Mon, Oct 31, 2022 at 05:22:13PM +0800, Binbin Wu wrote: > > On 2022/10/30 14:22, isaku.yamahata@intel.com wrote: > > From: Sean Christopherson > > > > Add error codes for the TDX SEAMCALLs both for TDX VMM side for TDH > > SEAMCALL and TDX guest side for TDG.VP.VMCALL. KVM issues the TDX > > SEAMCALLs and checks its error code. KVM handles hypercall from the TDX > > guest and may return an error. So error code for the TDX guest is also > > needed. > > > > TDX SEAMCALL uses bits 31:0 to return more information, so these error > > codes will only exactly match RAX[63:32]. Error codes for TDG.VP.VMCALL is > > defined by TDX Guest-Host-Communication interface spec. > > > > Signed-off-by: Sean Christopherson > > Signed-off-by: Isaku Yamahata > > Reviewed-by: Paolo Bonzini > > --- > > arch/x86/kvm/vmx/tdx_errno.h | 38 ++++++++++++++++++++++++++++++++++++ > > 1 file changed, 38 insertions(+) > > create mode 100644 arch/x86/kvm/vmx/tdx_errno.h > > > > diff --git a/arch/x86/kvm/vmx/tdx_errno.h b/arch/x86/kvm/vmx/tdx_errno.h > > new file mode 100644 > > index 000000000000..ce246ba62454 > > --- /dev/null > > +++ b/arch/x86/kvm/vmx/tdx_errno.h > > @@ -0,0 +1,38 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* architectural status code for SEAMCALL */ > > + > > +#ifndef __KVM_X86_TDX_ERRNO_H > > +#define __KVM_X86_TDX_ERRNO_H > > + > > +#define TDX_SEAMCALL_STATUS_MASK 0xFFFFFFFF00000000ULL > > + > > +/* > > + * TDX SEAMCALL Status Codes (returned in RAX) > > + */ > > +#define TDX_SUCCESS 0x0000000000000000ULL > > +#define TDX_NON_RECOVERABLE_VCPU 0x4000000100000000ULL > > +#define TDX_INTERRUPTED_RESUMABLE 0x8000000300000000ULL > > +#define TDX_OPERAND_BUSY 0x8000020000000000ULL > > one minor format issue, spaces are used  instread of tabs this line. Thanks, fixed it locally. It will be include in the next respin. -- Isaku Yamahata