pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

haxm: Update to c072ad9b68e1d558a9fb791511468d10a1a9b319



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed Feb 13 03:34:16 2019 +0100
Changeset:	6955063ad2cf5225c899174e0cf2b421f51c9832

Modified Files:
	haxm/Makefile
	haxm/distinfo
Added Files:
	haxm/patches/patch-core_ia32.c
	haxm/patches/patch-core_ia32__ops.asm
	haxm/patches/patch-core_include_ia32.h
	haxm/patches/patch-core_include_vcpu.h
	haxm/patches/patch-core_vcpu.c

Log Message:
haxm: Update to c072ad9b68e1d558a9fb791511468d10a1a9b319

Drop PKG_FAIL_REASON as a preparation for making it a real package.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=6955063ad2cf5225c899174e0cf2b421f51c9832

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 haxm/Makefile                          | 11 ++---------
 haxm/distinfo                          | 13 +++++++++----
 haxm/patches/patch-core_ia32.c         | 16 ++++++++++++++++
 haxm/patches/patch-core_ia32__ops.asm  | 15 +++++++++++++++
 haxm/patches/patch-core_include_ia32.h | 21 +++++++++++++++++++++
 haxm/patches/patch-core_include_vcpu.h | 12 ++++++++++++
 haxm/patches/patch-core_vcpu.c         | 30 ++++++++++++++++++++++++++++++
 7 files changed, 105 insertions(+), 13 deletions(-)

diffs:
diff --git a/haxm/Makefile b/haxm/Makefile
index d2427080db..d70e5ff76d 100644
--- a/haxm/Makefile
+++ b/haxm/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 
 GITHUB_PROJECT= haxm
-GITHUB_TAG=     502145393ea67373c002bc940a3683895ab62e36
+GITHUB_TAG=     c072ad9b68e1d558a9fb791511468d10a1a9b319
 DISTNAME=       haxm-0.${GITHUB_TAG}
 CATEGORIES=     emulators
 MASTER_SITES=   ${MASTER_SITE_GITHUB:=intel/}
@@ -13,13 +13,6 @@ LICENSE=	modified-bsd
 
 WRKSRC=		${WRKDIR}/haxm-${GITHUB_TAG}
 
-PKG_FAIL_REASON=	"Build manually and install manually:"
-PKG_FAIL_REASON+=	"cd platforms/netbsd && make"
-PKG_FAIL_REASON+=	"modload ./intel-hax"
-PKG_FAIL_REASON+=	"cd /dev && mknod HAX c 220 0"
-PKG_FAIL_REASON+=	"cd /dev && mkdir hax_vm hax_vm00"
-PKG_FAIL_REASON+=	"cd /dev/hax_vm && mknod vm00 c 222 0"
-PKG_FAIL_REASON+=	"cd /dev/hax_vm00 && mknod vcpu00 c 221 0"
-PKG_FAIL_REASON+=	"qemu-system-x86_64 --enable-hax"
+#OSVERSION_SPECIFIC=	YES
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/haxm/distinfo b/haxm/distinfo
index 74bc840b9b..263e210753 100644
--- a/haxm/distinfo
+++ b/haxm/distinfo
@@ -1,6 +1,11 @@
 $NetBSD$
 
-SHA1 (haxm-0.226b5a8ef3b79ca3d235a629a83a4a2168c11e36-226b5a8ef3b79ca3d235a629a83a4a2168c11e36.tar.gz) = 8b1bd7c077eff2b059261069ccfc573dbcada132
-RMD160 (haxm-0.226b5a8ef3b79ca3d235a629a83a4a2168c11e36-226b5a8ef3b79ca3d235a629a83a4a2168c11e36.tar.gz) = 050b8801d2de265d53b4d05bb515259406129e57
-SHA512 (haxm-0.226b5a8ef3b79ca3d235a629a83a4a2168c11e36-226b5a8ef3b79ca3d235a629a83a4a2168c11e36.tar.gz) = ddcd7bfdfb8aed40382cae4d4e5b4206c957bf2ca72d0f7cad698faf5cc10dd520dc37a892e331f4cc6f10c491b9c3ce0066f3eed2f0ae0958b662083e634adb
-Size (haxm-0.226b5a8ef3b79ca3d235a629a83a4a2168c11e36-226b5a8ef3b79ca3d235a629a83a4a2168c11e36.tar.gz) = 218100 bytes
+SHA1 (haxm-0.c072ad9b68e1d558a9fb791511468d10a1a9b319-c072ad9b68e1d558a9fb791511468d10a1a9b319.tar.gz) = da6fe9b8c98292e8c4ca5f62ad6aa9a4a65c6bb1
+RMD160 (haxm-0.c072ad9b68e1d558a9fb791511468d10a1a9b319-c072ad9b68e1d558a9fb791511468d10a1a9b319.tar.gz) = 6c1248be0b9ee775c9879627bf60d20eb3a94368
+SHA512 (haxm-0.c072ad9b68e1d558a9fb791511468d10a1a9b319-c072ad9b68e1d558a9fb791511468d10a1a9b319.tar.gz) = df8e8b634fea18faa05ae57648dee6500a5b0d93fa081172835e1991ab3ae2b6ad0ad1a99d91d695f0a6656e79744445ff6f6f42947b311bb8245640dd8cff23
+Size (haxm-0.c072ad9b68e1d558a9fb791511468d10a1a9b319-c072ad9b68e1d558a9fb791511468d10a1a9b319.tar.gz) = 233043 bytes
+SHA1 (patch-core_ia32.c) = 8a3bcd53a42ca6a67e3d146186305e81fb8eb751
+SHA1 (patch-core_ia32__ops.asm) = 1881d60a63967c3e1858ee223a1b421993a50fb8
+SHA1 (patch-core_include_ia32.h) = f2da278f209af765c68270cf6e51b8959f7a5ec0
+SHA1 (patch-core_include_vcpu.h) = 5740d39138cbab414450aa540d80cf8a30574f11
+SHA1 (patch-core_vcpu.c) = d1b8e7f72f1e3db1853e8b4563ab506cbd3ac29f
diff --git a/haxm/patches/patch-core_ia32.c b/haxm/patches/patch-core_ia32.c
new file mode 100644
index 0000000000..c2888a3e7a
--- /dev/null
+++ b/haxm/patches/patch-core_ia32.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- core/ia32.c.orig	2019-02-12 09:24:47.000000000 +0000
++++ core/ia32.c
+@@ -81,6 +81,11 @@ uint64_t ia32_rdtsc(void)
+ #endif
+ }
+ 
++void hax_clts(void)
++{
++    asm_clts();
++}
++
+ void hax_fxinit(void)
+ {
+     asm_fxinit();
diff --git a/haxm/patches/patch-core_ia32__ops.asm b/haxm/patches/patch-core_ia32__ops.asm
new file mode 100644
index 0000000000..9d49de6979
--- /dev/null
+++ b/haxm/patches/patch-core_ia32__ops.asm
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- core/ia32_ops.asm.orig	2019-02-12 09:24:47.000000000 +0000
++++ core/ia32_ops.asm
+@@ -213,6 +213,10 @@ function asm_enable_irq, 0
+     sti
+     ret
+ 
++function asm_clts, 0
++    clts
++    ret
++
+ function asm_fxinit, 0
+     finit
+     ret
diff --git a/haxm/patches/patch-core_include_ia32.h b/haxm/patches/patch-core_include_ia32.h
new file mode 100644
index 0000000000..8414f093d7
--- /dev/null
+++ b/haxm/patches/patch-core_include_ia32.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- core/include/ia32.h.orig	2019-02-12 09:24:47.000000000 +0000
++++ core/include/ia32.h
+@@ -72,6 +72,7 @@ void ASMCALL set_kernel_fs(uint16_t val)
+ 
+ void ASMCALL asm_btr(uint8_t *addr, uint bit);
+ void ASMCALL asm_bts(uint8_t *addr, uint bit);
++void ASMCALL asm_clts(void);
+ void ASMCALL asm_fxinit(void);
+ void ASMCALL asm_fxsave(mword *addr);
+ void ASMCALL asm_fxrstor(mword *addr);
+@@ -85,6 +86,8 @@ void ia32_wrmsr(uint32_t reg, uint64_t v
+ 
+ uint64_t ia32_rdtsc(void);
+ 
++void hax_clts(void);
++
+ void hax_fxinit(void);
+ void hax_fxsave(mword *addr);
+ void hax_fxrstor(mword *addr);
diff --git a/haxm/patches/patch-core_include_vcpu.h b/haxm/patches/patch-core_include_vcpu.h
new file mode 100644
index 0000000000..fdef2d342c
--- /dev/null
+++ b/haxm/patches/patch-core_include_vcpu.h
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- core/include/vcpu.h.orig	2019-02-12 09:24:47.000000000 +0000
++++ core/include/vcpu.h
+@@ -238,6 +238,7 @@ struct vcpu_t {
+ #ifdef CONFIG_HAX_EPT2
+     struct mmio_fetch_cache mmio_fetch;
+ #endif  // CONFIG_HAX_EPT2
++    int cr0_ts;
+ };
+ 
+ #define vmx(v, field) v->vmx.field
diff --git a/haxm/patches/patch-core_vcpu.c b/haxm/patches/patch-core_vcpu.c
new file mode 100644
index 0000000000..570b78daea
--- /dev/null
+++ b/haxm/patches/patch-core_vcpu.c
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- core/vcpu.c.orig	2019-02-12 09:24:47.000000000 +0000
++++ core/vcpu.c
+@@ -2041,6 +2041,10 @@ static void vcpu_enter_fpu_state(struct 
+     struct fx_layout *hfx = (struct fx_layout *)hax_page_va(hstate->hfxpage);
+     struct fx_layout *gfx = (struct fx_layout *)hax_page_va(gstate->gfxpage);
+ 
++    vcpu->cr0_ts = !!(get_cr0() & CR0_TS);
++
++    hax_clts();
++
+     hax_fxsave((mword *)hfx);
+     hax_fxrstor((mword *)gfx);
+ }
+@@ -2052,8 +2056,14 @@ static void vcpu_exit_fpu_state(struct v
+     struct fx_layout *hfx = (struct fx_layout *)hax_page_va(hstate->hfxpage);
+     struct fx_layout *gfx = (struct fx_layout *)hax_page_va(gstate->gfxpage);
+ 
++    hax_clts();
++
+     hax_fxsave((mword *)gfx);
+     hax_fxrstor((mword *)hfx);
++
++    if (vcpu->cr0_ts) {
++        set_cr0(get_cr0() | CR0_TS);
++    }
+ }
+ 
+ // Instructions are never longer than 15 bytes:


Home | Main Index | Thread Index | Old Index