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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77427C4332F for ; Wed, 19 Oct 2022 16:09:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9F866B0072; Wed, 19 Oct 2022 12:09:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A280E6B0073; Wed, 19 Oct 2022 12:09:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C85B6B0074; Wed, 19 Oct 2022 12:09:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 778616B0072 for ; Wed, 19 Oct 2022 12:09:41 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 40C58AACD8 for ; Wed, 19 Oct 2022 16:09:41 +0000 (UTC) X-FDA: 80038184562.15.E1277E7 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf22.hostedemail.com (Postfix) with ESMTP id CA840C003E for ; Wed, 19 Oct 2022 16:09:40 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id b2so17702693plc.7 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=P/37sqidEWqAiuFxV6j/DZqY8ykEPdp4yAaAR00zqz70daWYsAWO5Hvz0CSpgRhx8b CjqoJ0R84WwnR+ycTVto/aBAOYhwYKWoRH6jCesXYLXDAuj9bsehkwn4GxRSb0bWm6K4 /+OZI02tjBMoXaqBicEVPdLjxdN0NYynYOiK4VyKUj6kRC5e3maIhbAHFDGBc/X16wSK vA+C4IWQcRKgzAXaxH0Yz23Hy0nwwhq+kp10+az11Ri4Krh9CzeT4V2ieo+cbe/nrW1J NIhJJ/8hLazfHYxP5PnMhX+jA/Pva3pAVl2pNGB2G6h/FBEiWeXjaVIDC5VAi+U8DGFD O/qw== X-Gm-Message-State: ACrzQf0R8WPojy1uvdD2aNzUB84nbUS5Ghbfch530w4MvL2zLGWaV/J+ nmn/tQ4WMJxNw+cxB9Lpo3a+5A== 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: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666195780; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ypkvL3yaAxMPxurJS0uFGqCkiFZ+RyzOnuF9leoHMPg=; b=TBrix1U5/hzv3oKXVvCZvRNBUIKOqZ2QabIukRkzmxqBObe2rlH3mfFj0gyWubHYJAmOws cgDvPqb9+ef1HRX/VjxrEJR8YT0jPigG0p34mCh/wCrkiCEXLyeFtGjACvwr7Y7yiVmH6U /T1pKAtufe7ixoFCLiyk6OwH3R8uQ6s= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=h+1KlUYC; spf=pass (imf22.hostedemail.com: domain of seanjc@google.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666195780; a=rsa-sha256; cv=none; b=193qaaairKftpEnd+1cl4CxaCrvhovNJWp13zlTI4IQhiDdoy2EdYLSPZEgWYLQZazFPOZ C7ehTe9ZSsjc4eKGvxQtr45hMa5SN63M6391N6dMH/GzqdivvuZCQ+6ev/vnzOo4zRP2af YIEqD9vjcIJyo30vGhSZqGxBr/UAJdw= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: CA840C003E X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=h+1KlUYC; spf=pass (imf22.hostedemail.com: domain of seanjc@google.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: 1i4m64kozh1dz1cc99kpjppp5wk3u3ks X-HE-Tag: 1666195780-733863 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.