[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 10/14] x86/vmx: move declarations used only by vmx code from vmx.h to private headers


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 27 Feb 2023 16:26:00 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=huTvSwUKfOwTf7t8DEP9EfMBDbC7pL9uxHpeZTUXJPE=; b=R5FLQP+476DaAG25OqOn4ZovNGibD1ve42OPY9Ao20IEThAHZCIymqPUzI1f9m32mvzJVbJEeaFTRq2JdrZobdPPEvhjjqX1wMI+Lx3O71qrTXuueMwAhdahpR+15SJP2Pan9+Ck0voD7PMT7ZEJ+PtrWRxNofnPLvRRv95T7H4fEuLFXjJYb7tBfDbRid3xpXk/qrKvx2EY4LrvMmdFwb43mCbI20BwPfc/dF7q4f4beDEAI71CuWU2Nclh+CSXU9oyxOaRWBzuSCD6kk+g+TD2amDu/Kjkxa62Lqg3kFqDZ2ULk8XDVNudnoPaFnUeDlgeRQbQ+jhU/HSViH8qYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZKQhWDUkIQw2EoWPe0A7EC76Q/DIdMshT1d6mpA5vXfB8xAwe5wMkOcc3A8Z1qBGQzr2/4FbP/iM8HGCWzz6Y2/qsAkaz0ULPxuZWGgwGHD2SxiCjjejGqN/UG8/2SnveF5epxVkV2AyNr7OC4gLT9tOZi4aCoLmX8cSsRGQuHKimZGAqhzXB4cD/22wldAQjNG54Hh1jYdV70FuiN/VKV30vidZprBjtyieznPjlj7EI07JAMGQU2neQu+Mp+b7uZpPlIZQlwWuNlFqxfHVkBYXsZcG0M4PowX8x0ajrSMVxvos0IAAoOLQFNhFsSkJlABD+oMAWM4ZckO8gW+Q2A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 27 Feb 2023 16:26:25 +0000
  • Ironport-data: A9a23:Yw9Q3qPELVKnOXTvrR1LlsFynXyQoLVcMsEvi/4bfWQNrUoj1WYOz DRLXGyDM62IMGf2edF1bNzi90gGsJDUy9I1HQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvLrRC9H5qyo42tC5ANmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0vowKFxrr fMZExIyKSjdldyz7ZzgbOY506zPLOGzVG8ekldJ6GiDSNMZG9XESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+/RxvzG7IA9ZidABNPL8fNCQSNoTtUGfv m/cpEzyAw0ANczZwj2Amp6prr6QwHilBthJfFG+3vd4qQSy9mwWMx4bBGu9ndXntnG8UOsKf iT4/QJr98De7neDRMTnTRS8p3KDoRc0VN9ZEul84waIooLE7gDcCmUaQzppbN09qNRwVTEsz kWOnd7iGXpoqrL9YXCA8PGSpDC7OykQJEcDYzMJSU0O5NyLiII+kBPJCMpiGaidj9vpFDW2y DePxAA8jbgOic8A142g4EvKxTmro/DhUQod9gjRGGW/4WtEiJWNYoWp7R3e8qxGJYPAFF2Z5 iBYwo6Z8fwECoyLmGqVWuIREbq15vGDdjrBnVpoGJpn/DOok5K+Qb1tDPhFDB8BGq45lfXBO yc/ZSs5CEdvAUaX
  • Ironport-hdrordr: A9a23:bL3YvaB2NzBtDCvlHemi55DYdb4zR+YMi2TDtnocdfUxSKelfq +V88jzuSWbtN9yYhEdcKG7WZVoKEm0nfQZ3WB7B8bAYOCJghrMEKhSqafk3j38C2nf24dmpM NdmnFFeb/NMWQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/02/2023 6:50 pm, Xenia Ragiadakou wrote:
> Create two new private headers in arch/x86/hvm/vmx called vmx.h and pi.h.
> Move all the definitions and declarations that are used solely by vmx code
> into the private vmx.h, apart from the ones related to posted interrupts that
> are moved into pi.h.
>
> EPT related declarations and definitions stay in asm/hvm/vmx/vmx.h because
> they are used in arch/x86/mm and drivers/passthrough/vtd.
>
> Also, __vmread(), used in arch/x86/cpu, and consequently the opcodes stay in
> asm/hvm/vmx/vmx.h.

Every time I read the vpmu code, I get increasingly sad.

That is dangerously unsafe, and comes with a chance of exploding completely.

That __vmread() is in NMI context, which means `current` isn't safe to
deference (we might hit in the middle of a context switch), and more
generally there's no guarantee that the loaded VMCS is the one
associated with `current` (we might hit in the middle of a remote VMCS
access).

vpmu is generally not supported, and BTS needs further custom enablement
because it is only useable with a custom bus analyser.


The __vmread() needs deleting - its absolutely not safe to say.

I'm tempted to hardwire the return 0, and punt the problem to whomever
next uses BTS.

Alternatively, MSR_DBGCTL needs wiring into the hvm_get_reg()
infrastructure, but I'm not convinced this will actually work in either
of the two problem cases above, hence preferring the previous option.

Thoughts?

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.