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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 EF436C433E0 for ; Mon, 18 May 2020 16:52:51 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C89E020674 for ; Mon, 18 May 2020 16:52:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C89E020674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jaj03-0003vH-PY; Mon, 18 May 2020 16:52:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jaj01-0003vC-Ms for xen-devel@lists.xenproject.org; Mon, 18 May 2020 16:52:21 +0000 X-Inumbo-ID: f03f7bde-9927-11ea-ae69-bc764e2007e4 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f03f7bde-9927-11ea-ae69-bc764e2007e4; Mon, 18 May 2020 16:52:20 +0000 (UTC) Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: bT9m3LRueHZIYCT7JnvSTiQSjpwj/iDHe8KfUtKnoEobqEMCVfREJ/AQEThI8uLgyJVjsCJMdi J23myrWLQu/4lpSON5aDnNmnrumR2II2xXwVPLUSg2Kj8qG1MiMpw73Ciz2UJBradh/qLwSbzw 78WSFFiUOLr3VevXbIGfUlFwTHMExDdntisdXYZiVzZNySPiDj5jLGKrOd/Z4zBg0UGbLV5RLT uJ4WapX9dPVzBds1Z+pFHcPTtdhNPwn5IfRPn5VPHSY1KvHrK2KZSD90fvZhLh8CiAELw3tgp1 CfE= X-SBRS: 2.7 X-MesageID: 17804328 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,407,1583211600"; d="scan'208";a="17804328" Date: Mon, 18 May 2020 18:52:13 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Jan Beulich Subject: Re: [PATCH v3] x86/PV: remove unnecessary toggle_guest_pt() overhead Message-ID: <20200518165213.GX54375@Air-de-Roger> References: <24d8b606-f74b-9367-d67e-e952838c7048@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <24d8b606-f74b-9367-d67e-e952838c7048@suse.com> X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: "xen-devel@lists.xenproject.org" , Wei Liu , Andrew Cooper Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Tue, May 05, 2020 at 08:16:03AM +0200, Jan Beulich wrote: > While the mere updating of ->pv_cr3 and ->root_pgt_changed aren't overly > expensive (but still needed only for the toggle_guest_mode() path), the > effect of the latter on the exit-to-guest path is not insignificant. > Move the logic into toggle_guest_mode(), on the basis that > toggle_guest_pt() will always be invoked in pairs, yet we can't safely > undo the setting of root_pgt_changed during the second of these > invocations. I'm not sure if it would be worth to add a comment to note the intended usage of toggle_guest_pt is to fetch data from the kernel page tables when running in user mode. The one about using it in pairs is certainly fine. > While at it, add a comment ahead of toggle_guest_pt() to clarify its > intended usage. > > Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné Thanks, Roger.