[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/vmx: Fold VMCS logic in vmx_{get,set}_segment_register()
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 21 Jan 2022 14:53:08 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=vmphCjcBoj0WxajIE6NzK2YkZY6RABI1X7Hi9dizdMQ=; b=bFjJU/CDBohUosI9yUG7b9X4YqZbBQkQ46AOo3qnwsvcpIm6rTwbz1dvbAIT+Hb75WTfqpgDSm1nq9o/0WukK30bifblRCWr4LmW2CAvA48AilqTlxOc5lKEtj+nhzhVr/W04Xu9FnM5IpS3l+AuJkBcxXQhmUmG49cgcY2RHtAd7TUYi1/mlKtVzMlo0uZmlQF/2OHdPdRSmY7A6V5+3EEmMcrM07Yx54wo8+AYDByP2+7o5C12w/ZXtE24QWeFc5PWs0FWqrysnDOnRl4FU2toCASv84zzixGHduBjeSa1atZb4oCLIaon2Lfv2KB1K8RthGDKi5571xFboBOLqw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FCJ54Dp6aK6COC18LZ264P6eUe7FHVn2Z/cIub8HuLsBw1ZRocSIcmcTRFYXyTLdcnhn8Komd0kKPEJWuWks2RTJchZvRL5vumMLKGezJMeR80zGcdiKnY3uvlS+xplgesKzkHpZASHXmyEyS7rrZDLAAPDaC44pNBEA/1bsxd25AdK92aL7p0rDlipwb+SdjiVYcSalj+LXRWemA9bB7DLUxogvYTL9GXd7agWtSePPrDQU/nax2dbLSGMYRBrV8rCoHLiZ6/e8g7IFZwBoMd6HyMrzIrinRWNPmIlQZRjGLGm1d2SIoMmJgEsDa/rBOQfoRpI7UT2KcITPOhCwmg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 21 Jan 2022 13:53:24 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 21.01.2022 12:08, Andrew Cooper wrote:
> Xen's segment enumeration almost matches the VMCS encoding order, while the
> VMCS encoding order has the system segments immediately following the user
> segments for all relevant attributes.
>
> Use a sneaky xor to hide the difference in encoding order to fold the switch
> statements, dropping 10 __vmread() and 10 __vmwrite() calls. Bloat-o-meter
> reports:
>
> add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-433 (-433)
> Function old new delta
> vmx_set_segment_register 804 593 -211
> vmx_get_segment_register 778 556 -222
>
> showing that these wrappers aren't trivial. In addition, 20 BUGs worth of
> metadata are dropped.
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
|