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

Re: [PATCH] xen/x86: Make XEN_DOMCTL_get_vcpu_msrs more configurable


  • To: Tamas K Lengyel <tamas.k.lengyel@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 26 Oct 2022 14:22:11 +0200
  • 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=A5ZL3M2l+5oszwDBX+lnLb+1M2f0j38MXzS0Lu5aqWM=; b=d6habteaZ+AEHpp01p8dfq2u8DisQoPZwXm2dM0l7wkdqPCYtRm+ZIV4gt4eQDW9AuugvyuJuJ5SuIBQd3VqrbDpb3sewU6d40pMoFN8AORgP00cwpmKCa/cbrSERYz5Ii+sWCvnnYHfWJafrOVFKZkZmFE+QjfdizG8ENG80sR3isAqJLz5nKZbt/LoIBy0tgWOJeg0IR6VBQmfF5WhpJcVOWtjx1xBXvjp/M51jaW7JIf6t2aHK7rOF07hJFgvqLUnLxhbQr0iPlr9JJO+GnuRcAg0Ip0ucmTqkBq8xXmIkapiOHpeDpXHekc/6CRgA4MRQdw2yQ9z0oO7N0aOYA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTVogthQ36FhZEaBS6o4AqRB5isJa9J33npjV4zo8byrLFNjvlixOH8jRaiZHQj7oT+nYJWk2m9iQUosUIiDYOvGUBFqkSUtQTXti9TDgIYABQ4Bnf+qSQxxx56XNn6JHwYk72NcZEI+m42UMn8cQKdKOeUUswjUNrIlUizcsIOzrHCpN0zn1GaaIG1PHrHUHF5RInE8GDsuzM9BjKBO5CkXSUB6Emlz11NTj9p7C64Zayyl+ZldAzEqgT8k56DpxWRu71X+H6nyEDeyFmtE0vgyr8e2Z2GuJa9jsQ/8BYSrkYcsyhc2NxwXiLhrj9tvQVqm6QCFu+kPRA/31J5WJQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 26 Oct 2022 12:22:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.10.2022 13:58, Tamas K Lengyel wrote:
> On Wed, Oct 26, 2022, 7:48 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
>> On 26.10.2022 13:34, Tamas K Lengyel wrote:
>>> On Wed, Oct 26, 2022, 7:06 AM Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
>>> wrote:
>>>
>>>> On 24/10/2022 17:58, Tamas K Lengyel wrote:
>>>>> Currently the XEN_DOMCTL_get_vcpu_msrs is only capable of gathering a
>>>> handful
>>>>> of predetermined vcpu MSRs. In our use-case gathering the vPMU MSRs by
>> an
>>>>> external privileged tool is necessary, thus we extend the domctl to
>>>> allow for
>>>>> querying for any guest MSRs. To remain compatible with the existing
>>>> setup if
>>>>> no specific MSR is requested via the domctl the default list is
>> returned.
>>>>>
>>>>> Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>
>>>>
>>>> Naming aside, XEN_DOMCTL_{get,set}_vcpu_msrs is supposed to be "get me
>>>> all MSRs needed to migrate a vCPU".  (I do intend to retire the
>>>> hypercall as part of fixing the Xen side of migration, but that's ages
>>>> away)
>>>>
>>>> It seems like what you want is something more like
>>>> XEN_DOMCTL_{rd,wr}msr_list  (convenient timing, given the recent ISE
>>>> update).  I think those would be better as a separate pair of
>>>> hypercalls, rather than trying to repurpose an existing hypercall.
>>>>
>>>>
>>>> As for actually getting the values, please fix up guest_{rd,wr}msr() to
>>>> access the perf MSRs safely.  I know the vpmu MSR handling is in a
>>>> tragic state, but this new get_msr subop is making the problem even more
>>>> tangled.
>>>>
>>>
>>> Adding a separate hypercall is fine.
>>
>> Which will then also avoid altering the behavior of the existing hypercall:
>> You can't just assume e.g. input fields to be zeroed (or otherwise
>> suitably set) by existing callers, when those were previously output only.
>>
> 
> I did add a memset to zero it on the single caller I could find.

Some may deem this sufficient on the assumption that all users should
go through the libxenguest function. But then at the minimum you want
to update documentation in the public header. Yet then this wasn't
the only issue I spotted (hence the use of "e.g.") - you also alter
documented behavior as to the returned number of MSRs when the input
value was too small, if I'm not mistaken.

Jan



 


Rackspace

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