Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1360942rwi; Wed, 19 Oct 2022 09:38:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4W3a7IDDER4kBWwWiHxZducEkVWtX5rDmLPotWLom1W1LvlxcgBb+xiNg/Ss1ivePdd17l X-Received: by 2002:a65:4585:0:b0:464:4538:c0bc with SMTP id o5-20020a654585000000b004644538c0bcmr8023051pgq.455.1666197527170; Wed, 19 Oct 2022 09:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666197527; cv=none; d=google.com; s=arc-20160816; b=I9KdKrUQp3q03ySh/iO6kAbD3mGKIU8cYrEtGOyBgPVRivF6Jzce41mYVAPGuI6/Za JOOl/FoQmi70J7DagWt9jEoQf4wr/JGpBTt+0v8rg1gjHK6j0LsYTxkxhYm7TBoKVkxE 3QVCOXzaPYkJZ4fF+OB8z5trqnA+LKQ4i5rE2WBxNN9eTQsGau0GtNLmwniQ9mFKhvoA jaaGWgcICz8qa20hWzT/79CmpiqJqpHpwGES+cX0SCSCvkNRhRBUbffulLYTzMfYl3ym vBG8OndBJyBwKDV/AcAzwrE5/hsYYOGtdMkA1Uu1oClYgHmudc1bNgC0nIfGfOdvBpRq YHHA== 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=ypkvL3yaAxMPxurJS0uFGqCkiFZ+RyzOnuF9leoHMPg=; b=NmImG1AXkTh/LOCq5tU2oJ73pec66flXb8wyNp/anjj1GZifUp3nYATgm7JZE8XKyn 7r8XSgYArrLsiaUBABZE/J1b6bLAKZBd1QSoYFEQamiBstmnOV1qf7ByVUhI1GcPwcfh iwIVH8aO6kg1hlt6M2DII4F4vuOFjRDIYwJxVYWcQUnslHS6XLhMKLkcHGVp+8EQwRSM thd3hpQv/6sYxvGDaooRTKNtGkTVvqouUoYLD+iHva0k12rfIcKngydPvqT7dNxUANaR T1mrFR6AAHyYLIJWiQPp2jXQ6yBU0wz8MPtvxKD/5vZ7Y5hvvHjaYI2wLhSuCrWMkh2z aU8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=h+1KlUYC; 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 h2-20020a056a00230200b005429324b543si19809452pfh.360.2022.10.19.09.38.32; Wed, 19 Oct 2022 09:38:47 -0700 (PDT) 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=h+1KlUYC; 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 S230331AbiJSQKD (ORCPT + 99 others); Wed, 19 Oct 2022 12:10:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbiJSQJ4 (ORCPT ); Wed, 19 Oct 2022 12:09:56 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3DB554CAF for ; Wed, 19 Oct 2022 09:09:40 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id u6so195739plq.12 for ; Wed, 19 Oct 2022 09:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.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=ypkvL3yaAxMPxurJS0uFGqCkiFZ+RyzOnuF9leoHMPg=; b=h+1KlUYCjsRVvRZom/eZaqVVZPwLNuYTzVtc/yfchg/FVn3f5I4RUVC9fB77Ol9VGf HgCK8mY6Nv+Xq72Fx81Po6YrtpzWxQ53rseaDQp3xO+NUuzg/Q/QlKyJ26MY8whFSFB9 Yz/rDhSdBT3TPLIrEG1lXL4xKfi0GT6oeGR8n8SqA7rIg+ZhIQiSL6k7+pVB5ukZ64kF kVFFiLi2o9zlE+Zz99wb/PPKOZvfE8v4DtNHoGGtu9prsA4BZL7zqk0frRY/JGZwwNq7 g2L2w4CVrM6EQ0r7EXNj734PT3xgw2/P2uRLexg59HxYszjKm2su2n+onT/oKpMmOXgw qJ9Q== 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=ypkvL3yaAxMPxurJS0uFGqCkiFZ+RyzOnuF9leoHMPg=; b=Czd3EGJzSv9hcGTqWFNtdlBhKkUU9ADRs+aNZwgmBKH7lBlUJrndpZXw/26H5qxKib 6U8NTXxT/jmz/VCeNgrEpJmLaGhsb4zttdH9cbnH+16I/WpHGMVssd102izKE4MLP65l iS2S0W410nxR8xaHkq5u8BBNr6VtwGFht12XLKvVrGJ/Xh/5XFUSyiQE31Gqy2pRF4s9 l/fHE8j6/fUKQIvqC/UyunTvE40W5OT7fFilS5EpPDEpYN4xBACmenDBENB0Yb1h6Bus nEWsb1NyF2/e9hazUZTk890CNL8O+mnWmgIUWrhyzYmAUSTCKJzNZBE4qkZQZvzsKuNF U0FQ== X-Gm-Message-State: ACrzQf3iwUmhVgXiFIW9aE+fD4nWa76lhNfzIymEzxQqmfzebsfBp9jU +Du5oXWBd75YRa5C8jPrme+mRA== X-Received: by 2002:a17:903:248b:b0:17d:ea45:d76a with SMTP id p11-20020a170903248b00b0017dea45d76amr9440949plw.97.1666195779474; Wed, 19 Oct 2022 09:09:39 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id d13-20020aa797ad000000b00553d573222fsm11558997pfq.199.2022.10.19.09.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 09:09:38 -0700 (PDT) Date: Wed, 19 Oct 2022 16:09:35 +0000 From: Sean Christopherson To: Fuad Tabba Cc: Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , wei.w.wang@intel.com Subject: Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions Message-ID: References: <20220915142913.2213336-1-chao.p.peng@linux.intel.com> <20220915142913.2213336-6-chao.p.peng@linux.intel.com> <20221012023516.GA3218049@chaop.bj.intel.com> <20221019132308.GA3496045@chaop.bj.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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=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 Wed, Oct 19, 2022, Fuad Tabba wrote: > > > > This sounds good. Thank you. > > > > > > I like the idea of a separate Kconfig, e.g. CONFIG_KVM_GENERIC_PRIVATE_MEM or > > > something. I highly doubt there will be any non-x86 users for multiple years, > > > if ever, but it would allow testing the private memory stuff on ARM (and any other > > > non-x86 arch) without needing full pKVM support and with only minor KVM > > > modifications, e.g. the x86 support[*] to test UPM without TDX is shaping up to be > > > trivial. > > > > CONFIG_KVM_GENERIC_PRIVATE_MEM looks good to me. > > That sounds good to me, and just keeping the xarray isn't really an > issue for pKVM. The xarray won't exist for pKVM if the #ifdefs in this patch are changed from CONFIG_HAVE_KVM_PRIVATE_MEM => CONFIG_KVM_GENERIC_PRIVATE_MEM. > We could end up using it instead of some of the other > structures we use for tracking. I don't think pKVM should hijack the xarray for other purposes. At best, it will be confusing, at worst we'll end up with a mess if ARM ever supports the "generic" implementation.