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

Re: Questions about Cx and Px state uploading from dom0


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 6 Apr 2022 17:57:23 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cgFRhV2tmkPELg6HtcElbngN1vuU5CP62IRJyCzhhYg=; b=QfFCo+OFd9vgEHzvc/m176MeHfdVK+PYRHMN/e/uYzYsfdvxS5Kihu/f4N8C6qrywmRyE71u10g/heU65bjPny3BGXW2jjMv+VsdA9ofQ8D5iiXm3Deq3QZD8X8NrUybMdXcvUUecoXAs/3CJUoUNC2TL3Y/yNzMqFFEwSfDifPqzWgoHNfVmgWBtld/hJegHanQcwvvoItVpOXJg3phfym7x/TX882vtQGGrsRRfaw+EUj8ReD0KSq9F0LMvf8f9xwiD3ZUExZFamEmJZKw4hWlhG2w6CF2f810iPvkzfVwVG36QnmjWwMcL418hVahG6QiaNTSsSmWnEMWPBWXBQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WPqi+iomawinjKphj7dcAVADpbS9h4EJbvFE5u1g6HyvJhTBndOawSDfsx73G8UzTlaCDAf4h5RGjQee8cgNsZnh+vaWEREqws6bAgmM7WwXN1UUeNxbZt3xESpi1EWOrEKcFiuD7y9Kp9u7lhRDC7EhsG2wfjPGy43NfyVumbv76C+6UHNjonYjJnQIWJUE77i5JGTAER3LY2Lkc8iKUAklyu9+6OoeMFpGkOMQ5fD0cFeAmMqdNQ6wSicKuk5Qxar2esTKcT4DaLb+YB9YKHShI1Mm2JOufapEPitZpGgUIkhrOz8u/6D5YjiHbQRyPjR8H3MHhJHT1ZiYI44S3Q==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 06 Apr 2022 15:57:45 +0000
  • Ironport-data: A9a23:K+pw2aAIngoTghVW/z7jw5YqxClBgxIJ4kV8jS/XYbTApDImhDQDm mNNXz+PafmOY2Pwc9x2adnjoxxSu5+Byt9mQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHWeIdA970Ug5w7Jh3NYy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPhAl s12srCCSTsQFZfrxPY3eh1VE3tHaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguw5K8bmJsUHs2xIxjDFF/c2B5vERs0m4PcHhGpv3ZkUTZ4yY eIbVTVzbCnYRyYXO2lLLpwbjeenoWHGJmgwRFW9+vNsvjm7IBZK+KjgNp/Zd8KHQe1Rn12Ev STW8mLhGBYYOdeDjz2f/RqEmevnjS79HoUIG9WQ9PRnnVmSzWw7EwANWB2wpvzRt6Klc4sBc QpOoHNo9PVsshzwJjXgY/GmiE/apiUbd+hQL9QR0ibR2ID95wuZXFFRG1atd+canMMxQDUr0 HqAkNXoGSFjvdWpdJ6NyluHhWjsYHZIdAfucQdBFFJYuIe7/OnfmzqVFr5e/LiJYsoZ8N0a6 xSDt2AAiroalqbnPI3rrAmc01pASnUkJzPZBzk7vEr4tmuVh6b/PuREDGQ3C94acu51qXHb4 RA5dzC2trxmMH10vHXlrB8xNL+o/e2ZFzbXnERiGZIsnxz0pSLyJNAMsGEudBgyWirhRdMPS BWN0e+2zMUNVEZGkIctO97hYyjU5faI+SvZugD8MYMVP8kZmP6v9yByf0+At10BY2B3+ZzTz ayzKJ72ZV5DUPwP5GPvG481jO96rghjlDi7bc2qkHyaPU+2OSf9pUEtawDVMIjULcqs/W3oz jqoH5DTkU8CD7SiPHK/HEx6BQliEEXXzKve8qR/XuWCPhBnCCcmDfrQyqkmYItrg+JekeKgw 513chQwJIbX7ZEfFTi3Vw==
  • Ironport-hdrordr: A9a23:w+P5qauEzLGN8MMJiwGh+egB7skCkoMji2hC6mlwRA09TyXGra 6TdaUguiMc1gx8ZJhBo7C90KnpewK7yXdQ2/htAV7EZnibhILIFvAZ0WKG+Vzd8kLFh4tgPM tbAsxD4ZjLfCdHZKXBkXmF+rQbsaG6GcmT7I+0pRodLnAJV0gj1XYDNu/yKDwGeOAsP+tBKH Pz3Lshm9L2Ek5nEPhTS0N1FNTrlpnurtbLcBQGDxko5E2nii6p0qfzF1y90g0FWz1C7L8++S yd+jaJq5mLgrWe8FvxxmXT55NZlJ/IzcZCPtWFjowwJi/3ggilSYx9U/mpvSwzosuo9FE2+e O86SsIDoBW0Tf8b2u1qRzi103J1ysv0WbrzRuijX7qsaXCNUQHIvsEobgcXgrS6kImst05+r lMxXilu51eCg6FtDjh5vDTPisa2HackD4Hq6o+nnZfWYwRZPt6tooE5n5YF58GAWbT9J0nKu 9zF8vRjcwmPm9yV0qp/lWH/ebcHUjaRny9Mwo/U42uonRrdUlCvgolLJd1pAZEyHo/I6M0kN gsfJ4Y0I2mdfVmH56VNN1xMvdfNVa9NC4kEFjiaGgPR5t3c04klfbMkcEIDaeRCds18Kc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 06, 2022 at 05:51:06PM +0200, Jan Beulich wrote:
> On 06.04.2022 17:09, Roger Pau Monné wrote:
> > On Wed, Apr 06, 2022 at 02:47:38PM +0200, Jan Beulich wrote:
> >> On 06.04.2022 12:38, Roger Pau Monné wrote:
> >>> On Wed, Apr 06, 2022 at 10:13:41AM +0200, Jan Beulich wrote:
> >>>> On 23.03.2022 09:54, Roger Pau Monné wrote:
> >>>>> Hello,
> >>>>>
> >>>>> I was looking at implementing ACPI Cx and Px state uploading from
> >>>>> FreeBSD dom0, as my main test box is considerably slower without Xen
> >>>>> knowing about the Px states.  That has raised a couple of questions.
> >>>>>
> >>>>> 1. How to figure out what features to report available by OSPM when
> >>>>> calling the _PDC (or _OSC) ACPI method.  I'm confused by the usage of
> >>>>> this from Linux: it seems to be used to detect mwait support in
> >>>>> xen_check_mwait but not when calling _PDC (ie: in
> >>>>> acpi_processor_set_pdc).  I'm also not sure what the hypercall expects
> >>>>> the caller to provide.  Should buf[2] be set to all the possible
> >>>>> features supported by the OS and Xen will trim those as required?
> >>>>
> >>>> I'm afraid upstream Linux doesn't quite use this as originally
> >>>> intended. Consulting my most recent (but meanwhile quite old) forward
> >>>> port tree of XenoLinux that I still have readily available, I find in
> >>>> drivers/acpi/processor_pdc.c:
> >>>>
> >>>> static acpi_status
> >>>> acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list 
> >>>> *pdc_in)
> >>>> {
> >>>>  acpi_status status = AE_OK;
> >>>>
> >>>> #ifndef CONFIG_XEN
> >>>>  if (boot_option_idle_override == IDLE_NOMWAIT) {
> >>>>          /*
> >>>>           * If mwait is disabled for CPU C-states, the C2C3_FFH access
> >>>>           * mode will be disabled in the parameter of _PDC object.
> >>>>           * Of course C1_FFH access mode will also be disabled.
> >>>>           */
> >>>> #else
> >>>>  {
> >>>>          struct xen_platform_op op;
> >>>> #endif
> >>>>          union acpi_object *obj;
> >>>>          u32 *buffer = NULL;
> >>>>
> >>>>          obj = pdc_in->pointer;
> >>>>          buffer = (u32 *)(obj->buffer.pointer);
> >>>> #ifndef CONFIG_XEN
> >>>>          buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH);
> >>>> #else
> >>>>          op.cmd = XENPF_set_processor_pminfo;
> >>>>          op.u.set_pminfo.id = -1;
> >>>>          op.u.set_pminfo.type = XEN_PM_PDC;
> >>>>          set_xen_guest_handle(op.u.set_pminfo.u.pdc, buffer);
> >>>>          VOID(HYPERVISOR_platform_op(&op));
> >>>> #endif
> >>>>  }
> >>>>  status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL);
> >>>>
> >>>>  if (ACPI_FAILURE(status))
> >>>>          ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> >>>>              "Could not evaluate _PDC, using legacy perf. control.\n"));
> >>>>
> >>>>  return status;
> >>>> }
> >>>>
> >>>> (This is a 4.4-based tree, for reference.)
> >>>>
> >>>> IOW the buffer is passed to Xen for massaging before invoking _PDC.
> >>>
> >>> Indeed.  I'm however confused by what should be pre-filled into the
> >>> buffer by the OS.  _PDC is about the processor driver power management
> >>> support, and none of this power management is done by the OS (I don't
> >>> plan to let FreeBSD do CPU power management when running as hardware
> >>> domain), so IMO passing an empty buffer and letting Xen fill it is the
> >>> correct thing to do, at least for the use-case in FreeBSD.
> >>
> >> I don't think that would work: Xen doesn't "fill in" the buffer, but
> >> merely alters individual bits. The buffer really is IN/OUT here for
> >> Xen.
> > 
> > Hm, but I have no idea what to put here from FreeBSD PoV, as said
> > FreeBSD will only use the processor object to upload the required data
> > to Xen, but won't attach any driver itself.
> > 
> > I've so far been providing an empty buffer to Xen and it does seem to
> > set the right flags so that the Cx and Px states can be fetched
> > afterwards.
> 
> Hmm, an empty buffer should result in -EINVAL from the hypercall.
> The first of the three uint32_t-s should be 1 (ACPI_PDC_REVISION_ID)
> and the 2nd (size) is supposed to be non-zero.

Right, I guess I was too simplistic here. I'm passing a buffer with
{1, 1, 0}, so no features added by the OS (because it won't attach any
driver to the processor object).

Thanks, Roger.



 


Rackspace

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