Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9132611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:20:24+00:00 2026-06-17T08:20:24+00:00

Assume there is a code like this. MOV [0x1234], EAX (intel assembly) let’s say

  • 0

Assume there is a code like this.

MOV [0x1234], EAX (intel assembly)

let’s say that CPU wants to process this instruction.
and let’s assume there is no hypervisor.
we are just using normal x86 CPU(protected mode) in linux environment.

now, what I understand is that
since 0x1234 is a virtual address, this needs to be translated
into physical address.(let’s skip segmentation part)

CPU just pass this address(0x1234) to MMU hardware.
MMU walks the page table and access the memory contents using physical address.

am I correct?

now let’s assume there is hypervisor and this code
is running from guest OS.

what happens exactly??

I know that hypervisor provides another layer of page table.
but I don’t understand how exactly this works.

if the guest code “MOV [0x1234], EAX” is executed
in real CPU. the virtual address 0x1234 will be translated by
real hardware MMU. so I think this instruction has to be
rewritten(0x1234 should be replaced to another address
before the code is executed), or trapped to hypervisor…

am I wrong?
if I am wrong, please fix my understanding…

thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:20:25+00:00Added an answer on June 17, 2026 at 8:20 am

    Answering your first question: yes you are. That’s basically how virtual memory works.

    Now, let’s see what’s happen when an hypervisor is running between the MMU and a guest OS. For performance sake, an hypervisor (weither it’s a type 1 or type 2) would try to avoid trapping at each guest OS memory access. The idea is to let the guest OS managing the MMU. I will elaborate with possible implementations, one for x86 and one for PowerPC.

    On x86, from the Intel’s manual 3B:

    27.3.2 Guest & Host Physical Address Spaces

    Memory virtualization provides guest software with contiguous guest physical
    address space starting zero and extending to the maximum address supported by
    the guest virtual processor’s physical address width. The VMM utilizes guest physical
    to host physical address mapping to locate all or portions of the guest physical
    address space in host memory. The VMM is responsible for the policies and algorithms
    for this mapping which may take into account the host system physical
    memory map and the virtualized physical memory map exposed to a guest by the
    VMM.

    The VMM knows the current PDBR base address of the VM (the PDBR is hold in the CR3 register), since an access to CR3 will cause a VM_EXIT. The VMM will be able to maintain the real page directory on the behalf of the guest OS. I mean when the guest OS modifies its page directory to map logical address A to physical address B, the VMM traps on this, and instead of mapping A to B, it maps A to C. Thus any further access to A won’t cause a #PF, it will be flawlessly routed to C through the MMU. The sad part on this approach is that the guest believes it has mapped A to B, but actually A is mapped to C, thus the VMM has to maintain a virtual page directory in case that the guest would read where it has previously mapped A. The VMM traps on this read access, and instead of saying A is mapped to B, it returns to the guest that A is mapped to C.

    27.3.3 Virtualizing Virtual Memory by Brute Force

    A simple-minded way to do this would be to ensure that all guest attempts to access
    address-translation hardware trap to the VMM where such operations can be properly
    emulated. It must ensure that accesses to page directories and page tables also get
    trapped. This may be done by protecting these in-memory structures with conventional
    page-based protection. The VMM can do this because it can locate the page
    directory because its base address is in CR3 and the VMM receives control on any
    change to CR3; it can locate the page tables because their base addresses are in the
    page directory.

    On PowerPC, you don’t have an hardware table-walk of a page directory as Intel’s. Each modification of the TLB is induced by an instruction, usually from the kernel memory manager. Here again, a straightforward idea is to trap on each guest access to the TLB (setting up things to cause a VM exit when the guest execute a tlbwe instruction for instance; note: tlbwe writes an entry into the TLB). Once inside the VMM, the hypervisor decodes the trapping instruction, and emulates its behaviour, but instead of mapping A to B, it maps A to C, directly into the TLB. Again the VMM has to maintain a virtual TLB in case the guest OS wants to check what’s in the TLB, and returns what it believes to have put in the TLB earlier.

    To conclude, although some hardware features help in virtualizing the guest physical memory, it’s generally up to the VMM to manage the effective guest-physical to host-physical memory mapping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some code that looks like this: class Serializer { public: template<class Type>
I have code that looks like this: if(func_cliche_start(line)): a=func_cliche_start(line) #... do stuff with 'a'
assume there is a grid with some points in it just like in the
Let's assume there is a static .Net method static void RegisterDelegate(Action<array<Object^>^>^ handler); defined in
I think Im tying myself up in knots with this and I assume there's
I have container of geometrical entities. Let's assume there is circle, ellipse, line, arc.
Assume that there's no problem with my header file and some included library. I'm
We all know that most applications out there assume class names to follow the
I would like to have this x86 ASM code ported to C or C++,
Ok, So I have the following situation. I originally had some code like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.