[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/4] tools/libs: Apply MSR policy to a guest
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
- Date: Fri, 19 Feb 2021 09:57:24 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.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=cdkCO4q8WDY5V2H9ToXTzu8WfAE5LQu8USvb4eEJaFo=; b=lxWnZpFL0rBEoU1clsYcRZ5Uhjs62OiCqoudVm2NKSCBWiP9WS4pffawHDMnSCuFQuzUBWvDGDYUHsI12qh/gfO2TXcxYyP1K82+DOCjn1GtKrJIH/Gkr50wEV4AbBUa+QP8rQXWUJeGKy1MbKRvm30Dx6vGOVwaFCi1ylVSMLFhWQOqsCY5EylBOIDcWpclKlH5Hi4XEPKQBU3gWbL5Ec5iHCSRTDLEMKWIMdZpfkEP5ao4PT1dR4AFHC3jZP+dEFdcZK06CwYU/57/fuUpwmZMJTFMp5zHcaBbNq6M2vlFc/vuYEQHJDzjyf0ApK5bqyreIEXz5IZUjrWcP4wRXg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fI4FWdURaF9Xwi9s/sVAtlSb42wqBnogNxAfDNmUbtHGarHGN4tNrK7uYu58HejjAyF46oh5oJ+ts8Jf7EEo/m0uYX7mn6gY9Cx1z/jOtfA/CfnPE9otpFzL8pfw9DhhDqMJQztPIdkRDg0uaWwnxDB+/dBHAQNatolH9inV/M4eZWkJp0ICHjQtl/frDnXJdrqNjaVa7badyUrzD2jaPsmPPXDZodEUp6DiKGOKwi9HcC1ek9c0GSZBHPKee8g89uAD3P8b6YLZZeTrzbOQuRYJoZ24DPrW0QUe0QT4WR0W638cbtN6Hi7/ELH30f7/oLKPD7F7qsGPh+J6FDu7XQ==
- Authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=oracle.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, iwj@xxxxxxxxxxxxxx, wl@xxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, andrew.cooper3@xxxxxxxxxx, jun.nakajima@xxxxxxxxx, kevin.tian@xxxxxxxxx
- Delivery-date: Fri, 19 Feb 2021 14:57:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2/18/21 6:48 AM, Roger Pau Monné wrote:
>
>> + /* Get the domain's default policy. */
>> + nr_leaves = 0;
>> + rc = xc_get_system_cpu_policy(xch, di.hvm ?
>> XEN_SYSCTL_cpu_policy_hvm_default
>> + :
>> XEN_SYSCTL_cpu_policy_pv_default,
>> + &nr_leaves, NULL, &nr_msrs, msrs);
>> + if ( rc )
>> + {
>> + PERROR("Failed to obtain %s default policy", di.hvm ? "hvm" : "pv");
>> + rc = -errno;
>> + goto out;
>> + }
> Why not use xc_get_domain_cpu_policy instead so that you can avoid the
> call to xc_domain_getinfo?
Yes, indeed.
-boris
>
> It would also seem safer, as you won't be discarding any adjustments
> made to the default policy by the hypervisor for this specific domain.
>
> Thanks, Roger.
|