lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7fb97f08-daac-1dad-f51e-13fe6753832c@linux.intel.com>
Date:   Tue, 12 Feb 2019 17:49:56 +0800
From:   "Li, Aubrey" <aubrey.li@...ux.intel.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Aubrey Li <aubrey.li@...el.com>
Cc:     mingo@...hat.com, peterz@...radead.org, hpa@...or.com,
        ak@...ux.intel.com, tim.c.chen@...ux.intel.com,
        dave.hansen@...el.com, arjan@...ux.intel.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 2/3] x86,/proc/pid/status: Add AVX-512 usage elapsed
 time

On 2019/2/12 17:14, Li, Aubrey wrote:
> On 2019/2/12 16:22, Thomas Gleixner wrote:
>> On Tue, 12 Feb 2019, Aubrey Li wrote:
>>> diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
>>> index d53c54b842da..60ee932070fe 100644
>>> --- a/arch/x86/include/asm/processor.h
>>> +++ b/arch/x86/include/asm/processor.h
>>> @@ -996,5 +996,7 @@ enum l1tf_mitigations {
>>>  };
>>>  
>>>  extern enum l1tf_mitigations l1tf_mitigation;
>>> +/* Add support for architecture specific output in /proc/pid/status */
>>> +extern void arch_proc_pid_status(struct seq_file *m, struct task_struct *task);
>>
>> Sigh. This is absolutely the wrong place. The weak function is declared and
>> used in fs/proc/... So the prototype wants to be in a header which is
>> included from there independent of x86...
> 
> Can the prototype be in the architecture header if they want to call the function?
> Like the following? arch_report_meminfo() is used in fs/proc/... as well.
> 
> $ find . -name *.h | xargs grep arch_report_meminfo
> ./arch/s390/include/asm/pgtable.h:void arch_report_meminfo(struct seq_file *m);
> ./arch/x86/include/asm/pgtable_types.h:extern void arch_report_meminfo(struct seq_file *m);
> ./arch/parisc/include/asm/pgtable.h:extern void arch_report_meminfo(struct seq_file *m);
> 

Actually both way exist in the current kernel,the reason I chose to put the prototype
into architecture header file is that I found some architectures rename the function
name by a micro definition while others use prototype. See below:

$ find . -name *.h | xargs grep arch_irq_stat
./arch/arm64/include/asm/hardirq.h:#define arch_irq_stat_cpu	smp_irq_stat_cpu
./arch/arm/include/asm/hardirq.h:#define arch_irq_stat_cpu	smp_irq_stat_cpu
./arch/x86/include/asm/hardirq.h:extern u64 arch_irq_stat_cpu(unsigned int cpu);

This looks more flexible than it in the common header file.

Anyway, putting the prototype into the common header file like include/linux/proc_fs.h
is also acceptable to me if you persist, please just let me know, :)

Thanks,
-Aubrey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ