[{"id":1778989,"web_url":"http://patchwork.ozlabs.org/comment/1778989/","msgid":"<be749b52-b0f9-64ef-bf9d-606df0609a30@redhat.com>","list_archive_url":null,"date":"2017-10-03T13:47:06","subject":"Re: [Qemu-devel] [PATCH v4 00/14] add support for\n\tHypervisor.framework in QEMU","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 13/09/2017 11:05, Sergio Andres Gomez Del Real wrote:\n> ================\n> Changes in v4:\n>  (1) Use g_new0 instead of g_malloc.\n>  (2) hvf TODO's in cpu.c explained: in-kernel irqchip.\n>  (3) Introduce ins_len field in patch where actually used.\n>  (4) Remove outdated comment \"/* Definition of hvf_state is here */\"\n>  (5) Treat vcpu_dirty as boolean throughout.\n>  (6) checkpatch.pl patch only does styling changes.\n>  (8) Add comment documenting meaning of -1 returned by\n>      apic_get_highest_priority_irr.\n>  (9) Add TODO to move hvf's synchronization functions inside\n>      cpu_synchronize_*, along with kvm's and hax's.\n> ================\n\nThanks Sergio, this is a good start.  I have done a few more cleanup and\nsent my patches which, however, I could not test.  In any case, it seems\nfeasible to get this done for 2.11!\n\nRegards,\n\nPaolo\n\n> ================\n> Changes in v3:\n>  (1) Fixed licensing issues in patch 3.\n>  (2) Revert to late adding of compilation rules in Makefile.objs (patch 8/14);\n>      files aren't ready to compile earlier.\n>  (3) Make a single patch just for fixing style (patch 4/14).\n>  (4) Fix data type for hvf_fd field.\n>  (5) Add comment that return value of -1 in apic function added in 7/14 means\n>      \"no interrupt\".\n> ================\n> \n> ================\n> Changes in v2:\n>  (1) Removed legacy option \"-enable-hvf\" in favor of \"-M accel=hvf\"\n>  (2) Added missing copyright headers; replace fprintfs for error_report;\n>      improved commit description.\n>  (3) Moved patch that adds compilation rules in Makefile.objs right after\n>      the patch that adds the new files from Google's repo.\n>  (4) Removed conditional macros from cpus.c and cpu.c\n>  (5) Moved patch that fixes coding style to patch # 3\n>  (6) Fix commit message in apic patch\n>  (7) Squash some commits to avoid code churn\n> ================\n> \n> The following patchset adds to QEMU the supporting for macOS's native\n> hypervisor, Hypervisor.framework (hvf). The code base is taken from\n> Google's Android emulator at\n> https://android.googlesource.com/platform/external/qemu/+/emu-master-dev.\n> Notably missing is support for live migration.\n> \n> Apart from general code refactoring, some additional features were implemented:\n> retrieve the set of features supported by host cpu and hvf (cpuid);\n> dirty page tracking for VGA memory area; reimplementation of the event\n> injection mechanism to allow injection of exceptions during vmexits, which is\n> exemplified by the injection of a GP fault when the guest vmexits due to\n> execution of the vmcall instruction; changing the emulator's use of CPUState\n> structure in favor of CPUX86State, so as to in the future remove data structures\n> that are uselessly specific to hvf and unified some of the state between kvm/tcg\n> and hvf.\n> Some features initially planned to implement that didn't make it include:\n> page fault handling in the emulator and implementing the dummy_signal to handle\n> the SIG_IPI signal without race conditions. Hopefully these can be implemented\n> in the near future.\n> Event injection was tested through the eventinj kvm test. The latest Debian and\n> Damn Small Linux images were executed, although by now ways it was an\n> exhaustive testing.\n> \n> Sergio Andres Gomez Del Real (14):\n>   hvf: add support for Hypervisor.framework in the configure script\n>   hvf: add code base from Google's QEMU repository\n>   hvf: fix licensing issues; isolate task handling code (GPL v2-only)\n>   hvf: run hvf code through checkpatch.pl and fix style issues\n>   hvf: add code to cpus.c and do refactoring in preparation for\n>     compiling\n>   hvf: handle fields from CPUState and CPUX86State\n>   apic: add function to apic that will be used by hvf\n>   hvf: add compilation rules to Makefile.objs\n>   hvf: use new helper functions for put/get xsave\n>   hvf: implement hvf_get_supported_cpuid\n>   hvf: refactor cpuid code\n>   hvf: implement vga dirty page tracking\n>   hvf: refactor event injection code for hvf\n>   hvf: inject General Protection Fault when vmexit through vmcall\n> \n>  configure                           |   38 +\n>  cpus.c                              |   89 ++\n>  hw/intc/apic.c                      |   12 +\n>  include/hw/i386/apic.h              |    1 +\n>  include/qom/cpu.h                   |    2 +\n>  include/sysemu/hvf.h                |  181 +++\n>  qemu-options.hx                     |   10 +-\n>  target/i386/Makefile.objs           |    1 +\n>  target/i386/cpu-qom.h               |    4 +-\n>  target/i386/cpu.c                   |   80 +-\n>  target/i386/cpu.h                   |   34 +-\n>  target/i386/hvf-all.c               |  963 +++++++++++++++\n>  target/i386/hvf-i386.h              |   50 +\n>  target/i386/hvf-utils/Makefile.objs |    1 +\n>  target/i386/hvf-utils/README.md     |    7 +\n>  target/i386/hvf-utils/vmcs.h        |  371 ++++++\n>  target/i386/hvf-utils/vmx.h         |  222 ++++\n>  target/i386/hvf-utils/x86.c         |  184 +++\n>  target/i386/hvf-utils/x86.h         |  394 +++++++\n>  target/i386/hvf-utils/x86_cpuid.c   |  417 +++++++\n>  target/i386/hvf-utils/x86_cpuid.h   |   52 +\n>  target/i386/hvf-utils/x86_decode.c  | 2186 +++++++++++++++++++++++++++++++++++\n>  target/i386/hvf-utils/x86_decode.h  |  325 ++++++\n>  target/i386/hvf-utils/x86_descr.c   |  124 ++\n>  target/i386/hvf-utils/x86_descr.h   |   55 +\n>  target/i386/hvf-utils/x86_emu.c     | 1536 ++++++++++++++++++++++++\n>  target/i386/hvf-utils/x86_emu.h     |   49 +\n>  target/i386/hvf-utils/x86_flags.c   |  333 ++++++\n>  target/i386/hvf-utils/x86_flags.h   |  243 ++++\n>  target/i386/hvf-utils/x86_gen.h     |   53 +\n>  target/i386/hvf-utils/x86_mmu.c     |  273 +++++\n>  target/i386/hvf-utils/x86_mmu.h     |   45 +\n>  target/i386/hvf-utils/x86_task.c    |  201 ++++\n>  target/i386/hvf-utils/x86_task.h    |   18 +\n>  target/i386/hvf-utils/x86hvf.c      |  463 ++++++++\n>  target/i386/hvf-utils/x86hvf.h      |   39 +\n>  target/i386/kvm.c                   |    2 -\n>  37 files changed, 9025 insertions(+), 33 deletions(-)\n>  create mode 100644 include/sysemu/hvf.h\n>  create mode 100644 target/i386/hvf-all.c\n>  create mode 100644 target/i386/hvf-i386.h\n>  create mode 100644 target/i386/hvf-utils/Makefile.objs\n>  create mode 100644 target/i386/hvf-utils/README.md\n>  create mode 100644 target/i386/hvf-utils/vmcs.h\n>  create mode 100644 target/i386/hvf-utils/vmx.h\n>  create mode 100644 target/i386/hvf-utils/x86.c\n>  create mode 100644 target/i386/hvf-utils/x86.h\n>  create mode 100644 target/i386/hvf-utils/x86_cpuid.c\n>  create mode 100644 target/i386/hvf-utils/x86_cpuid.h\n>  create mode 100644 target/i386/hvf-utils/x86_decode.c\n>  create mode 100644 target/i386/hvf-utils/x86_decode.h\n>  create mode 100644 target/i386/hvf-utils/x86_descr.c\n>  create mode 100644 target/i386/hvf-utils/x86_descr.h\n>  create mode 100644 target/i386/hvf-utils/x86_emu.c\n>  create mode 100644 target/i386/hvf-utils/x86_emu.h\n>  create mode 100644 target/i386/hvf-utils/x86_flags.c\n>  create mode 100644 target/i386/hvf-utils/x86_flags.h\n>  create mode 100644 target/i386/hvf-utils/x86_gen.h\n>  create mode 100644 target/i386/hvf-utils/x86_mmu.c\n>  create mode 100644 target/i386/hvf-utils/x86_mmu.h\n>  create mode 100644 target/i386/hvf-utils/x86_task.c\n>  create mode 100644 target/i386/hvf-utils/x86_task.h\n>  create mode 100644 target/i386/hvf-utils/x86hvf.c\n>  create mode 100644 target/i386/hvf-utils/x86hvf.h\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y60p51jKrz9t2Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  4 Oct 2017 00:52:13 +1100 (AEDT)","from localhost ([::1]:58676 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dzNcJ-0006ab-Ba\n\tfor incoming@patchwork.ozlabs.org; Tue, 03 Oct 2017 09:52:11 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40550)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dzNXv-0003Gh-RC\n\tfor qemu-devel@nongnu.org; Tue, 03 Oct 2017 09:47:41 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1dzNXq-00055B-TV\n\tfor qemu-devel@nongnu.org; Tue, 03 Oct 2017 09:47:39 -0400","from mail-wr0-f171.google.com ([209.85.128.171]:49035)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>) id 1dzNXb-0004r2-9N\n\tfor qemu-devel@nongnu.org; Tue, 03 Oct 2017 09:47:34 -0400","by mail-wr0-f171.google.com with SMTP id u5so6181237wrc.5\n\tfor <qemu-devel@nongnu.org>; Tue, 03 Oct 2017 06:47:18 -0700 (PDT)","from [192.168.10.165]\n\t(dynamic-adsl-78-12-246-117.clienti.tiscali.it.\n\t[78.12.246.117]) by smtp.gmail.com with ESMTPSA id\n\tt36sm22194590wrc.28.2017.10.03.06.47.15\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 03 Oct 2017 06:47:16 -0700 (PDT)"],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=4mXDmVGlFfkPvYXx8wcO8w4Kpm6VXiQ4E10UfqtId7w=;\n\tb=nqqLnf/u70zhSj9m7UwMY0y8HL7dAiis2p770XrYoUAtizsqk0VToG+L6Ezd7na07Y\n\tQKd/aMBotSbDxfZJTG6J1WQGb5V1oSO/MtumgGfZnG7u1C6jQV9KMeFucRiFNC167fP2\n\tpiJc+JEysgLTTDFe3h0CXWGjRQ7VUZMhKhgD5I5waset7z1WibErwlgMz02ZwBHsYcrO\n\tdPW8DamMvHBEed0w0nWKA2v0e3bER3SxapgJF3d4Xoo6UELotb1UCN2dZ8w+fkHf68cq\n\tlh/6atv8wZzGBBDyM+IC+UnC2kfc2SBMXNHZjs+WOomjwhSZ4KdM9barI9YLXmvmh+3V\n\tksfA==","X-Gm-Message-State":"AMCzsaU1cLpoBSAIkShTymH8PUiTIgbXraokGLQL4ZtsPAQtxOBdE/XE\n\t6m1J3NMd1PDwCO9sN3xbPpVmdXQXglM=","X-Google-Smtp-Source":"AOwi7QDFZtnCjA8ZcbTnNt4b8/Py3f20rIYAxoaQ5Cphx+YXfJgu2OKso/awQFQuWc+PXnFPHrwrhA==","X-Received":"by 10.223.183.201 with SMTP id t9mr7594395wre.149.1507038437209; \n\tTue, 03 Oct 2017 06:47:17 -0700 (PDT)","To":"Sergio Andres Gomez Del Real <sergio.g.delreal@gmail.com>,\n\tqemu-devel@nongnu.org","References":"<20170913090522.4022-1-Sergio.G.DelReal@gmail.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Message-ID":"<be749b52-b0f9-64ef-bf9d-606df0609a30@redhat.com>","Date":"Tue, 3 Oct 2017 15:47:06 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170913090522.4022-1-Sergio.G.DelReal@gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.85.128.171","Subject":"Re: [Qemu-devel] [PATCH v4 00/14] add support for\n\tHypervisor.framework in QEMU","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"stefanha@gmail.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]