Skip to content

[gen] Add VMSA PTE attribute annotations#1884

Open
ShaleXIONG wants to merge 3 commits into
herd:masterfrom
ShaleXIONG:vmsa-attributes
Open

[gen] Add VMSA PTE attribute annotations#1884
ShaleXIONG wants to merge 3 commits into
herd:masterfrom
ShaleXIONG:vmsa-attributes

Conversation

@ShaleXIONG

Copy link
Copy Markdown
Collaborator

The supported attribute annotations are:

  • PteWB
  • PteWT
  • PteNC
  • PteGRE
  • PtenGRE
  • PtenGnRE
  • PtenGnRnE
    For example diyone7 -metadata false -arch AArch64 -variant kvm PodWW PteNC L Rfe PodRR Fre generates:
AArch64 MP+popptenc.l+po
Variant=vmsa
{
 [x]=1;
 [y]=5;
 [PTE(y)]=(oa:PA(y), attrs:(Normal,ISH,iNC,oNC));
 0:X1=x; 0:X3=y;
 1:X1=x; 1:X3=y;
}
 P0           | P1          ;
 MOV W0,#2    | LDR W0,[X3] ;
 STR W0,[X1]  | LDR W2,[X1] ;
 MOV W2,#6    |             ;
 STLR W2,[X3] |             ;

exists (1:X0=6 /\ 1:X2=1)

The implementation separates existing implementations of (1) PTE field updates and (2) memory attributes separate and introduce new (3) PTE attributes. This new structure allows combination of (2) and (3).

Last, the new vmsa.t test file adds focused one-location diyone7 coverage for:

  • standalone PTE annotations, such as PteV1 and PteHA
  • standalone PTE memory attributes, such as PteWT
  • combined PTE fields such as PteV1 PteWT
  • attributes combined with fields, HA/HD, and access annotations such as Pte PteWT A

Allow PTE attrs such as WB, WT, NC, and Device variants to be carried by
Pte annotations and reflected in the generated initial PTE values.
Represent PTE acquire/release modifiers separately from the base PTE
operation. This keeps PTE reads and writes as Read/Set operations while
carrying A/Q/L through a dedicated PTE access field.
Cover standalone PTE field, attribute, HA/HD, and access annotations
with small one-location diyone7 tests. Also add combined cases for
attributes with fields, HA/HD, and access annotations to check that PTE
annotation merging preserves both the generated test shape and expected
initial PTE values.
@ShaleXIONG ShaleXIONG requested a review from relokin June 24, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant