Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1559318rwi; Wed, 19 Oct 2022 12:12:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4hdzNgD2GauxCXvEc5mO0vlCmC7sckSCrXjWZi2LoFnIPXvuEvnccw2mtB4fHJiBHUpB7g X-Received: by 2002:aa7:9147:0:b0:562:6036:18f3 with SMTP id 7-20020aa79147000000b00562603618f3mr10062749pfi.84.1666206734951; Wed, 19 Oct 2022 12:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666206734; cv=none; d=google.com; s=arc-20160816; b=O2F7PCjCdO2DSbkFoM2YLI3nwPpb/3OvlYUL0KSkQ5QSFoRjRP2wi0cfOyda06iRiW T4afR9PZvtFKlKdWpfQdvGv0iQ30q8DF371cZunx7VYqiqqNKKBpwRUB6469NU5XkHjv pQ7HTGL7MZfoB6teKH7orscZMyJvNbwO6QxJU/tF6dZWxkwuT8WstIts98fE6TMku00h S6+ZhG+u10/2fslPqNepnrcrxMUt6DqwX40jnSLK43/BDJntxv/HlI4cocj9+ux+WjqP 2rJQxlFo+j0tt77SXisDvjJpbbkBa4noCEaHccUq8bNlSALi9KGJjBWOfQP1IV4xCeaO 7SHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VPr6UAOpmN1/gMX0ewomaOCJg5YtZQmOBncflHxMDjk=; b=le40REm7uMyu5jWWAkmxh9Oh+Z5EHMh3IUTxmLpG+9DaX2YioEoKGuv8oVUpnmgVnj Ez2Lkmo6Oq9aRQaLLdlUcCp5V7vAJUyO+Q3jUQc1TRqPPHDVpKPAQnE6PaIq8B++n8T4 K5bavppydGwrBAHuRFZWKuf+e1zs43MYkobyaXuxGe6spT3tjoUYvuftV3ejt/ohOnfR ndCDFRdCkCvr2UcvTlgkCh+EkzwsQat5jLu0h7NMuKbesdI89qg+8U5fkWPWeKeXWOTR Us7uENN/Jueqn2EqQ9I7eDZQ4jXJBQkDXdvnLnVUlMzkVDsJbleOgaVg8ClfSYzitL8Q N4kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LwRPgs44; 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 q9-20020a17090311c900b0017f5ea2e8easi941966plh.357.2022.10.19.12.12.01; Wed, 19 Oct 2022 12:12:14 -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=LwRPgs44; 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 S230053AbiJSSdE (ORCPT + 99 others); Wed, 19 Oct 2022 14:33:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbiJSSdC (ORCPT ); Wed, 19 Oct 2022 14:33:02 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BE181CFF3B for ; Wed, 19 Oct 2022 11:33:00 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id j4so29646713lfk.0 for ; Wed, 19 Oct 2022 11:33:00 -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=15hfDe5nszg8eWoMiDuc0XSs2H1uYx3Qb3NgVwTQVJG68OnSgH/dEX07g8dabaF9hb CINbqddIG71hUv+4lvzZ45V3Jf0SquwJ9C8HuDDuYWpVQIQ5kJtYUPytl6M7twCdqeQ3 tNxyqDur9HcntnEnTKKl0gvAO6ElyI0kz6jHuT0E2fe5KMQOPQhdQYIsXP0Q/JO4f0og G7Ddtx2Bky8q1XYwCRKyJE16TRPonbSgoDaMUHNZV26IpbWVUGzFmG5u+WBsLe9IotWP H1bbcNhH01T7S0bY0nIKk9+5d3bgbk3noJBosKfRnDa0Df0ar+zr4Sfo3WgkJMJmOAiv fDpQ== X-Gm-Message-State: ACrzQf0YsaXTZ/2bnDEjXviX4p9ixD7O0ESRAzjKy2iSsVHJlgFe1n77 KZr9zHBnH0EDvUFKdqce9gYkR0LJ8yEP5GXTvFkLZA== 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" 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=ham 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 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