All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hax: Support for Linux hosts
@ 2018-11-08 11:11 Alexandro Sanchez Bach
  0 siblings, 0 replies; 13+ messages in thread
From: Alexandro Sanchez Bach @ 2018-11-08 11:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: yu.ning, Alexandro Sanchez Bach

Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com>
---
 target/i386/Makefile.objs                 |  5 ++++-
 target/i386/hax-i386.h                    | 10 +++++++++-
 target/i386/{hax-darwin.c => hax-posix.c} |  0
 target/i386/{hax-darwin.h => hax-posix.h} |  0
 4 files changed, 13 insertions(+), 2 deletions(-)
 rename target/i386/{hax-darwin.c => hax-posix.c} (100%)
 rename target/i386/{hax-darwin.h => hax-posix.h} (100%)

diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
index 04678f5503..be36d31d23 100644
--- a/target/i386/Makefile.objs
+++ b/target/i386/Makefile.objs
@@ -12,8 +12,11 @@ obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o
 ifdef CONFIG_WIN32
 obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-windows.o
 endif
+ifdef CONFIG_LINUX
+obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o
+endif
 ifdef CONFIG_DARWIN
-obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-darwin.o
+obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o
 obj-$(CONFIG_HVF) += hvf/
 endif
 obj-$(CONFIG_WHPX) += whpx-all.o
diff --git a/target/i386/hax-i386.h b/target/i386/hax-i386.h
index 6abc156f88..f87a64c9df 100644
--- a/target/i386/hax-i386.h
+++ b/target/i386/hax-i386.h
@@ -20,6 +20,10 @@
 typedef int hax_fd;
 #endif
 
+#ifdef CONFIG_LINUX
+typedef int hax_fd;
+#endif
+
 #ifdef CONFIG_WIN32
 typedef HANDLE hax_fd;
 #endif
@@ -83,7 +87,11 @@ void hax_memory_init(void);
 
 
 #ifdef CONFIG_DARWIN
-#include "target/i386/hax-darwin.h"
+#include "target/i386/hax-posix.h"
+#endif
+
+#ifdef CONFIG_LINUX
+#include "target/i386/hax-posix.h"
 #endif
 
 #ifdef CONFIG_WIN32
diff --git a/target/i386/hax-darwin.c b/target/i386/hax-posix.c
similarity index 100%
rename from target/i386/hax-darwin.c
rename to target/i386/hax-posix.c
diff --git a/target/i386/hax-darwin.h b/target/i386/hax-posix.h
similarity index 100%
rename from target/i386/hax-darwin.h
rename to target/i386/hax-posix.h
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-25 17:14       ` Paolo Bonzini
  2019-01-08 17:12         ` Kamil Rytarowski
@ 2019-02-02 15:03         ` Kamil Rytarowski
  1 sibling, 0 replies; 13+ messages in thread
From: Kamil Rytarowski @ 2019-02-02 15:03 UTC (permalink / raw)
  To: Paolo Bonzini, Alexandro Sanchez Bach, qemu-devel
  Cc: Eduardo Habkost, yu.ning, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

On 25.11.2018 18:14, Paolo Bonzini wrote:
> On 25/11/18 00:50, Kamil Rytarowski wrote:
>> On 22.11.2018 08:24, Kamil Rytarowski wrote:
>>> On 16.11.2018 13:52, Paolo Bonzini wrote:
>>>> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
>>>>> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
>>>>> the corresponding userland changes.
>>>>>
>>>>> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
>>>>> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
>>>>> the naming used in the rest of QEMU.
>>>>
>>>> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
>>>> avoiding bitrot?
>>>>
>>>> Paolo
>>>>
>>>
>>> This patch is also useful for NetBSD, even if it's not a Linux host.
>>> There is a driver in progress again (thanks to the newly added Linux
>>> port, it's now much easier to get done).
>>>
>>> I recommend to merge this patch.
>>>
>>
>> For the record, I've a functional version of HAXM for NetBSD as host.
>> Once you will merge this patch, I will submit another one to configure
>> to enable haxm for NetBSD.
>>
>> I need to keep the patch by Alexandro in a local copy of qemu.
> 
> Sure, it will be accepted for the release after 3.1.
> 
> Paolo
> 
> 

I've pushed the haxm patch for NetBSD through qemu-trivial.

https://lists.gnu.org/archive/html/qemu-trivial/2019-01/msg00161.html

A proof that it is usable:

http://blog.netbsd.org/tnf/entry/the_hardware_assisted_virtualization_challenge


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 850 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2019-01-08 18:27           ` Paolo Bonzini
@ 2019-01-09 11:00             ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 13+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-09 11:00 UTC (permalink / raw)
  To: Paolo Bonzini, Kamil Rytarowski, Alexandro Sanchez Bach, qemu-devel
  Cc: Eduardo Habkost, yu.ning, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]

On 1/8/19 7:27 PM, Paolo Bonzini wrote:
> On 08/01/19 18:12, Kamil Rytarowski wrote:
>> On 25.11.2018 18:14, Paolo Bonzini wrote:
>>> On 25/11/18 00:50, Kamil Rytarowski wrote:
>>>> On 22.11.2018 08:24, Kamil Rytarowski wrote:
>>>>> On 16.11.2018 13:52, Paolo Bonzini wrote:
>>>>>> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
>>>>>>> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
>>>>>>> the corresponding userland changes.
>>>>>>>
>>>>>>> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
>>>>>>> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
>>>>>>> the naming used in the rest of QEMU.
>>>>>>
>>>>>> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
>>>>>> avoiding bitrot?
>>>>>>
>>>>>> Paolo
>>>>>>
>>>>>
>>>>> This patch is also useful for NetBSD, even if it's not a Linux host.
>>>>> There is a driver in progress again (thanks to the newly added Linux
>>>>> port, it's now much easier to get done).
>>>>>
>>>>> I recommend to merge this patch.
>>>>>
>>>>
>>>> For the record, I've a functional version of HAXM for NetBSD as host.
>>>> Once you will merge this patch, I will submit another one to configure
>>>> to enable haxm for NetBSD.
>>>>
>>>> I need to keep the patch by Alexandro in a local copy of qemu.
>>>
>>> Sure, it will be accepted for the release after 3.1.
>>>
>>> Paolo
>>>
>>>
>>
>> Ping.
> 
> It's already queued, but the pull request was pretty big and it had some
> issues (quite an understatement).

Hopefully you queued Alexandro's v2 (which isn't named v2) with Alex
comments fixed, thanks!

Phil.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2019-01-08 17:12         ` Kamil Rytarowski
@ 2019-01-08 18:27           ` Paolo Bonzini
  2019-01-09 11:00             ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 13+ messages in thread
From: Paolo Bonzini @ 2019-01-08 18:27 UTC (permalink / raw)
  To: Kamil Rytarowski, Alexandro Sanchez Bach, qemu-devel
  Cc: Eduardo Habkost, yu.ning, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]

On 08/01/19 18:12, Kamil Rytarowski wrote:
> On 25.11.2018 18:14, Paolo Bonzini wrote:
>> On 25/11/18 00:50, Kamil Rytarowski wrote:
>>> On 22.11.2018 08:24, Kamil Rytarowski wrote:
>>>> On 16.11.2018 13:52, Paolo Bonzini wrote:
>>>>> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
>>>>>> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
>>>>>> the corresponding userland changes.
>>>>>>
>>>>>> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
>>>>>> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
>>>>>> the naming used in the rest of QEMU.
>>>>>
>>>>> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
>>>>> avoiding bitrot?
>>>>>
>>>>> Paolo
>>>>>
>>>>
>>>> This patch is also useful for NetBSD, even if it's not a Linux host.
>>>> There is a driver in progress again (thanks to the newly added Linux
>>>> port, it's now much easier to get done).
>>>>
>>>> I recommend to merge this patch.
>>>>
>>>
>>> For the record, I've a functional version of HAXM for NetBSD as host.
>>> Once you will merge this patch, I will submit another one to configure
>>> to enable haxm for NetBSD.
>>>
>>> I need to keep the patch by Alexandro in a local copy of qemu.
>>
>> Sure, it will be accepted for the release after 3.1.
>>
>> Paolo
>>
>>
> 
> Ping.

It's already queued, but the pull request was pretty big and it had some
issues (quite an understatement).

Paolo


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-25 17:14       ` Paolo Bonzini
@ 2019-01-08 17:12         ` Kamil Rytarowski
  2019-01-08 18:27           ` Paolo Bonzini
  2019-02-02 15:03         ` Kamil Rytarowski
  1 sibling, 1 reply; 13+ messages in thread
From: Kamil Rytarowski @ 2019-01-08 17:12 UTC (permalink / raw)
  To: Paolo Bonzini, Alexandro Sanchez Bach, qemu-devel
  Cc: Eduardo Habkost, yu.ning, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

On 25.11.2018 18:14, Paolo Bonzini wrote:
> On 25/11/18 00:50, Kamil Rytarowski wrote:
>> On 22.11.2018 08:24, Kamil Rytarowski wrote:
>>> On 16.11.2018 13:52, Paolo Bonzini wrote:
>>>> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
>>>>> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
>>>>> the corresponding userland changes.
>>>>>
>>>>> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
>>>>> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
>>>>> the naming used in the rest of QEMU.
>>>>
>>>> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
>>>> avoiding bitrot?
>>>>
>>>> Paolo
>>>>
>>>
>>> This patch is also useful for NetBSD, even if it's not a Linux host.
>>> There is a driver in progress again (thanks to the newly added Linux
>>> port, it's now much easier to get done).
>>>
>>> I recommend to merge this patch.
>>>
>>
>> For the record, I've a functional version of HAXM for NetBSD as host.
>> Once you will merge this patch, I will submit another one to configure
>> to enable haxm for NetBSD.
>>
>> I need to keep the patch by Alexandro in a local copy of qemu.
> 
> Sure, it will be accepted for the release after 3.1.
> 
> Paolo
> 
> 

Ping.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 850 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-24 23:50     ` Kamil Rytarowski
@ 2018-11-25 17:14       ` Paolo Bonzini
  2019-01-08 17:12         ` Kamil Rytarowski
  2019-02-02 15:03         ` Kamil Rytarowski
  0 siblings, 2 replies; 13+ messages in thread
From: Paolo Bonzini @ 2018-11-25 17:14 UTC (permalink / raw)
  To: Kamil Rytarowski, Alexandro Sanchez Bach, qemu-devel
  Cc: Eduardo Habkost, yu.ning, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

On 25/11/18 00:50, Kamil Rytarowski wrote:
> On 22.11.2018 08:24, Kamil Rytarowski wrote:
>> On 16.11.2018 13:52, Paolo Bonzini wrote:
>>> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
>>>> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
>>>> the corresponding userland changes.
>>>>
>>>> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
>>>> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
>>>> the naming used in the rest of QEMU.
>>>
>>> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
>>> avoiding bitrot?
>>>
>>> Paolo
>>>
>>
>> This patch is also useful for NetBSD, even if it's not a Linux host.
>> There is a driver in progress again (thanks to the newly added Linux
>> port, it's now much easier to get done).
>>
>> I recommend to merge this patch.
>>
> 
> For the record, I've a functional version of HAXM for NetBSD as host.
> Once you will merge this patch, I will submit another one to configure
> to enable haxm for NetBSD.
> 
> I need to keep the patch by Alexandro in a local copy of qemu.

Sure, it will be accepted for the release after 3.1.

Paolo



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-22  7:24   ` Kamil Rytarowski
@ 2018-11-24 23:50     ` Kamil Rytarowski
  2018-11-25 17:14       ` Paolo Bonzini
  0 siblings, 1 reply; 13+ messages in thread
From: Kamil Rytarowski @ 2018-11-24 23:50 UTC (permalink / raw)
  To: Paolo Bonzini, Alexandro Sanchez Bach, qemu-devel
  Cc: Eduardo Habkost, yu.ning, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

On 22.11.2018 08:24, Kamil Rytarowski wrote:
> On 16.11.2018 13:52, Paolo Bonzini wrote:
>> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
>>> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
>>> the corresponding userland changes.
>>>
>>> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
>>> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
>>> the naming used in the rest of QEMU.
>>
>> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
>> avoiding bitrot?
>>
>> Paolo
>>
> 
> This patch is also useful for NetBSD, even if it's not a Linux host.
> There is a driver in progress again (thanks to the newly added Linux
> port, it's now much easier to get done).
> 
> I recommend to merge this patch.
> 

For the record, I've a functional version of HAXM for NetBSD as host.
Once you will merge this patch, I will submit another one to configure
to enable haxm for NetBSD.

I need to keep the patch by Alexandro in a local copy of qemu.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 850 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-16 12:52 ` Paolo Bonzini
  2018-11-16 15:00   ` Alexandro Sanchez
@ 2018-11-22  7:24   ` Kamil Rytarowski
  2018-11-24 23:50     ` Kamil Rytarowski
  1 sibling, 1 reply; 13+ messages in thread
From: Kamil Rytarowski @ 2018-11-22  7:24 UTC (permalink / raw)
  To: Paolo Bonzini, Alexandro Sanchez Bach, qemu-devel
  Cc: Eduardo Habkost, yu.ning, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

On 16.11.2018 13:52, Paolo Bonzini wrote:
> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
>> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
>> the corresponding userland changes.
>>
>> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
>> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
>> the naming used in the rest of QEMU.
> 
> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
> avoiding bitrot?
> 
> Paolo
> 

This patch is also useful for NetBSD, even if it's not a Linux host.
There is a driver in progress again (thanks to the newly added Linux
port, it's now much easier to get done).

I recommend to merge this patch.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 850 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-16 12:52 ` Paolo Bonzini
@ 2018-11-16 15:00   ` Alexandro Sanchez
  2018-11-22  7:24   ` Kamil Rytarowski
  1 sibling, 0 replies; 13+ messages in thread
From: Alexandro Sanchez @ 2018-11-16 15:00 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Ning, Yu, Richard Henderson, Eduardo Habkost

Hey Paolo,

> What's the advantage of HAXM when Linux hosts can just run KVM?

For end-users, it's true that there's several disadvantages and barely any
advantages: There's some guests run only on HAXM, since it can handle MMIO
accesses using BMI instructions ...and that's about it. :-) The HAXM API
also offers protecting/unprotecting arbitrary chunks of guest memory, which
has some advantages over KVM_GET_DIRTY_LOG. It's used in [1], but has not
been upstreamed yet.

For developers, there's few advantages over KVM that make work slightly
easier/simpler:
- No need to recompile+install a kernel, but just build+load a kernel
module, which takes few seconds, e.g. [2]. I'm aware of your kvm-kmod
(really helpful!), but Linux updates require patching it, which in turn
makes it incompatible with older Linux releases.
- Automated building, testing (and soon nightly builds as well).
- Extensive emulator tests [3] (generic virtualization tests also on the
way).
- Inspired by Bareflank, support for 3rd party "extensions". [4]

Of course, I'm aware that KVM is much more mature/compatible/performant
that HAXM and many other alternatives. My point is that it might be a bit
more comfortable to work with HAXM (and we are trying to improve this
further every day).

Another point concerns what I feel is the raison d'etre for HAXM:

There seems to be an unnecessary fragmentation of hypervisor APIs: KVM
(Linux), HVF (Mac), WHPX (Windows), which resembles the fragmentation of
graphics APIs. Afaik, no cross-platform type-2 hypervisor exists aside from
HAXM and Bareflank. This is fine for QEMU, since all major accelerators are
implemented, but other smaller projects might suffer from this. Of course,
we could wrap all APIs under a single userland library, but aside from
adding another layer of abstraction/translation, the underlying problem
persists: Each new feature needs to be re-implemented inside each
hypervisor (and HVF/WHPX are closed-source!).

Type-2 hypervisors don't *need* to be tightly coupled to a specific kernel:
If you look at HAXM, a thin platform-specific layer exists, the rest is
shared code. I believe that's much more convenient.

Cheers,
Alexandro

[1]
https://android-review.googlesource.com/c/platform/external/qemu/+/643674/
[2] https://travis-ci.com/intel/haxm/builds/91615353
[3] https://github.com/intel/haxm/blob/master/tests/test_emulator.cpp
[4] https://github.com/intel/haxm/pull/121


On Fri, Nov 16, 2018 at 1:53 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
> > Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch
> includes
> > the corresponding userland changes.
> >
> > Since the Darwin userland backend is POSIX-compliant, the
> hax-darwin.{c,h}
> > files have been renamed to hax-posix.{c,h}. This prefix is consistent
> with
> > the naming used in the rest of QEMU.
>
> What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
> avoiding bitrot?
>
> Paolo
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-14 13:04 Alexandro Sanchez Bach
  2018-11-14 15:04 ` Alex Bennée
@ 2018-11-16 12:52 ` Paolo Bonzini
  2018-11-16 15:00   ` Alexandro Sanchez
  2018-11-22  7:24   ` Kamil Rytarowski
  1 sibling, 2 replies; 13+ messages in thread
From: Paolo Bonzini @ 2018-11-16 12:52 UTC (permalink / raw)
  To: Alexandro Sanchez Bach, qemu-devel
  Cc: yu.ning, Richard Henderson, Eduardo Habkost

On 14/11/18 14:04, Alexandro Sanchez Bach wrote:
> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
> the corresponding userland changes.
> 
> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
> the naming used in the rest of QEMU.

What's the advantage of HAXM when Linux hosts can just run KVM?  I guess
avoiding bitrot?

Paolo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-14 15:04 ` Alex Bennée
@ 2018-11-15  1:33   ` Alexandro Sanchez Bach
  0 siblings, 0 replies; 13+ messages in thread
From: Alexandro Sanchez Bach @ 2018-11-15  1:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: yu.ning, Alex Bennée, Alexandro Sanchez Bach, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost

Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
the corresponding userland changes.

Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
files have been renamed to hax-posix.{c,h}. This prefix is consistent with
the naming used in the rest of QEMU.

Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com>
---
 target/i386/Makefile.objs                 | 4 +++-
 target/i386/hax-i386.h                    | 6 +++---
 target/i386/{hax-darwin.c => hax-posix.c} | 0
 target/i386/{hax-darwin.h => hax-posix.h} | 0
 4 files changed, 6 insertions(+), 4 deletions(-)
 rename target/i386/{hax-darwin.c => hax-posix.c} (100%)
 rename target/i386/{hax-darwin.h => hax-posix.h} (100%)

diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
index 04678f5503..070e701856 100644
--- a/target/i386/Makefile.objs
+++ b/target/i386/Makefile.objs
@@ -12,8 +12,10 @@ obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o
 ifdef CONFIG_WIN32
 obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-windows.o
 endif
+ifdef CONFIG_POSIX
+obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o
+endif
 ifdef CONFIG_DARWIN
-obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-darwin.o
 obj-$(CONFIG_HVF) += hvf/
 endif
 obj-$(CONFIG_WHPX) += whpx-all.o
diff --git a/target/i386/hax-i386.h b/target/i386/hax-i386.h
index 6abc156f88..f13fa4638f 100644
--- a/target/i386/hax-i386.h
+++ b/target/i386/hax-i386.h
@@ -16,7 +16,7 @@
 #include "cpu.h"
 #include "sysemu/hax.h"
 
-#ifdef CONFIG_DARWIN
+#ifdef CONFIG_POSIX
 typedef int hax_fd;
 #endif
 
@@ -82,8 +82,8 @@ hax_fd hax_mod_open(void);
 void hax_memory_init(void);
 
 
-#ifdef CONFIG_DARWIN
-#include "target/i386/hax-darwin.h"
+#ifdef CONFIG_POSIX
+#include "target/i386/hax-posix.h"
 #endif
 
 #ifdef CONFIG_WIN32
diff --git a/target/i386/hax-darwin.c b/target/i386/hax-posix.c
similarity index 100%
rename from target/i386/hax-darwin.c
rename to target/i386/hax-posix.c
diff --git a/target/i386/hax-darwin.h b/target/i386/hax-posix.h
similarity index 100%
rename from target/i386/hax-darwin.h
rename to target/i386/hax-posix.h
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] hax: Support for Linux hosts
  2018-11-14 13:04 Alexandro Sanchez Bach
@ 2018-11-14 15:04 ` Alex Bennée
  2018-11-15  1:33   ` Alexandro Sanchez Bach
  2018-11-16 12:52 ` Paolo Bonzini
  1 sibling, 1 reply; 13+ messages in thread
From: Alex Bennée @ 2018-11-14 15:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Alexandro Sanchez Bach, Eduardo Habkost, yu.ning,
	Richard Henderson


Alexandro Sanchez Bach <asanchez@kryptoslogic.com> writes:

> Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
> the corresponding userland changes.
>
> Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
> files have been renamed to hax-posix.{c,h}. This prefix is consistent with
> the naming used in the rest of QEMU.
>
> Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com>
> ---
>  target/i386/Makefile.objs                 |  5 ++++-
>  target/i386/hax-i386.h                    | 10 +++++++++-
>  target/i386/{hax-darwin.c => hax-posix.c} |  0
>  target/i386/{hax-darwin.h => hax-posix.h} |  0
>  4 files changed, 13 insertions(+), 2 deletions(-)
>  rename target/i386/{hax-darwin.c => hax-posix.c} (100%)
>  rename target/i386/{hax-darwin.h => hax-posix.h} (100%)
>
> diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
> index 04678f5503..be36d31d23 100644
> --- a/target/i386/Makefile.objs
> +++ b/target/i386/Makefile.objs
> @@ -12,8 +12,11 @@ obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o
>  ifdef CONFIG_WIN32
>  obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-windows.o
>  endif
> +ifdef CONFIG_LINUX
> +obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o
> +endif
>  ifdef CONFIG_DARWIN
> -obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-darwin.o
> +obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o

This is starting to get repetitive, perhaps:

  obj-$(CONFIG_HAX) += hax-all.o hax-mem.o
  ifneq ($(CONFIG_LINUX)$(CONFIG_DARWIN),)
  obj-$(CONFIG_HAX) += hax-posix.o
  endif
  ifdef CONFIG_WIN32
  obj-$(CONFIG_HAX) += hax-windows.o
  endif

Would be better?

>  obj-$(CONFIG_HVF) += hvf/
>  endif
>  obj-$(CONFIG_WHPX) += whpx-all.o
> diff --git a/target/i386/hax-i386.h b/target/i386/hax-i386.h
> index 6abc156f88..f87a64c9df 100644
> --- a/target/i386/hax-i386.h
> +++ b/target/i386/hax-i386.h
> @@ -20,6 +20,10 @@
>  typedef int hax_fd;
>  #endif
>
> +#ifdef CONFIG_LINUX
> +typedef int hax_fd;
> +#endif

Again this could be merged with the other POSIX like above.

> +
>  #ifdef CONFIG_WIN32
>  typedef HANDLE hax_fd;
>  #endif
> @@ -83,7 +87,11 @@ void hax_memory_init(void);
>
>
>  #ifdef CONFIG_DARWIN
> -#include "target/i386/hax-darwin.h"
> +#include "target/i386/hax-posix.h"
> +#endif
> +
> +#ifdef CONFIG_LINUX
> +#include "target/i386/hax-posix.h"
>  #endif

And here.

In fact looking at my config-host.mak we have a CONFIG_POSIX so you
could use that.

>
>  #ifdef CONFIG_WIN32
> diff --git a/target/i386/hax-darwin.c b/target/i386/hax-posix.c
> similarity index 100%
> rename from target/i386/hax-darwin.c
> rename to target/i386/hax-posix.c
> diff --git a/target/i386/hax-darwin.h b/target/i386/hax-posix.h
> similarity index 100%
> rename from target/i386/hax-darwin.h
> rename to target/i386/hax-posix.h


--
Alex Bennée

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH] hax: Support for Linux hosts
@ 2018-11-14 13:04 Alexandro Sanchez Bach
  2018-11-14 15:04 ` Alex Bennée
  2018-11-16 12:52 ` Paolo Bonzini
  0 siblings, 2 replies; 13+ messages in thread
From: Alexandro Sanchez Bach @ 2018-11-14 13:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: yu.ning, Alexandro Sanchez Bach, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost

Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes
the corresponding userland changes.

Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h}
files have been renamed to hax-posix.{c,h}. This prefix is consistent with
the naming used in the rest of QEMU.

Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com>
---
 target/i386/Makefile.objs                 |  5 ++++-
 target/i386/hax-i386.h                    | 10 +++++++++-
 target/i386/{hax-darwin.c => hax-posix.c} |  0
 target/i386/{hax-darwin.h => hax-posix.h} |  0
 4 files changed, 13 insertions(+), 2 deletions(-)
 rename target/i386/{hax-darwin.c => hax-posix.c} (100%)
 rename target/i386/{hax-darwin.h => hax-posix.h} (100%)

diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
index 04678f5503..be36d31d23 100644
--- a/target/i386/Makefile.objs
+++ b/target/i386/Makefile.objs
@@ -12,8 +12,11 @@ obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o
 ifdef CONFIG_WIN32
 obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-windows.o
 endif
+ifdef CONFIG_LINUX
+obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o
+endif
 ifdef CONFIG_DARWIN
-obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-darwin.o
+obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o
 obj-$(CONFIG_HVF) += hvf/
 endif
 obj-$(CONFIG_WHPX) += whpx-all.o
diff --git a/target/i386/hax-i386.h b/target/i386/hax-i386.h
index 6abc156f88..f87a64c9df 100644
--- a/target/i386/hax-i386.h
+++ b/target/i386/hax-i386.h
@@ -20,6 +20,10 @@
 typedef int hax_fd;
 #endif
 
+#ifdef CONFIG_LINUX
+typedef int hax_fd;
+#endif
+
 #ifdef CONFIG_WIN32
 typedef HANDLE hax_fd;
 #endif
@@ -83,7 +87,11 @@ void hax_memory_init(void);
 
 
 #ifdef CONFIG_DARWIN
-#include "target/i386/hax-darwin.h"
+#include "target/i386/hax-posix.h"
+#endif
+
+#ifdef CONFIG_LINUX
+#include "target/i386/hax-posix.h"
 #endif
 
 #ifdef CONFIG_WIN32
diff --git a/target/i386/hax-darwin.c b/target/i386/hax-posix.c
similarity index 100%
rename from target/i386/hax-darwin.c
rename to target/i386/hax-posix.c
diff --git a/target/i386/hax-darwin.h b/target/i386/hax-posix.h
similarity index 100%
rename from target/i386/hax-darwin.h
rename to target/i386/hax-posix.h
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-02-02 15:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 11:11 [Qemu-devel] [PATCH] hax: Support for Linux hosts Alexandro Sanchez Bach
2018-11-14 13:04 Alexandro Sanchez Bach
2018-11-14 15:04 ` Alex Bennée
2018-11-15  1:33   ` Alexandro Sanchez Bach
2018-11-16 12:52 ` Paolo Bonzini
2018-11-16 15:00   ` Alexandro Sanchez
2018-11-22  7:24   ` Kamil Rytarowski
2018-11-24 23:50     ` Kamil Rytarowski
2018-11-25 17:14       ` Paolo Bonzini
2019-01-08 17:12         ` Kamil Rytarowski
2019-01-08 18:27           ` Paolo Bonzini
2019-01-09 11:00             ` Philippe Mathieu-Daudé
2019-02-02 15:03         ` Kamil Rytarowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.