tech-kern archive

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

Re: NVMM missing opcode REPE CMPS implementation



On Nov 11, 2020, at 3:23 AM, Reinoud Zandijk <reinoud%NetBSD.org@localhost> wrote:

> On Sat, Oct 31, 2020 at 11:16:52AM -0500, Robert Nestor wrote:
>> Apologies if this isn’t the proper place to bring this up, but the
>> discussion on this brings two questions to mind:
>> 
>> 1) Since the proposed patch isn’t correct and was reverted, and assuming
>> there is a problem with this opcode, is there another correct fix coming?
> 
> Working on a patch in libnvmm for it and it ought to work fine now, but i'm
> stuggling with writing ATF case codes; they are needed to validate the
> emulation before committing it.
> 
>> 2) Is there some code that one can insert locally into NVMM and/or LIBNVMM
>> to help catch other possible problems similar to this?
> 
> There are some unhandled cases on Intel support code that can bomb out libnvmm
> and thus qemu. They hardly ever come by though and I only see them on one OS
> image (OpenServer v5 IIRC) and then consistently at the same place but I have
> no idea as to what triggers it there. The VM exit code is
> VMCS_EXITCODE_TASK_SWITCH (9) and not handled in nvmm_x86_vmx.c. See section
> 27.2.4 of
> https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3c-part-3-manual.pdf
> 
>> While NVMM is very robust and runs a lot of other systems, there are some
>> that it still stumbles over.  I’m sure the vast majority of users don’t care
>> about running something like OS X under NVMM for various reasons, it does
>> seem to be a real good test of emulation capabilities.  Various versions can
>> be installed from standard, non-hacked distributions and run successfully
>> without hacks or modifications under KVM on Linux (macOS-Simple-KVM comes to
>> mind), but not under NVMM.  Maybe the reason is that there are similar
>> missing opcodes being used that aren’t currently handled by NVMM?
> 
> I have never tried to boot MacOS-X with qemu+nvmm. I think lots of other
> things will need to be prepared for qemu to even start.
> 
> Do you know of other possible (more recent) OSs I could try to boot?

I’m no expert on any of the VM implementations, but from my experience running various versions of MacOS-X under VirtualBox and KVM on Linux works well enough to install and run basic applications without requiring anything more than the SMC key which qemu supports.  Things like game playing, audio and video playback, and bluetooth may be issues that require hacks, but I’ve never bothered with them.  My interest in being able to run MacOS-X under NVMM is two-fold; to help identify differences between KVM and NVMM that prevent NVMM from doing what KVM already does, and being able to run some old Mac Apps occasionally that no longer run under recent versions of MacOS-X and/or require older Mac HW.  Being able to run these in a VM environment on NetBSD would be ideal for me, although I could already do that under KVM on Linux, I’d just prefer not having to.

The only other OSs I’ve tried are versions of Windows (-95, -98, -XP), Linux (Mint, Ubuntu, SUSE), Solaris and of course NetBSD and FreeBSD.  Windows-95 almost works but eventually fails (for me at least) because of timing issues I think which are there in all VMs so it’s not an NVMM issue.  Linux works fine once you get past the ACPI installation issue.  Solaris-10 seems to work but Solaris-11 doesn’t but I think that’s an issue with how that last version of Solaris was mucked up.  And of course NetSBD and FreeBSD run without any serious issues.

Not being experienced in this, my approach has been to try and get something running in MintLinux using KVM, and if it runs there I try to run it under NetBSD with NVMM.  I’ve tried XEN under MintLinx for some of the same experiments, but haven’t had a lot of success.  I think on my system it’s some sort of configuration issue.  I haven’t tried XEN under NetBSD mainly because I haven’t taken the time to try to figure out the manual configurations I need.  Tried bypassing that by using VirtManager, but it doesn’t work (for me) on NetBSD - some issue about missing python scripts or modules.

MacOS-Simple-KVM does work for installation and running of MacOS-X versions 10.13 thru 10.16 under KVM.  (MacOS-X 10.6 Big-Sur is current I believe.)  The scripts used don’t require having the MacOS media as it fetches what it needs from the Apple Servers.  I have an older script that works with 10.6 and 10.9 (the two versions I tested), but it requires that one has the official Apple distribution media to install from.  None of these require any special setup or hacks other than inserting the SMC key into the qemu invocation command which I believe is embedded in the MacOS-Simple_KVM scripts.

Hope this answers your questions and I look forward to doing more testing with your latest changes to NVMM.

-bob


Home | Main Index | Thread Index | Old Index