Suggested by: hselasky
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 51904 Build 48795: arc lint + arc unit
Event Timeline
Comment Actions
I wonder if sizeof(uintptr_t) rather than sizeof(size_t) would be better?
sys/compat/linuxkpi/common/src/linux_page.c | ||
---|---|---|
189 | We should probably move the assignment below the KASSERT? |
Comment Actions
Well, we want 1 << order to fit in a type used to represent sizes, so I think size_t is correct. Consider that on CHERI, sizeof(uintptr_t) is 16, but we still want order <= 63.
sys/compat/linuxkpi/common/src/linux_page.c | ||
---|---|---|
189 | Good catch, thank you. |
sys/compat/linuxkpi/common/src/linux_page.c | ||
---|---|---|
192 | Should we subtract PAGE_SHIFT ? Then it would never overflow? |
sys/compat/linuxkpi/common/src/linux_page.c | ||
---|---|---|
106 | Same here. | |
164 | Same here. | |
208 | Can you verify the actual value of PAGE_MASK here? Because we have this: /usr/src/sys/compat/linuxkpi/common/include/linux/page.h:#undef PAGE_MASK /usr/src/sys/compat/linuxkpi/common/include/linux/page.h:#define PAGE_MASK (~(PAGE_SIZE-1)) Linux's PAGE_MASK is not FreeBSD's PAGE_MASK and maybe not use it? |
sys/compat/linuxkpi/common/src/linux_page.c | ||
---|---|---|
106 | I was just thinking that if you cannot allocate a certain amount, you cannot free it either. Maybe just define the limit as a macro / enum ? |