Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965683AbdD0Hkd convert rfc822-to-8bit (ORCPT ); Thu, 27 Apr 2017 03:40:33 -0400 Received: from prv-mh.provo.novell.com ([137.65.248.74]:47870 "EHLO prv-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964873AbdD0HkY (ORCPT ); Thu, 27 Apr 2017 03:40:24 -0400 Message-Id: <5901BC880200007800154A6E@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.1 Date: Thu, 27 Apr 2017 01:40:24 -0600 From: "Jan Beulich" To: "Andy Lutomirski" , "Boris Ostrovsky" Cc: "Borislav Petkov" , "X86 ML" , "xen-devel@lists.xenproject.org" , "Juergen Gross" , "linux-kernel@vger.kernel.org" Subject: Re: [Xen-devel] xen_exit_mmap() questions References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 668 Lines: 14 >>> On 27.04.17 at 02:55, wrote: > The point of CR3 loading here, I believe, is to make sure the hypervisor > knows that the (v)CPU is no longer using the the mm's cr3 (we are > loading swapper_pgdir here). Correct, or else there would still be a non-zero refcount for the page tables hanging off of that CR3, disallowing those pages to become writable, and in turn disallowing the use of direct writes instead of hypercalls to clear the individual entries (or to be precise, direct writes would still be allowed, but their use would be even slower than using hypercalls because they would trap into the hypervisor for emulation). Jan