[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes
From: |
Borislav Petkov |
Subject: |
Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes |
Date: |
Mon, 19 Dec 2022 11:17:22 +0100 |
On Mon, Dec 19, 2022 at 04:15:32PM +0800, Chao Peng wrote:
> Tamping down with error number a bit:
>
> if (attrs->flags)
> return -ENXIO;
> if (attrs->attributes & ~supported_attrs)
> return -EOPNOTSUPP;
> if (!PAGE_ALIGNED(attrs->address) || !PAGE_ALIGNED(attrs->size) ||
> attrs->size == 0)
> return -EINVAL;
> if (attrs->address + attrs->size < attrs->address)
> return -E2BIG;
Yap, better.
I guess you should add those to the documentation of the ioctl too
so that people can find out why it fails. Or, well, they can look
at the code directly too but still... imagine some blurb about
user-friendliness here...
:-)
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
- Re: [PATCH v10 1/9] mm: Introduce memfd_restricted system call to create restricted user memory, (continued)
[PATCH v10 2/9] KVM: Introduce per-page memory attributes, Chao Peng, 2022/12/02
Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes, Chenyi Qiang, 2022/12/28
[PATCH v10 3/9] KVM: Extend the memslot to support fd-based private memory, Chao Peng, 2022/12/02
Re: [PATCH v10 3/9] KVM: Extend the memslot to support fd-based private memory, Xiaoyao Li, 2022/12/08