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

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 22 Apr 2021 13:37:46 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=htLj8WU6wm4I7XA0zn9KFIuwOuTxfkMX7ApT/yhLWfo=; b=DkmcCV8siJz4rwXInLOo8xGtJLDmvcLth/OsEoA5TMcfWfDpdU2y1mN5JYcATMRfxvphzTyByr7VX6kr4YVHVdfJ45gPZn1pIUBlEIlNTda+y59TlIK0D3/Opmmh4p6G4HFBBr0xNHJtVKbozVGBa3RyuLh5PJ981mmmHNziBIG+0d/P++MNrB6Q13NkzqHmcm7B7ZJnK/uB2xUgFZv68h7gOMDxuF7MEIyzLo9b91rqP1zBxxGLUJhUI5B2v7g+3R9lwBvUeAkHviugAY4xLCB5Bd+oZH2k72zT5GWHwdfHU6LFJ9F5AWVDA1wf3XWCdWkHG0kL51bUj8Hn2vVT5Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BpvsSgvPnpVEpsB6gfTuiAgU4Dgk94aoBBrpE5TJqdudotC/q1CV4Li200w5lDM75c6E3z8KGeakHP0i2vukzt79BN2hsH1nAnw1/F+aWYJaxGikQNG0fBwEvWKppR4NBbaGCdh2ONl5OjWfsFEmq5N0cXdjuMCPCKQQK4owt+5EBH/j5WfEcfuAGBjBrdyGR1NvGp7npkIVm5b9rfra+IU1wk2fzXRj1VK4Iq0XOIfsOqQdOxkdmetgFtbD1qiJChAiWelyYv5k9hfQW8j7kCI6s9+hUt9jnyVMmwqnjpbB7lKeb8AG+fy/URqjHdk/BzMsIgDHHo46KdGwJIQjcw==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 22 Apr 2021 11:38:05 +0000
  • Ironport-hdrordr: A9a23:oqCISatrEmMsCMlPZSE3gNlt7skCxIYji2hD6mlwRA09T+WxrO rrtOgH1BPylTYaUGwhn9fFA6WbXXbA7/dOj7U5FYyJGC3ronGhIo0n14vtxDX8Bzbzn9Qz6Y 5JSII7MtH5CDFB4frSyBWkEtom3dmM+L2pg+Cb9Ht2UQR2cchbjztRICzzKDwReCBtA50lGJ 2AoudGvSOnY3QLbsK9b0N1ItTrjdvNiZ7gfFo6HBYh8gaDlneF77T9Hhie0H4lIk9y6J0l9n XIlBG827W7v5iAu2Xh/kLwz7ATotvuzdNfGNeB4/J1FhzAghulDb4RPoGqkysypIiUmTIXuf nK5ywtJsFir07WF1vF3ifF/ynF/HIQ52T5yVme6EGT0vDRYD4hEcJOicZ4X3LimjIdlepx2q 5KwG6V3qA/ZXir8VWflrq4Ii1CrUa6rWEvluQelRVkIPAjQYRcsJAF+wdtGIoAdRiKmLwPKv VkD83X+Z9tACqnRk3e11Mfp+CEbzAYGxeLRVU6ocqF0zRat2AR9Tpo+OUv2lgH754zUJ9C+q DtNblpjqhHSossYbt6H/ppe7r5NkX9BTb3dE6CK1XuE68Kf1rLtp7M+b0woMWnYoYBwpcekI nIOWko+1IaSgbLM4mjzZdL+hfCTCGWRjL20PxT4JB/p/nVWKfrGTfrciFsr+KQ59EkRuHLUf e6P5xbR9X5K3H1JIpP1w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Toh 1HaJkuqlxFuV8ku2f3huFUfIR3iOCvzG07A0bYWbEdo0s4u0LH/yzrnnJrqw+seFjNU7bp2exl HLGwCLEsc+31GodVJVVAUOfWrf8/4vGWRd8u2hZP3JmeQ5EEdAmECR/eZvHKwpqPrfVB7h8su8 7Kgl7w3ICcTPR2p+yd6AZ+r4wuPRkh/QFoOAWYHcOf62o2z7SuB9bLupyEvNjNy6UWGymbRgox 9yA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Apr 22, 2021 at 01:05:23PM +0200, Jan Beulich wrote:
> On 22.04.2021 12:56, Roger Pau Monné wrote:
> > On Thu, Apr 22, 2021 at 12:48:36PM +0200, Jan Beulich wrote:
> >> On 22.04.2021 12:34, Roger Pau Monné wrote:
> >>> On Thu, Apr 22, 2021 at 11:58:45AM +0200, Jan Beulich wrote:
> >>>> On 22.04.2021 11:42, Roger Pau Monné wrote:
> >>>>> On Wed, Apr 14, 2021 at 03:49:02PM +0200, Jan Beulich wrote:
> >>>>>> On 13.04.2021 16:01, Roger Pau Monne wrote:
> >>>>>>> @@ -944,3 +945,130 @@ bool xc_cpu_policy_is_compatible(xc_interface 
> >>>>>>> *xch, const xc_cpu_policy_t host,
> >>>>>>>  
> >>>>>>>      return false;
> >>>>>>>  }
> >>>>>>> +
> >>>>>>> +static uint64_t level_msr(unsigned int index, uint64_t val1, 
> >>>>>>> uint64_t val2)
> >>>>>>> +{
> >>>>>>> +    uint64_t val = val1 & val2;;
> >>>>>>
> >>>>>> For arbitrary MSRs this isn't going to do any good. If only very
> >>>>>> specific MSRs are assumed to make it here, I think this wants
> >>>>>> commenting on.
> >>>>>
> >>>>> I've added: "MSRs passed to level_msr are expected to be bitmaps of
> >>>>> features"
> >>>>
> >>>> How does such a comment help? I.e. how does the caller tell which MSRs
> >>>> to pass here and which to deal with anyother way?
> >>>
> >>> All MSRs should be passed to level_msr, but it's handling logic would
> >>> need to be expanded to support MSRs that are not feature bitmaps.
> >>>
> >>> It might be best to restore the previous switch and handle each MSR
> >>> specifically?
> >>
> >> I think so, yes. We need to be very careful with what a possible
> >> default case does there, though.
> > 
> > Maybe it would be better to handle level_msr in a way similar to
> > level_leaf: return true/false to notice whether the MSR should be
> > added to the resulting compatible policy?
> > 
> > And then make the default case in level_msr just return false in order
> > to prevent adding MSRs not properly leveled to the policy?
> 
> I'm afraid I'm not clear about the implications. What again is the
> (planned?) final effect of an MSR not getting added there?

Adding the MSR with a 0 value will zero out any previous value on the
'out' policy, while not adding it would leave the previous value
there given the current code in xc_cpu_policy_calc_compatible added by
this patch.

I would expect callers of xc_cpu_policy_calc_compatible to pass a
zeroed 'out' policy, so I think the end result should be the same.

Maybe I should also clear 'out' in xc_cpu_policy_calc_compatible, at
which point both options will get the same exact result.

Thanks, Roger.



 


Rackspace

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