From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91853C4332F for ; Wed, 19 Oct 2022 16:10:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbiJSQKE (ORCPT ); Wed, 19 Oct 2022 12:10:04 -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-Google-Smtp-Source: AMsMyM5J8mv9XBDJfNSTMwrJGznqodpAH+vWLTNt9JpHQACwNEqu56e3wBHUQ6hekV2SylbV5oa2BA== 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: 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.