Zum Hauptinhalt springen
Intelligence View
⚡ tsecurity.de Intelligence

kvm: hardware assisted paging

CPU vendors began adding hardware virtual memory management unit (vMMU) support circa 2009, with Intel's VT-x (vmx flag) addition. Historically, the guest's…

Beitrag
0
Seite
0
↗ Quelle (blog.stgolabs.net)
Cloud & Tech-Stack · 3 Min. Lesezeit
Quelle: blog.stgolabs.net
Rubrik: Server Unix e Linux

CPU vendors began adding hardware virtual memory management unit (vMMU) support circa 2009, with Intel's VT-x (vmx flag) addition. Historically, the guest's physical (gpa) to host physical  (hpa) addresses where translated through software, using shadow page tables. These tables are kept synchronized with the guest's page tables, and are one of the main sources of overhead in virtual machines, as they incur in expensive vm exits. A common way of keeping the shadow pages up to date are to write-protect the guest's pages, so that when they are changed, page faults are triggered and intercepted by the VMM, which emulates it (injecting the page) and updating the shadow ones, accordingly. This, of course, is transparent to the guest. Another major problem, is that TLB semantics require flushes upon context switching, as newly assigned processes need to have it empty to cache entries only belonging to the process's address space. To overcome this, CPUs now incorporate tags into the TLB - also known as vpid, which allow mapping that associate addresses to processes and thus reducing the amount of flushes.





With hardware vMMUs, in order to avoid the VMM overhead with shadow paging, the guest is left alone to update its
page tables, while the hardware maintains its own page tables which maps gpa to hpa. Intel calls these Extended Page Tables (EPT). 
Having
two page tables now requires that when a guest translates and address, two levels must be walked (sometimes
referred to as 2D page walks). So hardware support can come at a greater cost for programs with bad locality and cache unfriendly, than its software equivalent. When a TLB miss occurs, and the guest does a page walk, for each hierarchical level, the entire EPT must be walked as well, to obtain the hpa. For 64bit guests, this is worse than 32bit ones,  as the 64bit address space requires more levels (PML4, PDP, PD, PTE) of translation.





KVM's implementation of EPT is quite unique and uses both the guest's tables and the hardware's to translate addresses. When a guest needs to translate virtual addresses to physical ones, the gva_to_gpa()function is called:



 static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr, u32 access,  
struct x86_exception *exception)
{
struct guest_walker walker;
gpa_t gpa = UNMAPPED_GVA;
int r;
r = FNAME(walk_addr)(&walker, vcpu, vaddr, access);
if (r) {
gpa = gfn_to_gpa(walker.gfn);
gpa |= vaddr & ~PAGE_MASK;
} else if (exception)
*exception = walker.fault;
return gpa;
}



If the guest's walk fails and the gva-gpa mapping is not present, a page fault is raised, and tdp_page_fault() - two diminutional paging - is invoked through an EPT violation - handle_ept_violation() to translate gpa to hpa. A new page table entry is created and the shadow page code is reused through mmu_set_spte()and added to the beginning of the page list through pte_list_add(). This way, the next time the guest virtual address is accessed, it will already be in the guest's pages and walk_addr() will be done successfully, and the gpa can be returned without further a due. 
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:
✏️ Information ergänzen
🛡️ Versioniert via CMS-Revisions-Engine (Freigabe-Queue für Gäste)

💬 Discussione della community e commenti

🌐 Entra nella chat principale

Avvia la discussione nel flusso broadcast della Social Chat oppure invia qui sopra un contributo esperto tramite il modulo di integrazione.

Briefing di sicurezza Gratuito · disdetta in 1 clic

Intelligence Digest — gratuito

Ogni giorno le notizie di sicurezza più importanti · annullabile in qualsiasi momento

Valutazione della community & prova sociale
⭐ Giudizio dei lettori
–
Ø / 5.0
Ancora nessuna valutazione dei lettori
Questo articolo ti è stato utile?
0
Lascia ora la tua valutazione
Valutazione dettagliata (facoltativa)
Contenuto & qualità
Fonte & credibilità
Attualità

Cluster di storie correlate & fonti (IA vettoriale)

6 Cluster
26 fonti
Black Friday Oura Ring deals: The best of the deals so far, picked by a wearable-tech expert
Latest from TechRadar 28 min. fa
25 altre fonti
CNET6 anni faOur Favorite Blenders of 2026 Are on Sale Ahead of Black Friday CNET33 min. faBrighten Up Your Day by Saving 20% Off Flashlights With Olight’s Black Friday Sale CNET25 min. faLive: Black Friday Deals Are Here. Shop Expert Picks Across Tech, Everyday Essentials and More at Up to 60% Off Golem.de38 min. faAnzeige: Logitech-Tastatur MX Keys S am Black Friday zum Sensationspreis auf Amazon PC-WELT50 min. faLuminar zum Black Friday: KI-Bildbearbeitung für nur 79,20 Euro Latest from TechRadar1 h faThis is the pair of open earbuds to hunt down over Black Friday Latest from TechRadar1 h faBest AirPods Black Friday deals: all live savings on AirPods Pro 3 and more Computer Bild1 h faPhilips Sonicare DiamondClean 9000 zum Black Friday günstiger netzwelt.de2 h faESR startet mit Black-Friday-Rabatten: Diese AirPods-Hüllen lohnen sich jetzt netzwelt.de2 h faPlayStation 5 geschenkt: Diese Black-Friday-Aktion legt die Konsole gratis obendrauf netzwelt.de2 h fa6 Dyson-Staubsauger im Vergleich: Dieser Sauger wird am Black Friday überraschend zum Preis/Leistungssieger netzwelt.de1 h faMonitore im Angebot zum Black Friday: Gutes Bild für Office, Gaming und mehr Golem.de1 h faAnzeige: Akkuschrauber mit 20 Bits zum Black Friday erstmals unter 50 Euro bei Amazon PC-WELT1 h faDie günstigsten Handytarife an Black Friday von 10 GB bis Unlimited: Hier lohnt sich ein Wechsel PC-WELT1 h faBlack Friday 2026 bei LiberNovo: Ergonomische Bürostühle mit bis zu 44 Prozent Rabatt Latest from TechRadar1 h faThe best Black Friday robot vacuum deals: Dreame, Shark, Dyson, and Roborock Golem.de1 h faAnzeige: Topdon-Starthilfe-Powerbank für Kfz zum Black-Friday-Bestpreis nur rund 85 Euro heise online News1 h faBlack Friday: Die besten Kopfhörer zum Tiefstpreis – Sonos Ace, Nothing & Shokz Latest from Windows Central1 h faDell's Black Friday deals drop major savings on Alienware OLED monitors CNET2 anni faMake Every Night Game Night and Save $90 on the Nex Playground With This Black Friday Deal DEV Community1 h faThe app is part of the gadget: 14,000 App Store reviews of 28 device apps before Black Friday Latest from TechRadar2 h faBlack Friday tech deals under $100 / £100: Fire TV Sticks, earbuds, coffee machines and more Caschys Blog3 h faGoogle One: Black-Friday-Angebot mit bis zu 50 Prozent Rabatt netzwelt.de3 h faDem Testsieger ebenbürtig: Zum Black Friday stürzt Xiaomis stärkster E-Scooter im Preis ab Macerkopf.de3 h faFotos verbessern mit Aiarty: 52 % Rabatt + Gratisgeschenke zum Black Friday
Articoli simili
🔍 Verwandte News

Auch interessante Nachrichten kvm: hardware assisted paging

Thematisch verwandte Begriffe: hardware, assisted, paging · 6 Treffer

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

Laden...

Caricamento degli articoli ...

Laden...

Caricamento dei video ...

💬 Caricamento dei commenti…
Trascina per aggiornare
Widgets & Topics
Loading widgets…
Nächster Beitrag