- Sep 12, 2014
-
-
Peter Maydell authored
Make the debug_excp_handler target specific hook into a QOM CPU method. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Sep 05, 2014
-
-
Eduardo Habkost authored
Instead of simply printing a warning, report an error when invalid CPU options are provided on the CPU model string. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
When the "migratable" property was implemented, the behavior was tested by changing the default on the code, but actually using the option on the command-line (e.g. "-cpu host,migratable=false") doesn't work as expected. This is a regression for a common use case of "-cpu host", which is to enable features that are supported by the host CPU + kernel before feature-specific code is added to QEMU. Fix this by initializing the feature words for "-cpu host" on x86_cpu_parse_featurestr(), right after parsing the CPU options. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Michael Roth <mdroth@linux.vnet.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
- Aug 26, 2014
-
-
Eduardo Habkost authored
tsc_adjust migration support is already implemented (commit f28558d3), so we can add it to the list of known feature names. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Eduardo Habkost authored
Migration support for MPX is already implemented (commit 79e9ebeb), so we can add it to the list of known feature names. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Aug 25, 2014
-
-
Alex Williamson authored
The SDM specifies (June 2014 Vol3 11.11.5): On a hardware reset, the P6 and more recent processors clear the valid flags in variable-range MTRRs and clear the E flag in the IA32_MTRR_DEF_TYPE MSR to disable all MTRRs. All other bits in the MTRRs are undefined. We currently do none of that, so whatever MTRR settings you had prior to reset is what you have after reset. Usually this doesn't matter because KVM often ignores the guest mappings and uses write-back anyway. However, if you have an assigned device and an IOMMU that allows NoSnoop for that device, KVM defers to the guest memory mappings which are now stale after reset. The result is that OVMF rebooting on such a configuration takes a full minute to LZMA decompress the firmware volume, a process that is nearly instant on the initial boot. Signed-off-by:
Alex Williamson <alex.williamson@redhat.com> Reviewed-by:
Laszlo Ersek <lersek@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Williamson authored
The MTRR state in KVM currently runs completely independent of the QEMU state in CPUX86State.mtrr_*. This means that on migration, the target loses MTRR state from the source. Generally that's ok though because KVM ignores it and maps everything as write-back anyway. The exception to this rule is when we have an assigned device and an IOMMU that doesn't promote NoSnoop transactions from that device to be cache coherent. In that case KVM trusts the guest mapping of memory as configured in the MTRR. This patch updates kvm_get|put_msrs() so that we retrieve the actual vCPU MTRR settings and therefore keep CPUX86State synchronized for migration. kvm_put_msrs() is also used on vCPU reset and therefore allows future modificaitons of MTRR state at reset to be realized. Note that the entries array used by both functions was already slightly undersized for holding every possible MSR, so this patch increases it beyond the 28 new entries necessary for MTRR state. Signed-off-by:
Alex Williamson <alex.williamson@redhat.com> Reviewed-by:
Laszlo Ersek <lersek@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Williamson authored
We currently define the number of variable range MTRR registers as 8 in the CPUX86State structure and vmstate, but use MSR_MTRRcap_VCNT (also 8) to report to guests the number available. Change this to use MSR_MTRRcap_VCNT consistently. Signed-off-by:
Alex Williamson <alex.williamson@redhat.com> Reviewed-by:
Laszlo Ersek <lersek@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
William Grant authored
Commit e8f6d00c ("target-i386: raise page fault for reserved physical address bits") added a check that the NX bit is not set on PAE PDPEs, but it also added it to rsvd_mask for the rest of the function. This caused any PDEs or PTEs with NX set to be erroneously rejected, making PAE guests with NX support unusable. Signed-off-by:
William Grant <wgrant@ubuntu.com> Cc: qemu-stable@nongnu.org Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Aug 22, 2014
-
-
Jincheng Miao authored
Currently syscall instruction is buggy on user mode X86_64, the EIP is updated after do_syscall(), that is too late for clone(). Because clone() will create a thread at the env->EIP (the address of syscall insn), and then child thread enters do_syscall() again, that is not expected. Sometimes it is tragic. User mode syscall insn emulation is not used MSR, so the action should be same to INT 0x80. INT 0x80 will update EIP in do_interrupt(), ditto for syscall() for consistency. Signed-off-by:
Jincheng Miao <jmiao@redhat.com> Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Riku Voipio <riku.voipio@linaro.org>
-
- Aug 12, 2014
-
-
Lluís Vilanova authored
Signed-off-by:
Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Aug 08, 2014
-
-
chenfan authored
Signed-off-by:
Chen Fan <chen.fan.fnst@cn.fujitsu.com> Reviewed-by:
Igor Mammedov <imammedo@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Jul 15, 2014
-
-
Ricky Zhou authored
Previously, execute would be disabled for all pages with SMEP enabled, regardless of what mode the access took place in. Signed-off-by:
Ricky Zhou <ricky@rzhou.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jul 10, 2014
-
-
Eduardo Habkost authored
KVM_FEATURE_CLOCKSOURCE_STABLE_BIT is enabled by default and supported by KVM. But not having a name defined makes QEMU treat it as an unknown and unmigratable feature flag (as any unknown feature may possibly require state to be migrated), and disable it by default on "-cpu host". As a side-effect, the new name also makes the flag configurable, allowing the user to disable it (which may be useful for testing or for compatibility with old kernels). Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 25, 2014
-
-
Eduardo Habkost authored
This adds a new CPU model named "Broadwell". It has all the features from Haswell, plus PREFETCHW, RDSEED, ADX, SMAP. PREFETCHW was already supported as "3dnowprefetch". RDSEED, ADX was added on Linux v3.15-rc1. SMAP was added on Linux v3.15-rc2. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Cc: Wang, Yong Y <yong.y.wang@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Dugger, Donald D <donald.d.dugger@intel.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Marcelo Tosatti authored
Expose "Invariant TSC" flag, if KVM is enabled. From Intel documentation: 17.13.1 Invariant TSC The time stamp counter in newer processors may support an enhancement, referred to as invariant TSC. Processor’s support for invariant TSC is indicated by CPUID.80000007H:EDX[8]. The invariant TSC will run at a constant rate in all ACPI P-, C-. and T-states. This is the architectural behavior moving forward. On processors with invariant TSC support, the OS may use the TSC for wall clock timer services (instead of ACPI or HPET timers). TSC reads are much more efficient and do not incur the overhead associated with a ring transition or access to a platform resource. Signed-off-by:
Marcelo Tosatti <mtosatti@redhat.com> [ehabkost: redo feature filtering to use .tcg_features] [ehabkost: add CPUID_APM_INVTSC macro, add it to .unmigratable_flags] Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Marcelo Tosatti authored
Invariant TSC documentation mentions that "invariant TSC will run at a constant rate in all ACPI P-, C-. and T-states". This is not the case if migration to a host with different TSC frequency is allowed, or if savevm is performed. So block migration/savevm. Signed-off-by:
Marcelo Tosatti <mtosatti@redhat.com> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> [AF+mtosatti: Updated error message] Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Having only migratable flags reported by default on the "host" CPU model is safer for the following reasons: * Existing users may expect "-cpu host" to be migration-safe, if they take care of always using compatible host CPUs, host kernels, and QEMU versions. * Users who don't care aboug migration and want to enable all features supported by the host kernel can simply change their setup to use migratable=no. Without this change, people using "-cpu host" will stop being able to migrate, because now "invtsc" is getting enabled by default. We are not setting migratable=yes by default on all X86CPU subclasses, because users should be able to get non-migratable features enabled if they ask for them explicitly. Reviewed-by:
Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
This flag will allow the user to choose between two modes: * All flags that can be enabled on the host, even if unmigratable (migratable=no); * All flags that can be enabled on the host, are known to QEMU and migratable (migratable=yes). The default is still migratable=false, to keep current behavior, but this will be changed to migratable=true by another patch. My plan was to support the "migratable" flag on all CPU classes, but have the default to "false" on all CPU models except "host". However, DeviceClass has no mechanism to allow a child class to have a different property default from the parent class yet, so by now only the "host" CPU model will support the "migratable" flag. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
If enforce/check is specified in TCG mode, QEMU will ensure all CPU features are supported by TCG, so no CPU feature is silently disabled. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> [AF: Be explicit about TCG vs. !KVM] Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Instead of manually filtering each feature word, add a tcg_features field to FeatureWordInfo, and use that field to filter all feature words in TCG mode. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Now that we have the feature word arrays, we don't need to manually copy each array item, we can simply iterate through each feature word. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Those macros will be used in the feature_word_info array data, so need to be defined earlier. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
TCG doesn't support any of the feature flags on FEAT_KVM and FEAT_C000_0001_EDX feature words, so clear all bits on those feature words. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
The TCG_7_0_EBX_FEATURES macro was defined but never used (it even had a typo that was never noticed). Make the existing TCG feature filtering code use it. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Instead of an #ifdef in the middle of the code, just set TCG_EXT2_FEATURES to a different value depending on TARGET_X86_64. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
This will allow us to re-use the feature filtering logic (and the check/enforce flag logic) for TCG. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
This will help us simplify the code that calls report_unavailable_features() later. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Merge filter_features_for_kvm() and kvm_check_features_against_host(). Both functions made exactly the same calculations, the only difference was that filter_features_for_kvm() changed the bits on cpu->features[], and kvm_check_features_against_host() did error reporting. Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
Instead of checking and calling unavailable_host_feature() once for each bit, simply call the function (now renamed to report_unavailable_features()) once for each feature word. Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> [AF: Drop unused return value] Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
Eduardo Habkost authored
KVM never supported the MONITOR flag so it doesn't make sense to have it enabled by default when KVM is enabled. The rationale here is similar to the cases where it makes sense to have a feature enabled by default on all CPU models when on KVM mode (e.g. x2apic). In this case we are having a feature disabled by default for the same reasons. In this case we don't need machine-type compat code because it is currently impossible to run a KVM VM with the MONITOR flag set. Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Andreas Färber <afaerber@suse.de>
-
- Jun 16, 2014
-
-
Tom Musta authored
This patch eliminates the (now) redundant copy of the Advanced Encryption Standard (AES) ShiftRows and InvShiftRows tables; the code is updated to use the common tables declared in include/qemu/aes.h. Signed-off-by:
Tom Musta <tommusta@gmail.com> Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Alexander Graf <agraf@suse.de>
-
Juan Quintela authored
After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong: .fields = (VMStateField []) { and .fields = (VMStateField []) { Change all the combinations to: .fields = (VMStateField[]){ The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another. Signed-off-by:
Juan Quintela <quintela@redhat.com> Acked-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Jun 10, 2014
-
-
Paolo Bonzini authored
Because of the "goto out", the contents of local_err are leaked and lost. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Peter Maydell authored
The function tcg_gen_lshift() is unused; remove it. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
- Jun 05, 2014
-
-
Paolo Bonzini authored
Make the code a bit more similar to x86_cpu_handle_mmu_fault. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
User pages must be marked as non-executable when running under SMEP; otherwise, fetching the page first and then calling it will fail. With this patch, all SMEP testcases in kvm-unit-tests now pass. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
4MB pages can use 40-bit addresses by putting the higher 8 bits in bits 20-13 of the PDE. Bit 21 is reserved. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
In large pages, bit 12 is for PAT, but bits starting at 13 are reserved. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-