Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10098383rwl; Wed, 11 Jan 2023 14:34:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXsuD0dJ6VfjZwLmb+GA+bg7q0tMQxumzgFcuM15ofi6n0gqnWd3xfSYaryK3G2TtZEjWx51 X-Received: by 2002:a62:1b58:0:b0:581:4ab0:abcd with SMTP id b85-20020a621b58000000b005814ab0abcdmr3798174pfb.14.1673476494043; Wed, 11 Jan 2023 14:34:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673476494; cv=none; d=google.com; s=arc-20160816; b=Thibn0vXI/wiMweFU8IYpUb9Nck8tg1+MxJ6WiF6tB52JeU+LqC0NPfyZ9Csh/PNcY Nof8L3Xg0cvKZvNZrytHscs6Eu8vrTv/X4++KMtl+TdaEoTz9lxRLJlHsEmVH9a4KjUJ HUzjIBj1+uByLI0Y3u0yWQdW4ZXa8RnX7NtZzI8dOizGS/CsyTkNuQSHEM58O0gz6crE hB1s/4RQafSX0yrg9U5WYwgoTooRdPhKThuLU2PMoG7v60hbX5J5J37pf1xMMnfAAsyP F+uq/6auFOearD/GCL/EngjRW6MGc4sQ0sVVqCQFtYMz7n4Zzl1TMjtfz+ZDmKrhX9/B zudA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VmuBCsBxf7mGeczzGNyI3TdKv9UghiIBbcHCLEfGXdM=; b=lT+4WkZjAv5o+uL6mlq9ho/q7FPP1ZH/7sFWwJgAgamNKh8BkwhPZ/RZWyCwP+vrTm 12Bl30cUDu33CqomcHqpvuUSofZLU/vSEceXq5vOGmrAUZQox7dy7pR3gZ5Z4LueB82H vaMPmKZ4N3a4qoYHisnloEcFuxCFy2kOZ3owHd8+oz+braJJZKgN2Wd9hN6EnJ7bj3A5 lUpt0fC0KvYsZzRF2r2cr3byLH5UGtJcEFz3s+yqc0vjS9MDP8AA+algaWYNwJcPlDH9 DAh2JJjAitMEqgIyKj7fGg7sHYdYIqMlFhBpzoMC1V9DIG1tMNjs97Rvspk63BpePGpA x0Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=KaFTBvuz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j12-20020a056a00234c00b005767cb3a67fsi15832876pfj.270.2023.01.11.14.34.47; Wed, 11 Jan 2023 14:34:54 -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=@google.com header.s=20210112 header.b=KaFTBvuz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230281AbjAKWDP (ORCPT + 50 others); Wed, 11 Jan 2023 17:03:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232477AbjAKWDK (ORCPT ); Wed, 11 Jan 2023 17:03:10 -0500 Received: from mail-vk1-xa2b.google.com (mail-vk1-xa2b.google.com [IPv6:2607:f8b0:4864:20::a2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06CFE13F32 for ; Wed, 11 Jan 2023 14:03:10 -0800 (PST) Received: by mail-vk1-xa2b.google.com with SMTP id i82so7675527vki.8 for ; Wed, 11 Jan 2023 14:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VmuBCsBxf7mGeczzGNyI3TdKv9UghiIBbcHCLEfGXdM=; b=KaFTBvuzzUGYrZ+Ybzzensoen8m4E/m1o7K4b71m0FAGmqXFaMaSDRpu++B6Ok8oEN f3AcgLUCTslQoRgcV0s1D9QvNshpfhIR+qlWY6vwFY1TfMF9YQnfQPliZMfGmRAiprbI pUAcF6HuklZsxetyIsR2eHH/vqwElPE6YbIc1EbrZXi6ioYulQFGj8ttyHhyDZg2vBtq cMclNpu7P4tPWSwrhP9Zjh5lS02JfSBEqc2YWOlY2KpDaZ90HK1u0Jua1HGRTY7+k51P nUwy47oXH5x3JUGxumq4hpvIuGGPUvThPNATphMrf4MTz3ejPeTtio0IY+n1vSzMz3hh oSRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VmuBCsBxf7mGeczzGNyI3TdKv9UghiIBbcHCLEfGXdM=; b=5jkuupOK7NhEuwPmjXZeNWWaBdga+NPyUUQ42+dfks315rYsfXVTsghvcTv6nttcTc 19pFhYQQz6O05WKo/SDncpStIYi9qirKGR2jdAbY+B+U6tO+SUNy8vlRzqEVee4qNAIQ 7zncpCOPIa9yYVf88yqsEDg6WxbkIdtdXjBp9ibEZEXPp/klwfO2AIck528aIoHh+NTl M3jHIp4Indb5Vw3phYmCfNVjJi532uS8h2IBLFlVGHEeGVPBpX3k5W/dhtM3+zjZ63jO +QRCvO3UjzK07b+YaUlQpXFE6DT7kw80VpdJDsfsaxQ/8rP4wzo1HxAiPcZJ/WnRGDuw Hj8A== X-Gm-Message-State: AFqh2krz+5Bgyv3skFz2gQ9eAayM+Dq62aYEX8hF42wdaPZF8z2H5EHw rfaaCLixTLFQc7jeEgy+hmEbtf3JnfQJvIo1SMuvsg== X-Received: by 2002:a1f:aa15:0:b0:3d5:dcb7:5f88 with SMTP id t21-20020a1faa15000000b003d5dcb75f88mr5238304vke.37.1673474588933; Wed, 11 Jan 2023 14:03:08 -0800 (PST) MIME-Version: 1.0 References: <99e5fcf2a7127347816982355fd4141ee1038a54.1667110240.git.isaku.yamahata@intel.com> In-Reply-To: <99e5fcf2a7127347816982355fd4141ee1038a54.1667110240.git.isaku.yamahata@intel.com> From: Erdem Aktas Date: Wed, 11 Jan 2023 14:02:58 -0800 Message-ID: Subject: Re: [PATCH v10 005/108] KVM: TDX: Initialize the TDX module when loading the KVM intel kernel module To: isaku.yamahata@intel.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , Sean Christopherson , Sagi Shahar , David Matlack Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Sat, Oct 29, 2022 at 11:24 PM wrote: > > From: Isaku Yamahata > +int __init tdx_hardware_setup(struct kvm_x86_ops *x86_ops) > +{ > + int r; > + > + if (!enable_ept) { > + pr_warn("Cannot enable TDX with EPT disabled\n"); > + return -EINVAL; > + } > + > + /* MOVDIR64B instruction is needed. */ > + if (!static_cpu_has(X86_FEATURE_MOVDIR64B)) { > + pr_warn("Cannot enable TDX with MOVDIR64B supported "); > + return -ENODEV; > + } > + > + /* TDX requires VMX. */ > + r = vmxon_all(); > + if (!r) > + r = tdx_module_setup(); > + vmxoff_all(); if few CPUs have VMX enabled, this will disable VMX in all of them. Depending on what enabled VMX on those CPUs, would this not cause kernel crashes/problems?