ghw icon indicating copy to clipboard operation
ghw copied to clipboard

Add aarch64 and RISCV64 support

Open rockrush opened this issue 2 years ago • 4 comments

Depend on sysfs instead of /proc/cpuinfo, for content of this file varies across CPU architectures, and doesn't offer unified info tag.

Solves issue #199 .

Signed-off-by: Xingyou Chen [email protected]

rockrush avatar Mar 07 '22 13:03 rockrush

Thanks for this PR! I'm generally in favour of moving from /proc/cpuinfo to sysfs to learn about the CPU data. Let's check this change is covered by the existing tests, and let's add more of them if needed other than that, at glance looks good! I'll have a deeper look later

ffromani avatar Mar 11 '22 15:03 ffromani

/cc @jaypipes because cpuinfo -> sysfs move and support for extra arches

ffromani avatar Mar 24 '22 19:03 ffromani

we would need some aarch64 and riscv64 machines to run at least some CI on; unfortunately, code outside CI bitrots pretty fast. I'm not aware of option (not sure gh actions run on arm, IIRC not)

FYI you can run tests on qemu arm64 under github ci. Yes, its slow as hell, and you need to ssh into the VM to run your tests, but seems to work as expected, we run our battery of tests on it, even installing and restarting the vm to test different things and we can say it works.

See a vagrantfile to bring machine X up on qemu-system-aarch64: https://github.com/rancher-sandbox/cOS-toolkit/blob/master/tests/Vagrantfile#L30 and the makefile that brings it up: https://github.com/rancher-sandbox/cOS-toolkit/blob/master/make/Makefile.test#L61

Let me know if you need any help in this area (testing on aarch64 vms on github ci!) :)

Itxaka avatar May 10 '22 14:05 Itxaka

we would need some aarch64 and riscv64 machines to run at least some CI on; unfortunately, code outside CI bitrots pretty fast. I'm not aware of option (not sure gh actions run on arm, IIRC not)

FYI you can run tests on qemu arm64 under github ci. Yes, its slow as hell, and you need to ssh into the VM to run your tests, but seems to work as expected, we run our battery of tests on it, even installing and restarting the vm to test different things and we can say it works.

See a vagrantfile to bring machine X up on qemu-system-aarch64: https://github.com/rancher-sandbox/cOS-toolkit/blob/master/tests/Vagrantfile#L30 and the makefile that brings it up: https://github.com/rancher-sandbox/cOS-toolkit/blob/master/make/Makefile.test#L61

Let me know if you need any help in this area (testing on aarch64 vms on github ci!) :)

that would help a lot indeed, thanks! I'll review your suggestion ASAP (time allowing) and we'll try to move this forward. The bright side is the ghw testsuite runs really fast - let's try to keep it this way!

ffromani avatar May 10 '22 14:05 ffromani

This PR resolves CPU discovery issues on an ARMv7 network switch as well.

I would like to see this PR merged into main.

jak3kaj avatar Oct 26 '22 17:10 jak3kaj

adding arm support would be very nice indeed. Unfortunately we still need to sort out the CI and the supportability aspects, because we very much want to avoid the feature to break (or to break silently!) when the projects moves on.

ffromani avatar Oct 27 '22 05:10 ffromani

Understood.

I'm going to work on adding arm support for some of the data that's usually stored in dmi on x86. I will also work on setting up some arm CI in a fork and I'll circle back to see if that will be suitable for this project too.

jak3kaj avatar Oct 27 '22 14:10 jak3kaj

FYI @jaypipes merged #333 , this can be closed

glimchb avatar Mar 29 '23 18:03 glimchb

nice!

Itxaka avatar Mar 30 '23 07:03 Itxaka