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

Re: [PATCH] x86/HVM: convert most remaining hvm_funcs hook invocations to alt-call


  • To: Andrew Cooper <amc96@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 30 Nov 2021 15:32:12 +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=8GwfV8SGRNg330Ub69KlfEGgjMgge+Hn3k/kjrimdK8=; b=J3eoz7Dfo1AE8a1PaJ7ezGXXnyrqnxQFgFKUDZI1WCQVwqqa8i3w119BpREqQibneM8b8dzwPMj3uK8zWd+YHbkP5EwYMrAke+fl2NKz9yhwWZ8/U/Efbq9Dk8rutCtSYcI87WS3gfkOEroWm8OAkbshY9+xdH7nc6Zm42Re6FF2V4b1LzHGcUD1xFO0NTnYzOxxPP6lo8rMRJyDaKEN+cKaAkempBLqDAWP7DYBIMae4mt5gDgfCeOkQDne0UzrwB3WcO6W43g+2sBHRq7sRgCo2UJOJAEYlj3Ch0QV1mJZ3g1sQlNqCuPPDy3m2f8sxAhYTbr+EGabeOMhUWH0cw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJAgj44so7XVDOfzkjjKsI2aJpz+ZrTjUQg++dgcTT6JAmvgBmh3Q1xSqbEsdE2ZJKHSV8qUJbjI3SFaeO3u/2nblfbScSXexwm3RN9lvY6W+DXb5/ldkKwgC4uZG7kqz7u4SLKc6blYsKkBiwABMK/uPLLrQqVIrB0mz+OScLH/5mnsy+djjB5nFFOZNcj07XJDUoLG0lBOOzeuxlvyj/wIWpra63BqaZRFWqAYbdI/Hie3DjdScZXy1AGw8Ntsk0pGS1JPh9bM+bEz3azq9Dy2OZlaEfvFVLJQ6W1LmEms0VLFlq7SndrdZk665X6nlcS3zQvzLlwZyiwVzTemOQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 30 Nov 2021 14:32:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.11.2021 15:25, Andrew Cooper wrote:
> On 30/11/2021 14:03, Jan Beulich wrote:
>> On 30.11.2021 14:48, Andrew Cooper wrote:
>>> On 29/11/2021 09:04, Jan Beulich wrote:
>>>> The aim being to have as few indirect calls as possible (see [1]),
>>>> whereas during initial conversion performance was the main aspect and
>>>> hence rarely used hooks didn't get converted. Apparently one use of
>>>> get_interrupt_shadow() was missed at the time.
>>>>
>>>> While I've intentionally left alone the cpu_{up,down}() etc hooks for
>>>> not being guest reachable, the nhvm_hap_walk_L1_p2m() one can't
>>>> currently be converted as the framework supports only up to 6 arguments.
>>>> Down the road the three booleans perhaps want folding into a single
>>>> parameter/argument.
>>> To use __initdata_cf_clobber, all hooks need to use altcall().
>> Right, but that's not going to be sufficient: The data members then also
>> need to move elsewhere, aiui.
> 
> Nope.  It is safe for data members to stay.

But then it can't be in .init.data, can it?

>>> There is also an open question on how to cope with things such as the
>>> TSC scaling hooks, which are only conditionally set in {vmx,svm}_hvm_funcs.
>> Why's that an open question? The requirement is that the pointers be
>> set before the 2nd pass of alternatives patching (it's really just
>> one: setup()). That's already the case, or else the hook couldn't be
>> invoked via altcall. And that's also not the only hook getting set
>> dynamically.
> 
> This was in reference to cf_clobber, not altcall().
> 
> If the conditional hooks aren't added into {vmx,svm}_hvm_funcs, then the
> clobbering loop can't find them.

Oh, I see. Which simple means the clobbering loop shouldn't run
meaningfully earlier than the 2nd pass of patching.

>>>   However...
>>>
>>>> [1] https://lists.xen.org/archives/html/xen-devel/2021-11/msg01822.html
>>>> ---
>>>> Another candidate for dropping the conditional would be
>>>> .enable_msr_interception(), but this would then want the wrapper to also
>>>> return void (hence perhaps better done separately).
>>> I think that's a side effect of Intel support being added first, and
>>> then an incomplete attempt to add AMD support.
>>>
>>> Seeing as support isn't disappearing, I'd be in favour of reducing it to
>>> void.  The sole caller already doesn't check the return value.
>>>
>>>
>>> If I do a prep series sorting out nhvm_hap_walk_L1_p2m() and
>>> enable_msr_interception(), would you be happy rebasing this patch and
>>> adjusting every caller, including cpu_up/down() ?
>> Sure. I don't think cleaning up enable_msr_interception() is a prereq
>> though. The potential for doing so was merely an observation while
>> going through the hook uses.
> 
> Yeah, I suppose that one can be a followup.
> 
>> With it not being sufficient to convert the remaining hook invocations
>> and with the patch already being quite large, I wonder though whether
>> it wouldn't make sense to make further conversions the subject of a
>> fresh patch. I could commit this one then with your R-b (and further
>> acks, once they have trickled in) once the tree is fully open again.
> 
> Honestly, this is legitimately "tree-wide".  While the patch is already
> large, 3 extra hooks (on top of a fix for nhvm_hap_walk_L1_p2m()) is
> mechanical, and probably easier than two patches.

Okay, I'll wait for your change then and re-base on top.

Jan




 


Rackspace

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