Page MenuHomeFreeBSD

Limit ofw_cpu_early_foreach to CPUs only
ClosedPublic

Authored by wma_semihalf.com on Jul 27 2015, 8:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 23 2024, 2:29 PM
Unknown Object (File)
Jan 29 2024, 1:12 AM
Unknown Object (File)
Dec 20 2023, 12:10 AM
Unknown Object (File)
Dec 15 2023, 8:53 PM
Unknown Object (File)
Nov 13 2023, 1:31 PM
Unknown Object (File)
Oct 25 2023, 9:00 AM
Unknown Object (File)
Sep 26 2023, 5:26 PM
Unknown Object (File)
Aug 29 2023, 12:02 AM
Subscribers

Details

Summary

On some platforms, the /cpus entry contains cpu-to-cluster
map which deffinitely is not a CPU device. Its presence was
causing incrementing of "id" variable and reporting more
CPUs available than it should.
To make "id" valid, increment it only when an entry really
is a CPU.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

wma_semihalf.com retitled this revision from to Limit ofw_cpu_early_foreach to CPUs only.
wma_semihalf.com updated this object.
wma_semihalf.com edited the test plan for this revision. (Show Details)
wma_semihalf.com set the repository for this revision to rS FreeBSD src repository - subversion.

I'm not sure we need a goto in the loop, finding the next id is simple to do when we know we have a cpu node.

sys/dev/ofw/ofw_cpu.c
300
u_int next_id;
...
next_id = 0;
...
for (child = OF_child(node); child != 0; child = OF_peer(child), id = next_id) {
310
next_id++;
319

Then revert this

329

And this

333

etc.

wma_semihalf.com edited edge metadata.
wma_semihalf.com removed rS FreeBSD src repository - subversion as the repository for this revision.
andrew edited edge metadata.

Just need to fix the minor style issue before committing.

sys/dev/ofw/ofw_cpu.c
300–310

This line will need to be split as it was already at 80 characters.

This revision is now accepted and ready to land.Jul 28 2015, 8:50 AM
This revision was automatically updated to reflect the committed changes.