Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2193543rwb; Thu, 15 Dec 2022 21:34:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf5kJKSN+OWcibw/RHt0Om9rxJVLnZSqMYOgJq58H8lDS7K2iFbZHNnScRnoydpK13igKElc X-Received: by 2002:a05:6402:35d1:b0:46c:fabc:5897 with SMTP id z17-20020a05640235d100b0046cfabc5897mr35093251edc.7.1671168863108; Thu, 15 Dec 2022 21:34:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671168863; cv=none; d=google.com; s=arc-20160816; b=Rt7KRB/PWwCumoaLKrSw8C7bw1egE15iELbRkUs6iEMhgSlYymFb22DkSpWmcpE4BB 6GkzzKVMj8/J15IhFeDBqutuHBESxp5dcD3OWmnyuXhVDpyMJBB9d2JTT/FcIGpVj7tk IEe9dj33sQqZAnmLcFwKeRFUDuGN+C2v6tqLQH94eXqi2MTS2LVwQoOhWNj2soWhxY1a FuR1xq956KFQnAHYPOjnlQrg0wmQNuShfOlBQZPmEw5yDPWhVMjCuZbhpNLKiTIgJd39 o8tX0u1idjno+BJ9olar/JLtodLprx0ks8QOXkVHgUOhy4Eyhv3VJgeGFRYJB34Okl9M X/5g== 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=CdHnVY8nb6Yk9Xaeu1Dmkn7tDhOJ1cSSlgeTmWNpY4g=; b=iia4n30g4LQHRm3pVa5IUaVSXMKpIrtdPDur+7QJdbKNgMAuS13U2Uv8J+G8OjIvTO Hpzl5S13Gh8SETYGs/SmkQpQo6ZzAJeezsZKR7543dG2bo8UOYVWeabwmnLG+/EfkrZ3 avnEXZQrT1IuV0cIE9EsoJq/G3QVm0qeYwIQtDLYZsicRfZwXZaOWFFtPGVpPQqf7OWe of/fYWK0sKAnE6UAdLxVPpv7JW9Rz34h0RrKm6x8HzrFMNkUeuXvhBkdqvKQ7SXEZkAX YqrjWiJHwy7zbfn41PhzgCiyJNHvt5KoUohsH2xO22I15DKQ5WDO0cIJ78ja0FCCHVLH /BAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UV5iZlPC; 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 i3-20020a05640242c300b00468eee74e58si2028583edc.273.2022.12.15.21.34.06; Thu, 15 Dec 2022 21:34:23 -0800 (PST) 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=UV5iZlPC; 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 S230051AbiLPDue (ORCPT + 68 others); Thu, 15 Dec 2022 22:50:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiLPDuc (ORCPT ); Thu, 15 Dec 2022 22:50:32 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A649E48760; Thu, 15 Dec 2022 19:50:31 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id q17-20020a17090aa01100b002194cba32e9so4790370pjp.1; Thu, 15 Dec 2022 19:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CdHnVY8nb6Yk9Xaeu1Dmkn7tDhOJ1cSSlgeTmWNpY4g=; b=UV5iZlPC8KUf7JHbTh4dsoHgiF93ceVHZjaIHpuDK6wC8L8vdqPWZfiiFbdGCShCIM gLSBTrwENZ2C+CMkQzo4nAmWHbMWU3PQg1qDtQKFZYmsD1CNiQItSCE1QMa4SP0pAhUT lU1XSamINyoWjjAUJMy1OUIlWrNkZfWbVmzqkElLJIc62er6F+ijQ949mzxLSYN64iR6 P0xd/aVh/nN2+IWx5Km+mAhm18wL9S+sQQQ1ubIWrNaYeFvbRCQp6wEydKhbaN4OoESc dCgShe3Zc8jKViBb1PP99dfTzsTYbwSjfYCLNyQ9zntx8eEhjlSp6cVyzzASaYi38dyB gUMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to: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=CdHnVY8nb6Yk9Xaeu1Dmkn7tDhOJ1cSSlgeTmWNpY4g=; b=oRfCbbC6gWDDPB9WXanO1jTXxlIsCrc9XQSmEMTzFd1UaI21IfD0drdOT3CuNTU5ke tpqUjSzs+xWjIccO7dqsPNZTrQYaYEuY8LsugKILK6evw7a2M60iXnouOEkmBoSeLg4K vcSBbNYh3NNwZdAswrPvMsSjfidbfRRfyYB1idiGG5PfUXpVm2DJP4gJjm9f+zq12xdt uXr33uRtKHP4bdGI6xRTZdyNm5rWutth5pbsBY5GOshlR53e8Pg8x+rUYeliVxaRBROy 8t+WEzP8U0LC1Z61AEAVrSWXDwyrXz1A0FYOTlX4rpa0JW2/rabampoWe1oWzF6j/Pna DHTg== X-Gm-Message-State: ANoB5pnXCCZlPgmWxP+YybQzYqZ6deJZ7BOZthzrL/ivRREipjhbqeUR Hj597WJst833BAAwU0wrdRM= X-Received: by 2002:a17:90a:4681:b0:220:bc30:a19e with SMTP id z1-20020a17090a468100b00220bc30a19emr25005848pjf.32.1671162631104; Thu, 15 Dec 2022 19:50:31 -0800 (PST) Received: from localhost ([192.55.54.55]) by smtp.gmail.com with ESMTPSA id mm8-20020a17090b358800b00218d894fac3sm3965254pjb.3.2022.12.15.19.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 19:50:30 -0800 (PST) Date: Thu, 15 Dec 2022 19:50:29 -0800 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 Subject: Re: [PATCH v10 104/108] KVM: TDX: Silently ignore INIT/SIPI Message-ID: <20221216035029.GD527635@ls.amr.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Wed, Nov 23, 2022 at 11:17:44PM +0800, Binbin Wu wrote: > > diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c > > index 4acba8d8cb27..d776d5d169d0 100644 > > --- a/arch/x86/kvm/vmx/main.c > > +++ b/arch/x86/kvm/vmx/main.c > > @@ -286,6 +286,25 @@ static void vt_deliver_interrupt(struct kvm_lapic *apic, int delivery_mode, > > vmx_deliver_interrupt(apic, delivery_mode, trig_mode, vector); > > } > > +static void vt_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector) > > +{ > > + if (is_td_vcpu(vcpu)) > > + return; > > + > > + kvm_vcpu_deliver_sipi_vector(vcpu, vector); > > +} > > + > > +static void vt_vcpu_deliver_init(struct kvm_vcpu *vcpu) > > +{ > > + if (is_td_vcpu(vcpu)) { > > + /* TDX doesn't support INIT. Ignore INIT event */ > > + vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; > > + return; > > + } > > + > > + kvm_vcpu_deliver_init(vcpu); > > +} > > + > > Is it better to add WARN_ON_ONCE in the above two functions for TD case? No because KVM_SET_VCPU_EVENTS ioctl can trigger those callback. -- Isaku Yamahata