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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 05FBDC43218 for ; Sat, 27 Apr 2019 07:37:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD2B8206C1 for ; Sat, 27 Apr 2019 07:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725912AbfD0Hhk (ORCPT ); Sat, 27 Apr 2019 03:37:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44326 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbfD0Hhk (ORCPT ); Sat, 27 Apr 2019 03:37:40 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2B47B144051; Sat, 27 Apr 2019 07:37:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2148E600C5; Sat, 27 Apr 2019 07:37:40 +0000 (UTC) Received: from zmail18.collab.prod.int.phx2.redhat.com (zmail18.collab.prod.int.phx2.redhat.com [10.5.83.21]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 17365181AC42; Sat, 27 Apr 2019 07:37:40 +0000 (UTC) Date: Sat, 27 Apr 2019 03:37:39 -0400 (EDT) From: Paolo Bonzini To: Yang Weijiang Cc: kvm@vger.kernel.org Message-ID: <1936609002.15679158.1556350659850.JavaMail.zimbra@redhat.com> In-Reply-To: <20190426085723.GA32222@local-michael-cet-test> References: <20190417095918.GA15982@local-michael-cet-test.sh.intel.com> <20190426085723.GA32222@local-michael-cet-test> Subject: Re: Migration for SPP(Sub-Page Protection) bitmaps MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [93.56.166.5, 10.4.196.23, 10.5.100.50, 10.4.195.28] Thread-Topic: Migration for SPP(Sub-Page Protection) bitmaps Thread-Index: eRHkG1zKGh4OHNaz4/jfbUIMgyzUaw== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 27 Apr 2019 07:37:40 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org > > The destination userspace should simply call KVM_SUBPAGES_SET_ACCESS, > > and KVM will process it just like it would on the source. In other > > words, it shouldn't matter if the ioctl is done as part of migration or > > the first time a VM is setup. And in both cases, lazy setup should be > > fine. > > The problem is in current patch (as in link), it assumes > the target pages are there in EPT, but in migration case, these pages > are not setup in ETP, so KVM_SUBPAGES_SET_ACCESS during migration or > destination bootup will fail, should I modify the patch to setup the > ETP in lazy mode? Yes, definitely. Remember that EPT page tables come and go (pages could be swapped out, or moved from one host physical address to another; there is also a shrinker that will release EPT page tables if memory is low), so SPP support should be ready for that. Migration is just a special case. Paolo