OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:17 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: X86-64 paging global bit
PostPosted: Mon Apr 10, 2023 6:36 am 
Offline

Joined: Sun Jun 05, 2022 4:16 pm
Posts: 5
How is the global bit used on 64 bit paging? Can it be used on the top level like when using 32 bit paging?

I am kind of confused by the images on the wiki for 6 for 64 4 bit paging. I'd don't know why there are two images, and what is meant with page-sized and non-page-sized.

Thanks


Top
 Profile  
 
 Post subject: Re: X86-64 paging global bit
PostPosted: Mon Apr 10, 2023 7:28 am 
Offline
Member
Member

Joined: Tue Apr 03, 2018 2:44 am
Posts: 401
bmj wrote:
How is the global bit used on 64 bit paging? Can it be used on the top level like when using 32 bit paging?


The Global bit just prevents that page from being flushed from the TLB when the CR3 is updated. It's used for mappings that are shared between all address spaces, such as the kernel page mapping.

64-bit paging on x86 is just like PAE paging in 32-bit, except the "top" level is no longer 4 entries long, but the full 512 entries long (it also is no longer the top level either, but instead has possibly a 4th and 5th level above it.)

Global is a PTE bit, so if a higher level page table is mapping a large page (such as a 2MB page in PAE mode), then yes, it can have the Global bit set, and will be used across address spaces.

bmj wrote:
I am kind of confused by the images on the wiki for 6 for 64 4 bit paging. I'd don't know why there are two images, and what is meant with page-sized and non-page-sized.

Thanks


The PS field at the directory level indicates whether the physical address is:
- 0 - A pointer to the next level down page table.
- 1 - A pointer to an actual page, sized accordingly by the page table level.

For example, when PS=1 at the page directory level, the physical address is the address of a page of size 4MB (non-PAE) or 2MB (PAE). It's just discriminating between entries for big pages and entries for page tables.


Top
 Profile  
 
 Post subject: Re: X86-64 paging global bit
PostPosted: Sat Apr 15, 2023 4:10 am 
Offline

Joined: Sun Jun 05, 2022 4:16 pm
Posts: 5
thewrongchristian wrote:
bmj wrote:
How is the global bit used on 64 bit paging? Can it be used on the top level like when using 32 bit paging?


The Global bit just prevents that page from being flushed from the TLB when the CR3 is updated. It's used for mappings that are shared between all address spaces, such as the kernel page mapping.

64-bit paging on x86 is just like PAE paging in 32-bit, except the "top" level is no longer 4 entries long, but the full 512 entries long (it also is no longer the top level either, but instead has possibly a 4th and 5th level above it.)

Global is a PTE bit, so if a higher level page table is mapping a large page (such as a 2MB page in PAE mode), then yes, it can have the Global bit set, and will be used across address spaces.

bmj wrote:
I am kind of confused by the images on the wiki for 6 for 64 4 bit paging. I'd don't know why there are two images, and what is meant with page-sized and non-page-sized.

Thanks


The PS field at the directory level indicates whether the physical address is:
- 0 - A pointer to the next level down page table.
- 1 - A pointer to an actual page, sized accordingly by the page table level.

For example, when PS=1 at the page directory level, the physical address is the address of a page of size 4MB (non-PAE) or 2MB (PAE). It's just discriminating between entries for big pages and entries for page tables.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], SemrushBot [Bot] and 76 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group