home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,823 of 4,255   
   Dan Cross to cr88192@gmail.com   
   Re: x86-S   
   25 May 23 19:08:41   
   
   From: cross@spitfire.i.gajendra.net   
      
   In article , BGB   wrote:   
   >On 5/24/2023 1:12 PM, Dan Cross wrote:   
   >>>> Right.  But the guest expects to run within a virtual address   
   >>>> space of its own construction.  You have a single TLB at the top   
   >>>> level that is shared by both guest and host and must be   
   >>>> multiplexed between them; what do you do when they conflict?   
   >>>   
   >>> The guest doesn't push into the main TLB.   
   >>> The whole thing is a "pull" model, not a "push" model.   
   >>>   
   >>> Rather, it would be more like:   
   >>>    Host experiences a TLB miss, checks its structures;   
   >>>      If it is host memory, the host can translate it as appropriate;   
   >>>    Checks the guests TLB;   
   >>>      If it is found in the guest's TLB, pull it down into the host.   
   >>>      This performs any address translation.   
   >>>    If it is not found, trap into guest.   
   >>   
   >> This is not the scenario that I'm talking about here.   
   >>   
   >> You have the host.  The host has chosen to run itself at virtual   
   >> address 0xWhatever.  The host is executing a guest, that has   
   >> also chosen to run itself at 0xWhatever.  The type of fault you   
   >> receive here is actually a page protection fault (presumably,   
   >> you are forcing the guest to run in userspace while the   
   >> hypervisor runs in privileged mode), not a TLB miss; there is   
   >> already a TLB entry for the address in question, since you were   
   >> (presumably) just using it in the host.  So what do you do?   
   >>   
   >   
   >This is where ASIDs come in:   
   >They allow multiple address spaces to coexist in the TLB at the same   
   >time, while being mutually invisible to each other.   
   >   
   >So, say:   
   >   0123_456789AB with ASID=1234   
   >And:   
   >   0123_456789AB with ASID=5678   
   >   
   >Can both exist in the TLB at the same time.   
      
   This doesn't really solve the problem, but just moves the   
   goal-posts (because now, of course, you're sharing the ASID   
   space with the guest in the exact same way that you are sharing   
   the virtual address space).  Now, you have to trap every guest   
   reference to an ASID and adjust it, pushing significant   
   complexity into the VMM, which was the original argument for why   
   a soft-TLB was "better."   
      
   	- Dan C.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca