mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* target/i386: bugfixes * regenerate meson-buildoptions.sh # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmh5FGsUHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroN8LQf/bUbOs4rNMO8SM5j0l8z3AzYZzoI+ # fhJYsvg1mKRg9A+bB1zhb6pKgANRir5s9DQw1BhDkRVvIUDSloefl/aUTP8WYbho # TfS1f3BDv1nvR9EiPHSIBJx5bN+by1rOjxZTa+m1tFT5rpTQu5mV/RjKtl1Pri3r # V6W0zxBUhj4TG0cgiX+yIJSB4lr2tjMVMVI82ggkKaYI+1cyJGuPiMydmlF0kz1o # vEZDF0KAonBZgGtYQWtTbB8Fj3bLUg8YlQOyXijsRi9xE/gZ6FKHkOHpgmWEz9is # zb6q5rqBT8opo63/NCtSTK4vyTRAoLVZ6ZzFxH5GoRKo28SctKTd5/BwWA== # =Z7qn # -----END PGP SIGNATURE----- # gpg: Signature made Thu 17 Jul 2025 11:19:07 EDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: i386/tdx: Remove the redundant qemu_mutex_init(&tdx->lock) i386/cpu: Cleanup host_cpu_max_instance_init() target/i386: tdx: fix locking for interrupt injection meson: re-generate scripts/meson-buildoptions.sh to fix IGVM entry i386/cpu: Move x86_ext_save_areas[] initialization to .instance_init target/i386: do not expose ARCH_CAPABILITIES on AMD CPU Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
@@ -130,7 +130,7 @@ meson_options_help() {
|
||||
printf "%s\n" ' hv-balloon hv-balloon driver (requires Glib 2.68+ GTree API)'
|
||||
printf "%s\n" ' hvf HVF acceleration support'
|
||||
printf "%s\n" ' iconv Font glyph conversion support'
|
||||
printf "%s\n" ' igvm IGVM file support'
|
||||
printf "%s\n" ' igvm Independent Guest Virtual Machine (IGVM) file support'
|
||||
printf "%s\n" ' jack JACK sound support'
|
||||
printf "%s\n" ' keyring Linux keyring support'
|
||||
printf "%s\n" ' kvm KVM acceleration support'
|
||||
|
||||
+15
-7
@@ -9619,6 +9619,16 @@ static void x86_cpu_register_feature_bit_props(X86CPUClass *xcc,
|
||||
}
|
||||
|
||||
static void x86_cpu_post_initfn(Object *obj)
|
||||
{
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (current_machine && current_machine->cgs) {
|
||||
x86_confidential_guest_cpu_instance_init(
|
||||
X86_CONFIDENTIAL_GUEST(current_machine->cgs), (CPU(obj)));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void x86_cpu_init_xsave(void)
|
||||
{
|
||||
static bool first = true;
|
||||
uint64_t supported_xcr0;
|
||||
@@ -9639,13 +9649,6 @@ static void x86_cpu_post_initfn(Object *obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (current_machine && current_machine->cgs) {
|
||||
x86_confidential_guest_cpu_instance_init(
|
||||
X86_CONFIDENTIAL_GUEST(current_machine->cgs), (CPU(obj)));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void x86_cpu_init_default_topo(X86CPU *cpu)
|
||||
@@ -9715,6 +9718,11 @@ static void x86_cpu_initfn(Object *obj)
|
||||
x86_cpu_load_model(cpu, xcc->model);
|
||||
}
|
||||
|
||||
/*
|
||||
* accel's cpu_instance_init may have the xsave check,
|
||||
* so x86_ext_save_areas[] must be initialized before this.
|
||||
*/
|
||||
x86_cpu_init_xsave();
|
||||
accel_cpu_instance_init(CPU(obj));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
uint32_t host_cpu_phys_bits(void);
|
||||
void host_cpu_instance_init(X86CPU *cpu);
|
||||
void host_cpu_max_instance_init(X86CPU *cpu);
|
||||
bool host_cpu_realizefn(CPUState *cs, Error **errp);
|
||||
|
||||
void host_cpu_vendor_fms(char *vendor, int *family, int *model, int *stepping);
|
||||
|
||||
@@ -503,8 +503,12 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
|
||||
* Linux v4.17-v4.20 incorrectly return ARCH_CAPABILITIES on SVM hosts.
|
||||
* We can detect the bug by checking if MSR_IA32_ARCH_CAPABILITIES is
|
||||
* returned by KVM_GET_MSR_INDEX_LIST.
|
||||
*
|
||||
* But also, because Windows does not like ARCH_CAPABILITIES on AMD
|
||||
* mcahines at all, do not show the fake ARCH_CAPABILITIES MSR that
|
||||
* KVM sets up.
|
||||
*/
|
||||
if (!has_msr_arch_capabs) {
|
||||
if (!has_msr_arch_capabs || !(edx & CPUID_7_0_EDX_ARCH_CAPABILITIES)) {
|
||||
ret &= ~CPUID_7_0_EDX_ARCH_CAPABILITIES;
|
||||
}
|
||||
} else if (function == 7 && index == 1 && reg == R_EAX) {
|
||||
|
||||
@@ -1126,10 +1126,15 @@ int tdx_parse_tdvf(void *flash_ptr, int size)
|
||||
return tdvf_parse_metadata(&tdx_guest->tdvf, flash_ptr, size);
|
||||
}
|
||||
|
||||
static void tdx_inject_interrupt(uint32_t apicid, uint32_t vector)
|
||||
static void tdx_inject_interrupt(TdxGuest *tdx)
|
||||
{
|
||||
int ret;
|
||||
uint32_t apicid, vector;
|
||||
|
||||
qemu_mutex_lock(&tdx->lock);
|
||||
vector = tdx->event_notify_vector;
|
||||
apicid = tdx->event_notify_apicid;
|
||||
qemu_mutex_unlock(&tdx->lock);
|
||||
if (vector < 32 || vector > 255) {
|
||||
return;
|
||||
}
|
||||
@@ -1179,8 +1184,7 @@ static void tdx_get_quote_completion(TdxGenerateQuoteTask *task)
|
||||
error_report("TDX: get-quote: failed to update GetQuote header.");
|
||||
}
|
||||
|
||||
tdx_inject_interrupt(tdx_guest->event_notify_apicid,
|
||||
tdx_guest->event_notify_vector);
|
||||
tdx_inject_interrupt(tdx);
|
||||
|
||||
g_free(task->send_data);
|
||||
g_free(task->receive_buf);
|
||||
@@ -1523,8 +1527,6 @@ static void tdx_guest_init(Object *obj)
|
||||
tdx_guest_set_qgs,
|
||||
NULL, NULL);
|
||||
|
||||
qemu_mutex_init(&tdx->lock);
|
||||
|
||||
tdx->event_notify_vector = -1;
|
||||
tdx->event_notify_apicid = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user