[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/shim: Simplify compat handling in write_start_info()
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 20 Apr 2021 18:37:36 +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:X-MS-Exchange-SenderADCheck; bh=+xGlr9fhgmV3YVMsKJcABd8Y6hxgCGA2j3NzGmk4yME=; b=Ma/k6RbzEljwwnIzuM/ekS1hBoa7VR8QmWWFT4Kseliy96g7XSLmpyPso0/bOCW00KtOMEkmbiBUkeeD4IPXrGrjf04zHmxeDI/QQlNlnmI0XGYcDrI8ExB2ZzsNkB2D+2ggPLEAW+BZ/WZW2JaWjACVnhr51CnJ6FEYRz1fO8FAyHroBK1VQm81Zc+KGIROV1s1qvB+qqJt5q+GhmDB7kqdcCI+gJJ5MESieSdMM6RHnGpkdILfL0fokpYCUdChGXk7L1Me/FP2veN4ID6QqrluYmbLTPdH67wSChLNn4tugbY3HWxipUSMluT00Om7hrUonL7ptuOsJU0uBIANZQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XQgjukxN33yyisTDnrq1el5Q9j3iZOPx3FB35kTEPBPdPEviv15ivfGWCdLEXQ6HXPuvSybwUWPE4KwCphU3fETXq29vL58xUNL3NtvfSB8tmWbziODsO6IeJTU+5nPzZG5Sctmu/a11IYsr6SkFyFYbe0+upCnS7JX6IZ2zhPJ4vfuZvGhOnEdggTh5KtNCESaTS4FMt01U7hH3tr0aRHpXRicUCGnkcaKNnWatlkVK2zK3NOsbSJL+fIFRUCS/qRyKSNoxI6NUdVEgpya2r5atkzmTad9Zm+ox4pD3EOWSTtAsdGpmaew/QVCihinumK1jkS7UT4xdDFVkh+mVXA==
- Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 20 Apr 2021 17:37:56 +0000
- Ironport-hdrordr: A9a23:PtO4+a4Dcuk23u3OqQPXwWeEI+orLtY04lQ7vn1ZYSd+NuSFis Gjm+ka3xfoiDAXHEotg8yEJbPoex3h3LZPy800Ma25VAfr/FGpIoZr8Jf4z1TbdBHW3tV2kZ 1te60WMrHNJHBnkMf35xS5Gd48wN+BtJuln/va0m0Fd2FXQotLhj0JbjqzOEtwWQVAGN4dHJ 2T+sJIq1ObCAoqR+68AWQIWPWGmsbCk4jobQVDKxks7gSPij3A0s+ELzGz2BACXzRThYoz6G StqX2E2oyPkdGejiXd2Wja8ohMlLLaq+drKcSQhqEuW07RoymyYoAJYczlgBkUp6WV5E8ugJ 3wpX4bTrlOwlfwWk3wnhf3wQnn118Vmg3f4HuVm2Hqr8C8ZB9SMbs4uatjfhHU61UtsbhHuc ohtQ/p1Os0fGf9tR/w6NTSWxZhmlDcmwtErccpg2FCSoxbUbdNrOUkjTBoOa0dFyH34p1PKp gWMOjg4p9tADanRkzCsnIq6NKhWWlbJGb9fmEy/uaR0zRQgUljyVoZyME1jh47heIAYqgByO LePqtykrZSCucQcKJmHe8EBfC6E2rXXHv3QSyvCGWiMJtCF2PGqpbx7rlwzOa2eKYQxJ93vJ jaSltXuUM7ZkqGM7zO4LR7tjT2BEmtVzXkzc9To7JjvKfnebbtOSqfDHgzjsqJuZwkc4/mcs f2HKgTL+7oLGPoF4oM9Rb5QYNuJX4XV9BQksonWmiJvtnAJuTRx6/mWceWAICoPScvW2v5DH dGdiP0Pt984keiXWK9rwPWX1/rZ0z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/k i4slrhbbwL3EyiMOoT6Ad8w6e6707J97JEKxdmZVWsSkxPmJipmqdn0+3NkduxB+VEwDUeIdRB g0JsV5KyE1fBCthO0vX1DA0pUkw4s9NaiBrXrcsJZo9//tL9Eazj9hXGxtALKkmBlo+xzlQ1F9 D6A=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 19/04/2021 17:00, Jan Beulich wrote:
> On 19.04.2021 17:57, Andrew Cooper wrote:
>> On 19/04/2021 16:55, Jan Beulich wrote:
>>> On 19.04.2021 16:45, Andrew Cooper wrote:
>>>> Factor out a compat boolean to remove the lfence overhead from multiple
>>>> is_pv_32bit_domain() calls.
>>>>
>>>> For a compat guest, the upper 32 bits of rdx are zero, so there is no need
>>>> to
>>>> have any conditional logic at all when mapping the start info page.
>>> Iirc the contents of the upper halves hold unspecified contents after
>>> a switch from compat to 64-bit mode. Therefore only with this part of
>>> the change dropped ...
>> But we're shim, so will never ever mix compat and non-compat guests.
> That's not the point: A compat guest will still cause the CPU to
> transition back and forth between 64-bit and compat modes. It is
> this transitioning which leaves the upper halves of all GPRs in
> undefined state (even if in reality a CPU would likely need to go
> through extra hoops to prevent them from being zero if they were
> written to in compat mode).
Hmm. That's awkward.
So real behaviour (I've checked with some contacts) is that upper bits
are preserved until the next write to the register, after which the
upper bits are zeroed.
I wonder whether I'll have any luck formally asking AMD and Intel for a
tweak to this effect in the manuals.
~Andrew
|