[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:41:40 +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=Wb/H+wRXn5fAOMPkpALEF5sGp4DfgYIxSPs3wNeJDrw=; b=KC1tzldYJc+sGFHEt2Wen+n640UR2ZqBBvf6qx1rm605nJwGXb03foJpdXk99HC/hd0+uAZ5MkvdqkYGu071M14xoV/PhTARqWu2NdNyMyRV/j658el49TJU1WvbUzDthA3kqDJ053yDiewRp4UKgjKhIF71irMxtD/DH9UkJyo3nUpTrbDN0heqIuZEddN0nbuUdWDfrBF9byG9vj659loNqYg+4OH+J6RL3v10WS+jLpO3a/GHPjCaiHqSthCj1YjLn0BQXnyla9E4t/v/nxcQZ7TYtAjHq8Z/I+fLA5vorrQmYPiouclQ4rdE55E7Hl8WwQm8Tjucfo6aAQYA5A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f2jbLP/FxK3p+7DutisZq3ynZqrR1C0dM1wWQL5FckLf6kXaSP7a4ihjhXGVCN/bJtqq2DV/teAGzqBjfNX0JrNysYA+OHBYYTu9rqnP0UNJW1x58THN5PuBTfnHiSIWH8Cx+OtDXSICjod1522EnCiM8T9S5xbjEYUuKxbC8lY4HeiHEqDeXBzUle7ZuGq1dnW3i5ZJsL1Bi4HcMmfKTsa+IJyVvdgbRlCS9hCSctJ+DYX5msHL3Gim6ufcTcl4wTF/O4iW4wvGqwiYQNskO7LR9bny1Cl3USMEnhY2/XnGKb4x89fqA/qOBjMhOwagOY/2gZPZ8VHmaTxn/7vLQQ==
  • 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:42:28 +0000
  • Ironport-data: A9a23:o+NV1KkzZbrDeweZLfNtmEfo5gxpJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xIcDTiDM/2MZGP3Lo93b4yx9kwHuZPVxtBlGwdupH89HyMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE4p7aSaVA8w5ARkPqgR5gCGzBH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 aQ+Om8mSxSDvf6/nI2JGsxLjZ8DLta+aevzulk4pd3YJdAPZMmZBo/stZpf1jp2gd1SF/HDY cZfcSBocBnLfxxIPBEQFY46m+CrwHL4dlW0qnrM/fZxvzeVkVE3iea9WDbWUoXiqcF9t0CUv G/ZuU/+BQkXLoe3wjuZ6HO8wOTImEsXXapDROXpqaY22TV/wERCLzAPfny/r8Khg2G/W45jK EwR2jox+P1aGEuDC4OVswe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FO/K0dsZkrPRl 0+YRPUGOJsqmiWZ16QummlZ5qqQD2xwa5N
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27/02/2023 4:26 pm, Andrew Cooper wrote:
> 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.

to stay*

>
> 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®.