Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp444905pxb; Thu, 7 Apr 2022 09:35:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxBO91bjDVUXkjetMxlcUVykIIn7LENGQ2lNqS0g3QAkhUD0HjDiSFDxzAvmaKls/4Yowu X-Received: by 2002:aa7:d148:0:b0:41c:df0f:194a with SMTP id r8-20020aa7d148000000b0041cdf0f194amr15371140edo.42.1649349314720; Thu, 07 Apr 2022 09:35:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649349314; cv=none; d=google.com; s=arc-20160816; b=F6f1ThrA7M+iea7tADs2Q8HofLhgjZIntZbPDwE8NHgUD2HVwZ+qxpdj2W78aYZIaO NH9Y20vpaMlXWk2srRGT0AXKVBw9/2bNvJp8TuOC90fIydYPRgQZi+HRNCa8TCPJoRz4 D+EZQ5W+6no48VKON+scLKJ7xINKdFD3ybb6dxeqxHKZRC5uJhN3qhr12/1lZLa5SHdF kcnncXWKPSBP2nlut9UsIdf/3lydpGWOw6o2sYaIrHWvzpjhBpshpVJdxqP1pDWp0xt+ g2BrnQIrIBTIhqjUcev2p2mll0jGA3UlI98ZzHmCDP4cMZgFYsww/HoJvoPZUjp+VXVw AVEg== 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=OFruv6SyU3k5Tp2Auo/lsfT5rYjkA30i4CwmN00PmTI=; b=Yo/DP9vO8qiddKikh78qgMCT04vL2YEOrJwS0DBLQGwZoji3/O+GmG29pnJAquPx0n pM+v0vfSxuJZnuk7q+90NQjH2Nt34/+3U3EXwl3q77hMj1KdDPpCA72pe520VbY+KnW/ 4tdNoUKpKsxK/JwJhkVOEWVLK6tD2gtPTGI5PnAjRnz9H1BvGBnyOokOmkDq+My+Dv3v 1AyvRMI1BwEmYe5bhtqM3FnU48zTf1iFKo7RmgJYkpLYvgQS28ATD2jC+kBnNBzKc3v/ RBirHkznCu89arxQFS16rT1Xqs+VqYeRWe675x4jh+cvsMeFQrmVHmlsl5WIvDmO5wkc cpCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PjJ8oh31; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s15-20020a170906284f00b006e4870fb699si13543859ejc.510.2022.04.07.09.34.46; Thu, 07 Apr 2022 09:35:14 -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=@redhat.com header.s=mimecast20190719 header.b=PjJ8oh31; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240029AbiDGN6K (ORCPT + 99 others); Thu, 7 Apr 2022 09:58:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbiDGN6I (ORCPT ); Thu, 7 Apr 2022 09:58:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF3BC10612C for ; Thu, 7 Apr 2022 06:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649339768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OFruv6SyU3k5Tp2Auo/lsfT5rYjkA30i4CwmN00PmTI=; b=PjJ8oh31OWkdxiknHu4J4uxf0wR5Jnnj9ze37Gmvf6zyOBlDs8HLsl42wyCvuhvBppY0iL aecLnai2zw7TECsapRZiX9821Fy9ouldjng1qi+V1d8J5g5ria5A8mNp2/f5k5RfUIT7ET unQe4Aq36DRC4Z4hJ5kjLi2Q1mO1MmE= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-cGoIXPUEPDCyL8AtVePMCA-1; Thu, 07 Apr 2022 09:56:04 -0400 X-MC-Unique: cGoIXPUEPDCyL8AtVePMCA-1 Received: by mail-ej1-f69.google.com with SMTP id qk32-20020a1709077fa000b006e7b83dc82fso3136023ejc.8 for ; Thu, 07 Apr 2022 06:56:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=OFruv6SyU3k5Tp2Auo/lsfT5rYjkA30i4CwmN00PmTI=; b=I4QcF/0PTbSvVro1NIRyrF1Iil19ii2p58mQZjjY/SPbALqME+WSMCAycKO+Pylt/Z p/zLEqcJa8HYr1QSU1YraTdB2/pmypCKZLe81YiSqYTZzWjup2N2bsn/oBtsPjK7pSPo 7kJ8hm/yS3XPkQWco+0DtN+YBKGTVV4ttkIzY2M7YKOyQpFKUsIO2Hi5weueNUJKrRy3 Y9Oj3qymIe+qygkQT6uw7VKEumHgae8PTszD3iMQYqjUyYqvGkmVy6ZGsLxgDsuS9iYE nNnGfnFBR/XXSONHsXx/HkRt8QGhW1yCvwwWGHggPDfqnBKhJaO7lC9Z85DYTSwD6ENh TX+A== X-Gm-Message-State: AOAM531nx08HkqsR8KpvfpemD950/nGZFykp3+N8aTZYUC/UGcBNkn/q 6ESKZZhWX9C7rAZ+Cf2uOYlI1oaNiH1BafKGPjJfUseXTTsq1KN7O85387XsXyitfiNtnjRdPHC xtlXW6T3UPQHBUHVC0luXRVB/ X-Received: by 2002:a17:907:a088:b0:6e4:dad7:1b1f with SMTP id hu8-20020a170907a08800b006e4dad71b1fmr13211420ejc.84.1649339763222; Thu, 07 Apr 2022 06:56:03 -0700 (PDT) X-Received: by 2002:a17:907:a088:b0:6e4:dad7:1b1f with SMTP id hu8-20020a170907a08800b006e4dad71b1fmr13211393ejc.84.1649339762999; Thu, 07 Apr 2022 06:56:02 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id j24-20020a170906255800b006e7f44d46fesm4255745ejb.222.2022.04.07.06.56.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 06:56:02 -0700 (PDT) Message-ID: <282d4cd1-d1f7-663c-a965-af587f77ee5a@redhat.com> Date: Thu, 7 Apr 2022 15:56:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH v5 092/104] KVM: TDX: Handle TDX PV HLT hypercall Content-Language: en-US To: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@gmail.com, Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson References: <6da55adb2ddb6f287ebd46aad02cfaaac2088415.1646422845.git.isaku.yamahata@intel.com> From: Paolo Bonzini In-Reply-To: <6da55adb2ddb6f287ebd46aad02cfaaac2088415.1646422845.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.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_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 3/4/22 20:49, isaku.yamahata@intel.com wrote: > + bool interrupt_disabled = tdvmcall_p1_read(vcpu); Where is R12 documented for TDG.VP.VMCALL? > + * Virtual interrupt can arrive after TDG.VM.VMCALL during > + * the TDX module executing. On the other hand, KVM doesn't > + * know if vcpu was executing in the guest TD or the TDX module. I don't understand this; why isn't it enough to check PI.ON or something like that as part of HLT emulation? > + details.full = td_state_non_arch_read64( > + to_tdx(vcpu), TD_VCPU_STATE_DETAILS_NON_ARCH); TDX documentation says "the meaning of the field may change with Intel TDX module version", where is this field documented? I cannot find any "other guest state" fields in the TDX documentation. Paolo > + if (details.vmxip) > + return 1; > + } > + > + return kvm_emulate_halt_noskip(vcpu);