Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2190541pxb; Wed, 9 Feb 2022 12:50:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhEXOJabGdZ/FJuitU8KUiCdQrNf2yWchi98spUAAqZzhRb6xHoU2aNPDcveBooyzL7vsa X-Received: by 2002:a17:902:c94a:: with SMTP id i10mr3205504pla.137.1644439819985; Wed, 09 Feb 2022 12:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644439819; cv=none; d=google.com; s=arc-20160816; b=v9ltAqDxL9pnE+0Rhkp0cWB31drwg9UGfNselbceJCHVnDGVq3bDoLeoDYLcBDyJVg QwkmnEpf5BueotbN77OCjIZs28AzAwz/q+5vEPVHQMv2ftZB/v0tht3sp1lvXP5A798O f7zUgh72AMh56GrwPiDitPgGePNc0pO92ttIt0c5IS2/SNMsk4+2uEICx4dokyGYptTq dz1gb4Zm0zfb+6vg0N1DutCtTCTj8kIK3uqFXodi5198iA213r8KxuY32UYk9nMdxQ6b s9HF3+Il3q7vHcQ19FQj6HGwqMehfdewIOlrVHJ56PKLbimAtpej1oPEMIwDq5iV6bIO bsig== 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=V2Zrre00TNTEedxC/ZG0lSRvO9PMNVjhgf6zFope9rg=; b=Df1sCbrdMqzUwVaha0lRaCC0tZ6xwrOtibxJ9dNumeThADhtxx/FKAYWXvGNxVUXrv SgJdo2JKExenjDGcj6y0O8DTGLGhiFoOoN0AlaIZpRdSUdg65XyAwKmlyO+OkbtckhuG 6Bk0LhbjaDzSrHEB3fRxB4LC+LnEuLGW28pqQr7T4ErNvBPcX6uxM7z0zQaBiHgm+eqg LnNM5ZJUdKd4cnbd3t1exJ5WhQk4ELEMEBq9jCpm/XRsNW+I48lMScNYlFoS7Wihjbau j3YIeadfpYmZy8WQIHLdEJL7PbLZgAKTWbFkLjm4AfRyRSNTLdOClcDle1CioUJ/0+Uu nArA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=OSs6kNg2; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x190si141710pgd.158.2022.02.09.12.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 12:50:19 -0800 (PST) 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=@google.com header.s=20210112 header.b=OSs6kNg2; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D47DBE05BA42; Wed, 9 Feb 2022 12:13:13 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231410AbiBIUIG (ORCPT + 99 others); Wed, 9 Feb 2022 15:08:06 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:35790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbiBIUH4 (ORCPT ); Wed, 9 Feb 2022 15:07:56 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58A5FE079D0C for ; Wed, 9 Feb 2022 12:07:57 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id v5-20020a17090a4ec500b001b8b702df57so6241397pjl.2 for ; Wed, 09 Feb 2022 12:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V2Zrre00TNTEedxC/ZG0lSRvO9PMNVjhgf6zFope9rg=; b=OSs6kNg2PSSA7aVcIkUpDfbe+Qg5Cezsu9BBK4ruy1EEvba5x35rMDkGALUUeHvQu4 0j7Nay1LsagRugHsqNCRJBJp0u97bnDfw1Vxg/iXKnf/3SxGTEBBAkcEKgfTE9AKHE1L Y2wj4NnmpJvWJLY0UyhkNyrzxqYDeYYstEuV4tAX6H0gfrWUgMkqL1F8bowFYXKLyh86 AQhbcs9E0GlP5ueJdVL/Uj8pqcDBz0ZnWtU3F3eXCCCE/llFm7U5AEZD9UymboV62msZ nmm6WBHal3C58wvY4W8IMr+pYTqJOMZ5Pp7rgZdMdKxmOHDQzvV7rIFo1qn0xpL+5jR0 kVtg== 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:in-reply-to; bh=V2Zrre00TNTEedxC/ZG0lSRvO9PMNVjhgf6zFope9rg=; b=TYSW/9LNdq+hc0IVqO+iGHGOoSwRZp8HljlKoxHe+iJUKdoQe0kwP0S8MiyfFJFBt9 Rd2uL2iBO1BnFvv9iZw5n+h+u93jEGgxsoihBnNU4Qxoe5TcEfvuVGN8xjAEboKDzMcb h6gTmLa4oWNxnJXDE20NJJeAVTGmVdR/G9A+fD+qFVfpQgmMKnymvfxn2njnWMxhOomu XiqPBoF4Wp1zt5rwLHt/npaSIzUDMT3c7/Rd0lCPg8oIL6iErNswHMAdlB6eA4RXCVCP SNYD3/fgfRGKKIjAO5TpF6pbYyJLjh39K8sFDQCytaRIpIrO2KVniRf5FPkzwsDt65kn /cQA== X-Gm-Message-State: AOAM5330UHQe5sRZX83Hq4HITdM1+0cAR/JbjcRuvWrw0puYr5TgnGWl hZZyUVq8YOxaYKKr9uc7NjYRoA== X-Received: by 2002:a17:902:e74e:: with SMTP id p14mr3838573plf.95.1644437276682; Wed, 09 Feb 2022 12:07:56 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id kk17sm7374060pjb.21.2022.02.09.12.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 12:07:56 -0800 (PST) Date: Wed, 9 Feb 2022 20:07:52 +0000 From: Sean Christopherson To: Borislav Petkov Cc: Kai Huang , "Kirill A. Shutemov" , tglx@linutronix.de, mingo@redhat.com, dave.hansen@intel.com, luto@kernel.org, peterz@infradead.org, sathyanarayanan.kuppuswamy@linux.intel.com, aarcange@redhat.com, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, jgross@suse.com, jmattson@google.com, joro@8bytes.org, jpoimboe@redhat.com, knsathya@kernel.org, pbonzini@redhat.com, sdeep@vmware.com, tony.luck@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2 00/29] TDX Guest: TDX core support Message-ID: References: <20220124150215.36893-1-kirill.shutemov@linux.intel.com> <20220209235613.652f5720cd196331d7a220ec@intel.com> <20220210003033.e57c2925b69bab5cfabf7292@intel.com> <20220210004831.03dea501738bee060003d040@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 Wed, Feb 09, 2022, Borislav Petkov wrote: > On Wed, Feb 09, 2022 at 04:50:08PM +0000, Sean Christopherson wrote: > > An alternative idea would be to mirror what generic KVM does (virt/kvm/), and do: > > > > arch/x86/coco/ > > arch/x86/virt/<"generic" x86 host virtualization stuff> > > arch/x86/virt/coco/ > > arch/x86/virt/kvm/ > > > > Though I can already hear the stable trees and downstream kernels crying out in > > horror at moving arch/x86/kvm :-) > > Hmmm, so I am still thinking about guest-only when we're talking about > arch/x86/coco/. > > Lemme look at the other virt things: > > the kvm host virt stuff is in: > > arch/x86/kvm/ > > (btw, this is where the SEV host stuff is: arch/x86/kvm/svm/sev.c) > > arch/x86/hyperv/ - looks like hyperv guest stuff > > arch/x86/xen/ - xen guest stuff > > arch/x86/kernel/cpu/vmware.c - vmware guest stuff > > arch/x86/kernel/cpu/acrn.c - Acorn guest stuff > > So we have a real mess. :-( Don't forget :-) arch/x86/kernel/kvm.c - KVM guest stuff > Not surprised though. So that last thing you're suggesting kinda makes > sense but lemme tweak it a bit: > > arch/x86/coco/ > arch/x86/virt/<"generic" x86 host virtualization stuff> > arch/x86/virt/tdx/ - no need for the "coco" thing - TDX is nothing but coco. TDX host > stuff > > arch/x86/virt/sev/ - ditto > > and we'll keep arch/x86/kvm because of previous precedents with other > things I've enumerated above. > > Hmmm? No objection to omitting "coco". Though what about using "vmx" and "svm" instead of "tdx" and "sev". We lose the more explicit tie to coco, but it would mirror the sub-directories in arch/x86/kvm/ and would avoid a mess in the scenario where tdx or sev needs to share code with the non-coco side, e.g. I'm guessing TDX will need to do VMXON. arch/x86/virt/vmx/ tdx.c vmx.c arch/x86/virt/svm/ sev.c sev-es.c sev-snp.c svm.c