-
Notifications
You must be signed in to change notification settings - Fork 21
x86/hyperv: Fix wrong argument to hv_vtl_bringup_vcpu #125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -298,32 +298,17 @@ int hv_snp_boot_ap(u32 apic_id, unsigned long start_ip, unsigned int cpu) | |||||||||||||
| struct sev_es_save_area *cur_vmsa; | ||||||||||||||
| struct desc_ptr gdtr; | ||||||||||||||
| struct hv_enable_vp_vtl *start_vp_input; | ||||||||||||||
| int cpu_id = -EINVAL; | ||||||||||||||
| unsigned long flags; | ||||||||||||||
| int vp_index = apic_id; | ||||||||||||||
| int vp_index; | ||||||||||||||
| u64 ret, retry = 5; | ||||||||||||||
|
|
||||||||||||||
| if (!vmsa) | ||||||||||||||
| return -ENOMEM; | ||||||||||||||
|
|
||||||||||||||
| #ifdef CONFIG_HYPERV_VTL_MODE | ||||||||||||||
| int i; | ||||||||||||||
|
|
||||||||||||||
| for_each_possible_cpu(i) { | ||||||||||||||
| if (per_cpu(x86_cpu_to_apicid, i) == apic_id) { | ||||||||||||||
| cpu_id = i; | ||||||||||||||
| break; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (cpu_id == -EINVAL) | ||||||||||||||
| panic("%s: no cpu found for APIC ID %d\n", __func__, apic_id); | ||||||||||||||
|
|
||||||||||||||
| /* Find the Hyper-V VP index which might be not the same as APIC ID */ | ||||||||||||||
| vp_index = hv_apicid_to_vp_index(apic_id); | ||||||||||||||
| if (vp_index < 0 || vp_index > ms_hyperv.max_vp_index) | ||||||||||||||
| return -EINVAL; | ||||||||||||||
|
Comment on lines
310
to
311
|
||||||||||||||
| if (vp_index < 0 || vp_index > ms_hyperv.max_vp_index) | |
| return -EINVAL; | |
| if (vp_index < 0 || vp_index > ms_hyperv.max_vp_index) { | |
| free_page((u64)vmsa); | |
| return -EINVAL; | |
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1373,7 +1373,7 @@ static __init int print_s5_reset_status_mmio(void) | |||||
| * The below ioread32() causes a triple fault for SNP due to a hypevisor | ||||||
| * bug. Work it around for now. | ||||||
| */ | ||||||
| if (!ms_hyperv.paravisor_present && hv_isolation_type_snp()) | ||||||
| if (!ms_hyperv.paravisor_present && hv_is_isolation_supported()) | ||||||
|
||||||
| if (!ms_hyperv.paravisor_present && hv_is_isolation_supported()) | |
| if (!ms_hyperv.paravisor_present && hv_isolation_type_snp()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description focuses on fixing the wrong argument passed to hv_vtl_bringup_vcpu(), but this PR also changes Hyper-V isolation gating in arch/x86/kernel/cpu/amd.c and per-CPU VMSA bookkeeping in arch/x86/hyperv/ivm.c. Please either mention these additional changes in the PR description (with rationale) or split them into separate commits/PRs so the fix can be reviewed/merged independently.