Timur Tabi
2025-Dec-03 19:17 UTC
[PATCH 10/11] gpu: nova-core: LibosMemoryRegionInitArgument size must be page aligned
On Wed, 2025-12-03 at 19:34 +0100, Miguel Ojeda wrote:> In any case, if it is decided to continue execution (either with an > error or with a "default" value etc.), then please use EB, i.e. adding > `debug_assert!` and possibly `pr_warn!` (or perhaps `pr_warn_once!` > once available).So this: let size = match num::usize_as_u64(obj.size()).align_up(GSP_PAGE_ALIGNMENT) { Some(v) => v, None => { debug_assert!(false, "Invalid size {}", obj.size()); pr_warn!("Invalid size {}", obj.size()); num::usize_as_u64(obj.size()) } }; Isn't this absurdly excessive? We cannot ever test this error path, because it's physically impossible for obj.size() to return a value that will cause an error.