Closed yota9 closed 10 months ago
@rppt PTAL
All modified lines are covered by tests :white_check_mark:
Comparison is base (
5e37ccf
) 70.43% compared to head (75a7da0
) 70.53%.:exclamation: Current head 75a7da0 differs from pull request most recent head 5a31b86. Consider uploading reports for the commit 5a31b86 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
It's a nice catch. page_size in defined in criu/include/common/arch/*/asm/page.h. Interestingly, on x86, s390, arm, it returns unsigned long which does not cause the above issue. However, on aarch64, mips, ppc64, it returns unsigned int. I wonder if changing the page_size to return unsigned long in all archs is a good solution.
It's a nice catch. page_size in defined in criu/include/common/arch/*/asm/page.h. Interestingly, on x86, s390, arm, it returns unsigned long which does not cause the above issue. However, on aarch64, mips, ppc64, it returns unsigned int. I wonder if changing the page_size to return unsigned long in all archs is a good solution.
I think it is. Adding a cast in uffd.c is more of a band aid and making page_size() return unsigned long is the proper solution IMO.
It's a nice catch. page_size in defined in criu/include/common/arch/*/asm/page.h. Interestingly, on x86, s390, arm, it returns unsigned long which does not cause the above issue. However, on aarch64, mips, ppc64, it returns unsigned int. I wonder if changing the page_size to return unsigned long in all archs is a good solution.
Thanks for further investigations, I've made page_size() to return unsigned long in all the arches and couple of other places.
It's a nice catch. page_size in defined in criu/include/common/arch/*/asm/page.h. Interestingly, on x86, s390, arm, it returns unsigned long which does not cause the above issue. However, on aarch64, mips, ppc64, it returns unsigned int. I wonder if changing the page_size to return unsigned long in all archs is a good solution.
Thanks for further investigations, I've made page_size() to return unsigned long in all the arches and couple of other places.
It looks like you've missed loongarch64 :)
True, done. Thanks!
It's a nice catch. page_size in defined in criu/include/common/arch/*/asm/page.h. Interestingly, on x86, s390, arm, it returns unsigned long which does not cause the above issue. However, on aarch64, mips, ppc64, it returns unsigned int. I wonder if changing the page_size to return unsigned long in all archs is a good solution.
Thanks for further investigations, I've made page_size() to return unsigned long in all the arches and couple of other places.
It looks like you've missed loongarch64 :)
I'm not authorized to merge this pull request, so please do it for me, thanks!
The page_size() returns unsigned int value that is after "bitwise not" is promoted to unsigned long (msg->arg.pagefault.address) value. Sinc e the value is unsigned promotion is done with 0 MSB that results in lost of MSB pagefault address bits. Cast page_size to unsigned long first to avoid such situation.