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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 9A74AC43218 for ; Fri, 26 Apr 2019 08:57:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C5D720684 for ; Fri, 26 Apr 2019 08:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726222AbfDZI5M (ORCPT ); Fri, 26 Apr 2019 04:57:12 -0400 Received: from mga09.intel.com ([134.134.136.24]:4967 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfDZI5L (ORCPT ); Fri, 26 Apr 2019 04:57:11 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Apr 2019 01:57:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,396,1549958400"; d="scan'208";a="340997944" Received: from unknown (HELO localhost) ([10.239.159.128]) by fmsmga006.fm.intel.com with ESMTP; 26 Apr 2019 01:57:09 -0700 Date: Fri, 26 Apr 2019 16:57:23 +0800 From: Yang Weijiang To: Paolo Bonzini Cc: kvm@vger.kernel.org Subject: Re: Migration for SPP(Sub-Page Protection) bitmaps Message-ID: <20190426085723.GA32222@local-michael-cet-test> References: <20190417095918.GA15982@local-michael-cet-test.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Apr 26, 2019 at 10:06:17AM +0200, Paolo Bonzini wrote: > On 17/04/19 11:59, Yang Weijiang wrote: > > Hi, Paolo, > > > > I'm working on migration support for SPP(Sub-Page Protection) feature, > > the previous patch set is here: > > https://lkml.org/lkml/2018/11/30/574, basically it's used to protect > > 128-byte subpages within a normal 4KB page. > > > > but I'm not sure whether we need to add migration support for such kind of feature. > > > > Currently, my solution is to store the SPP bitmaps to destination KVM, when > > there's EPT violation, search the bitmap mapping table to check if the > > guest page needs to be protected. > > > > Another solution is to setup EPT table directly at the end of migration. > > 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. > > Thanks, > > Paolo Thanks Paolo! 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?