linux-insides icon indicating copy to clipboard operation
linux-insides copied to clipboard

description of BUILD_BUG_ON in linux-initialization-1.md

Open PinoTsao opened this issue 6 years ago • 1 comments

Probably need rework. The current description bases on its definition in the arch/x86/boot/boot.h, while is not belonged to vmlinux, it is belonged to ZO image, which is produced under arch/x86/boot.

The real definition locates include/linux/build_bug.h

#define BUILD_BUG_ON(condition) \
	BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)

extend it along, will see it is a usage of GCC attribute

PinoTsao avatar Jun 21 '19 04:06 PinoTsao

I would mark each point I identified in this doc, which I think should be improved here.

And after this we can see call of the reset_early_page_tables function where we resets all page global directory entries and write new pointer to the PGT in cr3:

It is (PTRS_PER_PGD-1), so it should be:

...we reset all page global directory entries but last one and ...

And the same problem in:

Here we can see that we zero all Page Global Directory entries.

PinoTsao avatar Jun 24 '19 09:06 PinoTsao