From nobody Tue Apr 16 05:26:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1581175235873241.10108754149803; Sat, 8 Feb 2020 07:20:35 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j0RtZ-0003x6-6p; Sat, 08 Feb 2020 15:19:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j0RtY-0003x1-Nn for xen-devel@lists.xenproject.org; Sat, 08 Feb 2020 15:19:44 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6e912e2e-4a86-11ea-b319-12813bfff9fa; Sat, 08 Feb 2020 15:19:43 +0000 (UTC) X-Inumbo-ID: 6e912e2e-4a86-11ea-b319-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1581175184; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=HcblYZz7MUwVQtM4xzoEyF52IucTPJqP19UFGTQYrx0=; b=FZC8AL1pnql6sypV+Tz4nnG8BiaemJklHu9S1d0ckeqPAyWTITMpgr1y dPpFy1rMU00BF2ZZxPbcZNAnkXwm0gkdhm0KeyYJyUbkSqOamGowT9I6H ap4/JO63wPFPzuhdBXGN9JplyFA7f+HXW+nQAU83CMW7QsFtTNJ922ToG 4=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: kdlWRpSHR7ZJqqmToMDjwrygQ1XmRozDFiSqhNpdVw70Y/HjBN/UjUQ0Mg8CaGRlvhLWG3izfM edSJHhjkp3k4FN5Cr3ZlSivgXjzWJdj2T55ixXsFDaGbclxyCZJl3jFLkFKplU8goeIUPSOh6b bk+5dttII/KiXIkKovphRrGHHVyjbEGgULXScvHm6aDON7gaQ4adgogE2lAP3/s6AFQn1K+mkr Mi92NCFusmJ6ISwwPGxdsCCwinmR9w5QFboSSfdCYifTBEaY4sk2+G5d1IGRF0vav6pPQwxguj qAA= X-SBRS: 2.7 X-MesageID: 12328351 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,417,1574139600"; d="scan'208";a="12328351" From: Andrew Cooper To: Xen-devel Date: Sat, 8 Feb 2020 15:19:39 +0000 Message-ID: <20200208151939.31691-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] xen/pvh: Fix segment selector ABI X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Ian Jackson , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The written ABI states that %es will be set up, but libxc doesn't do so. In practice, it breaks `rep movs` inside guests before they reload %es. The written ABI doesn't mention %ss, but libxc does set it up. Having %ds different to %ss is obnoxous to work with, as different registers have different implicit segments. Modify the spec to state that %ss is set up as a flat read/write segment. This a) matches the Multiboot 1 spec, b) matches what is set up in practice, and c) is the more sane behaviour for guests to use. Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monn=C3=A9 Reviewed-by: Wei Liu --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Ian Jackson This wants backporting. --- docs/misc/pvh.pandoc | 2 +- tools/libxc/xc_dom_x86.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/misc/pvh.pandoc b/docs/misc/pvh.pandoc index f892e6e641..ccf1c8fe69 100644 --- a/docs/misc/pvh.pandoc +++ b/docs/misc/pvh.pandoc @@ -23,7 +23,7 @@ following machine state: * `cs`: must be a 32-bit read/execute code segment with a base of =E2=80= =980=E2=80=99 and a limit of =E2=80=980xFFFFFFFF=E2=80=99. The selector value is unsp= ecified. =20 - * `ds`, `es`: must be a 32-bit read/write data segment with a base of + * `ds`, `es`, `ss`: must be a 32-bit read/write data segment with a base = of =E2=80=980=E2=80=99 and a limit of =E2=80=980xFFFFFFFF=E2=80=99. The se= lector values are all unspecified. =20 * `tr`: must be a 32-bit TSS (active) with a base of '0' and a limit of '= 0x67'. diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c index 155ef69037..9439805eaa 100644 --- a/tools/libxc/xc_dom_x86.c +++ b/tools/libxc/xc_dom_x86.c @@ -1053,14 +1053,17 @@ static int vcpu_hvm(struct xc_dom_image *dom) /* Set the cached part of the relevant segment registers. */ bsp_ctx.cpu.cs_base =3D 0; bsp_ctx.cpu.ds_base =3D 0; + bsp_ctx.cpu.es_base =3D 0; bsp_ctx.cpu.ss_base =3D 0; bsp_ctx.cpu.tr_base =3D 0; bsp_ctx.cpu.cs_limit =3D ~0u; bsp_ctx.cpu.ds_limit =3D ~0u; + bsp_ctx.cpu.es_limit =3D ~0u; bsp_ctx.cpu.ss_limit =3D ~0u; bsp_ctx.cpu.tr_limit =3D 0x67; bsp_ctx.cpu.cs_arbytes =3D 0xc9b; bsp_ctx.cpu.ds_arbytes =3D 0xc93; + bsp_ctx.cpu.es_arbytes =3D 0xc93; bsp_ctx.cpu.ss_arbytes =3D 0xc93; bsp_ctx.cpu.tr_arbytes =3D 0x8b; =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel