Re: [PATCH RFC v9 11/51] x86/traps: Define RMP violation #PF error code

From: Dave Hansen
Date: Mon Jun 12 2023 - 12:27:06 EST


On 6/11/23 21:25, Michael Roth wrote:
> From: Brijesh Singh <brijesh.singh@xxxxxxx>
>
> Bit 31 in the page fault-error bit will be set when processor encounters
> an RMP violation.
>
> While at it, use the BIT_ULL() macro.
...
> enum x86_pf_error_code {
> - X86_PF_PROT = 1 << 0,
> - X86_PF_WRITE = 1 << 1,
> - X86_PF_USER = 1 << 2,
> - X86_PF_RSVD = 1 << 3,
> - X86_PF_INSTR = 1 << 4,
> - X86_PF_PK = 1 << 5,
> - X86_PF_SGX = 1 << 15,
> + X86_PF_PROT = BIT(0),
> + X86_PF_WRITE = BIT(1),
> + X86_PF_USER = BIT(2),
> + X86_PF_RSVD = BIT(3),
> + X86_PF_INSTR = BIT(4),
> + X86_PF_PK = BIT(5),
> + X86_PF_SGX = BIT(15),
> + X86_PF_RMP = BIT(31),
> };

It would be nice if the changelog "BIT_ULL()" matched the code "BIT()". :)

With that fixed,

Acked-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>