Skip to contentSkip to conversation

can queue_virt_boundary() exceed PAGE_SIZE?

DISCUSSION Al Viro 2 participants 2 messages Dec 10, 2022 – Dec 12, 2022 Block layer

lore
Share & tools
lore

Al Viro

author
#0 lore raw

I'd always assumed that to be impossible, but...

drivers/infiniband/ulp/srp/ib_srp.c:add_target_store()

		target_host->virt_boundary_mask = ~srp_dev->mr_page_mask;

and

        /*
         * Use the smallest page size supported by the HCA, down to a
         * minimum of 4096 bytes. We're unlikely to build large sglists
         * out of smaller entries.
         */
        mr_page_shift           = max(12, ffs(attr->page_size_cap) - 1);
        srp_dev->mr_page_size   = 1 << mr_page_shift;
        srp_dev->mr_page_mask   = ~((u64) srp_dev->mr_page_size - 1);

and it looks like some drivers have ->page_size_cap come from the hardware.

Can it actually end up with ->virt_boundary_mask greater than PAGE_SIZE and if it does, how could things like bio_copy_user_iov() possibly work? page_alloc() won't give us alignment better than PAGE_SIZE, after all...

#1 lore raw
Quoted 1 line · Al Viro

I'd always assumed that to be impossible, but...

I think that's everyones assumptions, so we'd better reject setting too large masks.