[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <diqz356guhnx.fsf@ackerleytng-cloudtop.c.googlers.com>
Date: Wed, 08 Mar 2023 01:59:46 +0000
From: Ackerley Tng <ackerleytng@...gle.com>
To: Chao Peng <chao.p.peng@...ux.intel.com>
Cc: vannapurve@...gle.com, seanjc@...gle.com, x86@...nel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, pbonzini@...hat.com,
vkuznets@...hat.com, wanpengli@...cent.com, jmattson@...gle.com,
joro@...tes.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
shuah@...nel.org, yang.zhong@...el.com, ricarkol@...gle.com,
aaronlewis@...gle.com, wei.w.wang@...el.com,
kirill.shutemov@...ux.intel.com, corbet@....net, hughd@...gle.com,
jlayton@...nel.org, bfields@...ldses.org,
akpm@...ux-foundation.org, yu.c.zhang@...ux.intel.com,
jun.nakajima@...el.com, dave.hansen@...el.com,
michael.roth@....com, qperret@...gle.com, steven.price@....com,
ak@...ux.intel.com, david@...hat.com, luto@...nel.org,
vbabka@...e.cz, marcorr@...gle.com, erdemaktas@...gle.com,
pgonda@...gle.com, nikunj@....com, diviness@...gle.com,
maz@...nel.org, dmatlack@...gle.com, axelrasmussen@...gle.com,
maciej.szmigiero@...cle.com, mizhang@...gle.com, bgardon@...gle.com
Subject: Re: [V2 PATCH 0/6] KVM: selftests: selftests for fd-based private memory
Chao Peng <chao.p.peng@...ux.intel.com> writes:
>> [...]
>> Chao, I'll work on
>> + Running conversion tests for non-overlapping GPA ranges of
>> same/different memslots from multiple vcpus
>> + Deleting memslots with restricted memfd while guests are being
>> executed
>> + Installing multiple memslots with ranges within the same restricted
>> mem files
>> this week.
> Thanks Ackerley. Looks good to me.
> BTW, for whom may have interest, below are the testcases I added:
> https://github.com/chao-p/linux/commit/24dd1257d5c93acb8c8cc6c76c51cf6869970f8a
> https://github.com/chao-p/linux/commit/39a872ef09d539ce0c953451152eb05276b87018
> https://github.com/chao-p/linux/commit/ddd2c92b268a2fdc6158f82a6169ad1a57f2a01d
> Chao
Hi Chao,
While I was working on the selftests I noticed that this could perhaps
be improved:
https://github.com/chao-p/linux/blob/ddd2c92b268a2fdc6158f82a6169ad1a57f2a01d/virt/kvm/kvm_main.c#L1035
We should use a temporary variable to hold the result of fget(fd).
As it is now, if the user provides any invalide fd, like -1,
slot->restrictedmem.file would be overwritten and lost.
We cannot update slot->restrictedmem.file until after the
file_is_restrictedmem() check.
For now there isn't a big problem because kvm_restrictedmem_bind() is
only called on a new struct kvm_memory_slot, but I think this should be
changed in case the function is used elsewhere in future.
Ackerley
Powered by blists - more mailing lists