Re: [PATCH v4 1/5] mm: add ARCH_SUPPORTS_NON_LEAF_PTDUMP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Le 18/06/2024 à 21:41, Maxwell Bland a écrit :
> [Vous ne recevez pas souvent de courriers de mbland@xxxxxxxxxxxx. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> On Tue, Jun 18, 2024 at 06:38:24PM GMT, LEROY Christophe wrote:
>> Le 18/06/2024 à 16:40, Maxwell Bland a écrit :
>>> @@ -64,10 +65,11 @@ static int ptdump_p4d_entry(p4d_t *p4d, unsigned long addr,
>>>           if (st->effective_prot)
>>>                   st->effective_prot(st, 1, p4d_val(val));
>>>
>>> -       if (p4d_leaf(val)) {
>>> +       if (IS_ENABLED(CONFIG_ARCH_SUPPORTS_NON_LEAF_PTDUMP) || pgd_leaf(val))
>>
>> Don't you mean p4d_leaf() here instead of pgd_leaf() ?
>> Don't you mean pud_leaf() here instead of pgd_leaf() ?
>> Don't you mean pmd_leaf() here instead of pgd_leaf() ?
> 
> Oh my, this is embarrassing. )-:
> 
> Hence the review process---thank you for catching these, will fix in v5.

Maybe we could have a nicer code with something like:

static inline bool has_non_leaf_ptdump()
{
	return IS_ENABLED(CONFIG_ARCH_SUPPORTS_NON_LEAF_PTDUMP);
}

static int ptdump_p4d_entry(...)
{
	...
	if (has_non_leaf_ptdump() || pgd_leaf(val))
		...
}

Christophe




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux