forked from xen-project/xen
-
Notifications
You must be signed in to change notification settings - Fork 3
Xen fastabi seves #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Th0rOnDoR
wants to merge
42
commits into
xcp-ng:xen-fastabi-seves
Choose a base branch
from
Th0rOnDoR:xen-fastabi-seves
base: xen-fastabi-seves
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Teddy Astie <[email protected]>
Signed-off-by: Teddy Astie <[email protected]>
Signed-off-by: Teddy Astie <[email protected]>
SYSCFG_MEM_ENCRYPT is the AMD SME MSR used to enable SME and AMD SEV. Signed-off-by: Andrei Semenov <[email protected]>
struct svm_domain was in vmcb.h which is meant for VMCB specific operations and values, move it to svm.h where it belongs. Signed-off-by: Teddy Astie <[email protected]> --- v2: - remove unneeded vmcb.h include
Introduce vpid_sync_vcpu_context to do a single-context invalidation on the vpid attached to the vcpu as a alternative to per-gva and all-context invlidations. Signed-off-by: Teddy Astie <[email protected]>
From: Vaishali Thakkar <[email protected]> Currently ASID generation and management is done per-PCPU. This scheme is incompatible with SEV technologies as SEV VMs need to have a fixed ASID associated with all vcpus of the VM throughout it's lifetime. This commit introduces a Xen-wide allocator which initializes the asids at the start of xen and allows to have a fixed asids throughout the lifecycle of all domains. Having a fixed asid for non-SEV domains also presents us with the opportunity to further take use of AMD instructions like TLBSYNC and INVLPGB for broadcasting the TLB invalidations. Introduce vcpu->needs_tlb_flush attribute to schedule a guest TLB flush for the next VMRUN/VMENTER. This will be later be done using either TLB_CONTROL field (AMD) or INVEPT (Intel). This flush method is used in place of the current ASID swapping logic. TODO: - Intel: Don't assign the VPID at each VMENTER, though we need to rethink how we manage VMCS with nested virtualization / altp2m for changing this behavior. - AMD: Consider hot-plug of CPU with ERRATA_170. (is it possible ?) - Consider cases where we don't have enough ASIDs (e.g Xen as nested guest) - Nested virtualization ASID management Signed-off-by: Teddy Astie <[email protected]> Signed-off-by: Vaishali Thakkar <[email protected]> --- Changes since v4: - track vCPU migrations and flush TLB after them - add missing TLB flushes in guest_flush_tlb_flags Changes since v3: - Simplified asid bitmap management It is only called once per domain, so it doesn't need to have a complicated logic. - Drop hvm_asid_data structure which doesn't serve a purpose anymore. - Introduce and use vcpu->needs_tlb_flush to indicate that a guest TLB flush is needed before waking the vcpu. It is used to set TLB_CONTROL (AMD) field properly or make a appropriate invept (Intel). - Only assign ASID once (see TODO for Intel side) - Check the ERRATA_170 for each CPU present. Changes since v2: - Moved hvm_asid_domain_create to hvm_domain_initialise - Added __ro_after_init for bitmaps - Make hvm_asid_init unsigned int __init - Remove functions hvm_asid_flush_domain_asid and hvm_asid_flush_vcpu - Mark ASID 0 permenantly - Remove the irrelevant tracking of generation - Add hvm_domain_asid_destroy to avoid layering violation - Remove unnecessary fixups touching the same code - Add a logic to move asids from reclaim_bitmap->asid_bitmap - Misc styling fixes - remove unncessary trailing spaces/printks Changes since v1: - Introudce hvm_asid_bitmap as discussed at Xen-summit - Introduce hvm_reclaim_bitmap for reusing ASIDs - Assign the asid to the domain at the domain creation via hvm_asid_domain_create - Corrected the use of CPUID in the svm_asid_init function - Adjusted the code in nested virtualization related files to use new scheme. As discussed at the Xen-summit, this is not tested. - Addressed Jan's comments about using uniform style for accessing domains via v->domain - Allow to flush at the vcpu level in HAP code - Documented the sketch of implementation for the new scheme - Remove min_asid as for this patch, we are not demonstarting it's usecase - Arrange includes in multiple files as per Jan's feedback
Signed-off-by: Teddy Astie <[email protected]>
From: Andrei Semenov <[email protected]> Introduce a basic PSP driver with focus on SEV commands. Signed-off-by: Andrei Semenov <[email protected]> Signed-off-by: Teddy Astie <[email protected]>
Introduce a subsystem that is used for future confidential computing platforms. This subsystem manages and provides hooks for domain management and exposes various informations for toolstack (COCO platform, supported features, ...). Add a domain creation flag to build a confidential computing guest. Signed-off-by: Teddy Astie <[email protected]>
From: Vaishali Thakkar <[email protected]> Signed-off-by: Vaishali Thakkar <[email protected]> Signed-off-by: Teddy Astie <[email protected]> Fix wrong size initrd
Those bits are used to enable SEV-related features in VMCB. Signed-off-by: Andrei Semenov <[email protected]> Signed-off-by: Teddy Astie <[email protected]> (commit)
Signed-off-by: Teddy Astie <[email protected]> --- v2 - backport cpuid fixups
From: Andrei Semenov <[email protected]> AMD-SEV is AMD implementation of confidential computing. (TODO: say more regarding this) Signed-off-by: Andrei Semenov <[email protected]> Signed-off-by: Teddy Astie <[email protected]>
From: Andrei Semenov <[email protected]> Some code paths are not emulable under SEV or needs special handling. Signed-off-by: Andrei Semenov <[email protected]> Signed-off-by: Teddy Astie <[email protected]>
Signed-off-by: Teddy Astie <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.