Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1064177pxb; Wed, 6 Apr 2022 07:55:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV5szuJNW3EtQJ1rRiJ+kunKiQpUfe8MPOzpkYK28rCOnCXinHekFx+9zPY2CE6Czgfhz8 X-Received: by 2002:a63:d13:0:b0:381:f043:c627 with SMTP id c19-20020a630d13000000b00381f043c627mr7510251pgl.168.1649256904458; Wed, 06 Apr 2022 07:55:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649256904; cv=none; d=google.com; s=arc-20160816; b=OHcMXsJrERSJAeZtC7vRTtLnIblpnLxGJmM2wiofVxPyjn7xmSBr08FHjLlhFOzm6R xi57CfN6XtNJw2wGe/8P6eXAYGcVCWF24Zh6gsR+PK8misLgmp0oB4C2LcR+AYgAXfTZ lMpQd3w10+4QJ0qls8ZbhKELBLle2u3pBT/b8kVQJ8pl+sQ91SlqAK8xwJvc7hNRyjW2 iFkdU3xMGAQzKR5zSAfah2bGlWWDeA1n6X0SW3nrHBqm9oDXp/9JvUXsNp0jKwHw0rvf KuXIDAgM0LiMx/tbdRRU5TM1k0haP5V1nbdpMfxQDrgjxTU1sjsmgB3hohPCydpv4Wpj +CRQ== 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:dkim-signature; bh=ZveUJKzsoCzkXjLEmVVwtjwhVIlnnTQ1b+zTECXTF/U=; b=hX0KMfvkQbJmY0VCFtFM8QsNw1MvWxjGeOtdsEHPEaW48Pzfg3YUaptPQir3GSLfQJ uiOzGJ+JY54Fjas2DHMlEkQGTsOo8tgqybymZSdtia3r/icGOM1Obrn/31jrWlL6bOFJ EISRI3CqZ52Vm3n9C8C/dhQ9QT9aOMpkXOFdIwEwgLMb/AWkOMNMsPyDvmwyP/SjE4bC EUQxG3DmKaYzIav/H43W7pu4Q7swmEQge+dRLfy/ww5RlECRrRmlfJjEmskCPHBC26IM F4PTc5RKtskJZLe4ZCsAENscrmGbe480uBEbTDOrip7yD54SnP75SBc+og7RXREdJnFf AfRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G5kJ65kb; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i10-20020a63130a000000b00399750cb8a2si3567857pgl.630.2022.04.06.07.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:55:04 -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=@redhat.com header.s=mimecast20190719 header.b=G5kJ65kb; 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=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 C58EC49D657; Wed, 6 Apr 2022 05:39:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349979AbiDEVEj (ORCPT + 99 others); Tue, 5 Apr 2022 17:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1392285AbiDEPgB (ORCPT ); Tue, 5 Apr 2022 11:36:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2E3913D0A for ; Tue, 5 Apr 2022 06:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649166515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZveUJKzsoCzkXjLEmVVwtjwhVIlnnTQ1b+zTECXTF/U=; b=G5kJ65kb7zw/NQQb13mDyCYU13+pExTyZZtoy9vkmSP5K8L/OTjkZ4erldv4N41khJHuNF TSZAPy1u+MdvM7PSuXJYLJWo9Yj5/XK5lY86PYVDk9E3okiCUmfr7Gf2ePb228/9poxHBU AgbVPNQHKqZtTx2/gdH9LZiKLFR7pfM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-1-_WSV99ANOFOfiwbtjLtvrw-1; Tue, 05 Apr 2022 09:48:33 -0400 X-MC-Unique: _WSV99ANOFOfiwbtjLtvrw-1 Received: by mail-wr1-f70.google.com with SMTP id x17-20020adfbb51000000b002060ff71a3bso1360320wrg.22 for ; Tue, 05 Apr 2022 06:48:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ZveUJKzsoCzkXjLEmVVwtjwhVIlnnTQ1b+zTECXTF/U=; b=XIXhNHanNx5LbGnB+W3HckA4/SI5gmfHyiM8eCIFqwGqCBikjOVPqLGtqY6AaFsaNu lSKrklKTK9CAARLaQ8nkHuchoE5z4SMDrEhIxOAoLcPQcVBtFK1HnKPJfBj5Wf1CGjE8 UZcWda0BXl9WAP8k55bItMBiXzc1zxwcJuVmVPn62WyLJeF1V3H24JSWBVVpMkPFCHlT 84jzpxmln3dWbFcZ9rSfqqtXG9dzfh+jAaMm6Ge0FNWSJ+3NhgwCvblNyRrxvqfBNWLb WuhI1UIakNgSomA5c1RshzUKzqnEjq9GK50g2zTbOsPjxY/q6InLQF4ublJwBrqwilgQ g14Q== X-Gm-Message-State: AOAM530iaLoirSoNi7cUGNsdtDj8Hh5my0P9DgI9CbbJMX+oYzjJ9Av4 +OiYtueTnzuOjxWbnVsrhpohF0D6C7cpVFFUyLQ1Eue6VOj24TQ99RBHiOPmwyVadlaZ6kzcsMz qle1oFU5pEsbZvmcglhCTKhfR X-Received: by 2002:a7b:cd13:0:b0:38c:9a08:5c62 with SMTP id f19-20020a7bcd13000000b0038c9a085c62mr3234416wmj.154.1649166512157; Tue, 05 Apr 2022 06:48:32 -0700 (PDT) X-Received: by 2002:a7b:cd13:0:b0:38c:9a08:5c62 with SMTP id f19-20020a7bcd13000000b0038c9a085c62mr3234400wmj.154.1649166511973; Tue, 05 Apr 2022 06:48:31 -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 o19-20020a05600c511300b0038d0d8f67e5sm2275912wms.16.2022.04.05.06.48.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 06:48:30 -0700 (PDT) Message-ID: <5093bff2-bc85-57b9-5f8b-ecb81417409e@redhat.com> Date: Tue, 5 Apr 2022 15:48:29 +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 032/104] KVM: x86/mmu: introduce config for PRIVATE KVM MMU Content-Language: en-US To: Kai Huang , Isaku Yamahata Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson References: <770235e7fed04229b81c334e2477374374cea901.1646422845.git.isaku.yamahata@intel.com> <55fa888b31bae80bf72cbdbdf6f27401ea4ccc5c.camel@intel.com> <20220401015130.GE2084469@ls.amr.corp.intel.com> <9e01bc014df60e215ba17432c06b6854f6dae3f8.camel@intel.com> From: Paolo Bonzini In-Reply-To: <9e01bc014df60e215ba17432c06b6854f6dae3f8.camel@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 4/1/22 04:13, Kai Huang wrote: >> I don't want to use CONFIG_INTEL_TDX_HOST in KVM MMU code. I think the change >> to KVM MMU should be a sort of independent from TDX. But it seems failed based >> on your feedback. > > Why do you need to use any config? As I said majority of your changes to MMU > are not under any config. But I'll leave this to maintainer/reviewers. There are few uses, but the effect should be pretty large, because the config symbol replaces variable accesses with constants: +static inline gfn_t kvm_gfn_stolen_mask(struct kvm *kvm) +{ +#ifdef CONFIG_KVM_MMU_PRIVATE + return kvm->arch.gfn_shared_mask; +#else + return 0; +#endif +} Please keep it. Paolo