Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp11577pxh; Thu, 7 Apr 2022 21:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxMIhrwxQHGsbXJec1zEFg1TGuEhnxI2VeT0aAs2as4DF+NdgidBtiToT6jk6LAMfA9R04 X-Received: by 2002:a17:90a:f48b:b0:1cb:2780:62a8 with SMTP id bx11-20020a17090af48b00b001cb278062a8mr5061803pjb.138.1649390926894; Thu, 07 Apr 2022 21:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649390926; cv=none; d=google.com; s=arc-20160816; b=qFC3MaoNtKBvnCRWJQy8NkX58ltfwvhYg+6W8egKSqrC0b1JF+HnVmv0TU/DmnPab9 0bp9brwOKDsE00uxRgxYPPYIib6mzEzOLrhPwpFrMiNWeOsSGWjkI9kp/2gSPLMspTJz aApmbxiBqigsfu6MaAibP4LQR2xWIdK25C6AXUJ0Y5knjKp6GrABFuNJAq3zpg+HZNIh LcRXrjfX4nTSE///Pl3Q4vSHXaduHHfRc+82QK81JoQqgPdVL8n2tT5l1iI/kagOSvKW exkdtnOM5rLaWDiBUIA9q2uUg0TTkPEMrB/OW6nhST0q09dpq7OEZevPo6GJFY17aYKd aElQ== 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=dw+ROn8RvBkqEEh4rGoMJ1WVteSRDkuc1/T16Z5qZMc=; b=kQKXNcLcVGNBnkL8VS8N8HETlW8ZPTVy1Sc4ld6ruvfYyh+SebA1ynrfkbqYh2xi6W y19N4PTb2dRaJUrhVcGRHeaT7RDi4OgttZuf/VQlDkunqbz+7x7UO4g9JVNs9rdhriN2 WUh7FIUzcMqi3CJi8BLMrrjubVBs/HI3jGCq/b7roqBiuXYjtyLJSi2txYts8eqjozcE xX3NORupONgTrP7KdFMVIR1txKDyxdRQoOW+OWhK0m+R+DfaWvc02w4KLqRMk2KWrMW5 5H+adJFg5Gl1qx7terB431ahOCV9Y8Rr6AVx+HGIb1bS29QODfH4/dQicCkhfH3Akv0G TByw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EeBrjzYK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a38-20020a056a001d2600b004fe50440a05si6905309pfx.331.2022.04.07.21.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 21:08:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EeBrjzYK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7C201D7D97; Thu, 7 Apr 2022 20:34:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231510AbiDHDgF (ORCPT + 99 others); Thu, 7 Apr 2022 23:36:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbiDHDgD (ORCPT ); Thu, 7 Apr 2022 23:36:03 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FBB41D2B47; Thu, 7 Apr 2022 20:34:00 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id q142so6658799pgq.9; Thu, 07 Apr 2022 20:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=dw+ROn8RvBkqEEh4rGoMJ1WVteSRDkuc1/T16Z5qZMc=; b=EeBrjzYK8SkX1OqjP+i4bvgZKa+egv6bbbX6Xseqd75gu8/cTyTmEKI66pcq42X4Tt jUu+tdejhl+pgRUDFf3ekJue/654i8tzbQvbIqOElao4jnOElmCskBymalqtkaTdS7td 4B41UNZxOQSsBUXzZI7JAuypNaXHFhb90Int7OPOhfDVDz7wMoiEOiUf8ka6R2+Qk7H0 2SHBCSD0e181CRTA+6Ww96XYGQD6xsDEiQ/BlD4kvrq4ITL/TcB1KFDGKNft7l/ycYcC l666RQJjkeA7+bKN3J4WOGxeH8isiZMHyGn8NoU+Am/JyeLwRLmzOppBIF6BOofCi9mi IqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=dw+ROn8RvBkqEEh4rGoMJ1WVteSRDkuc1/T16Z5qZMc=; b=mJF17z/z7me98J0N1Piupk6WPYhieZxg7exRZwf8Y1nT5jcHiBPslDK3t7L3gBZRlv g4mLYYKm9XNh4TF4mxtn4TPEr1tYL0kMv9Nf3TnewmqOhRME5ArucHNXJkONCtdzn80Z HT50FuVZXOrT2RwBRBWWrhXNcc6vviRa0aLFYGxM9LCMDrXizj5fkGMijBwSgxU0r27H yoQfgXfZb/UE9hi/0RxB7/eiXuD4MBvfM/+kzMg3mZwHhiH74dZSqNusupijoMTY/hT1 3zCHgGwXBhs2L8LQ/y/HKxYPOT9SOq+gZW3YRaLfZJRI/RQaSFPBVnAMphfyBDhZPqAF YBfw== X-Gm-Message-State: AOAM531Y/eV58Ja8e7DILfILX1GTcKqETKxfheeq0yqXMQaOA2V32EC5 jC2Jfmior7DPo2sA7iMuQjk= X-Received: by 2002:a63:f24c:0:b0:383:c279:e662 with SMTP id d12-20020a63f24c000000b00383c279e662mr13907253pgk.303.1649388839948; Thu, 07 Apr 2022 20:33:59 -0700 (PDT) Received: from localhost ([192.55.54.52]) by smtp.gmail.com with ESMTPSA id r10-20020a17090a454a00b001c96a912aa0sm10618624pjm.3.2022.04.07.20.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 20:33:59 -0700 (PDT) Date: Thu, 7 Apr 2022 20:33:57 -0700 From: Isaku Yamahata To: Kai Huang Cc: Xiaoyao Li , Paolo Bonzini , isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson Subject: Re: [RFC PATCH v5 027/104] KVM: TDX: initialize VM with TDX specific parameters Message-ID: <20220408033357.GF2864606@ls.amr.corp.intel.com> References: <34d773c8d32c8d38033aae7e0fee572d757e242c.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <34d773c8d32c8d38033aae7e0fee572d757e242c.camel@intel.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Apr 07, 2022 at 01:51:38PM +1200, Kai Huang wrote: > On Thu, 2022-04-07 at 09:29 +0800, Xiaoyao Li wrote: > > On 4/5/2022 8:58 PM, Paolo Bonzini wrote: > > > On 3/4/22 20:48, isaku.yamahata@intel.com wrote: > > > > +    td_params->attributes = init_vm->attributes; > > > > +    if (td_params->attributes & TDX_TD_ATTRIBUTE_PERFMON) { > > > > +        pr_warn("TD doesn't support perfmon. KVM needs to save/restore " > > > > +            "host perf registers properly.\n"); > > > > +        return -EOPNOTSUPP; > > > > +    } > > > > > > Why does KVM have to hardcode this (and LBR/AMX below)?  Is the level of > > > hardware support available from tdx_caps, for example through the CPUID > > > configs (0xA for this one, 0xD for LBR and AMX)? > > > > It's wrong code. PMU is allowed. > > > > AMX and LBR are disallowed because and the time we wrote the codes they > > are not supported by KVM. Now AMX should be allowed, but (arch-)LBR > > should be still blocked until KVM merges arch-LBR support. > > I think Isaku's idea is we don't support them in the first submission? > > If so as I suggested, we should add a TODO in comment.. Sure, will add a TODO comment. -- Isaku Yamahata