Skip to content
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

KVM: SVM: CSV: Explicitly enable LBR Virtualization after succeed to … #362

Merged

Conversation

Avenger-285714
Copy link
Collaborator

…RECEIVE_UPDATE_VMSA

hygon inclusion
category: feature
CVE: NA


Before the commit b7e4be0a224f ("KVM: SEV-ES: Delegate LBR virtualization to the processor"), the LBR Virtualization is enabled during init VMCB:
init_vmcb() -> sev_init_vmcb() -> sev_es_init_vmcb()

While the commit b7e4be0a224f ("KVM: SEV-ES: Delegate LBR virtualization to the processor") enable LBR Virtualization after succeed to LAUNCH_UPDATE_VMSA for each vCPUs. The process to enable LBR Virtualization will not be executed in common code path. To ensure the CSV2 guest to work properly after migrated to target machine, we should explicitly to enable LBR Virtualization after succeed to RECEIVE_UPDATE_VMSA for each vCPUs.

Fixes: b7e4be0a224f ("KVM: SEV-ES: Delegate LBR virtualization to the processor")

…RECEIVE_UPDATE_VMSA

hygon inclusion
category: feature
CVE: NA

---------------------------

Before the commit b7e4be0a224f ("KVM: SEV-ES: Delegate LBR
virtualization to the processor"), the LBR Virtualization is enabled
during init VMCB:
    init_vmcb() -> sev_init_vmcb() -> sev_es_init_vmcb()

While the commit b7e4be0a224f ("KVM: SEV-ES: Delegate LBR
virtualization to the processor") enable LBR Virtualization after
succeed to LAUNCH_UPDATE_VMSA for each vCPUs. The process to enable LBR
Virtualization will not be executed in common code path. To ensure the
CSV2 guest to work properly after migrated to target machine, we should
explicitly to enable LBR Virtualization after succeed to
RECEIVE_UPDATE_VMSA for each vCPUs.

Fixes: b7e4be0a224f ("KVM: SEV-ES: Delegate LBR virtualization to the processor")
Signed-off-by: hanliyang <[email protected]>
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • 在新增代码中,注释使用了英文,应根据项目规范决定是否需要使用中文注释以保持一致性。
  • vcpu->arch.guest_state_protected 赋值操作应该在 kfree(vmsa) 之后添加错误处理,以确保 kfree 操作成功后再设置状态。
  • svm_enable_lbrv(vcpu); 函数调用缺少错误处理,如果函数执行失败,应该有相应的处理逻辑。

是否建议立即修改:

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from avenger-285714. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Avenger-285714 Avenger-285714 self-assigned this Aug 13, 2024
@Avenger-285714 Avenger-285714 merged commit dd5139c into deepin-community:linux-6.6.y Aug 13, 2024
4 of 6 checks passed
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.

2 participants