Commit graph

15018 commits

Author SHA1 Message Date
Miao Yan c12d82ef15 net/vmxnet3: rename VMXNET3_DEVICE_VERSION to VMXNET3_UPT_REVISION
VMXNET3_DEVICE_VERSION is used as return value for accessing
UPT Revision Report and Selection register. So rename it
to VMXNET3_UPT_REVISION.

Signed-off-by: Miao Yan <yanmiaoebest@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan 8856be1512 net/vmxnet3: return 0 on unknown command
Return 0 on unknown command, this is what esxi (5.x+) behaves.

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan 5ae3e91c35 net/vmxnet3: return correct value for VMXNET3_CMD_GET_DEV_EXTRA_INFO
VMXNET3_CMD_GET_DEV_EXTRA_INFO should return 0 for emulation
mode

This behavior can be observed by the following steps:

1) run a Linux distro on esxi server (5.x+)
2) modify vmxnet3 Linux driver to read the register:

  VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DEV_EXTRA_INFO);
  ret =  VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD);
  pr_info("vmxnet3 dev_info: 0x%x\n", ret);

The kernel log will have some like the following message:

  [ 7005.111170] vmxnet3 dev_info: 0x0

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan c469669ef7 net/vmxnet3: return correct value for VMXNET3_CMD_GET_DID_* command
VMXNET3_CMD_GET_DID_LO should return PCI ID of the device
and VMXNET3_CMD_GET_DID_HI should return vmxnet3 revision ID.

This behavior can be observed by the following steps:

1) run a Linux distro on esxi server (5.x+)
2) modify vmxnet3 Linux driver to read DID_HI and DID_LO:

  VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DID_LO);
  lo =  VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD);

  VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DID_HI);
  high =  VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD);
  pr_info("vmxnet3 DID lo: 0x%x, high: 0x%x\n", lo, high);

The kernel log will have something like the following message:

  [ 7005.111170] vmxnet3 DID lo: 0x7b0, high: 0x1

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan fde58177aa net/vmxnet3: return 1 on device activation failure
When reading device status, 0 means device is successfully
activated and 1 means error.

This behavior can be observed by the following steps:

1) run a Linux distro on esxi server (5.5+)
2) modify vmxnet3 Linux driver to give it an invalid
   address to 'adapter->shared_pa' which is the
   shared memory for guest/host communication

This will trigger device activation failure and kernel
log will have the following message:

   [ 7138.403256] vmxnet3 0000:03:00.0 eth1: Failed to activate dev: error 1

So return 1 on device activation failure instead of -1;

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
P J P aa4a3dce1c net: vmxnet3: avoid memory leakage in activate_device
Vmxnet3 device emulator does not check if the device is active
before activating it, also it did not free the transmit & receive
buffers while deactivating the device, thus resulting in memory
leakage on the host. This patch fixes both these issues to avoid
host memory leakage.

Reported-by: Qinghao Tang <luodalongde@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan dd3c168471 net/vmxnet3: remove redundant VMW_SHPRN(...) definition
Macro VMW_SHPRN(...) is already defined vmxnet3_debug.h,
so remove the duplication

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan 71c2f5b9b3 net/vmxnet3: fix debug macro pattern for vmxnet3
Vmxnet3 uses the following debug macro style:

 #ifdef SOME_DEBUG
 #  define debug(...) do{ printf(...); } while (0)
 # else
 #  define debug(...) do{ } while (0)
 #endif

If SOME_DEBUG is undefined, then format string inside the
debug macro will never be checked by compiler. Code is
likely to break in the future when SOME_DEBUG is enabled
 because of lack of testing. This patch changes this
to the following:

 #define debug(...) \
  do { if (SOME_DEBUG_ENABLED) printf(...); } while (0)

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan 2e4ca7dbc1 net/vmxnet3: use %zu for size_t in printf
Use %zu specifier for size_t in printf, otherwise build would fail
on platforms where size_t is not unsigned long

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:34 +08:00
Miao Yan 938cdfefee net/vmxnet3: fix a build error when enabling debug output
Macro MAC_FMT and MAC_ARG are not defined, but used in vmxnet3_net_init().
This will cause build error when debug level is raised in
vmxnet3_debug.h (enable all VMXNET3_DEBUG_xxx).

Use VMXNET_MF and VXMNET_MA instead.

Signed-off-by: Miao Yan <yanmiaobest@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11 11:01:32 +08:00
Peter Maydell 6bb9ead762 sdl2/opengl: add opengl context and scanout support
ui/curses: Fix color attribute of monitor for curses
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWj66aAAoJEEy22O7T6HE4rSgP/iBVMpm5wZrOvxGZ7XV0wx7D
 /JiQ7J7oS6aWBpz0LFHeiseWMDX1/V2kEDe/3mwHqeNULfeZqlf9PIXwM8N6FX2Q
 tIO0DB7iTDg/nT10Q2gHsYQtaNcsuw1c8+mwOw20ogcBVTXqHw4tACPhZWthVNDQ
 sLeIwH0OU/n/Gf6E+tMAfourDH0SIM8wtw9UguGcR1PxbyDnvRv8gEiPty2qOnGq
 nTdIdmf54eCgll6qQRhZ3+53k1ShrTv7hn5GKRmQZSOFXe5JgBeUfoT6xZf/lIAf
 D9LdmAU9vuNK7m4TceEsIAzUvNG49jAsVQGUO6Ebk3rT3FSoNLfx7ION/N0xjDvt
 CAKGN1Ub/vuqPBl57/qb9AxTYcRPW5KgHSrALWrM7TTLY8xLa2cRjEd6kVYfPsvs
 rhhrfHeac3qiwg9sjKaHeXvcmOCSRX/pTzkER9RK7bIeMHyDu7x+WJvIkW5qdfSe
 1G62aXZIeSRlSfKDvdbn1zfu/gZ7uy8xtvG/3CrCcT5Qf3PqEr2KOPsq/S1C1BKN
 GSCnt+DcLNmdiwyESMluibdVx9Vh7urbOdCh9pebFjgswCPNRSXzyUji0Xkzwe8b
 BkBoSCqdu5Z0QmiapG83Y2e9e/uWqfyr/DAB/CiFf2wLgoiiP1usof3Euzez96oa
 i7q5dNgGuBlv25Z8ngT8
 =4sRO
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160108-1' into staging

sdl2/opengl: add opengl context and scanout support
ui/curses: Fix color attribute of monitor for curses

# gpg: Signature made Fri 08 Jan 2016 12:42:02 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-ui-20160108-1:
  sdl2/opengl: add opengl context and scanout support
  ui/curses: Fix color attribute of monitor for curses

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-08 12:50:19 +00:00
Peter Maydell 9df2513730 usb: mtp and ohci fixes.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWj4wjAAoJEEy22O7T6HE4PegP/A9occg8K/vXW9WKm4qJLX3w
 MCSlyEnIVWkK6nRx8xQnzINxvxFg7KXmWU8Rkp8JY7NZOFpdo4/ivGObfl4B7bCY
 uHfdXAmU7RycT3m0TERS92fK95LPurN19q/66me1HH8orfOMBYmoVr7UILJaehUW
 ZHEka0lnPeTcs7AY59svUn8g6Xr4dn5zN0v0mEJemAjWmOiolMcX9P/hKskn7nPc
 kC3vu/vVFEXmKWVwAYrDasFltAJ1670tIvI8sNhPZeoD+wucMBLx29JJ8760AmJT
 kQO4vZkD0GM4AjDCvKt8tCn6XQt/5D+Fg9gdXtX7Nv8IbHhrLYrTM8iQsvT7dyCX
 JhY4USoKERjjttzDo6JbGZDYe5YwUP5U9QNXVTCw9oM8jfTA9o6evnFgASMEbGlW
 CZpZG+PCYe/x2MG4pMSVHYR/RZxNfncqdjX7jxr376zDGWt5ptnZWrNlL92O/+XI
 3biXorhsiJUtHMmrDIR8xhGn44F1/zVAvuP+1oqt7kMSr9p7wtxQ2RQEcVFQ7QJN
 KU6DEoC5EYjUEv74HIylHyrLGa1s+l1LUFS0c4TQGslO5BcjprF37l48q+o+3G9V
 nN6s+UqUhI8J8mvx7jE04xROPZmMf6oztw28j8EEMbHVvdyPgnCcJcHX0QuEBEWH
 fZrVjBLAT12RZk4Z7X6f
 =mdBV
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20160108-1' into staging

usb: mtp and ohci fixes.

# gpg: Signature made Fri 08 Jan 2016 10:14:59 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-usb-20160108-1:
  ohci: clear pending SOF on suspend
  ohci: delay first SOF interrupt
  usb-mtp: fix call to trace function
  usb-mtp: use safe variant when cleaning events list
  ohci: fix command HostControllerReset
  ohci: fix Host Controller USBRESET
  ohci: split reset method in 3 parts

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-08 11:24:15 +00:00
OGAWA Hirofumi 4083733db5 ui/curses: Fix color attribute of monitor for curses
Current text_console_update() writes totally broken color attributes
to console_write_ch(). The format now is writing,

[WRONG]
	bold << 21 | fg << 12 | bg << 8 | char
	fg == 3bits curses color number
	bg == 3bits curses color number

I can't see this format is where come from. Anyway, this doesn't work
at all.

What curses expects is actually (and vga.c is using),

[RIGHT]
	bold << 21 | bg << 11 | fg << 8 | char
	fg == 3bits vga color number
	bg == 3bits vga color number

And curses set COLOR_PAIR() up to match this format, and curses's
chtype. I.e,

	bold | color_pair | char
	color_pair == (bg << 3 | fg)

To fix, this simply uses VGA color number everywhere except curses.c
internal. Then, convert it to above [RIGHT] format to write by
console_write_ch(). And as bonus, this reduces to expose curses define
to other parts (removes COLOR_* from console.c).

[Tested the first line is displayed as white on blue back for monitor
in curses console]

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Message-id: 87r3j95407.fsf@mail.parknet.co.jp
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 12:20:07 +01:00
Laurent Vivier 087462c773 ohci: clear pending SOF on suspend
On overcommitted CPU, kernel can be so slow that an interrupt can
be triggered by the device whereas the driver is not ready to receive
it. This drives us into an infinite loop.

On suspend, if a SOF interrupt is raised between the stop of the
device processing and the change of the device internal state to
OHCI_USB_SUSPEND (QEMU stops SOF timer on this state change), this
interrupt is never acknowledged.

This patch clears pending SOF interrupt on OHCI_USB_SUSPEND setting.

Some details:

- ohci_irq(): the OHCI interrupt handler, acknowledges the SOF IRQ
  only if the state of the driver (rh_state) is OHCI_STATE_RUNNING.
  So if this interrupt happens and the driver is not in this state,
  the function is called again and again, moving the system to a
  CPU starvation.

- ohci_rh_suspend(): the function stop the operation and acknowledge
  pending interrupts (but doesn't disable it). Later in the function,
  the device is moved to OHCI_SUSPEND_STATE, and the driver to
  OHCI_RH_SUSPENDED. If between the moment when the interrupt is
  acknowledged and the moment when the device is suspended a new
  interrupt is raised, it will be never acknowledged because the
  driver is now not in OHCI_RH_RUNNING state.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 1452109525-32150-3-git-send-email-lvivier@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:29:24 +01:00
Laurent Vivier fd0a10cd20 ohci: delay first SOF interrupt
On overcommitted CPU, kernel can be so slow that an interrupt can
be triggered by the device whereas the driver is not ready to receive
it. This drives us into an infinite loop.

This does not happen on real hardware because real hardware never send
interrupt immediately after the controller has been moved to OPERATION state.

This patch tries to delay the first SOF interrupt to let driver exits from
the critical section (which is not protected against interrupts...)

Some details:

- ohci_irq(): the OHCI interrupt handler, acknowledges the SOF IRQ
  only if the state of the driver (rh_state) is OHCI_STATE_RUNNING.
  So if this interrupt happens and the driver is not in this state,
  the function is called again and again, moving the system to a
  CPU starvation.

- ohci_rh_resume(): the driver re-enables operation with OHCI_USB_OPER.
  In QEMU this start the SOF timer and QEMU starts to send IRQs. As
  the driver is not in OHCI_STATE_RUNNING and not protected against IRQ,
  the ohci_irq() can be called and the driver never moved to
  OHCI_STATE_RUNNING.

Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 1452109525-32150-2-git-send-email-lvivier@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:29:24 +01:00
Bandan Das ec93e158b1 usb-mtp: fix call to trace function
trace_usb_mtp_inotify_event() was being called after the object was
being freed.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 1450861787-16213-3-git-send-email-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Bandan Das c22d5dcd7a usb-mtp: use safe variant when cleaning events list
usb_mtp_inotify_cleanup uses QLIST_FOREACH to pick events
from a list and free them which is incorrect. Use QLIST_FOREACH_SAFE
instead.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 1450861787-16213-2-git-send-email-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Hervé Poussineau 0922c3f606 ohci: fix command HostControllerReset
Specification says that: "This bit is set by HCD to initiate a software reset of HC."

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-4-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Hervé Poussineau 7d938fd14b ohci: fix Host Controller USBRESET
Specification says that, when entering this state, "the contents of the registers
(except Root Hub registers) are preserved by the HC. [...] The Root Hub is being reset,
which causes the Root Hub's downstream ports to be reset and possibly powered off."

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-3-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Hervé Poussineau 84d04e2162 ohci: split reset method in 3 parts
The three parts are:
- root hub reset (ohci_roothub_reset)
- host controller soft reset (ohci_soft_reset)
- host controller hard reset (ohci_hard_reset)

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-id: 1450567431-31795-2-git-send-email-hpoussin@reactos.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 09:25:50 +01:00
Fam Zheng 05e4d14bf3 block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE
It's necessary to distinguish source and target before we can add
blockdev-mirror, because we would want a concrete type of operation to
check on target bs before starting.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1450932306-13717-2-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-01-07 21:30:17 +01:00
Edgar E. Iglesias a7e00e2536 petalogix-ml605: Set the MicroBlaze CPU version to 8.10.a
Set the MicroBlaze CPU version to 8.10.a avoiding a runtime
warning due to an unset CPU version.

Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-07 14:57:26 +01:00
Edgar E. Iglesias ad24f947be s3adsp1800: Set the MicroBlaze CPU version to 7.10.d
Set the MicroBlaze CPU version to 7.10.d avoiding a runtime
warning due to an unset CPU version.

Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-07 14:57:26 +01:00
Mark Cave-Ayland bf43330aa4 sun4u: split NPT and INT_DIS accesses between timer and compare registers
Accesses to the timer register high bit should only set NPT, whilst accesses
to the timer compare register high bit should only set INT_DIS. This fixes
issues with the timer being unexpectedly disabled whilst trying to boot
FreeBSD SPARC64.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-By: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-01-07 12:21:02 +00:00
Mark Cave-Ayland e913cac71b sun4u: split out NPT and INT_DIS into separate CPUTimer fields
Currently there is confusion between use of these bits for the timer and timer
compare registers (while they both have the same value, the behaviour is
different). Split into two separate CPUTimer fields so we can always reference
the correct value.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-By: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-01-07 12:20:53 +00:00
Peter Maydell 8b4f90316a Fix a 2.5 regression.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlZ6ffwACgkQAvw66wEB28L59wCdEbXdeiE8SPV4rI/PIdvnUtAX
 BmAAn2MPJ07PcUXmu3jaj1ZEmjoEGJ+R
 =DucP
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging

Fix a 2.5 regression.

# gpg: Signature made Wed 23 Dec 2015 10:57:00 GMT using DSA key ID 0101DBC2
# gpg: Good signature from "Greg Kurz <gkurz@fr.ibm.com>"
# gpg:                 aka "Greg Kurz <groug@free.fr>"
# gpg:                 aka "Greg Kurz <gkurz@linux.vnet.ibm.com>"
# gpg:                 aka "Gregory Kurz (Groug) <groug@free.fr>"
# gpg:                 aka "Gregory Kurz (Cimai Technology) <gkurz@cimai.com>"
# gpg:                 aka "Gregory Kurz (Meiosys Technology) <gkurz@meiosys.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2

* remotes/gkurz/tags/for-upstream:
  virtio-9p: use accessor to get thread_pool

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-12-23 13:29:47 +00:00
Peter Maydell 5fbba56073 acpi, pc features
pxb support for q35
 nvdimm support
 most of ipmi support
 part of DSDT rewrite
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWeX6WAAoJECgfDbjSjVRp08kH/0YwnLl23evSIst67O5AthCm
 IjTu7tbANtpadMq9YxU7Is+6QEi27C26pqy4CWgoirhsrjiY2jC5LVCZqhIhBEeJ
 JFyAiYglJDMraHWyKG373lLEeQvNmEmFsxmULmV6cX2j1tsgyXCqdQs5DmRGnHno
 L02W0p3EnEfUwYvnuyeuKmdw+ykiCxKt5zBYodSU6yPkFI34Ex/VBiwqt6nJ0hU1
 xDNbmudN0GI/ckUezq0ko6AXPnmouiq0QPGVf0EXRaFQxwjbyb+f9zK+xmo/v2k3
 5Mz3+otQ8i5cyunY9ziQf58WKMXY/CmerXXv4/gnfwz6EfdZZGsNc1niJcsXxDs=
 =D7er
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

acpi, pc features

pxb support for q35
nvdimm support
most of ipmi support
part of DSDT rewrite

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Tue 22 Dec 2015 16:47:18 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream: (55 commits)
  acpi: extend aml_and() to accept target argument
  acpi: extend aml_or() to accept target argument
  acpi add aml_dma()
  acpi: add aml_to_buffer()
  acpi: add aml_to_hexstring()
  acpi: extend aml_field() to support LockRule
  acpi: add aml_lgreater()
  acpi: add aml_lor()
  acpi: add aml_sleep()
  acpi: add aml_alias()
  acpi: extend aml_shiftright() to accept target argument
  acpi: add aml_to_integer()
  acpi: add aml_call0() helper
  acpi: add aml_decrement() and aml_subtract()
  acpi: extend aml_add() to accept target argument
  acpi: aml: add helper for Opcode Arg2 Arg2 [Dst] AML pattern
  acpi: add aml_create_qword_field()
  acpi: add aml_mutex(), aml_acquire(), aml_release()
  acpi: add aml_lgreater_equal()
  acpi: add aml_sizeof
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-12-23 12:27:51 +00:00
Peter Maydell 05bec7eb0e Xen 2015/12/22
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJWeXe1AAoJEIlPj0hw4a6QpTUQAPirj6gWanKtVTRGPnOhClMW
 h9inFwkoAxQj5KGYeiI8RYzrWhFKDooOe4T+qIenp6HYMzQdSpM1A/wEeO6UnyVw
 j3hEI6bi+ZNG27yEJV2mygSY4ivNG7gk2dbKRwqaA2pmbrNEtMTdv45MQYrQeqjC
 vd6uy+VoZSuG/spQGhGc5JhoYiFFWHzprueqfHsFO8nM+7htRxBne7zw2iB17o9q
 pptOoETfV6mjbdqxDHKlRnm5DtvXpyszDFtFp3utzjAbsTkrMTxb2iaS+p359fav
 6QweJQgrnDKIR1v3VWhs054OmoY9jcW4Q6lnqu7TJbVuOKnlS9Hoe70A0s+knZsz
 7HDz73GEjB2rgK0KArK7sOS2/M5lQRj1JbtbzLLkWmq9lndRLgRj6+QoZ72gLs2S
 +s5X5c1iXLhZtBmGAz/sH6u5A1Bk7YVGHuEN9evfDsIC/uxVGhNX+exXgy0pADG0
 iT0+BPKGVTKbZmxYiyfhhMsEiTdcQTI9/KYT+sDHy/9PTaqS6D8rFRHnrZi6PWRn
 get5L3ZRQ686KcyEh8pQVYpki+HUWStqVlvufvbPkJ0Wpaj9yi6KdlmQOA3IrWni
 syFd6KJuumtUrX/xISuY+kpG6FlsDHQzh318NEmjU9jFhoKE34JHqtd/C/RMAWKF
 FdbVufoH+Rq/yQy2QNqE
 =FXtN
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/sstabellini/tags/xen-2015-12-22' into staging

Xen 2015/12/22

# gpg: Signature made Tue 22 Dec 2015 16:17:57 GMT using RSA key ID 70E1AE90
# gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"

* remotes/sstabellini/tags/xen-2015-12-22:
  xen_disk: treat "vhd" as "vpc"
  xen/pass-through: correctly deal with RW1C bits
  xen/MSI-X: really enforce alignment
  xen/MSI-X: latch MSI-X table writes

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-12-23 12:04:01 +00:00
Greg Kurz 4b3a4f2d45 virtio-9p: use accessor to get thread_pool
The aio_context_new() function does not allocate a thread pool. This is
deferred to the first call to the aio_get_thread_pool() accessor. It is
hence forbidden to access the thread_pool field directly, as it may be
NULL. The accessor *must* be used always.

Fixes: ebac1202c9
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-stable@nongnu.org
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
2015-12-23 10:56:58 +01:00
Igor Mammedov 5530427f0c acpi: extend aml_and() to accept target argument
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov ca3df95df8 acpi: extend aml_or() to accept target argument
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov a23b887281 acpi add aml_dma()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 25c1432ebe acpi: add aml_to_buffer()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 6d5ea945ce acpi: add aml_to_hexstring()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 36de884a13 acpi: extend aml_field() to support LockRule
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov dabad78b0d acpi: add aml_lgreater()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov df241999b6 acpi: add aml_lor()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 0073518dd7 acpi: add aml_sleep()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 67a5c0faa6 acpi: add aml_alias()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov c360639aee acpi: extend aml_shiftright() to accept target argument
it allows to express ShiftRight(A,B,C) syntax

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov f411199de7 acpi: add aml_to_integer()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 7b38ba9cb6 acpi: add aml_call0() helper
it will help to call a method with 0 arguments

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 7059eb4262 acpi: add aml_decrement() and aml_subtract()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 20ca520884 acpi: extend aml_add() to accept target argument
it allows to express following ASL expression:
 Add(arg1, arg2, result)

usecases that do not need to store result
should pass NULL as 3rd arg that would express
 Add(arg1, arg2,)
construct.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:21 +02:00
Igor Mammedov 439e2a6e10 acpi: aml: add helper for Opcode Arg2 Arg2 [Dst] AML pattern
Currently AML API doesn't compose terms in form of
following pattern:

   Opcode Arg2 Arg2 [Dst]

but ASL used in piix4/q35 DSDT ACPI tables uses that
form, so for clean conversion of it, AML API should
be able to handle an optional 'Dst' argumet used there.

Since above pattern is used by arithmetic/bit ops,
introduce helper that they could reuse.
It reduces code duplication in existing 5 aml_foo()
functions and also will prevent more duplication
when exiting functions are extended to support
optional 'Dst' argument.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
2015-12-22 18:39:20 +02:00
Igor Mammedov 7e192a383b acpi: add aml_create_qword_field()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
2015-12-22 18:39:20 +02:00
Xiao Guangrong 6e1db3f263 acpi: add aml_mutex(), aml_acquire(), aml_release()
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-22 18:39:20 +02:00
Igor Mammedov 2d3f667dc6 acpi: add aml_lgreater_equal()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
2015-12-22 18:39:20 +02:00
Xiao Guangrong 52483d147b acpi: add aml_sizeof
Implement SizeOf term which is used by NVDIMM _DSM method in later patch

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-22 18:39:20 +02:00
Xiao Guangrong 95cb066190 acpi: add aml_derefof
Implement DeRefOf term which is used by NVDIMM _DSM method in later patch

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-12-22 18:39:20 +02:00