From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9626 invoked from network); 5 Dec 2020 00:22:23 -0000 Received: from ewsd.inri.net (107.191.116.128) by inbox.vuxu.org with ESMTPUTF8; 5 Dec 2020 00:22:22 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Fri Dec 4 19:19:12 -0500 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id f640997e (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Fri, 4 Dec 2020 16:19:03 -0800 (PST) Message-ID: <5BA0FE28F1C6A68B4421AB3D0FA98F13@eigenstate.org> To: ftrvxmtrx@gmail.com To: 9front@9front.org Date: Fri, 04 Dec 2020 16:19:02 -0800 From: ori@eigenstate.org In-Reply-To: <52CB3E735527EF01CDF9E2641E3A406B@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: ISO-certified storage module strategy Subject: Re: [9front] VMX improvements + AVX Reply-To: 9front@9front.org Precedence: bulk Quoth Sigrid Solveig Haflnudttir : > Hello. I made some changes to /sys/src/9/^(pc pc64) and > /sys/src/cmd/vmx to get better support for Linux and OpenBSD emulation > and before I push it (or not) I'd like to get more eyes (and hands) on > it. 386 kernel should not be affected by the change at all, this is > about amd64 specifically. > > Changes were tested on two machines I have, with AVX enabled/disabled. > No problems were found with extensive use, nor any performance issues > detected. This fixes the 'xgetbv' trap that I was getting with OpenBSD. Thanks! That's been something that I've wanted to get to, and I'm thrilled that I don't need to. > On the host Go is using AVX successfully with this change. I'm > writing optimized routines related to video playback so that's yet > another reason why this work has been done in the first place. It's also probably worth noting that the compilers for 9legacy have some support for more recent XMM/YMM registers: https://github.com/0intro/plan9-contrib/commit/94fe116949ba36db8216abed83dbad8fb84ecdf7.patch We've diverged a bit so the merge would be a pain in the ass, and we'd need to get the disassembly done -- but at least some of the code has been written. > * AVX/AVX2 support on amd64 for both 9front kernel itself + VMX > guests. Enabled by setting "*avx=" in plan9.ini. As mentioned in gridchat: I think we can remove this knob, or at least turn it on by default and have '*noavx=' for debugging > * Make vmx(1) report to guest it's running under a hypervisor. I'm skimming the code, but don't see anything obvious. How are you reporting to the guest? > * Provide "fast strings" (through msr) properly to guests. > * Rework cpuid in vmx(1). > * A bit better timing by using tsc offset feature. Clock is still > wrong but at least not THAT much. Proper kvm clock implementation > in the future will address that. I'll pull up the spec soon enough and try to make a bit more sense of this code, but it looks awesome so far. Thanks!