Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp729619pxb; Thu, 21 Oct 2021 08:24:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzryCDNmaQldYmWT9Oix2TAe/t391hH1FoZctDA2Z7WLuhgzYHPIMPb7BwAv1eenxCT6fK X-Received: by 2002:a17:90b:30e:: with SMTP id ay14mr48602pjb.135.1634829866303; Thu, 21 Oct 2021 08:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634829866; cv=none; d=google.com; s=arc-20160816; b=Hwuww5iEwugoObo8OYXP8WzCCMWU7eEThovCgedn+R/aIMoURktQAA36T3yND4e/p2 tT8mRdZRvGWzNiabeq/yLmp5Sh0BYhNTXtZZrwzHPieu1KvN7ridD8VsJwH+/ztrrLu6 5ofzayeJHGzV01lBFVQ4eD2rUXpaaxOEGKUq0bvbf0PeiJkmlvH2by7fT/t3uPLz2p1I oe2RY+DpdPwTv1pSPFOWVaTFXz9trZKPiTM0pB5aWGnom/ms3wiPtkzsCxVYs29T6M8Y aiT4es4hO5NpFU4AIzKIWu0J1w27on0zA5pyqsCvWfnP4wNK6bBx4ecJjSK10VKoqvii el4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xi3Exzq4O8MBJAFUK0RiNBXpwkHIMrkkmR7icPEpJVg=; b=uBw7O4L2BE3ceZk7wlSs6WuojYbL0pwrptcZDGS2z+eejXVWw4df63DlI0GpCOCjYo i7TzMXjw6SSqzPSnmEEJoTSTuVbWPHKAKM9PPsM3+6UOjrIwaMyiFRKGszYokCNMnOiV /ucdYJHgLx3Z0oSfRN6TbUh0LqARLXvNz2WZ+FrE9wQflujE4osdVo3tkmykfnIsLre1 Z1cy7f0h3Vn+LLoA81HL6wOcV1bpvxPSajA/6Bc1gRKf/Kh8fQbOclV0f/EMJSNuPKuY 0+IctBarbkfZNnIdV27E0xaBNp1D3vAmhGGOfJ3KC2SMvA+CgbP51Xojw8bDE4lOwgIK tRWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hlBcIjmk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si9392921plk.15.2021.10.21.08.24.10; Thu, 21 Oct 2021 08:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hlBcIjmk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231873AbhJUPZO (ORCPT + 99 others); Thu, 21 Oct 2021 11:25:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42454 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbhJUPZI (ORCPT ); Thu, 21 Oct 2021 11:25:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634829772; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xi3Exzq4O8MBJAFUK0RiNBXpwkHIMrkkmR7icPEpJVg=; b=hlBcIjmkEauT3bN8J+Ckx8MRlkCpRE5y8jwE8TbJryoI/ekZSCaCI1uBlYAjCPRSigjBI0 npFkDTb/V7F+3AthEgW53Y64yIx70/Y5KuGFV4XfQ9oyOnq76CrWerGAdERRv5vkrlF9vC F6Rv56iOc67OQM3EvpWbqldYXMtnVTk= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-FE1IgqsfMgCr5IkY9JrQiA-1; Thu, 21 Oct 2021 11:22:51 -0400 X-MC-Unique: FE1IgqsfMgCr5IkY9JrQiA-1 Received: by mail-ed1-f69.google.com with SMTP id h19-20020aa7de13000000b003db6ad5245bso722935edv.9 for ; Thu, 21 Oct 2021 08:22:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=xi3Exzq4O8MBJAFUK0RiNBXpwkHIMrkkmR7icPEpJVg=; b=PLm8qGqIaet/tR8mtXPIuCzzRwhZBP/M6WWp8xqW/7raAYxJBMGn0AX216h/q9J1GW INmHQsDQfDFMtOWRCYyzBmPNuyBYASbCE8Jnearv62KErjqQr0qQ5k2ATAg388A//mG9 0yl/0ESIG2JMGhkRFiaELF5Xlgmxhjkc6Ldms1Gjt39jIuIloUPKBykqgPIepO2/u6xx G0MgdAz5guKjJs5GlMPgjHWW1mf5VZIqGMulf1muEiqwflLA/+rK++ILsgGyammxCyVf 7myroIIJduaOAG6KqTq9zTW2PiznDMoaCDe1IEmPGCz72ZVgFJd9wALXQv1idT+JRq4G b92w== X-Gm-Message-State: AOAM530bZejFU386b4ZA2VBwgqzMqGom4WzVz4v3akp7M6OxbTBj+gtu NrTmV/wkTUYxUip/ovCraCTvzQ8WvDRqjodASZMZzd1gXD3vHYDKbIYcKpAc6ZnMfHoK1rQc102 xJgMhAiUjZJFcd5YnSfeUn9g6 X-Received: by 2002:a17:907:6da3:: with SMTP id sb35mr3553388ejc.41.1634829770016; Thu, 21 Oct 2021 08:22:50 -0700 (PDT) X-Received: by 2002:a17:907:6da3:: with SMTP id sb35mr3553369ejc.41.1634829769793; Thu, 21 Oct 2021 08:22:49 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id mp5sm878222ejc.68.2021.10.21.08.22.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Oct 2021 08:22:49 -0700 (PDT) Message-ID: <775667ae-3e82-bba1-d1af-e11d04ddb03d@redhat.com> Date: Thu, 21 Oct 2021 17:22:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [RFC 02/16] KVM: selftests: add hooks for managing encrypted guest memory Content-Language: en-US To: Michael Roth , Mingwei Zhang Cc: linux-kselftest@vger.kernel.org, kvm , LKML , x86@kernel.org, Nathan Tempelman , Marc Orr , Steve Rutherford , Sean Christopherson , Brijesh Singh , Tom Lendacky , Varad Gautam , Shuah Khan , Vitaly Kuznetsov , David Woodhouse , Ricardo Koller , Jim Mattson , Wanpeng Li , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" References: <20211005234459.430873-1-michael.roth@amd.com> <20211005234459.430873-3-michael.roth@amd.com> <20211021033723.tfnhazbnlz4z5czl@amd.com> From: Paolo Bonzini In-Reply-To: <20211021033723.tfnhazbnlz4z5czl@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/10/21 05:37, Michael Roth wrote: >> Do we have to make a copy for the sparsebit? Why not just return the >> pointer? By looking at your subsequent patches, I find that this data >> structure seems to be just read-only? > Yes, it's only intended to be used for read access. But I'll if I can > enforce that without the need to use a copy. > Return it as a const pointer? Paolo