[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] x86/vPMU: invoke <vendor>_vpmu_initialise() through a hook as well
- To: Andrew Cooper <amc96@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 1 Dec 2021 09:31:00 +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=NdjsxFx9RDSocv7m53yughdCPL2k95NBFvazzjrlZUc=; b=GaApeQOU1UHXDfUCSKzBGNZfmObhGxwymYzPw3cRVtZEM+QQuQ9gZxvXID3KyBIHrhM67ukcvFtafu+IljaHqkXJb6jSR8eoSxPj2Iskdl8DAz3gr750vyOSX47iQPjwCPb27yQsdWpbYmerTnVVCG4lkruj0F772L2havlJiirUtLNDenqQowwwuu31OGSsZSHw4QrSeipeO/kfIIw6PFlUDQ+p8Yn9ERKJwBV8GOOd6eqdnVSeJ+PWePrug4iEbJYlAN/K0s7Aumewhu688j1QloqwzKFUimFG+9tjq97PZXdSC0MHfA0D4fdglspf2/rcvxxLoPnNcNOMXgZf4Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XRpUowk1/BoJ3bqdx/w083Mv8CCg84VRfRXsTXkQfhUQehuqk9ZQiVjbXot7hLBoiM5ywir9d73qBYvUf8Ig+04WZ6ApFRBmqJCnTVpPke6mVwcHWPrUf3fvP0gOnuBVhyo3vtngFUOSVrGOPLRCejzv9QjytTdqS8DrJ3nH6FFNg8EJhX+WEztJvKZxEmh77NpzKx9OuOoKlmDgj1EVGK4qFmy5zfAjOfr5NZieys80PXczi6Rtk0MxlQBmftFjYFd50QSwiw+1GMkYhqFTaixwH/jOsLs8+4vwhoHOFvy+//ZbA6InOcFq2wpH7FoT5YKz39FNky+aHmsrG+zkTQ==
- 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>, Kevin Tian <kevin.tian@xxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 01 Dec 2021 08:31:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 30.11.2021 22:18, Andrew Cooper wrote:
> On 29/11/2021 09:10, Jan Beulich wrote:
>> --- a/xen/arch/x86/cpu/vpmu.c
>> +++ b/xen/arch/x86/cpu/vpmu.c
>> @@ -480,12 +470,17 @@ static int vpmu_arch_initialise(struct v
>> return -EINVAL;
>> }
>>
>> - vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
>> -
>> + ret = alternative_call(vpmu_ops.initialise, v);
>> if ( ret )
>> + {
>> printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
>> + return ret;
>> + }
>> +
>> + vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
>> + vpmu_set(vpmu, VPMU_INITIALIZED);
>
> It occurs to me that if, in previous patch, you do:
>
> if ( ret )
> printk(XENLOG_G_WARNING "VPMU: Initialization failed for %pv\n", v);
> + else
> + vpmu_set(vpmu, VPMU_INITIALIZED);
>
> then you don't need to undo the adjustments in
> {svm,vmx}_vpmu_initialise() in this patch.
I actually had it that way first, until noticing it was wrong. It can
be done only here because it if only here where the XENPMU_MODE_OFF
checks move from the vendor functions into here.
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, although
> preferably with the VPMU_INITIALIZED adjustment.
Thanks; as said, that adjustment can't be done in patch 1 just yet.
But I did add the missing trailing commas.
Jan
|