[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] x86/svm: Enumeration for CET
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Wed, 28 Apr 2021 15:17:32 +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=n+WP1I2cTtE3ypHvFpo6R6D/N3KMJYfW2us5beYhPps=; b=bHHLrZc5J4jCCSIjBRk+njTS8I5Ye65eu2LK0u0/30ubgGr01u0sDzC2LMSzFps4mgGNOJuPkpC3w/WcOZYF9QlSCEIj7Wfn6JdiJvy3ciqEUP/HIEfSon88tvrtUWABLgwJ2n+yVXh/omc4rjUiVU8kBjUdW/brwBbGPFKsajauLj7MzGQ0CbXHdWin+tvGRxOVQ9a/efHazyxLQzZ2UzRFpYEL70S1gNWPgPNWRKC1Q0LZopN3neldOaQmug5zvFKo5uX+DLiyZGxBSZEAf+I7kHSljkK8Ee9aiAfXDVHXNmZm9LnXu1GOiKAmuSfUHMJegJHpGwpLjzKAoAeEeg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FLk3XEmV0jSARIVUxdgvaAVlN7yimVPuq95w9AicAwSc3QBkM2WTnNqoGrHGVvX9xWUmT0EPvbnMcml58AJTkjX78b7NOHq7orBOTqb8BUnI7od9mb+QufwcdKLj0MLltQgDfrtJIe9p5MewAeNBeBtQBq5+jqWDE5Z8zZINO0tsUH/hqPt7SoCc29j3yDJeOCG5Ny1/tQH86C6DmZut4jllzQ5NYMeitVrtNkFRkywLJtuJx5zURsfqoTIsnk9FmWWvE7al4o01GY+eKA+CAAxjTSo/moZ5c0X6GTRG/k8Kd2DsC0ggUoAouPfj/ylQTVMrq36rxkIWcndRxrVOXA==
- Authentication-results: esa2.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: Wed, 28 Apr 2021 14:17:48 +0000
- Ironport-hdrordr: A9a23:sRiO1KDZjNbQeJ/lHegDtMeALOonbusQ8zAX/mhLY1h8btGYm8 eynP4SyB/zj3IrVGs9nM2bUZPvfVr1zrQwxYUKJ7+tUE3duGWuJJx/9oeK+VLdMgXE3Kpm2a 9kGpITNPTZEUV6gcHm4AOxDtYnx529/Lq1gPrFpk0McShBQchbnmBEIyycFVB7QxQDIJI/Go aV6MYvnUvfRV08aMOnCn4ZG9XZr9rQm578JTIADRgr6A6B5AnYl4LSOR6ewxsYTndz0a4vmF K17zDRy4eCl7WAyhHa33LO9Jg+orrc4/ZKGcDksLlvFhzCkQCtDb4RIoGqnDdwm+237UZvrd +kmWZcA+1Wy1f8Ol64ugHs3Q6I6kdd11bHxUWDiXXu5ezVLQhKc/Zpvo5SfhvH50dIhrgVu8 gnrgHp1esiMTr6kCvw/NTOXR1x/3DEx0YKquIPk2dZFbIXdb45l/1twGpuDJwCECjmgbpXdd VGMce03oczTXqndXzD+kFgzNuwN05DZCuucwwpv8yY1CVuh3Zpz0cU79x3pAZxyLsND7ZD/O jKKaJuifVnSdIXd7t0AKM7TdKwEXGle2ODDEuiZXDcUI0XMXPErJD6pJ0z+eGRYZQNiL8/go 7IXl90vXM7EnieSPGm7dluyFTgUW+9VTPixoV1/J5ioIDxQ7LtLGmqVE0uu9HImYRcPuTrH9 KIfL5GCf7qKmXjXaxT2RflZpVUIX4CFOUIp9cAXU6UqM6jEPyoisXrNNLoYJb9GzctXW3yRl EZWiLoGclG5ke3HlDihhz8XG7sZ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J4 eThPb6cZVoHP+qHcnDGPPVO4l6yMR6Nx3X8D8P4hiLAgBhFAQIvezdeczVD482J3r9L/cAMmx1 j2GKizSNHbaD0QoFwfDRek6+cQ5e2Y51t7mbmCVQROzGLO6hewYr3TVDeWqqoDFpnqNAVcx4eH 7fY=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 28/04/2021 10:14, Jan Beulich wrote:
> On 27.04.2021 19:47, Andrew Cooper wrote:
>> On 27/04/2021 16:53, Jan Beulich wrote:
>>> On 26.04.2021 19:54, Andrew Cooper wrote:
>>>> @@ -497,7 +501,9 @@ struct vmcb_struct {
>>>> u64 rip;
>>>> u64 res14[11];
>>>> u64 rsp;
>>>> - u64 res15[3];
>>>> + u64 _msr_s_cet; /* offset 0x400 + 0x1E0 - cleanbit 12 */
>>>> + u64 _ssp; /* offset 0x400 + 0x1E8 | */
>>>> + u64 _msr_isst; /* offset 0x400 + 0x1F0 v */
>>>> u64 rax;
>>>> u64 star;
>>>> u64 lstar;
>>> Any reason for the leading underscores, when none of the neighboring
>>> fields have such?
>> Yes - they're covered by a cleanbit, and for better or worse, this is
>> our style.
> The underscore prefixes are, to my understanding, there only to
> emphasize that the fields shouldn't be accessed directly, but ...
>
>>> Did you perhaps mean to add VMCB_ACCESSORS()
>>> instances for them?
>> TBH, I opencoded the cleanbit handling because I thoroughly hate that
>> entire infrastructure.
> ... via this (or something with similar abstracting effect). So
> for any fields you mean to access directly they imo shouldn't be
> there. I particularly don't view them as indicators of being
> covered by cleanbits (if the respective accessors aren't used).
The leading underscores are enforced by 'vmcb->_ ## name' in
VMCB_ACCESSORS().
The cleanbits are the only reason we can't treat this as a simple struct.
~Andrew
|