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

Re: [PATCH 1/3] tools/libacpi: Use 64-byte alignment for FACS


  • To: Kevin Stefanov <kevin.stefanov@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 9 Sep 2021 18:03:39 +0100
  • 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; bh=3aARRyjjI0EjxYyqpL6Ioai4rZieo2Y1y2K/3KUz/Z8=; b=nuxoUclUFf+RRNWW0e1sYFbYvgxEdw91WKJOeAU+ubw/QM0Li51MOxS+PtUsvW5iRibK9DpdCZ2EWw+XC6ohCl47rS7c/AtQVk7cUXwVRfZC7rpUGuzYZr6YoGb/WO+bvPmPNQJmj1QYm+Mj1bkVmjPi5JSA3wZMhjDqZHgW50jf/91L1B73Y7Adg7+ALWdfpqdEMi5FOk9H635M9+sgIVIWlN7puStPwgxYyN4mfJV9D3fXqsJlVPME6559shR8Kwa9cd8m3T+hpgG/dPaLCTqZqQvrcdPWxK23zUKPRT39OwCyLnDeJEWCSFB/BO45gOs410jLHrgbM18y9GxZkQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g/OSEbZ5B4g8Yv4wmKDU+zXx/q/++1FpqTY2vmG3q6+W8hOSO3ocwyY3fLngqBeCds5nzW/jtRZ/+ckBF+blxjjBvx79RIulfUifdhiosqzhQ8izVQsIHXzJ8b5v4Wo0tsLvddK93aNRhjscT4P6Fim86hpd+dWMWlp1Rj49hb8icJiUMac9qcQkXDnwhouO8hIUQyrumD9uGAnFICoRlI35XhlOIMnbBRWm8iQru0ySp4X5jjEsaGDVKmaiXCkgfKCO/yJfaYWjmClMPTNhbEfRpk3FG6E/Mc03B+7Wo1q/B4R/3PELAuY5bnvWRLjcnZ0CBoymBNR3TT+KQ1dqlQ==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Thu, 09 Sep 2021 17:04:04 +0000
  • Ironport-hdrordr: A9a23:ewR4WK/kVWEjlO/IvkFuk+FPdb1zdoMgy1knxilNoENuHfBwxv rDoB1E73LJYVYqOU3Jmbi7Scy9qADnhOFICO4qTMuftWjdyRaVxeRZg7cKrAeQYxEWmtQtsp uINpIOcuEYbmIK/foSgjPIaurIqePvmMvD5Za8vgRQpENRGsVdBm9Ce3em+yZNNW977PQCZf ihD4Z81kGdkSN9VLXEOpBJZZmOm/T70LbdJTIWDR8u7weDyRuu9b7BChCdmjMTSSlGz7sO+X XM11WR3NTsj9iLjjvnk0PD5ZVfn9XsjvNFGcy3k8AQbhHhkByhaohNU6CL+Bo1vOaswlA3l8 SkmWZuA+1Dr1fqOk2lqxrk3AftlB4o9n/Z0FedxUDupMToLQhKQPZptMZ8SF/0+kAgtNZz3O ZgxGSCradaChvGgWDU+8XIfwsCrDv2nVMS1cooy1BPW4oXb7Fc6aYF+llOLZsGFCXmrKg6De hVCt3G7vo+SyLbU5nghBgr/DWQZAV2Iv/fKXJy/fB9kgIm3UyR9nFohvD2xRw7hdQAo5ot3Z WNDk0nrsAWcie6BZgNc9vpevHHf1Aldyi8eV56EW6XZp3vBEi936IfwI9Frt1CK6Z4gafbpv z6ISVlXCgJChrTNfE=
  • Ironport-sdr: POJUicAwHf6ZMjosqRR4nOMTtTvVOnUmgQN2qLVIb0hoJzK4xNj4gurq4No581Vbi/cNoaBmNV CjVEnoiOCpSqHELjkUKAGHqyZxPANOhOpB0+5otUYbokj1hwNekOF4qnHw3fBzHbprRybzSTxz BF1vzxW4Fe7hexxeIvmY9K619kj2t5jOFJtAJoCweijD0BS6vLwnCa4EOjFCn93i7uPF3/FvQQ X3gyBfpyz1OaaKe3dS0zZxs0NsejOg86XF6VCn8jnVFABBCLxXnJpa11UZwcTFi6ER/vs0fZpA 5Nh30JLqs5xBt5FIyQvODLVa
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09/09/2021 17:34, Kevin Stefanov wrote:
> The spec requires 64-byte alignment, not 16.
>
> Signed-off-by: Kevin Stefanov <kevin.stefanov@xxxxxxxxxx>
> ---
> CC: Jan Beulich <jbeulich@xxxxxxxx>
> CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>
> Note: This does not fix the FACS alignment inside guests yet. See next
> patch.

The history here is complex.

c/s 938cee9d41d3 in 2006 deleted a comment saying

// FACS: should be 64-bit alignment
// so it is put at the start of buffer
// as the buffer is 64 bit alignment

Clearly it means byte rather than bit, but the change also introduced
logic to the effect of buf += ROUNDUP(sizeof(facs), 16).

This (incorrect) alignment survived several morphs of the logic and was
moved from hvmloader into libacpi by c/s 73b72736e6ca.

The current code is clearly wrong, but happens to work correctly in
hvmloader because FACS is the first table written and it starts on a
page boundary.  The logic does not work correctly when libxl passes a
buffer which doesn't start on a page boundary.

As a consequence, I'm not sure what to suggest as a Fixes tag here,
except "the logic has been wrong for 15 years - patch everything".

~Andrew




 


Rackspace

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