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

Re: [PATCH 4/4] x86/vmx: cleanup vmx.h


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 21 Feb 2023 12:23:52 +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=zQnlsk4Sloyu17UrIscbTr+TpVR3sIxbK3XeT00I/AY=; b=L7Mx3YJQxcnwI4dFT0qUbr/uJK3jEpdE1PJYV3wFsROSaMggKsAMekb9FDaACBrFpWeuxjwz4jOhjOi1ULONdrwptWxs/YoRKv0V18tSgOaNgxzYk0kkoFKtvm5HqZkJkUJdAGPoFphzSXAw0eBY4hMZIOyGZV8kK3XvQwUSOMYunjgXIWzwJErnSiuQ46SMeRR6z8f5+5R9Nteq03G81Wy3OtzQ67urXKjWuvjqFIbDNSJlVIH01z5uJ4bWjBv26/Q76CuxhS6nWYZjG0HnqMajE8LdnwBZysSDXTa/haL++xRP30MpjYj/65LCMOIJVfdX41czuoU1wqgIuBXtng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItxMmFUrGilg8cq0z2VAOdVxmkLS9pKhEllcK//X7RfvM7FIGM+qNgPZwHl4dnaA/kakd6G3ARs6JUFf+xJ0MDkvEsNpQB3/KeCKPEEygr4Ht+sJAzco0qQvD9agHo9i6Qv6Kt5LwvfvThcTKLYps1ddR3MirdY2swHLXrLFYVFqSNDpdu/DW3izDDjtzF/vGlcUaVAyEpcZbMsVx80rLRx6e44ENSWvY6IMeANxg+UAqc9Mc9QAToT1mQ2hstVDp1SMxbgZRuzBZxKEvqWe1tn0+IdDOeiqdn7otdJLtxRuPKRnXo2kF5gtrCNIUv6Wd9TKZJEbEQTqniulSNOfvQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 21 Feb 2023 11:24:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.02.2023 19:48, Xenia Ragiadakou wrote:
> Do not include the headers:
>   asm/i387.h
>   asm/hvm/trace.h
>   asm/processor.h
>   asm/regs.h
> because none of the declarations and macro definitions in them is used in
> this file. Sort alphabetically the rest of the headers.
> Fix build by including asm/i387.h in vmx.c, needed for 
> vcpu_restore_fpu_lazy().
> 
> Move the definition of GAS_VMX_OP just above the functions that use it and
> undefine it after its usage.
> 
> Move in vmcs.c the definitions of:
>   ept_sync_all()
>   __vmxoff()
>   __vmxon()
> because they are used only in this file. Take the opportunity to remove a
> trailing white space.

While the latter two are probably fine to be moved, I think the first one
wants to remain where it is, as new uses might appear.

> Move in vmx.c the definitions of:
>   pi_test_and_set_pir()
>   pi_test_pir()
>   pi_test_and_set_on()
>   pi_set_on()
>   pi_test_and_clear_on()
>   pi_test_on()
>   pi_get_pir()
>   pi_test_sn()
>   pi_set_sn()
>   pi_clear_sn()
>   vpid_sync_vcpu_gva()
> because they are used only in this file.

I'm not fully convinced of such movement. As a general remark: We typically
avoid "inline" for functions in .c files. Yet most if not all of the above
are pretty good candidates for being explicitly marked "inline".

> Move in vmx.c the declarations of:
>   ve_info_t
>   ept_qual_t
>   idt_or_gdt_instr_info_t
>   ldt_or_tr_instr_info_t
> because they are used only in this file.

I disagree with the movement of such types. Sooner or later they may want
using by vvmx.c as well. If you want to move them, then to a private header
under xen/arch/x86/hvm/vmx/.

Finally I think at least the individual groups of what is being moved or
adjusted want splitting into separate patches.

Jan



 


Rackspace

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