public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: [PATCH 1/6] xen/x86: streamline set_pte_mfn()
Date: Thu, 30 Sep 2021 14:34:56 +0200	[thread overview]
Message-ID: <b39c08e8-4a53-8bca-e6e7-3684a6cab8d0@suse.com> (raw)
In-Reply-To: <022b1a5e-4121-6bae-f07c-4ad5eac12481@suse.com>

In preparation for restoring xen_set_pte_init()'s original behavior of
avoiding hypercalls, make set_pte_mfn() no longer use the standard
set_pte() code path. That one is more complicated than the alternative
of simply using an available hypercall directly. This way we can avoid
introducing a fair number (2k on my test system) of cases where the
hypervisor would trap-and-emulate page table updates.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -241,9 +241,11 @@ static void xen_set_pmd(pmd_t *ptr, pmd_
  * Associate a virtual page frame with a given physical page frame
  * and protection flags for that frame.
  */
-void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
+void __init set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
 {
-	set_pte_vaddr(vaddr, mfn_pte(mfn, flags));
+	if (HYPERVISOR_update_va_mapping(vaddr, mfn_pte(mfn, flags),
+					 UVMF_INVLPG))
+		BUG();
 }
 
 static bool xen_batched_set_pte(pte_t *ptep, pte_t pteval)


  reply	other threads:[~2021-09-30 12:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 12:33 [PATCH 0/6] xen/x86: PV boot speedup Jan Beulich
2021-09-30 12:34 ` Jan Beulich [this message]
2021-09-30 12:35 ` [PATCH 2/6] xen/x86: restore (fix) xen_set_pte_init() behavior Jan Beulich
2021-09-30 12:35 ` [PATCH 3/6] xen/x86: adjust xen_set_fixmap() Jan Beulich
2021-09-30 12:36 ` [PATCH 4/6] xen/x86: adjust handling of the L3 user vsyscall special page table Jan Beulich
2021-09-30 12:36 ` [PATCH 5/6] xen/x86: there's no highmem anymore in PV mode Jan Beulich
2021-09-30 12:37 ` [PATCH 6/6] xen/x86: restrict PV Dom0 identity mapping Jan Beulich
2021-10-02  0:33 ` [PATCH 0/6] xen/x86: PV boot speedup Boris Ostrovsky
2021-10-27 13:17 ` Boris Ostrovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b39c08e8-4a53-8bca-e6e7-3684a6cab8d0@suse.com \
    --to=jbeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox