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

Re: [PATCH v2] x86/vlapic: call vmx_vlapic_msr_changed through an hvm_function callback


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Feb 2023 11:09:02 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=Bs32FRsoUzDxNmNs6gGvFykdxxo0Z0MipiufvwNIX1I=; b=mwzWrIi0myOpbqpl4nbSav0tfWzC9c6bisSLjDvdoE9qNbbFnz/o4EGwfliuPsOfWobl/DRjxHaHfdkWMpne5Yoh6jmy1HWLGVE7JHIH/GscWOfrg6U8MnH9qip20Lvb6pP945rWOeiuxG1zbt6JC74eUhvgctJlj9Ph0TwXBnx8BGGHz7Utba3iZlKJgjE95WvZjHKFPLdJPbhLLg7VWAsIs2av8jiIr9TYd1uEW80LNDx2A8Hw92xyir0RRZvZA/GRI73nmy7K5uoE7pu2N6XeA8/ag+dcJ9oPIdICpsA/vK6vFZZB6GTi9a/KXvBTUJ47+K+cffz+6y8UtWzWbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i/a2AWRl+hY5z1tdTt+5EPY2jIzUizdIZJaoyGzFWF02RxNiThOlc1AD8RwsEHjchjDA4md6tAjiC9ihvjK0pzr7tyHmle4o9GY0IR8oK6x7VDrw6rWB9LtwILo+UFelb41v2z4WEm/kXyHxwgFtvTADzjTVlUGu1PTKuo5d3xzFxyrSAroZE6Yw4Og+bAA5+1NKYDxKmRD7lYdrwgV4IyMm79vmUp4TkRcipXbqQcXVBmJNTzlEvHwG+ZIVBQ2vBXB8g435cDiZ/srMV4yLpU5oK0NaZFtit170PZnxGf0zj62nrixBWGO6UCpn5+O/v0h+oNgLXC6DECgPMW8cxg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 13 Feb 2023 10:09:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.02.2023 10:43, Xenia Ragiadakou wrote:
> APIC virtualization support is currently implemented only for Intel VT-x.
> To aid future work on separating AMD-V from Intel VT-x code, instead of
> calling directly vmx_vlapic_msr_changed() from common hvm code, add a stub
> to the hvm_function_table, named update_vlapic_mode, and create a wrapper
> function, called hvm_update_vlapic_mode(), to be used by common hvm code.
> 
> After the change above, do not include header asm/hvm/vmx/vmx.h as it is
> not required anymore and resolve subsequent build errors for implicit
> declaration of functions ‘TRACE_2_LONG_3D’ and ‘TRC_PAR_LONG’ by including
> missing asm/hvm/trace.h header.
> 
> No functional change intended.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
> ---
> 
> Changes in v2:
>   - rename set_virtual_apic_mode to update_vlapic_mode, suggested by Andrew
>   - in hvm_update_vlapic_mode(), call the stub only if available, otherwise
>     a BUG() will be triggered every time an svm guest writes the APIC_BASE 
> MSR,
>     bug reported by Andrew
>   - initialize the stub for vmx unconditionally to maintain current behavior
>     since no functional change is intended, bug reported by Andrew (here, I
>     decided to place the initialization in start_vmx to be closer to the
>     initializations of the other stubs that are relevant to apic 
> virtualization)

I disagree with this - unconditional hooks are better put in place right
in vmx_function_table's initializer.

Also now that you use the function as a callback, vmx_vlapic_msr_changed()
will need to have cf_check added (on both declaration and definition, albeit
I keep forgetting why putting it on just the declaration isn't sufficient; I
guess a short comment to that effect next to cf_check's definition in
compiler.h would help).

Jan



 


Rackspace

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