diff options
author | Mingwei Zhang <[email protected]> | 2021-08-02 11:09:03 -0700 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2021-08-04 09:43:03 -0400 |
commit | bb2baeb214a71cda47d50dce80414016117ddda0 (patch) | |
tree | 5d755952248ed12c4b8304492ce20c1af109704d /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 179c6c27bf487273652efc99acd3ba512a23c137 (diff) |
KVM: SVM: improve the code readability for ASID management
KVM SEV code uses bitmaps to manage ASID states. ASID 0 was always skipped
because it is never used by VM. Thus, in existing code, ASID value and its
bitmap postion always has an 'offset-by-1' relationship.
Both SEV and SEV-ES shares the ASID space, thus KVM uses a dynamic range
[min_asid, max_asid] to handle SEV and SEV-ES ASIDs separately.
Existing code mixes the usage of ASID value and its bitmap position by
using the same variable called 'min_asid'.
Fix the min_asid usage: ensure that its usage is consistent with its name;
allocate extra size for ASID 0 to ensure that each ASID has the same value
with its bitmap position. Add comments on ASID bitmap allocation to clarify
the size change.
Signed-off-by: Mingwei Zhang <[email protected]>
Cc: Tom Lendacky <[email protected]>
Cc: Marc Orr <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Alper Gun <[email protected]>
Cc: Dionna Glaze <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Vipin Sharma <[email protected]>
Cc: Peter Gonda <[email protected]>
Cc: Joerg Roedel <[email protected]>
Message-Id: <[email protected]>
[Fix up sev_asid_free to also index by ASID, as suggested by Sean
Christopherson, and use nr_asids in sev_cpu_init. - Paolo]
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions