[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 13:48:27 +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=eDMMaTAp4EGr2Zc5Zpmc5NR5QgXKacEiNe6VHnlr6Os=; b=f9suORdRji2SS/6/+d3Grrbs0VABmLn91Gh8/a1ZOrXyW5F2+kuW6UzvPF6ShzsM08SBJGJLdidAomLK2M26wYKVur3NkcCteL4jX1pCLt+twrzx83HciE0S/mFdcJ1+ubsctqiTtukh3pYKggL+51sAIhLcM30Xh8PkOOZE9PEyOD/Tt+HNcxgcjaNlwFPlOpe70zlPeO6/WRSjXpCDvPZKh5vaYu8fHtcv1bxZvOct5mj+MdOsfAicodIaFngwHwaKuhXtzVGQEiklb963Y4w+xfRY0uB5JxQemSN9z7uL3oKjaQ/18KFZl+3uzwuOvSRTq+IEoeeQcIuvnLDwww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHuLUVp2y8HHbl6bGOwpjCK79ft20WmXV3rRJPqHqQD9nQoRAHRjNCz/7H2poEzzK5jT9ASpBoHeC7/VGXn1KrfuY6Y1I0MSvyB0Yk2ME2zuMS+ZEGRugVXxZ8gMYeO5uGeu9Qnnx7w2XaKq0PuabEfMga2S0z78j/axirnnKUvx1GQkJzwBg5ITGxYpBpjCFTIDb+AQU8zAafu5sEkg2zung5Xq1kux3dbDSOJBBIeDu28dOHBioKfCd3TLJYkxEhVo95WSWzQXcrqLE6IDfncIAddCi9oGoo9XTdvS5/ZK3JsN/CfJ/MIivCVSYYKXvUqDi+BHzLULwCQ9FCse+w==
  • 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 11:48:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Jan



 


Rackspace

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