All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Don Slutz <dslutz@verizon.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Michael Tokarev <mjt@tls.msk.ru>,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Anthony Liguori <aliguori@amazon.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/1] -machine vmport=off: Allow disabling of VMWare ioport emulation
Date: Mon, 6 Oct 2014 10:26:12 +0100	[thread overview]
Message-ID: <20141006092612.GA14637@redhat.com> (raw)
In-Reply-To: <1412372017-5042-2-git-send-email-dslutz@verizon.com>

On Fri, Oct 03, 2014 at 05:33:37PM -0400, Don Slutz wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> This is a pc & q35 only machine opt.
> 
> VMWare apparently doesn't like running under QEMU due to our
> incomplete emulation of it's special IO Port.  This adds a
> pc & q35 property to allow it to be turned off.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Signed-off-by: Don Slutz <dslutz@verizon.com>
> ---
>  hw/i386/pc.c         | 19 +++++++++++++++++++
>  hw/i386/pc_piix.c    |  4 ++--
>  hw/i386/pc_q35.c     |  3 ++-
>  include/hw/i386/pc.h |  2 ++
>  qemu-options.hx      |  3 +++
>  vl.c                 |  4 ++++
>  6 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 82a7daa..8e37a99 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1687,6 +1687,20 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
>      pcms->max_ram_below_4g = value;
>  }
>  
> +static bool pc_machine_get_vmport(Object *obj, Error **errp)
> +{
> +    PCMachineState *pcms = PC_MACHINE(obj);
> +
> +    return pcms->vmport;
> +}
> +
> +static void pc_machine_set_vmport(Object *obj, bool value, Error **errp)
> +{
> +    PCMachineState *pcms = PC_MACHINE(obj);
> +
> +    pcms->vmport = value;
> +}
> +
>  static void pc_machine_initfn(Object *obj)
>  {
>      PCMachineState *pcms = PC_MACHINE(obj);
> @@ -1699,6 +1713,11 @@ static void pc_machine_initfn(Object *obj)
>                          pc_machine_get_max_ram_below_4g,
>                          pc_machine_set_max_ram_below_4g,
>                          NULL, NULL, NULL);
> +    pcms->vmport = !xen_enabled();
> +    object_property_add_bool(obj, PC_MACHINE_VMPORT,
> +                             pc_machine_get_vmport,
> +                             pc_machine_set_vmport,
> +                             NULL);
>  }
>  
>  static void pc_machine_class_init(ObjectClass *oc, void *data)
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 103d756..03a73ce 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -234,8 +234,8 @@ static void pc_init1(MachineState *machine,
>      pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
>  
>      /* init basic PC hardware */
> -    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled(),
> -        0x4);
> +    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy,
> +                         !pc_machine->vmport, 0x4);
>  
>      pc_nic_init(isa_bus, pci_bus);
>  
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index d4a907c..c5ba93d 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -241,7 +241,8 @@ static void pc_q35_init(MachineState *machine)
>      pc_register_ferr_irq(gsi[13]);
>  
>      /* init basic PC hardware */
> -    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, false, 0xff0104);
> +    pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy,
> +                         !pc_machine->vmport, 0xff0104);
>  
>      /* connect pm stuff to lpc */
>      ich9_lpc_pm_init(lpc);
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 77316d5..96febb9 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -35,11 +35,13 @@ struct PCMachineState {
>      HotplugHandler *acpi_dev;
>  
>      uint64_t max_ram_below_4g;
> +    bool vmport;
>  };
>  
>  #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
>  #define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
>  #define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
> +#define PC_MACHINE_VMPORT           "vmport"
>  
>  /**
>   * PCMachineClass:
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 365b56c..fe6b6e5 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -33,6 +33,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
>      "                property accel=accel1[:accel2[:...]] selects accelerator\n"
>      "                supported accelerators are kvm, xen, tcg (default: tcg)\n"
>      "                kernel_irqchip=on|off controls accelerated irqchip support\n"
> +    "                vmport=on|off controls emulation of vmport (default: on)\n"
>      "                kvm_shadow_mem=size of KVM shadow MMU\n"
>      "                dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
>      "                mem-merge=on|off controls memory merge support (default: on)\n"
> @@ -51,6 +52,8 @@ than one accelerator specified, the next one is used if the previous one fails
>  to initialize.
>  @item kernel_irqchip=on|off
>  Enables in-kernel irqchip support for the chosen accelerator when available.
> +@item vmport=on|off
> +Enables emulation of VMWare IO port, for vmmouse etc. (enabled by default)
>  @item kvm_shadow_mem=size
>  Defines the size of the KVM shadow MMU.
>  @item dump-guest-core=on|off
> diff --git a/vl.c b/vl.c
> index 9d2aaaf..26fa864 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -389,6 +389,10 @@ static QemuOptsList qemu_machine_opts = {
>              .name = PC_MACHINE_MAX_RAM_BELOW_4G,
>              .type = QEMU_OPT_SIZE,
>              .help = "maximum ram below the 4G boundary (32bit boundary)",
> +        }, {
> +            .name = PC_MACHINE_VMPORT,
> +            .type = QEMU_OPT_BOOL,
> +            .help = "Enable vmport (pc & q35)",
>          },{
>              .name = "iommu",
>              .type = QEMU_OPT_BOOL,
> -- 
> 1.8.4

I reviewed the code and compiled-tested it, but didn't run it since
I've moved my ESXi server to baremetal *.  You can add:

  Reviewed-by: Richard W.M. Jones <rjones@redhat.com>

Rich.

* For other reasons: QEMU emulates vmxnet3, but it's quite unreliable
when used with an ESXi hypervisor guest.  I saw frequent random
network disconnections.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

  parent reply	other threads:[~2014-10-06  9:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 21:33 [Qemu-devel] [PATCH v2 0/1] -machine vmport=off: Allow disabling of VMWare ioport emulation Don Slutz
2014-10-03 21:33 ` [Qemu-devel] [PATCH v2 1/1] " Don Slutz
2014-10-05 13:32   ` Paolo Bonzini
2014-10-06  9:26   ` Richard W.M. Jones [this message]
2014-10-15 21:20     ` [Qemu-devel] [PING] " Slutz, Donald Christopher
2014-10-16  7:33       ` Paolo Bonzini
2014-10-16  9:57   ` [Qemu-devel] " Eduardo Habkost
2014-10-06  9:53 ` [Qemu-devel] [PATCH v2 0/1] " Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141006092612.GA14637@redhat.com \
    --to=rjones@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=dgilbert@redhat.com \
    --cc=dslutz@verizon.com \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.