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 49BE6C4332F for ; Wed, 19 Oct 2022 18:33:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E059C6B0073; Wed, 19 Oct 2022 14:33:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB5CA6B0074; Wed, 19 Oct 2022 14:33:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7F816B0075; Wed, 19 Oct 2022 14:33:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B76E76B0073 for ; Wed, 19 Oct 2022 14:33:00 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 81844C04D2 for ; Wed, 19 Oct 2022 18:33:00 +0000 (UTC) X-FDA: 80038545720.26.6E6A7E6 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by imf21.hostedemail.com (Postfix) with ESMTP id BE0A61C002B for ; Wed, 19 Oct 2022 18:32:59 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id o12so21126266lfq.9 for ; Wed, 19 Oct 2022 11:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VPr6UAOpmN1/gMX0ewomaOCJg5YtZQmOBncflHxMDjk=; b=LwRPgs44Xx9fZBCWVguQMsygec+a76lxS9ASG3VWi6VBR4o+JOMKkdn5tTnapNhNbx FCagxAT3CfEM6YSuiTVMbPHaJojgG9FhVAFnQbxsBultlVUY0pF/BJ7Pb1rCsoLbQEMZ Tsz/eakulZFZMoaUwgMl+Q1Q2Mo6Ja/eO1XGRRJI1TLh6z4IE3uaaC2a1iSmaS0U4Sg7 StbFJsC36uGNihltZfZ/naEuTHBMd0aKRn0MseX2AD4OY2VEwCn3xL3Np44L+mr8bSRa xewHLuoL2hqyU3VemdfwUsM41M+NZMYII6+iUpJITWhnfKF5ZBr0cRMrYzrFp5Hl4kbC lg5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VPr6UAOpmN1/gMX0ewomaOCJg5YtZQmOBncflHxMDjk=; b=XFOUnbCZ7KqgFl0PxRMpW4nE8ZY17EWmzkmuwsEn/lT7r57XGbSHCnHwlLg9zWk3sY HmxK1SI1PFlTHy+jVHl97B1BONjltHqIWb2zXwiK81a0WqiNk0z5Xf1NIS83i8XJUt08 kkpyI1+8np+Ei+k92OTyjFl+4PNR7yZnrMd7xEFqoYYmvl+amfFrZ3YjSbaLhHweAVcq oOlQxqd7Vl6utVm8s5kbgSNNDAHVqdlBpJ7gVF+LGmp8aATPt47dsTUtWEIZJLuT2H7U +A4nfhPz72gcGhOtBZad1qfokprxs9OjDdLPLHnJ+MPak4OTF3HyYMiaLxUDD1IGZumS oqSA== X-Gm-Message-State: ACrzQf1gH+672n5qWu+PWT1kFOiRFd9F2Cp+ktxZxBDxgOLrzaztuGcA twlfeFm+cET4bzAmV3VJVnYG6OceGf2l1r4hGNJR3Q== X-Google-Smtp-Source: AMsMyM4EBV5NPiqUSsGoH76d60Oj4XtTNKzmBM3XB8zcFOXHmexalPNeyd2MnHJenC/4Cf4QA3Wt+/yC+VCqwQatWHo= X-Received: by 2002:a05:6512:3119:b0:4a2:d749:ff82 with SMTP id n25-20020a056512311900b004a2d749ff82mr3531001lfb.637.1666204378020; Wed, 19 Oct 2022 11:32:58 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Fuad Tabba Date: Wed, 19 Oct 2022 19:32:21 +0100 Message-ID: Subject: Re: [PATCH v8 5/8] KVM: Register/unregister the guest private memory regions To: Sean Christopherson 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 Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666204379; 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=VPr6UAOpmN1/gMX0ewomaOCJg5YtZQmOBncflHxMDjk=; b=aMzKtP2ZDkXsk7931b+UX5YOMJbXoylz0haGkZJU9nBgw5Q0CM/COssvTsjr+cC9r2bExk rOtQc0qtMOQj9KNyLLW0L7aWanSbLwCnPwaLwe3z+uF8pMOl+nLSBEbHcvyUbUIDVD5J30 OaFVlye8unTndG8FCjS57Qe6NFQGQho= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=LwRPgs44; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of tabba@google.com designates 209.85.167.42 as permitted sender) smtp.mailfrom=tabba@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666204379; a=rsa-sha256; cv=none; b=efC/wQctv6mEB901VWQ12QNZj8raOdz+BXYCSWwbNNqQ03y1aUXv7XHTdP2jyXLocwWHcw U36a5ZWrgqaMjwrVfQ1pCKdAwppQV71vGFQgwwE1OGq/S9pTL3dS6NF/69gjN32PCXgMTf DU7BygHd8mN4rfOFEjl7xpSmYMJVkcY= Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=LwRPgs44; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of tabba@google.com designates 209.85.167.42 as permitted sender) smtp.mailfrom=tabba@google.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: BE0A61C002B X-Rspam-User: X-Stat-Signature: kciaxk6b5rzqjpdrcus5z8st58f4tucp X-HE-Tag: 1666204379-508362 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 at 5:09 PM Sean Christopherson wrote: > > 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. Definitely wasn't referring to hijacking it for other purposes, which is the main reason I wanted to clarify the documentation and the naming of private_fd. Anyway, I'm glad to see that we're in agreement. Once I've tightened the screws, I'll share the pKVM port as an RFC as well. Cheers, /fuad