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 X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F03E9C433E6 for ; Wed, 17 Feb 2021 16:15:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5CC864E42 for ; Wed, 17 Feb 2021 16:15:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbhBQQPb (ORCPT ); Wed, 17 Feb 2021 11:15:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234137AbhBQQNw (ORCPT ); Wed, 17 Feb 2021 11:13:52 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6609BC0613D6 for ; Wed, 17 Feb 2021 08:13:12 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id e9so7654013plh.3 for ; Wed, 17 Feb 2021 08:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=30obSL6wNoXFckVZgqPZYM3QP6QIWGyiK7vFvnqdzsc=; b=uMcxqdXTNNbAbHrPi3G1vCKyjA5zEkRIsBX4o5BMlHNrbUndUYMFl3/Nn2C4stNK67 47C3V5ZBfV4pPQpdrUjEtvQimOKxcpNoJqVmiaT1eg19JROswfZEOvUeVycCpVOTWueO E8C5xkypv0DAHJz0zWUprp2lflWttCQ8nV/dlqVPr12YIcv6QoI9x6pLkKqm4UcFvFks rRu9azNmLqRHl0mcfSUcuzS7JeqXkGIfaOZYwsGQ2hSjBVUROEJMU3FU+N49Hf95pAC5 jv4GiyvYx2ef8pjKB+Z/5lz1frOibN1bwOvKaj31tt+fly7rxZaS4KvxQg2RDLhmtWA+ mDbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=30obSL6wNoXFckVZgqPZYM3QP6QIWGyiK7vFvnqdzsc=; b=rv6drzQdvohebhrAdfv6rAj7ATlZ/WYt2bTkc/D/UqUOpkD9DjgxsF25ejrjJEwxaO Fx9mE4AgbhZJa31w9JGnHwWGKHbmAq22BSL+5arpFD2qs+XyaazDJoSoBfXKhEaQEF3r +ZxRt4yJPsgAukii9Q7qfwzoFeqiFxqa6HeMKleaBnmm4rud4sxVBT0W/SN6LO3Gi7Vp 3/kXkJuagDmpTmmUNadA8xFKXTFt+aVKRjXyhmt5eZjxj8IHdXqXGyPpr8VgpFD/9dku hQNKvVDnuPzyGmUrbn464CAdlThRVb0PzB+I4nM4u1TmNXs9Gx6Z8+g992zgv4HLY6N8 ZuvA== X-Gm-Message-State: AOAM532rBjbEOCQvBieA35Zte2jqLuU16QARTuRNPacd1cMT64TpwTTU 20OJikNv+SZQHpzgz0bOXgwOXw== X-Google-Smtp-Source: ABdhPJyfKy2Cz1wXMvzNBd+cA8KhTW+umCAlEIA2Ctay8I7b4LKIUZ2LOEJzneCCMkuYOtND/wuWbA== X-Received: by 2002:a17:90a:1503:: with SMTP id l3mr9758253pja.41.1613578391687; Wed, 17 Feb 2021 08:13:11 -0800 (PST) Received: from google.com ([2620:15c:f:10:6948:259b:72c6:5517]) by smtp.gmail.com with ESMTPSA id 8sm3129452pfp.171.2021.02.17.08.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 08:13:11 -0800 (PST) Date: Wed, 17 Feb 2021 08:13:04 -0800 From: Sean Christopherson To: "Kalra, Ashish" Cc: "pbonzini@redhat.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "rkrcmar@redhat.com" , "joro@8bytes.org" , "bp@suse.de" , "Lendacky, Thomas" , "x86@kernel.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "srutherford@google.com" , "venu.busireddy@oracle.com" , "Singh, Brijesh" Subject: Re: [PATCH v10 10/16] KVM: x86: Introduce KVM_GET_SHARED_PAGES_LIST ioctl Message-ID: References: <7266edd714add8ec9d7f63eddfc9bbd4d789c213.1612398155.git.ashish.kalra@amd.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, Feb 17, 2021, Kalra, Ashish wrote: > From: Sean Christopherson > On Thu, Feb 04, 2021, Ashish Kalra wrote: > > From: Brijesh Singh > > > > The ioctl is used to retrieve a guest's shared pages list. > > >What's the performance hit to boot time if KVM_HC_PAGE_ENC_STATUS is passed > >through to userspace? That way, userspace could manage the set of pages >in > >whatever data structure they want, and these get/set ioctls go away. > > What is the advantage of passing KVM_HC_PAGE_ENC_STATUS through to user-space > ? > > As such it is just a simple interface to get the shared page list via the > get/set ioctl's. simply an array is passed to these ioctl to get/set the > shared pages list. It eliminates any probability of the kernel choosing the wrong data structure, and it's two fewer ioctls to maintain and test. > >Also, aren't there plans for an in-guest migration helper? If so, do we > >have any idea what that interface will look like? E.g. if we're going to > >end up with a full >fledged driver in the guest, why not bite the bullet now > >and bypass KVM entirely? > > Even the in-guest migration helper will be using page encryption status > hypercalls, so some interface is surely required. If it's a driver with a more extensive interace, then the hypercalls can be replaced by a driver operation. That's obviously a big if, though. > Also the in-guest migration will be mainly an OVMF component, won't really > be a full fledged kernel driver in the guest. Is there code and/or a description of what the proposed helper would look like?