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

Limitations for Running Xen on KVM Arm64


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "haseeb.ashraf@xxxxxxxxxxx" <haseeb.ashraf@xxxxxxxxxxx>
  • Date: Thu, 30 Oct 2025 06:12:44 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=erp5B8/zWvKQdvr4nZo1K1MCyTHV4bScG8pvt06uSkY=; b=t50F8+ZpMG5uFeHGPhgZkVovTGJ1Vk2MW8t2vGriltR+42mg2Avp6k+/ukDlBnf23TM1c0Qei82QUko2H7azZ7+Gx4FwNQDSWNXpBFy2DHgAXSvwaZs04mDgZgmHxqjI9aA0w4/QAzreH61Brt9PtiyMGnvpN38syG/SbcdTy4pELx2Fi3i4ZO0BANl4IkqYdQAZDmdxWXOhgelW3djW5dQkBdMPVX7zFCGhmF/oYM/nu0VuFuwlzq7Qb6I7tytVZbf5aruntUFcjdfQgaufTLdz675YbZsKwGz0a4aK6yJHCkSvl/dMEcl8yHE1RzBa7phSVqS0UgStnVA9WmflOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FTtinF2Y3B0uecTBG3RJTRFwqXT1rqzX2UNHrLVl6PYK9CLHNZ/cL5e7R3VW4qWL+rOR+ZDW45cdtD6mgdiOIn9ap0ia+Esd4giN++0gJHkkJWNQyE2KIwNUvqjE1x52/pCEQn5fgtW4ZLknrUwLRYVZ51fKJ6Vwd6l/s9chCA6qhqmCBkVrpNvQioDt4sDftFc/UAmtft/GrgVomX+6jUp2qzKH52Xo4c0gls4brFWzdt3phN38zvtDFWgHfy5YGnjV17rLO8omxyAQ0mI0T6yvgKXMWW58WZjxRgXQl5WVtajLCYOyJly7JY2/cH+K/cX4VgMKcM0+JhkVf25Bjg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com;
  • Delivery-date: Thu, 30 Oct 2025 10:18:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Enabled=True;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SiteId=38ae3bcd-9579-4fd4-adda-b42e1495d55a;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SetDate=2025-10-30T06:12:44.041Z;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Name=C1 - Restricted;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_ContentBits=1;MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Method=Standard;
  • Thread-index: AQHcSVi3paxtnyIgIkOf6jhuJCbvfg==
  • Thread-topic: Limitations for Running Xen on KVM Arm64

Hello Xen development community,

I wanted to discuss the limitations that I have faced while running Xen on KVM on Arm64 machines. I hope I am using the right mailing list.

The biggest limitation is the costly emulation of instruction tlbi vmalls12e1is in KVM. The cost is exponentially proportional to the IPA size exposed by KVM for VM hosting Xen. If I reduce the IPA size to 40-bits in KVM, then this issue is not much observable but with the IPA size of 48-bits, it is 256x more costly than the former one. Xen uses this instruction too frequently and this instruction is trapped and emulated by KVM, and performance is not as good as on bare-metal hardware. With 48-bit IPA, it can take up to 200 minutes for domu creation with just 128M RAM. I have identified two places in Xen which are problematic w.r.t the usage of this instruction and hoping to reduce the frequency of this instruction or use a more relevant TLBI instruction instead of invalidating whole stage-1 and stage-2 translations.

diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 7642dbc7c5..e96ff92314 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -1103,7 +1103,8 @@ static int __p2m_set_entry(struct p2m_domain *p2m,

    if ( removing_mapping )
        /* Flush can be deferred if the entry is removed */
-        p2m->need_flush |= !!lpae_is_valid(orig_pte);
+        //p2m->need_flush |= !!lpae_is_valid(orig_pte);
+        p2m->need_flush |= false;
    else
    {
        lpae_t pte = mfn_to_p2m_entry(smfn, t, a);
; switch to current VMID
tlbi rvae1, guest_vaddr ; first invalidate stage-1 TLB by guest VA for current VMID
tlbi ripas2e1, guest_paddr ; then invalidate stage-2 TLB by IPA range for current VMID
dsb ish
isb
; switch back the VMID

diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 7642dbc7c5..e96ff92314 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -247,7 +247,7 @@ void p2m_restore_state(struct vcpu *n)
      * when running multiple vCPU of the same domain on a single pCPU.
      */
     if ( *last_vcpu_ran != INVALID_VCPU_ID && *last_vcpu_ran != n->vcpu_id )
-        flush_guest_tlb_local();
+        ; // flush_guest_tlb_local();
 
     *last_vcpu_ran = n->vcpu_id;
 } 

Thanks & Regards,
Haseeb Ashraf

 


Rackspace

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