Thread (8 messages) flat view 8 messages, 2 authors, 2016-08-04

Can cores have different CPU features in a SMP system?

From: Jun Sun <hidden>
Date: 2016-08-04 04:14:58

Maybe I'm missing something.  read_system_reg() seems to be reading
the values initialized by cpu0.  Not true?

Jun

On Wed, Aug 3, 2016 at 2:42 AM, Suzuki K Poulose [off-list ref] wrote:
On 03/08/16 10:00, Suzuki K Poulose wrote:
quoted
On 02/08/16 18:23, Jun Sun wrote:
quoted
Hi, Suzuki,

I was looking at kernel 3.18 and drew the earlier conclusion.

I'm now looking at kernel v4.7-rc4.  It appears the logic is

  - cpu 0 sets up elf_hwcap (init_cpu_ftr_reg(), init_cpu_features() )

On arm64 CPU 0 doesn't set up elf_hwcap. It initialises the CPU feature
register
infrastructure which keeps track of the system wide safe values for the ID
registers. init_cpu_features() initialises the table with the values from
the boot CPU. This will also be used to detect if any secondary CPU has
variations in features which could affect the normal functioning of Linux
(via
update_cpu_features() -> check_update_ftr_reg() ).

The elf_hwcap and the system CPU_HWCAP bits are initialised only after all
the boot time active CPUs are online, from
setup_cpu_features()-> { setup_elf_hwcaps(), setup_feature_capabilities()
}

And the values are set based on the system wide safe values from the CPU
feature
infrastructure (using read_system_reg()).

Suzuki
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help