Date: Thu, 11 May 2017 17:04:30 +0000 From: "jan.dakinevich_gmail.com (Jan Dakinevich)" <phabric-noreply@FreeBSD.org> To: freebsd-virtualization@freebsd.org Subject: [Differential] D10540: vmx: explicit checking for necessary invvpid/invept types Message-ID: <c34fb76ee0585afb97d3901edf3862a7@localhost.localdomain> In-Reply-To: <differential-rev-PHID-DREV-dvcgq67pzsk2bfph2tq5-req@FreeBSD.org> References: <differential-rev-PHID-DREV-dvcgq67pzsk2bfph2tq5-req@FreeBSD.org>
index | next in thread | previous in thread | raw e-mail
jan.dakinevich_gmail.com added inline comments.
INLINE COMMENTS
> anish wrote in ept.c:58-59
> This is cryptic, better to have separate macros for it
> #define INVVPID_SINGLE_CTX_SUP(cap) ((cap) & (1UL << 41))
> #define INVVPID_ALL_CTX_SUP(cap) ((cap) & (1UL << 42))
It was done in that way to minimize produced patch. Actually, I would prefer to declare masks and check them against cap in code. Something like that:
#define INVVPID_MASK_SINGLE_CONTEXT (1UL << 41)
#define INVVPID_MASK_ALL_CONTEXTS (1UL << 42)
...
int
ept_init(int ipinum)
{
...
/* invvpid instruction with required types is supported */
if(!INVVPID_SUPPORTED(cap) ||
!(cap & INVVPID_MASK_SINGLE_CONTEXT) ||
!(cap & INVVPID_MASK_ALL_CONTEXTS))
return (EINVAL);
> grehan wrote in ept.c:68
> Might be worth splitting these out into individual tests, since I have a change that will look at the EPT capabilities individually (for PR 203994, bhyve as a KVM guest. Jan - judging from your work in https://patchwork.kernel.org/project/kvm/list/?submitter=170053 you are intimately familiar with this issue :)
> I have a change that will look at the EPT capabilities individually
I suppose it would be feasible to wait for your changes will be done.
> Jan - judging from your work in https://patchwork.kernel.org/project/kvm/list/?submitter=170053 you are intimately familiar with this issue :)
Yes, all these changes came from my attempt to run bhyve in KVM guest :)
REPOSITORY
rS FreeBSD src repository
REVISION DETAIL
https://reviews.freebsd.org/D10540
EMAIL PREFERENCES
https://reviews.freebsd.org/settings/panel/emailpreferences/
To: jan.dakinevich_gmail.com, grehan, neel
Cc: novel, anish, imp, freebsd-virtualization-list
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c34fb76ee0585afb97d3901edf3862a7>
