lkml.org 
[lkml]   [2013]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 00/15] memory-hotplug: hot-remove physical memory
Hi Simon,

On 02/01/2013 10:17 AM, Simon Jeons wrote:
>> For example:
>>
>> 64TB, what ever
>> xxxTB, what ever
>> logic address space: |_____kernel_______|_________user_________________|
>> \ \ / /
>> \ /\ /
>> physical address space: |___\/__\/_____________| 4GB or
>> 8GB, what ever
>> *****
>
> How much address space user process can have on x86_64? Also 8GB?

Usually, we don't say that.

8GB is your physical memory, right ?
But kernel space and user space is the logic conception in OS. They are
in logic
address space.

So both the kernel space and the user space can use all the physical memory.
But if the page is already in use by either of them, the other one
cannot use it.
For example, some pages are direct mapped to kernel, and is in use by
kernel, the
user space cannot map it.

>
>>
>> The ***** part physical is mapped to user space in the process' own
>> pagetable.
>> It is also direct mapped in kernel's pagetable. So the kernel can also
>> access it. :)
>
> But how to protect user process not modify kernel memory?

This is the job of CPU. On intel cpus, user space code is running in
level 3, and
kernel space code is running in level 0. So the code in level 3 cannot
access the data
segment in level 0.

Thanks. :)


\
 
 \ /
  Last update: 2013-02-01 04:21    [W:0.080 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site