Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp996436pxb; Wed, 6 Apr 2022 06:18:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz12c8nVrWRI0UkuBYgEY/bPefw1VOHgKqLqjQvHx2me7awcA29Fl1RcJiOCAgBwkk9xPDY X-Received: by 2002:a63:af4b:0:b0:373:a2a1:bf9a with SMTP id s11-20020a63af4b000000b00373a2a1bf9amr7158583pgo.369.1649251139355; Wed, 06 Apr 2022 06:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251139; cv=none; d=google.com; s=arc-20160816; b=o93Iexz0NvOWegWUQ+tlVtgtCn9IAE09qBwrsgjyFfTY8yFysqtvuY3VbvKQKmaL4q 3NcB5W7+tOaZql4reE/D66grb+Zn/d0nmKfvk4Xps2/Te22OQxVpzcOeiokRPRcNGvWG mpnrGsJr1YL6Kzr+tv+O4YIjfQJBb5iTNcOm4dVjlGMt16zUcGW31oOTdERalpSmUsFq zR/MWAv7+yXxSb3V4hORNYxz9C7Tma34CTz7BpC+x/VFzgLINZwn/LzZqdIbER9/c5Vg 36439FUXlNxwJ6yb0budUJHLuONzIUc/2zx1YfMy6zvJ9WQ0qu8aYXLcWbHXnRoEVcWv 4DxQ== 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:sender:dkim-signature; bh=A0FjBEpfdUc2aMXGxH1WIchkePURSO+P+PD9Wm9NGP0=; b=TJ/oFFA/i64Wiyo4SSVpHeQexTaG8U0vy7EPuihJDT1slAd7dbqCbSGz3MdrflD8Oc hX3SIR5+3KbyB1GXGh6BtdWoxIPhNy4MQMO1pDM9huRessOKVDso7dB70XWAle9z0o6X SpK5iYKnLIL2DotZ4QGSv/9fpycug0A/RVaB4Z4/+6FggXDqyBi1OgSKaaMuNu/XcGbi b8/b2S5YwaNjK/Ixp6DNa2Y5v2vU0jZijISEzBFcdqtv7kOPQJCWPvmyadq5m+j3Rsnr 3DmNRBE8H3rRdWzFIJcOg7Ewl7ukg8tjsHRXJdZpH9h8Wi9VVC0HvZ1+2sIVilEjEpUe qE/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=de+iQACJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j22-20020a056a00235600b004fa3a8dff57si17826771pfj.14.2022.04.06.06.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=de+iQACJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 785015A5FE4; Wed, 6 Apr 2022 03:57:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1456500AbiDEWqE (ORCPT + 99 others); Tue, 5 Apr 2022 18:46:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457467AbiDEQDQ (ORCPT ); Tue, 5 Apr 2022 12:03:16 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CCB73B295; Tue, 5 Apr 2022 08:48:57 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id p26-20020a05600c1d9a00b0038ccbff1951so1497822wms.1; Tue, 05 Apr 2022 08:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=A0FjBEpfdUc2aMXGxH1WIchkePURSO+P+PD9Wm9NGP0=; b=de+iQACJDntQIFyVxDxW4OrrQwlo2Zxp5d8eJLvzPHLzA1KwtwhbnT+AeX8F/vuAMb j+xXSO5fTCnXuBxXlckCplXKHUyx2ysLrYClJJhuveU++JdqQTh/N/PxSIMYMBFWjVys 3/rG49+/l85lGHJt9RUBZ0WgUs1hk/OSjwYvgBOY+U1HI4Pxq5xr1G8ekWeDFVAWl5U3 dNCmy7j3DObCw4y7RgevyioB4XBRhZkerg2aLSLPgSN2HyF01a+SJKHsGIrAEXTgoMH+ Pg/D0Y5b8skQuuGBcE5bkSIomGh0bL/rJ5ZR9BX+duwyIN1eZf0nJtNhhzKpo/424zAw sEmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=A0FjBEpfdUc2aMXGxH1WIchkePURSO+P+PD9Wm9NGP0=; b=G7zjliX79bkSMGG1oU773ELhoDFSfuo9MZKPZkBcbmD1FhTKycUNUwc843beOxIFvb wGxSjuFSEsTMyIo8OPGd/aO269uRkgp2ksK+eT0OAP+lm6Q90gdpIbx1sMtxsIq3gO8z bGryGOtCMLyQnrL32xuMoE6lyybn4+HOVxnH/fQ3hIh07zmZgMQ2UQMnrLnfZcK2f8xm yp6Hbr7+RDcycFReCsCevglGJg5OX10w7jsUo4786b9c+wieQgqo4PfKPOBVxwi2OsaD RUUb1UT2GCV/qjhw1ZQ3FxRUu90M3+w6W2cF59WWNlFJLU/2B/bmdskP/O/o0iwa9l/P nPIA== X-Gm-Message-State: AOAM531B8p15pnRnh8fu9/90E24y6rbNWC+EEiNM/JvqErHmSfklK9mG PjeHxFNfQqh4LYpbng32070= X-Received: by 2002:a05:600c:4f43:b0:38c:b270:f9af with SMTP id m3-20020a05600c4f4300b0038cb270f9afmr3761818wmq.36.1649173735827; Tue, 05 Apr 2022 08:48:55 -0700 (PDT) Received: from [10.32.181.87] (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.googlemail.com with ESMTPSA id a11-20020a056000188b00b00204109f7826sm14041183wri.28.2022.04.05.08.48.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 08:48:55 -0700 (PDT) Sender: Paolo Bonzini Message-ID: Date: Tue, 5 Apr 2022 17:48:54 +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 101/104] KVM: TDX: Silently ignore INIT/SIPI 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 , Tom Lendacky References: From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_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: > + if (kvm_init_sipi_unsupported(vcpu->kvm)) > + /* > + * TDX doesn't support INIT. Ignore INIT event. In the > + * case of SIPI, the callback of > + * vcpu_deliver_sipi_vector ignores it. > + */ > vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; > - else > - vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED; > + else { > + kvm_vcpu_reset(vcpu, true); > + if (kvm_vcpu_is_bsp(apic->vcpu)) > + vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; > + else > + vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED; > + } Should you check vcpu->arch.guest_state_protected instead of special-casing TDX? KVM_APIC_INIT is not valid for SEV-ES either, if I remember correctly. Paolo