On 7/25/23 12:23 PM, Muhammad Usama Anjum wrote:
On 7/24/23 9:10 PM, Michał Mirosław wrote: [...]>>>> @@ -2219,22 +2225,24 @@ static int pagemap_scan_get_args(struct pm_scan_arg
*arg, arg->category_anyof_mask | arg->return_mask) & ~PM_SCAN_CATEGORIES) return -EINVAL;
start = untagged_addr((unsigned long)arg->start);
end = untagged_addr((unsigned long)arg->end);
vec = untagged_addr((unsigned long)arg->vec);
arg->start = untagged_addr((unsigned long)arg->start);
arg->end = untagged_addr((unsigned long)arg->end);
arg->vec = untagged_addr((unsigned long)arg->vec);
BTW, We should we keep the tag in args writeback().
Sorry what? After this function, the start, end and vec would be used. We need to make sure that the address are untagged before that.
We do write back the address the walk ended at to arg->start in userspace. This pointer I think needs the tag reconstructed so that retrying the ioctl() will be possible.
Even if we reconstruct the tag for end and vec, We need to update the start address. Can we just put same tag as original start in it? I'm not sure.
The special users would use tags. If they are using it, they'll just re-add the tag in next invocation. I think this implementation is correct.