QOM CPUState patch queue 2012-11-15
Hello Anthony,
Here's some steps towards CPU-as-a-device and two new x86 CPU models. Please pull.
I decided to take only a conservative patch selection at this late hour:
Getting the qdev split in avoids having to rebase and review this over and over. While the CPU as a device would have been helpful as a shared code base for continued development, it does not provide our users with added value as-is.
Unless you see it as an important feature for v1.3, warranting header file shuffling during the Hard Freeze, I'll just set up a -next tree for us.
Regards,
Andreas
The following changes since commit ce34cf72fe508b27a78f83c184142e8d1e6a048a:
Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-1.3.0-rc0' into staging (2012-11-14 08:53:40 -0600)
are available in the git repository at:
git://github.com/afaerber/qemu-cpu.git qom-cpu
for you to fetch changes up to 37507094f350b75c62dc059f998e7185de3ab60a:
target-i386: Add Haswell CPU model (2012-11-15 03:48:47 +0100)
----------------------------------------------------------------
Andre Przywara (2):
target-i386/cpu: Name new CPUID bits
target-i386/cpu: Add new Opteron CPU model
Andreas Färber (1):
osdep: Move qemu_{open,close}() prototypes
Anthony Liguori (1):
qdev: Split up header so it can be used in cpu.h
Eduardo Habkost (5):
qemu-common.h: Comment about usage rules
qemu-fsdev-dummy.c: Include module.h
vnc-palette.h: Include <stdbool.h>
qemu-config.h: Include headers it needs
target-i386: Add Haswell CPU model
Igor Mammedov (2):
Move qemu_irq typedef out of qemu-common.h
qapi-types.h: Don't include qemu-common.h
fsdev/qemu-fsdev-dummy.c | 1 + hw/arm-misc.h | 1 + hw/bt.h | 2 + hw/devices.h | 2 + hw/irq.h | 2 + hw/mc146818rtc.c | 1 + hw/omap.h | 1 + hw/qdev-addr.c | 1 + hw/qdev-core.h | 238 +++++++++++++++++++++++++++++ hw/qdev-monitor.h | 16 ++ hw/qdev-properties.c | 1 + hw/qdev-properties.h | 130 ++++++++++++++++ hw/qdev.c | 1 + hw/qdev.h | 370 +--------------------------------------------- hw/soc_dma.h | 1 + hw/xen.h | 1 + osdep.h | 3 + qemu-common.h | 14 +- qemu-config.h | 2 + scripts/qapi-types.py | 3 +- target-i386/cpu.c | 73 ++++++++- target-i386/cpu.h | 22 +++ ui/vnc-palette.h | 1 + 23 Dateien geändert, 510 Zeilen hinzugefügt(+), 377 Zeilen entfernt(-) create mode 100644 hw/qdev-core.h create mode 100644 hw/qdev-monitor.h create mode 100644 hw/qdev-properties.h
PATCH 1/11 qemu-common.h: Comment about usage rules
From: Eduardo Habkost <[email protected]>
Every time we make a tiny change on a header file, we often find circular header dependency problems. To avoid this nightmare, we need to stop including qemu-common.h from other headers, and we should gradually move the declarations from the catch-all qemu-common.h header to their specific headers.
This simply adds a comment documenting the rules about qemu-common.h, hoping that people will see it before including qemu-common.h from other header files, and before adding more declarations to qemu-common.h.
--- qemu-common.h | 11 ++++++++++-
1 Datei geändert, 10 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
qemu-common.h +10 -1
@@ -1,5 +1,14 @@ -/* Common header file that is included by all of qemu. */ +/* Common header file that is included by all of QEMU. +* +* This file is supposed to be included only by .c files. No header file should +* depend on qemu-common.h, as this would easily lead to circular header +* dependencies. +* +* If a header file uses a definition from qemu-common.h, that definition +* must be moved to a separate header file, and the header that uses it +* must include that header. +*/ #ifndef QEMU_COMMON_H #define QEMU_COMMON_H
Signature · 1 line
1.7.10.4
PATCH 2/11 Move qemu_irq typedef out of qemu-common.h
In reply to Andreas FärberFrom: Igor Mammedov <[email protected]>
It's necessary for making CPU child of DEVICE without causing circular header deps.
--- hw/arm-misc.h | 1 + hw/bt.h | 2 ++ hw/devices.h | 2 ++ hw/irq.h | 2 ++ hw/omap.h | 1 + hw/soc_dma.h | 1 + hw/xen.h | 1 + qemu-common.h | 1 -
8 Dateien geändert, 10 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
hw/arm-misc.h +1 -0
@@ -12,6 +12,7 @@#define ARM_MISC_H 1#include "memory.h" +#include "hw/irq.h" /* The CPU is also modeled as an interrupt controller. */ #define ARM_PIC_CPU_IRQ 0
hw/bt.h +2 -0
@@ -23,6 +23,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ +#include "hw/irq.h" +/* BD Address */ typedef struct { uint8_t b[6];
hw/devices.h +2 -0
@@ -1,6 +1,8 @@#ifndef QEMU_DEVICES_H #define QEMU_DEVICES_H +#include "hw/irq.h" +/* ??? Not all users of this file can include cpu-common.h. */ struct MemoryRegion ;
hw/irq.h +2 -0
@@ -3,6 +3,8 @@/* Generic IRQ/GPIO pin infrastructure. */ +typedef struct IRQState *qemu_irq ; +typedef void (*qemu_irq_handler )(void *opaque,int n,int level);void qemu_set_irq (qemu_irq irq,int level);
hw/omap.h +1 -0
@@ -19,6 +19,7 @@#ifndef hw_omap_h#include "memory.h" # define hw_omap_h "omap.h" +#include "hw/irq.h" # define OMAP_EMIFS_BASE 0x00000000# define OMAP2_Q0_BASE 0x00000000
hw/soc_dma.h +1 -0
@@ -19,6 +19,7 @@*/ #include "memory.h" +#include "hw/irq.h" struct soc_dma_s ;struct soc_dma_ch_s ;
hw/xen.h +1 -0
@@ -8,6 +8,7 @@*/ #include <inttypes.h> +#include "hw/irq.h" #include "qemu-common.h" /* xen-machine.c */
qemu-common.h +0 -1
@@ -292,7 +292,6 @@ typedef struct PCIEPort PCIEPort;typedef struct PCIESlot PCIESlot ;typedef struct MSIMessage MSIMessage ;typedef struct SerialState SerialState ; -typedef struct IRQState *qemu_irq ;typedef struct PCMCIACardState PCMCIACardState ;typedef struct MouseTransformInfo MouseTransformInfo ;typedef struct uWireSlave uWireSlave ;
Signature · 1 line
1.7.10.4
PATCH 3/11 qdev: Split up header so it can be used in cpu.h
In reply to Andreas FärberFrom: Anthony Liguori <[email protected]>
Header file dependency is a frickin' nightmare right now. cpu.h tends to get included in our 'include everything' header files but qdev also needs to include those headers mainly for qdev-properties since it knows about CharDriverState and friends.
We can solve this for now by splitting out qdev.h along the same lines that we previously split the C file. Then cpu.h just needs to include qdev-core.h.
hw/qdev.h is split into following new headers:
hw/qdev-core.h
hw/qdev-properties.h
hw/qdev-monitor.h
[ehabkost: re-add DEFINE_PROP_PCI_HOST_DEVADDR, that was removed on the
original patch (by mistake, I guess)]
[ehabkost: kill qdev_prop_set_vlan() declaration]
[ehabkost: moved get_fw_dev_path() comment to the original location
(I don't know why it was moved)]
[ehabkost: removed qdev_exists() declaration]
[ehabkost: keep using 'QemuOpts' instead of 'struct QemuOpts', as
qdev-core.h includes qemu-option.h]
--- hw/mc146818rtc.c | 1 + hw/qdev-addr.c | 1 + hw/qdev-core.h | 238 ++++++++++++++++++++++++++++++++ hw/qdev-monitor.h | 16 +++ hw/qdev-properties.c | 1 + hw/qdev-properties.h | 130 ++++++++++++++++++ hw/qdev.c | 1 + hw/qdev.h | 370 +------------------------------------------------- 8 Dateien geändert, 392 Zeilen hinzugefügt(+), 366 Zeilen entfernt(-) create mode 100644 hw/qdev-core.h create mode 100644 hw/qdev-monitor.h create mode 100644 hw/qdev-properties.h
hw/mc146818rtc.c +1 -0
@@ -25,6 +25,7 @@#include "qemu-timer.h" #include "sysemu.h" #include "mc146818rtc.h" +#include "qapi/qapi-visit-core.h" #ifdef TARGET_I386 #include "apic.h"
hw/qdev-addr.c +1 -0
@@ -1,6 +1,7 @@#include "qdev.h" #include "qdev-addr.h" #include "hwaddr.h" +#include "qapi/qapi-visit-core.h" /* --- target physical address --- */
hw/qdev-core.h new file +238 -0
238 lines not on this page · raw message
hw/qdev-monitor.h new file +16 -0
@@ -0,0 +1,16 @@ +#ifndef QEMU_QDEV_MONITOR_H +#define QEMU_QDEV_MONITOR_H + +#include "qdev-core.h" +#include "monitor.h" + +/*** monitor commands ***/ + +void do_info_qtree (Monitor *mon); +void do_info_qdm (Monitor *mon); +int do_device_add (Monitor *mon,const QDict *qdict,QObject **ret_data); +int do_device_del (Monitor *mon,const QDict *qdict,QObject **ret_data); +int qdev_device_help (QemuOpts *opts); +DeviceState *qdev_device_add (QemuOpts *opts); + +#endif
hw/qdev-properties.c +1 -0
@@ -4,6 +4,7 @@#include "blockdev.h" #include "hw/block-common.h" #include "net/hub.h" +#include "qapi/qapi-visit-core.h" void *qdev_get_prop_ptr (DeviceState *dev,Property *prop) {
hw/qdev-properties.h new file +130 -0
130 lines not on this page · raw message
hw/qdev.c +1 -0
@@ -29,6 +29,7 @@#include "qdev.h" #include "sysemu.h" #include "error.h" +#include "qapi/qapi-visit-core.h" int qdev_hotplug =0 ;static bool qdev_hot_added = false;
hw/qdev.h +4 -366
375 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 4/11 qemu-fsdev-dummy.c: Include module.h
In reply to Andreas FärberFrom: Eduardo Habkost <[email protected]>
module.h is where machine_init() is defined, but qemu-fsdev-dummy.c doesn't include it.
The header is probably being included by accident because some other headers are including qemu-common.h, but those headers should eventually stop including qemu-common.h.
--- fsdev/qemu-fsdev-dummy.c | 1 +
1 Datei geändert, 1 Zeile hinzugefügt(+)
fsdev/qemu-fsdev-dummy.c +1 -0
@@ -14,6 +14,7 @@#include <string.h> #include "qemu-fsdev.h" #include "qemu-config.h" +#include "module.h" int qemu_fsdev_add (QemuOpts *opts) {
Signature · 1 line
1.7.10.4
PATCH 5/11 vnc-palette.h: Include <stdbool.h>
In reply to Andreas FärberFrom: Eduardo Habkost <[email protected]>
<stdbool.h> is needed for the 'bool' type, used in the header.
The header is probably being included by accident because some other headers are including qemu-common.h, but those headers should eventually stop including qemu-common.h.
--- ui/vnc-palette.h | 1 +
1 Datei geändert, 1 Zeile hinzugefügt(+)
ui/vnc-palette.h +1 -0
@@ -32,6 +32,7 @@#include "qlist.h" #include "qemu-queue.h" #include <stdint.h> +#include <stdbool.h> #define VNC_PALETTE_HASH_SIZE 256#define VNC_PALETTE_MAX_SIZE 256
Signature · 1 line
1.7.10.4
PATCH 6/11 qemu-config.h: Include headers it needs
In reply to Andreas FärberFrom: Eduardo Habkost <[email protected]>
Include:
- <stdio.h> for FILE
- qemu-option.h for QemuOptsList
Some of those headers were probably being included by accident because some other headers were including qemu-common.h, but those headers should eventually stop including qemu-common.h.
--- qemu-config.h | 2 ++
1 Datei geändert, 2 Zeilen hinzugefügt(+)
qemu-config.h +2 -0
@@ -1,6 +1,8 @@#ifndef QEMU_CONFIG_H #define QEMU_CONFIG_H +#include <stdio.h> +#include "qemu-option.h" #include "error.h" extern QemuOptsList qemu_fsdev_opts;
Signature · 1 line
1.7.10.4
PATCH 7/11 osdep: Move qemu_{open, close}() prototypes
In reply to Andreas FärberThey are implemented in osdep.c, so keep the prototypes in osdep.h.
--- osdep.h | 3 +++ qemu-common.h | 2 --
2 Dateien geändert, 3 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
osdep.h +3 -0
@@ -136,6 +136,9 @@ void qemu_vfree(void *ptr);int qemu_madvise (void *addr,size_t len,int advice); +int qemu_open (const char *name,int flags, ...); +int qemu_close (int fd); +#if defined(__HAIKU__) && defined(__i386__)#define FMT_pid "%ld"#elif defined(WIN64 )
qemu-common.h +0 -2
@@ -217,8 +217,6 @@ const char *path(const char *pathname);void *qemu_oom_check (void *ptr); -int qemu_open (const char *name,int flags, ...); -int qemu_close (int fd); ssize_t qemu_write_full(int fd, const void *buf, size_t count) QEMU_WARN_UNUSED_RESULT;ssize_t qemu_send_full (int fd,const void *buf,size_t count,int flags)
Signature · 1 line
1.7.10.4
PATCH 8/11 qapi-types.h: Don't include qemu-common.h
In reply to Andreas FärberFrom: Igor Mammedov <[email protected]>
Needed to prevent build breakage when CPUState becomes a child of DeviceState.
--- scripts/qapi-types.py | 3 ++-
1 Datei geändert, 2 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
scripts/qapi-types.py +2 -1
@@ -273,7 +273,8 @@ fdecl.write(mcgen(''' #ifndef %(guard)s #define %(guard)s -#include "qemu-common.h" +#include <stdbool.h> +#include <stdint.h> ''', guard=guardname(h_file)))
Signature · 1 line
1.7.10.4
PATCH 9/11 target-i386/cpu: Name new CPUID bits
In reply to Andreas FärberFrom: Andre Przywara <[email protected]>
Update QEMU's knowledge of CPUID bit names. This allows to enable/disable those new features on QEMU's command line when using KVM and prepares future feature enablement in QEMU.
This adds F16C, RDRAND, LWP, TBM, TopoExt, PerfCtr_Core, PerfCtr_NB, FSGSBASE, BMI1, AVX2, BMI2, ERMS, PCID, InvPCID, RTM, RDSeed and ADX.
Sources where the AMD BKDG for Family 15h/Model 10h, Intel Software Developer Manual, and the Linux kernel for the leaf 7 bits.
--- target-i386/cpu.c | 12 ++++++------ target-i386/cpu.h | 22 ++++++++++++++++++++++
2 Dateien geändert, 28 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)
target-i386/cpu.c +6 -6
@@ -66,7 +66,7 @@ static const char *ext_feature_name[] = {NULL ,"pcid" ,"dca" ,"sse4.1|sse4_1" ,"sse4.2|sse4_2" ,"x2apic" ,"movbe" ,"popcnt" ,"tsc-deadline" ,"aes" ,"xsave" ,"osxsave" , - "avx", NULL, NULL, "hypervisor", + "avx", "f16c", "rdrand", "hypervisor", };/* Feature names that are already defined on feature_name[] but are set on * CPUID[8000_0001].EDX on AMD CPUs don't have their names on
@@ -87,10 +87,10 @@ static const char *ext3_feature_name[] = {"lahf_lm" /* AMD LahfSahf */ ,"cmp_legacy" ,"svm" ,"extapic" /* AMD ExtApicSpace */ ,"cr8legacy" /* AMD AltMovCr8 */ ,"abm" ,"sse4a" ,"misalignsse" ,"3dnowprefetch" ,"osvw" ,"ibs" ,"xop" , -"skinit" ,"wdt" ,NULL ,NULL , -"fma4" ,NULL ,"cvt16" ,"nodeid_msr" , -NULL ,NULL ,NULL ,NULL , -NULL ,NULL ,NULL ,NULL , +"skinit" ,"wdt" ,NULL ,"lwp" , +"fma4" ,"tce" ,NULL ,"nodeid_msr" , +NULL ,"tbm" ,"topoext" ,"perfctr_core" , +"perfctr_nb" ,NULL ,NULL ,NULL , NULL, NULL, NULL, NULL, };
@@ -119,7 +119,7 @@ static const char *svm_feature_name[] = {static const char *cpuid_7_0_ebx_feature_name[] = {"fsgsbase" ,NULL ,NULL ,"bmi1" ,"hle" ,"avx2" ,NULL ,"smep" ,"bmi2" ,"erms" ,"invpcid" ,"rtm" ,NULL ,NULL ,NULL ,NULL , -NULL ,NULL ,NULL ,NULL ,"smap" ,NULL ,NULL ,NULL , +NULL ,NULL ,"rdseed" ,"adx" ,"smap" ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL ,NULL , };
target-i386/cpu.h +22 -0
@@ -403,9 +403,11 @@#define CPUID_EXT_TM2 (1 << 8)#define CPUID_EXT_SSSE3 (1 << 9)#define CPUID_EXT_CID (1 << 10) +#define CPUID_EXT_FMA (1 << 12)#define CPUID_EXT_CX16 (1 << 13)#define CPUID_EXT_XTPR (1 << 14)#define CPUID_EXT_PDCM (1 << 15) +#define CPUID_EXT_PCID (1 << 17)#define CPUID_EXT_DCA (1 << 18)#define CPUID_EXT_SSE41 (1 << 19)#define CPUID_EXT_SSE42 (1 << 20)
@@ -417,6 +419,8 @@#define CPUID_EXT_XSAVE (1 << 26)#define CPUID_EXT_OSXSAVE (1 << 27)#define CPUID_EXT_AVX (1 << 28) +#define CPUID_EXT_F16C (1 << 29) +#define CPUID_EXT_RDRAND (1 << 30)#define CPUID_EXT_HYPERVISOR (1 << 31)#define CPUID_EXT2_FPU (1 << 0)
@@ -472,7 +476,15 @@#define CPUID_EXT3_IBS (1 << 10)#define CPUID_EXT3_XOP (1 << 11)#define CPUID_EXT3_SKINIT (1 << 12) +#define CPUID_EXT3_WDT (1 << 13) +#define CPUID_EXT3_LWP (1 << 15)#define CPUID_EXT3_FMA4 (1 << 16) +#define CPUID_EXT3_TCE (1 << 17) +#define CPUID_EXT3_NODEID (1 << 19) +#define CPUID_EXT3_TBM (1 << 21) +#define CPUID_EXT3_TOPOEXT (1 << 22) +#define CPUID_EXT3_PERFCORE (1 << 23) +#define CPUID_EXT3_PERFNB (1 << 24)#define CPUID_SVM_NPT (1 << 0)#define CPUID_SVM_LBRV (1 << 1)
@@ -485,7 +497,17 @@#define CPUID_SVM_PAUSEFILTER (1 << 10)#define CPUID_SVM_PFTHRESHOLD (1 << 12) +#define CPUID_7_0_EBX_FSGSBASE (1 << 0) +#define CPUID_7_0_EBX_BMI1 (1 << 3) +#define CPUID_7_0_EBX_HLE (1 << 4) +#define CPUID_7_0_EBX_AVX2 (1 << 5)#define CPUID_7_0_EBX_SMEP (1 << 7) +#define CPUID_7_0_EBX_BMI2 (1 << 8) +#define CPUID_7_0_EBX_ERMS (1 << 9) +#define CPUID_7_0_EBX_INVPCID (1 << 10) +#define CPUID_7_0_EBX_RTM (1 << 11) +#define CPUID_7_0_EBX_RDSEED (1 << 18) +#define CPUID_7_0_EBX_ADX (1 << 19)#define CPUID_7_0_EBX_SMAP (1 << 20)#define CPUID_VENDOR_INTEL_1 0x756e6547/* "Genu" */
Signature · 1 line
1.7.10.4
Re: [Qemu-devel] [PATCH 09/11] target-i386/cpu: Name new CPUID bits
Eduardo,
While doing rebase of x86 cpu properties on top of the current master, I've stumbled on possibly removed by mistake cpuid feature, pls see inline
On Thu, 15 Nov 2012 04:06:45 +0100
Andreas Färber <[email protected]> wrote:
...
target-i386/cpu.c static const char *ext3_feature_name[] = { · line 91
Quoted 6 lines
target-i386/cpu.c +0
-2@@ -87,10 +87,10 @@ static const char *ext3_feature_name[] = {"lahf_lm" /* AMD LahfSahf */ ,"cmp_legacy" ,"svm" ,"extapic" /* AMD ExtApicSpace */ ,"cr8legacy" /* AMD AltMovCr8 */ ,"abm" ,"sse4a" ,"misalignsse" , "3dnowprefetch", "osvw", "ibs", "xop", -"skinit" ,"wdt" ,NULL ,NULL , - "fma4", NULL, "cvt16", "nodeid_msr",
^^^^
target-i386/cpu.c static const char *ext3_feature_name[] = { · line 91
Quoted 4 lines
target-i386/cpu.c +2
-2-NULL ,NULL ,NULL ,NULL , - NULL, NULL, NULL, NULL, +"skinit" ,"wdt" ,NULL ,"lwp" , + "fma4", "tce", NULL, "nodeid_msr",
^^^^ should we keep cvt16 here ?
target-i386/cpu.c static const char *ext3_feature_name[] = { · line 95
Quoted 4 lines
target-i386/cpu.c +2
-0+NULL ,"tbm" ,"topoext" ,"perfctr_core" , +"perfctr_nb" ,NULL ,NULL ,NULL , NULL, NULL, NULL, NULL, };
...
it's committed as: c8acc380: target-i386/cpu: Name new CPUID bits
Signature · 2 lines
Regards, Igor
Re: [Qemu-devel] [PATCH 09/11] target-i386/cpu: Name new CPUID bits
Quoted 20 lines · Igor Mammedov
Eduardo,
While doing rebase of x86 cpu properties on top of the current master, I've stumbled on possibly removed by mistake cpuid feature, pls see inline
On Thu, 15 Nov 2012 04:06:45 +0100
Andreas Färber <[email protected]> wrote:...
target-i386/cpu.c static const char *ext3_feature_name[] = { · line 91
Quoted 6 lines
target-i386/cpu.c +0
-2@@ -87,10 +87,10 @@ static const char *ext3_feature_name[] = {"lahf_lm" /* AMD LahfSahf */ ,"cmp_legacy" ,"svm" ,"extapic" /* AMD ExtApicSpace */ ,"cr8legacy" /* AMD AltMovCr8 */ ,"abm" ,"sse4a" ,"misalignsse" , "3dnowprefetch", "osvw", "ibs", "xop", -"skinit" ,"wdt" ,NULL ,NULL , - "fma4", NULL, "cvt16", "nodeid_msr",^^^^target-i386/cpu.c static const char *ext3_feature_name[] = { · line 91
Quoted 4 lines
target-i386/cpu.c +2
-2-NULL ,NULL ,NULL ,NULL , - NULL, NULL, NULL, NULL, +"skinit" ,"wdt" ,NULL ,"lwp" , + "fma4", "tce", NULL, "nodeid_msr",
Quoted 8 lines
^^^^ should we keep cvt16 here ?
target-i386/cpu.c static const char *ext3_feature_name[] = { · line 95
Quoted 4 lines
target-i386/cpu.c +2
-0+NULL ,"tbm" ,"topoext" ,"perfctr_core" , +"perfctr_nb" ,NULL ,NULL ,NULL , NULL, NULL, NULL, NULL, };...
it's committed as:
c8acc380: target-i386/cpu: Name new CPUID bits
It was on purpose. See
<http://article.gmane.org/gmane.comp.emulators.qemu/176694>.
This should have been documented on the commit message, but I didn't notice that the patch from Boris that I resubmitted in November was the same one where I asked for a commit message change in October.
Signature · 1 line
Eduardo
PATCH 10/11 target-i386/cpu: Add new Opteron CPU model
In reply to Andreas FärberFrom: Andre Przywara <[email protected]>
Add a new base CPU model called Opteron_G5 to model the latest Opteron CPUs. This increases the model value and model numbers and adds TBM, F16C and FMA over the latest G4 model.
--- target-i386/cpu.c | 32 ++++++++++++++++++++++++++++++++
1 Datei geändert, 32 Zeilen hinzugefügt(+)
target-i386/cpu.c +32 -0
@@ -756,6 +756,38 @@ static x86_def_t builtin_x86_defs[] = { .xlevel = 0x8000001A, .model_id = "AMD Opteron 62xx class CPU", }, + { + .name = "Opteron_G5", + .level = 0xd, + .vendor1 = CPUID_VENDOR_AMD_1, + .vendor2 = CPUID_VENDOR_AMD_2, + .vendor3 = CPUID_VENDOR_AMD_3, + .family = 21, + .model = 2, + .stepping = 0, + .features =CPUID_SSE2 |CPUID_SSE |CPUID_FXSR |CPUID_MMX | +CPUID_CLFLUSH |CPUID_PSE36 |CPUID_PAT |CPUID_CMOV |CPUID_MCA | +CPUID_PGE |CPUID_MTRR |CPUID_SEP |CPUID_APIC |CPUID_CX8 | +CPUID_MCE |CPUID_PAE |CPUID_MSR |CPUID_TSC |CPUID_PSE | + CPUID_DE | CPUID_FP87, + .ext_features =CPUID_EXT_F16C |CPUID_EXT_AVX |CPUID_EXT_XSAVE | +CPUID_EXT_AES |CPUID_EXT_POPCNT |CPUID_EXT_SSE42 | +CPUID_EXT_SSE41 |CPUID_EXT_CX16 |CPUID_EXT_FMA | + CPUID_EXT_SSSE3 | CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3, + .ext2_features =CPUID_EXT2_LM |CPUID_EXT2_RDTSCP | +CPUID_EXT2_PDPE1GB |CPUID_EXT2_FXSR |CPUID_EXT2_MMX | +CPUID_EXT2_NX |CPUID_EXT2_PSE36 |CPUID_EXT2_PAT | +CPUID_EXT2_CMOV |CPUID_EXT2_MCA |CPUID_EXT2_PGE | +CPUID_EXT2_MTRR |CPUID_EXT2_SYSCALL |CPUID_EXT2_APIC | +CPUID_EXT2_CX8 |CPUID_EXT2_MCE |CPUID_EXT2_PAE |CPUID_EXT2_MSR | + CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, + .ext3_features =CPUID_EXT3_TBM |CPUID_EXT3_FMA4 |CPUID_EXT3_XOP | +CPUID_EXT3_3DNOWPREFETCH |CPUID_EXT3_MISALIGNSSE | +CPUID_EXT3_SSE4A |CPUID_EXT3_ABM |CPUID_EXT3_SVM | + CPUID_EXT3_LAHF_LM, + .xlevel = 0x8000001A, + .model_id = "AMD Opteron 63xx class CPU", + }, };#ifdef CONFIG_KVM
Signature · 1 line
1.7.10.4
PATCH 11/11 target-i386: Add Haswell CPU model
In reply to Andreas FärberFrom: Eduardo Habkost <[email protected]>
Features added to the model, in relation to SandyBridge:
fma CPUID[1].ECX[12] pcid CPUID[1].ECX[17] movbe CPUID[1].ECX[22] fsgsbase CPUID[EAX=7,ECX=0].EBX[0] bmi1 CPUID[EAX=7,ECX=0].EBX[3] hle CPUID[EAX=7,ECX=0].EBX[4] avx2 CPUID[EAX=7,ECX=0].EBX[5] smep CPUID[EAX=7,ECX=0].EBX[7] bmi2 CPUID[EAX=7,ECX=0].EBX[8] erms CPUID[EAX=7,ECX=0].EBX[9] invpcid CPUID[EAX=7,ECX=0].EBX[10] rtm CPUID[EAX=7,ECX=0].EBX[11]
--- target-i386/cpu.c | 29 +++++++++++++++++++++++++++++
1 Datei geändert, 29 Zeilen hinzugefügt(+)
target-i386/cpu.c +29 -0
@@ -647,6 +647,35 @@ static x86_def_t builtin_x86_defs[] = { .model_id = "Intel Xeon E312xx (Sandy Bridge)", }, { + .name = "Haswell", + .level = 0xd, + .vendor1 = CPUID_VENDOR_INTEL_1, + .vendor2 = CPUID_VENDOR_INTEL_2, + .vendor3 = CPUID_VENDOR_INTEL_3, + .family = 6, + .model = 60, + .stepping = 1, + .features =CPUID_SSE2 |CPUID_SSE |CPUID_FXSR |CPUID_MMX | +CPUID_CLFLUSH |CPUID_PSE36 |CPUID_PAT |CPUID_CMOV |CPUID_MCA | +CPUID_PGE |CPUID_MTRR |CPUID_APIC |CPUID_CX8 | +CPUID_MCE |CPUID_PAE |CPUID_MSR |CPUID_TSC |CPUID_PSE | + CPUID_DE | CPUID_FP87, + .ext_features =CPUID_EXT_AVX |CPUID_EXT_XSAVE |CPUID_EXT_AES | +CPUID_EXT_POPCNT |CPUID_EXT_X2APIC |CPUID_EXT_SSE42 | +CPUID_EXT_SSE41 |CPUID_EXT_CX16 |CPUID_EXT_SSSE3 | +CPUID_EXT_PCLMULQDQ |CPUID_EXT_SSE3 | +CPUID_EXT_TSC_DEADLINE_TIMER |CPUID_EXT_FMA |CPUID_EXT_MOVBE | + CPUID_EXT_PCID, + .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL, + .ext3_features = CPUID_EXT3_LAHF_LM, + .cpuid_7_0_ebx_features =CPUID_7_0_EBX_FSGSBASE |CPUID_7_0_EBX_BMI1 | +CPUID_7_0_EBX_HLE |CPUID_7_0_EBX_AVX2 |CPUID_7_0_EBX_SMEP | +CPUID_7_0_EBX_BMI2 |CPUID_7_0_EBX_ERMS |CPUID_7_0_EBX_INVPCID | + CPUID_7_0_EBX_RTM, + .xlevel = 0x8000000A, + .model_id = "Intel Core Processor (Haswell)", + }, + { .name = "Opteron_G1", .level = 5, .vendor1 = CPUID_VENDOR_AMD_1,
Signature · 1 line
1.7.10.4
Am 15.11.2012 04:06, schrieb Andreas Färber:
Quoted 31 lines
The following changes since commit
ce34cf72fe508b27a78f83c184142e8d1e6a048a:Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-1.3.0-rc0' into staging (2012-11-14 08:53:40 -0600)
are available in the git repository at:
git://github.com/afaerber/qemu-cpu.gitqom-cpufor you to fetch changes up to
37507094f350b75c62dc059f998e7185de3ab60a:target-i386: Add Haswell CPU model (2012-11-15 03:48:47 +0100)
----------------------------------------------------------------
Andre Przywara (2):
target-i386/cpu: Name new CPUID bits
target-i386/cpu: Add new Opteron CPU modelAndreas Färber (1):
osdep: Move qemu_{open,close}() prototypesAnthony Liguori (1):
qdev: Split up header so it can be used incpu.hEduardo Habkost (5):
qemu-common.h: Comment about usage rules
qemu-fsdev-dummy.c: Includemodule.h
vnc-palette.h: Include <stdbool.h>
qemu-config.h: Include headers it needs
target-i386: Add Haswell CPU model
Quoted 3 lines
Igor Mammedov (2):
Moveqemu_irqtypedef out ofqemu-common.h
qapi-types.h: Don't includeqemu-common.h
Eduardo, Igor,
This batch has been pulled into v1.3.0-rc0. Can you please rebase and let me know how you would like to proceed? Igor had tried to avoid a new qemu-types.h, which iirc didn't completely work out?
Currently I still have five patches queued on qom-cpu-dev branch:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-dev
If you're available, I'd be interested in getting this staged during the freeze, so that I can continue review of the follow-up series on a common basis.
Thanks,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 32 lines · Andreas Färber
Am 15.11.2012 04:06, schrieb Andreas Färber:
Quoted 31 lines
The following changes since commit
ce34cf72fe508b27a78f83c184142e8d1e6a048a:Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-1.3.0-rc0' into staging (2012-11-14 08:53:40 -0600)
are available in the git repository at:
git://github.com/afaerber/qemu-cpu.gitqom-cpufor you to fetch changes up to
37507094f350b75c62dc059f998e7185de3ab60a:target-i386: Add Haswell CPU model (2012-11-15 03:48:47 +0100)
----------------------------------------------------------------
Andre Przywara (2):
target-i386/cpu: Name new CPUID bits
target-i386/cpu: Add new Opteron CPU modelAndreas Färber (1):
osdep: Move qemu_{open,close}() prototypesAnthony Liguori (1):
qdev: Split up header so it can be used incpu.hEduardo Habkost (5):
qemu-common.h: Comment about usage rules
qemu-fsdev-dummy.c: Includemodule.h
vnc-palette.h: Include <stdbool.h>
qemu-config.h: Include headers it needs
target-i386: Add Haswell CPU model
Quoted 8 lines
Quoted 3 lines
Igor Mammedov (2):
Moveqemu_irqtypedef out ofqemu-common.h
qapi-types.h: Don't includeqemu-common.hEduardo, Igor,
This batch has been pulled into v1.3.0-rc0. Can you please rebase and let me know how you would like to proceed?
I just rebased my CPU-DeviceState branch locally. I can send a new series with the result, if you think it is useful.
I am already expecting the rest of the CPU-DeviceState series to miss 1.3. If you think some of the remaining patches still have a chance of getting in (especially the qdev-split work), please let me know, so I can send a rebased version as soon as possible.
Now, talking about post-1.3: I would really like to get some feedback on "[PATCH 00/17] target-i386: CPU init cleanup for CPU classes/properties", to see if you think it's a good starting point for both the CPU classes and the CPU properties work.
Quoted 2 lines
Igor had tried to avoid a new
qemu-types.h, which iirc didn't completely work out?
Igor was trying to do that, maybe he managed to make qemu-types.h unnecessary for the 'Monitor' typedef. But we have other 49 typedefs on qemu-types.h (that were previously on qemu-common.h) that would have to be moved somewhere else, as well. :-)
I would love to kill qemu-types.h if possible, but I think we may find cases where it will be impossible to have a separate header for the typedefs, if (for example) we have two headers that don't really depend on each other, but use the typedefs for structs declared on each other[1].
Quoted 7 lines
Currently I still have five patches queued on qom-cpu-dev branch:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-devIf you're available, I'd be interested in getting this staged during the freeze, so that I can continue review of the follow-up series on a common basis.
Are you talking about just the 5 patches on qom-cpu-dev? I am absolutely OK with including them.
Quoted 7 lines
Thanks,
AndreasSignature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
[1] I mean, I won't be surprised if we find cases like:
foo.h:
struct Foo { ... };
struct OtherFooType { ... };
void foo_func(Foo *f, OtherFooType *ff, Bar *b);
bar.h:
struct Bar { ... };
struct OtherBarType { ... };
void bar_func(Bar *b, OtherBarType *bb, Foo *f);
Signature · 1 line
Eduardo
Quoted 36 lines · On Wed, 21 Nov 2012 18:43:21 +0100 Andreas Färber <[email protected]> wrote:
Am 15.11.2012 04:06, schrieb Andreas Färber:
Quoted 31 lines
The following changes since commit
ce34cf72fe508b27a78f83c184142e8d1e6a048a:Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-1.3.0-rc0' into staging (2012-11-14 08:53:40 -0600)
are available in the git repository at:
git://github.com/afaerber/qemu-cpu.gitqom-cpufor you to fetch changes up to
37507094f350b75c62dc059f998e7185de3ab60a:target-i386: Add Haswell CPU model (2012-11-15 03:48:47 +0100)
----------------------------------------------------------------
Andre Przywara (2):
target-i386/cpu: Name new CPUID bits
target-i386/cpu: Add new Opteron CPU modelAndreas Färber (1):
osdep: Move qemu_{open,close}() prototypesAnthony Liguori (1):
qdev: Split up header so it can be used incpu.hEduardo Habkost (5):
qemu-common.h: Comment about usage rules
qemu-fsdev-dummy.c: Includemodule.h
vnc-palette.h: Include <stdbool.h>
qemu-config.h: Include headers it needs
target-i386: Add Haswell CPU modelQuoted 3 lines
Igor Mammedov (2):
Moveqemu_irqtypedef out ofqemu-common.h
qapi-types.h: Don't includeqemu-common.h
Quoted 5 lines
Eduardo, Igor,
This batch has been pulled into v1.3.0-rc0. Can you please rebase and let me know how you would like to proceed? Igor had tried to avoid a new
qemu-types.h, which iirc didn't completely work out?
I'd go with Eduardo's qemu-types.h for now, so not to stall CPU as device & depended series on headers cleanup.
PS:monitor.h proved to be an other header with circular dependencies. Currently I have only a single huge blob that moves Monitor typedef into monitor.h and fixes all dependencies, however I hadn't time to split it into 2 sane series, yet. It could be posted later during 1.4 dev cycle, when it's ready.
Quoted 14 lines
Currently I still have five patches queued on qom-cpu-dev branch:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-devIf you're available, I'd be interested in getting this staged during the freeze, so that I can continue review of the follow-up series on a common basis.
Thanks,
AndreasSignature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Signature · 2 lines
Regards, Igor