39dd3e1f55
kvm: i8254: require KVM_CAP_PIT2 and KVM_CAP_PIT_STATE2
...
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 19:53:38 +02:00
52b04ea49d
kvm: i386: require KVM_CAP_SET_IDENTITY_MAP_ADDR
...
This was introduced in KVM in Linux 2.6.32, we can require it unconditionally.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 19:53:38 +02:00
700766ba60
kvm: i386: require KVM_CAP_ADJUST_CLOCK
...
This was introduced in KVM in Linux 2.6.33, we can require it
unconditionally. KVM_CLOCK_TSC_STABLE was only added in Linux 4.9,
for now do not require it (though it would allow the removal of some
pretty yucky code).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 19:53:38 +02:00
86f2438fc2
kvm: i386: require KVM_CAP_MCE
...
This was introduced in KVM in Linux 2.6.34, we can require it unconditionally.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 19:53:38 +02:00
1a44a79ddf
kvm: i386: require KVM_CAP_SET_VCPU_EVENTS and KVM_CAP_X86_ROBUST_SINGLESTEP
...
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 19:53:30 +02:00
8bba0a3b76
kvm: i386: require KVM_CAP_XSAVE
...
This was introduced in KVM in Linux 2.6.36, and could already be used at
the time to save/restore FPU data even on older processor. We can require
it unconditionally and stop using KVM_GET/SET_FPU.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:15 +02:00
f57a4dd311
kvm: i386: require KVM_CAP_DEBUGREGS
...
This was introduced in KVM in Linux 2.6.35, we can require it unconditionally.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:15 +02:00
4b2991666c
kvm: i386: move KVM_CAP_IRQ_ROUTING detection to kvm_arch_required_capabilities
...
Simple code cleanup.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:15 +02:00
a788260b20
kvm: require KVM_IRQFD for kernel irqchip
...
KVM_IRQFD was introduced in Linux 2.6.32, and since then it has always been
available on architectures that support an in-kernel interrupt controller.
We can require it unconditionally.
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:15 +02:00
cc5e719e2c
kvm: require KVM_CAP_SIGNAL_MSI
...
This was introduced in KVM in Linux 3.5, we can require it unconditionally
in kvm_irqchip_send_msi(). However, not all architectures have to implement
it so check it only in x86, the only architecture that ever had MSI injection
but not KVM_CAP_SIGNAL_MSI.
ARM uses it to detect the presence of the ITS emulation in the kernel,
introduced in Linux 4.8. Assume that it's there and possibly fail when
realizing the arm-its-kvm device.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:14 +02:00
d830054247
target/i386: check CPUID_PAE to determine 36 bit processor address space
...
PAE mode in x86 supports 36 bit address space. Check the PAE CPUID on the
guest processor and set phys_bits to 36 if PAE feature is set. This is in
addition to checking the presence of PSE36 CPUID feature for setting 36 bit
phys_bits.
Signed-off-by: Ani Sinha <anisinha@redhat.com >
Acked-by: Michael S. Tsirkin <mst@redhat.com >
Reviewed-by: David Hildenbrand <david@redhat.com >
Message-ID: <20230912120650.371781-1-anisinha@redhat.com >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:14 +02:00
e000687f12
target/i386: validate VEX.W for AVX instructions
...
Instructions in VEX exception class 6 generally look at the value of
VEX.W. Note that the manual places some instructions incorrectly in
class 4, for example VPERMQ which has no non-VEX encoding and no legacy
SSE analogue. AMD does a mess of its own, as documented in the comment
that this patch adds.
Most of them are checked for VEX.W=0, and are listed in the manual
(though with an omission) in table 2-16; VPERMQ and VPERMPD check for
VEX.W=1, which is only listed in the instruction description. Others,
such as VPSRLV, VPSLLV and the FMA3 instructions, use VEX.W to switch
between a 32-bit and 64-bit operation.
Fix more of the class 4/class 6 mismatches, and implement the check for
VEX.W in TCG.
Acked-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:07 +02:00
183e6679e3
target/i386: group common checks in the decoding phase
...
In preparation for adding more similar checks, move the VEX.L=0 check
and several X86_SPECIAL_* checks to a new field, where each bit represent
a common check on unused bits, or a restriction on the processor mode.
Likewise, many SVM intercepts can be checked during the decoding phase,
the main exception being the selective CR0 write, MSR and IOIO intercepts.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:07 +02:00
e582b629f0
target/i386: implement SHA instructions
...
The implementation was validated with OpenSSL and with the test vectors in
https://github.com/rust-lang/stdarch/blob/master/crates/core_arch/src/x86/sha.rs .
The instructions provide a ~25% improvement on hashing a 64 MiB file:
runtime goes down from 1.8 seconds to 1.4 seconds; instruction count on
the host goes down from 5.8 billion to 4.8 billion with slightly better
IPC too. Good job Intel. ;)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com >
2023-10-25 17:35:07 +02:00
ba9c09b40b
target/sparc: Remove disas_sparc_legacy
...
All instructions are now converted.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
3a38260e3c
target/sparc: Convert FZERO, FONE to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
2f72264169
target/sparc: Move FPACK16, FPACKFIX to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
e2fa6bd1ad
target/sparc: Move FPCMP* to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
40f9ad219b
target/sparc: Convert FCMP, FCMPE to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
f7ec8155f5
target/sparc: Move FMOVR, FMOVcc, FMOVfcc to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
f4e18df576
target/sparc: Move FMOVq, FNEGq, FABSq to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
7b8e3e1a87
target/sparc: Move FdTOq, FxTOq to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
13ebcc7749
target/sparc: Move FiTOq, FsTOq to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
1617586f5a
target/sparc: Move FqTOd, FqTOx to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
bd9c5c428f
target/sparc: Move FqTOs, FqTOi to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
199d43efb1
target/sparc: Move FiTOd, FsTOd, FsTOx to decodetree
...
Note that gen_ne_fop_DF was incorrectly named and does pass env.
The two sets of helpers should have been unified.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
8c94bcd850
target/sparc: Move gen_fop_FD insns to decodetree
...
Move FdTOs, FdTOi, FxTOs.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
5e3b17bbe9
target/sparc: Move FDMULQ to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
ff4c711b8d
target/sparc: Move FSMULD to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
a405623991
target/sparc: Move gen_fop_QQQ insns to decodetree
...
Move FADDq, FSUBq, FMULq, FDIVq.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
f2a59b0ad7
target/sparc: Move gen_fop_DDD insns to decodetree
...
Move FADDd, FSUBd, FMULd, FDIVd.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
c1514961e6
target/sparc: Move gen_fop_FFF insns to decodetree
...
Move FADDs, FSUBs, FMULs, FDIVs.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
c995216bab
target/sparc: Move FSQRTq to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
8aa418b3ef
target/sparc: Move gen_fop_DD insns to decodetree
...
Move FSQRTd, FxTOd, FdTOx.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
119cb94f69
target/sparc: Move gen_fop_FF insns to decodetree
...
Move FSQRTs, FiTOs, FsTOi.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
4b6edc0a27
target/sparc: Move gen_gsr_fop_DDD insns to decodetree
...
Move FPACK32, FALIGNDATA, BSHUFFLE.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
afb043448b
target/sparc: Move PDIST to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
e06c9f83c6
target/sparc: Move gen_ne_fop_DDD insns to decodetree
...
Move FMUL8x16, FMUL8x16AU, FMUL8x16AL, FMUL8SUx16, FMUL8ULx16,
FMULD8SUx16, FMULD8ULx16, FPMERGE, FEXPAND, FANDNOT1d, FANDNOT2d,
FANDd, FNANDd, FNORd, FORNOT1d, FORNOT2d, FORd, FPADD16d, FPADD32d,
FPSUB16d, FPSUB32d, FXNORd, FXORd.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
7f10b52f7b
target/sparc: Move gen_ne_fop_FFF insns to decodetree
...
Move FANDNOT1s, FANDNOT2s, FANDs, FNANDs, FNORs, FORNOT1s, FORNOT2s,
FORs, FPADD16s, FPADD32s, FPSUB16s, FPSUB32s, FXNORs, FXORs.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
fafba1bb0b
target/sparc: Use tcg_gen_vec_{add,sub}*
...
Replace the local helpers for the same integer operations.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
c6d83e4ff5
target/sparc: Move FMOVD, FNEGD, FABSD, FSRC*D, FNOT*D to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
baf3dbf258
target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
39ca3490f8
target/sparc: Move BMASK to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
9e20ca9409
target/sparc: Move ADDRALIGN* to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
45bfed3b2c
target/sparc: Move ARRAY* to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
b88ce6f246
target/sparc: Move EDGE* to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
da68140604
target/sparc: Merge LDFSR, LDXFSR implementations
...
Combine the helper to a single set_fsr().
Perform the mask and merge inline.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
3d3c06737b
target/sparc: Move LDFSR, STFSR to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
287b11520b
target/sparc: Move asi fp load/store to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00
06c060d9e5
target/sparc: Move simple fp load/store to decodetree
...
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
2023-10-25 01:01:13 -07:00