[PATCH 2/2] kexec: add a pmd huge entry condition during the page table

Eric W. Biederman ebiederm at xmission.com
Thu Jul 14 06:19:21 PDT 2016


zhong jiang <zhongjiang at huawei.com> writes:

> On 2016/7/12 23:46, Eric W. Biederman wrote:
>> zhongjiang <zhongjiang at huawei.com> writes:
>>
>>> From: zhong jiang <zhongjiang at huawei.com>
>>>
>>> when image is loaded into kernel, we need set up page table for it. and 
>>> all valid pfn also set up new mapping. it will tend to establish a pmd 
>>> page table in the form of a large page if pud_present is true. relocate_kernel 
>>> points to code segment can locate in the pmd huge entry in init_transtion_pgtable. 
>>> therefore, we need to take the situation into account.
>> I can see how in theory this might be necessary but when is a kernel virtual
>> address on x86_64 that is above 0x8000000000000000 in conflict with an
>> identity mapped physicall address that are all below 0x8000000000000000?
>>
>> If anything the code could be simplified to always assume those mappings
>> are unoccupied.
>>
>> Did you run into an actual failure somewhere?
>>
>> Eric
>>
>    I  do not understand what you trying to say,  Maybe I miss your point.
>   
>   The key is how to ensure that relocate_kernel points to the pmd
>   entry is not huge page.

Kernel virtual addresses are in the negative half of the address space.
Identity mapped physical addresses are in the positive half of the
address space.

As the entire negative half of the address space at the time that page
table entry is being created the are no huge pages present.

Even testing pmd_present is a redundant, and that is probably the bug.

Eric



More information about the kexec mailing list