[PATCH 3/3] vmcore: Convert read_from_oldmem() to take an iov_iter

Christoph Hellwig hch at lst.de
Mon Dec 13 00:02:57 PST 2021


>  
>  ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos)
>  {
> -	return read_from_oldmem(buf, count, ppos, 0,
> +	struct kvec kvec = { .iov_base = buf, .iov_len = count };
> +	struct iov_iter iter;
> +
> +	iov_iter_kvec(&iter, READ, &kvec, 1, count);
> +
> +	return read_from_oldmem(&iter, count, ppos,
>  				cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT));
>  }

elfcorehdr_read should probably also take an iov_iter while we're at it.

I also don't quite understand why we even need the arch overrides for it,
but that would require some digging into the history of this interface.



More information about the kexec mailing list