>>> On 01.09.15 at 21:37, <l...@amacapital.net> wrote:
> On Tue, Sep 1, 2015 at 3:48 AM, Jan Beulich <jbeul...@suse.com> wrote:
>> While commit 37868fe113 ("x86/ldt: Make modify_ldt synchronous") added
>> a nice comment explaining that Xen needs page-aligned whole page chunks
>> for guest descriptor tables, it then nevertheless used kzalloc() on the
>> small size path. As I'm unaware of guarantees for kmalloc(PAGE_SIZE, )
>> to return page-aligned memory blocks, I believe this needs to be
>> switched back to __get_free_page().
>>
>> Signed-off-by: Jan Beulich <jbeul...@suse.com>
>> Cc: Andy Lutomirski <l...@kernel.org>
>> Cc: Boris Ostrovsky <boris.ostrov...@oracle.com>
>> Cc: David Vrabel <david.vra...@citrix.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
>> ---
>>  arch/x86/kernel/ldt.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- 4.2/arch/x86/kernel/ldt.c
>> +++ 4.2-x86-LDT-alloc/arch/x86/kernel/ldt.c
>> @@ -58,7 +58,7 @@ static struct ldt_struct *alloc_ldt_stru
>>         if (alloc_size > PAGE_SIZE)
>>                 new_ldt->entries = vzalloc(alloc_size);
>>         else
>> -               new_ldt->entries = kzalloc(PAGE_SIZE, GFP_KERNEL);
>> +               new_ldt->entries = (void 
>> *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
> 
> This would need a corresponding change to the kfree path, right?

Oops - yes of course.

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to