Opened 12 years ago

Closed 12 years ago

#36856 closed defect (wontfix)

Qemu support of sse4.2 extended instructions.

Reported by: enf@… Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: haspatch Cc: gjasny@…
Port: qemu

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Qemu disables processor instruction extentions with non linux builds -- mac builds. specifically, processor sse4.2 functions.

Here is patch for cpu.c file to allow.

mmacbookpro-enf:~ enf$ diff -c ~/Downloads/qemu-1.2.0/target-i386/cpu.c ~/src/play/c/qemu-1.2.0/target-i386/cpu.c
*** /Users/enf/Downloads/qemu-1.2.0/target-i386/cpu.c 2012-09-05 07:03:06.000000000 -0700
--- /Users/enf/src/play/c/qemu-1.2.0/target-i386/cpu.c 2012-11-01 19:32:19.000000000 -0700
***************
*** 116,122 ****
 void host_cpuid(uint32_t function, uint32_t count,
                 uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
 {
! #if defined(CONFIG_KVM)
     uint32_t vec[4];

 #ifdef __x86_64__
--- 116,122 ----
 void host_cpuid(uint32_t function, uint32_t count,
                 uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
 {
! #if defined(CONFIG_KVM) || defined(__APPLE__)
     uint32_t vec[4];

 #ifdef __x86_64__
***************
*** 273,279 ****
           CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
 #define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | \
           CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
!           CPUID_EXT_HYPERVISOR)
           /* missing:
           CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_EST,
           CPUID_EXT_TM2, CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_XSAVE */
--- 273,279 ----
           CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */
 #define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_MONITOR | \
           CPUID_EXT_CX16 | CPUID_EXT_POPCNT | \
!           CPUID_EXT_HYPERVISOR | CPUID_EXT_SSE42)
           /* missing:
           CPUID_EXT_DTES64, CPUID_EXT_DSCPL, CPUID_EXT_VMX, CPUID_EXT_EST,
           CPUID_EXT_TM2, CPUID_EXT_XTPR, CPUID_EXT_PDCM, CPUID_EXT_XSAVE */

Change History (6)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: haspatch added
Port: qemu added

Patchfiles should be in unified not contextual form, and should be attached not pasted. Remember to use WikiFormatting when writing in Trac.

comment:2 Changed 12 years ago by gjasny@…

Hello,

did you try to submit the patch upstream?

Thanks, Gregor

comment:3 Changed 12 years ago by gjasny@…

Cc: gjasny@… added

Cc Me!

comment:4 in reply to:  2 Changed 12 years ago by enf@…

Replying to gjasny@…:

Hello,

did you try to submit the patch upstream?

Thanks, Gregor

Hi Gregor,

I see some patches applied to the QEMU code for MacPort functionality today. When looking at the qemu code base (their site appears down right now) there is no extra provision for Mac specific changes. Hence, I submitted these changes here.

Also... Sorry about the diff formatting.... I wanted to get the info into the report. Next time will be better.

-- Eric

comment:5 Changed 12 years ago by raimue (Rainer Müller)

Owner: changed from macports-tickets@… to raimue@…

Is still required for qemu @1.3.0_0?

comment:6 Changed 12 years ago by raimue (Rainer Müller)

Resolution: wontfix
Status: newclosed

The function host_cpuid() is called only from within conditional blocks checked by CONFIG_KVM or kvm_enabled(), so the proposed change to this function does not change any functionality.

Whether TCG already supports SSE 4.2 or if it should be added to the default features should be discussed with upstream as that is not specific to Mac OS X.

Note: See TracTickets for help on using tickets.