[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] x86/PV: remove unnecessary toggle_guest_pt() overhead

  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 18 May 2020 18:52:13 +0200
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Mon, 18 May 2020 16:52:41 +0000
  • Ironport-sdr: bT9m3LRueHZIYCT7JnvSTiQSjpwj/iDHe8KfUtKnoEobqEMCVfREJ/AQEThI8uLgyJVjsCJMdi J23myrWLQu/4lpSON5aDnNmnrumR2II2xXwVPLUSg2Kj8qG1MiMpw73Ciz2UJBradh/qLwSbzw 78WSFFiUOLr3VevXbIGfUlFwTHMExDdntisdXYZiVzZNySPiDj5jLGKrOd/Z4zBg0UGbLV5RLT uJ4WapX9dPVzBds1Z+pFHcPTtdhNPwn5IfRPn5VPHSY1KvHrK2KZSD90fvZhLh8CiAELw3tgp1 CfE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <jbeulich@xxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks, Roger.



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.