s390: remove non existent reference to GENERIC_KERNEL_THREAD

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
s390/disassembler: prevent endless loop in print_fn_code()

If the size of the opcode to be printed is larger than "len" we'll
see an overflow of an unsigned long value, which means that the
while loop within print_fn_code() will loop quite a long time until
there is the next chance for an exit.
So add an early exit check.

Reported-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
s390: disable pfmf for clear page instruction

Wit the introduction of large pages Linux also used pfmf for page
clearing. The current implementation is not ideal, though:
- currently we set usage intent=0, but cleared pages are often used
directly after the clearing
- z/VM does not yet provide EDAT
- KVM does have to intercept PFMF even for resident pages

Lets just the mvcl loop in all cases until we have a well defined
pattern were pfmf is besser.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
s390: fix gmap_ipte_notifier vs. software dirty pages

On heavy paging load some guest cpus started to loop in gmap_ipte_notify.
This was visible as stalled cpus inside the guest. The gmap_ipte_notifier
tries to map a user page and then made sure that the pte is valid and
writable. Turns out that with the software change bit tracking the pte
can become read-only (and only software writable) if the page is clean.
Since we loop in this code, the page would stay clean and, therefore,
be never writable again.
Let us just use fixup_user_fault, that guarantees to call handle_mm_fault.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
s390/ftrace: fix mcount adjustment

Tony Jones reported that the ftrace self tests on s390 do not work:

<6>Testing dynamic ftrace ops #1: (0 0 0 0 0) FAILED!
<6>Testing tracer irqsoff:
<3>failed to start irqsoff tracer
<4>.. no entries found ..FAILED!
<6>Testing tracer wakeup:
<3>failed to start wakeup tracer
<4>.. no entries found ..FAILED!
<6>Testing tracer function_graph:
<4>Failed to init function_graph tracer, init returned -19
<4>FAILED!

This happens because we forgot to adjust the instruction pointer that gets
passed to the ftrace trace function by MCOUNT_INSN_SIZE.

In addition change MCOUNT_INSN_SIZE to the correct value on 31 bit.
It only worked so far because the to be patched instruction was identical.

Reported-by: Tony Jones <tonyj@suse.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
xen/privcmd: fix condition in privcmd_close()

The parenthesis are in the wrong place so the original code is
equivalent to:

	if (!xen_feature(XENFEAT_writable_descriptor_tables)) { ...

Which obviously was not intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Merge tag 'v3.10-rc1' into stable/for-linus-3.10

Linux 3.10-rc1

* tag 'v3.10-rc1': (12273 commits)
  Linux 3.10-rc1
  [SCSI] qla2xxx: Update firmware link in Kconfig file.
  [SCSI] iscsi class, qla4xxx: fix sess/conn refcounting when find fns are used
  [SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type
  [SCSI] pm80xx: thermal, sas controller config and error handling update
  [SCSI] pm80xx: NCQ error handling changes
  [SCSI] pm80xx: WWN Modification for PM8081/88/89 controllers
  [SCSI] pm80xx: Changed module name and debug messages update
  [SCSI] pm80xx: Firmware flash memory free fix, with addition of new memory region for it
  [SCSI] pm80xx: SPC new firmware changes for device id 0x8081 alone
  [SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files
  [SCSI] pm80xx: MSI-X implementation for using 64 interrupts
  [SCSI] pm80xx: Updated common functions common for SPC and SPCv/ve
  [SCSI] pm80xx: Multiple inbound/outbound queue configuration
  [SCSI] pm80xx: Added SPCv/ve specific ids, variables and modify for SPC
  [SCSI] lpfc: fix up Kconfig dependencies
  [SCSI] Handle MLQUEUE busy response in scsi_send_eh_cmnd
  dm cache: set config value
  dm cache: move config fns
  dm thin: generate event when metadata threshold passed
  ...
xen/tmem: Cleanup. Remove the parts that say temporary.

Frontswap is upstream, no need to having this #ifdef.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: Move all of the boot and module parameters to the top of the file.

Just code movement to see the different boot or module parameters.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: Split out the different module/boot options.

There are three options - depending on what combination of
CONFIG_FRONTSWAP, CONFIG_CLEANCACHE and CONFIG_XEN_SELFBALLOONING
is used. Lets split them out nicely out in three groups to
make it easier to clean up.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: Fix compile warning.

We keep on getting:
drivers/xen/tmem.c:65:13: warning: ‘disable_frontswap_selfshrinking’ defined but not used [-Wunused-variable]

if CONFIG_FRONTSWAP=y and # CONFIG_CLEANCACHE is not set

Found by 0 day test project

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: s/disable_// and change the logic.

The variety of disable_[cleancache|frontswap|selfshrinking] are
making this a bit complex. Just remove the "disable_" part and
change the logic around for the "nofrontswap" and "nocleancache"
parameters.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: Remove the boot options and fold them in the tmem.X parameters.

If tmem is built-in or a module, the user has the option on
the command line to influence it by doing: tmem.<some option>
instead of having a variety of "nocleancache", and
"nofrontswap". The others: "noselfballooning" and "selfballooning";
and "noselfshrink" are in a different driver xen-selfballoon.c
and the patches:

 xen/tmem: Remove the usage of 'noselfshrink' and use 'tmem.selfshrink' bool instead.
 xen/tmem: Remove the usage of 'noselfballoon','selfballoon' and use 'tmem.selfballon' bool instead.

remove them.

Also add documentation.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: Remove the usage of 'noselfshrink' and use 'tmem.selfshrink' bool instead.

As the 'tmem' driver is the one that actually sets whether
it will use it or not so might as well make tmem responsible
for this knob.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: Remove the usage of '[no|]selfballoon' and use 'tmem.selfballooning' bool instead.

As the 'tmem' driver is the one that actually sets whether
it will use it (or not) so might as well make tmem responsible
for this knob.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/tmem: Don't use self[ballooning|shrinking] if frontswap is off.

There is no point. We would just squeeze the guest to put more and
more pages in the swap disk without any purpose.

The only time it makes sense to use the selfballooning and shrinking
is when frontswap is being utilized.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
s390/cio: add channel ID sysfs attribute

Add new attributes "chid" and "chid_external" to the channel-path
sysfs directory. These attributes contain information related to
the channel-ID of the channel-path.

Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
i2c: designware: fix RX FIFO overrun

i2c_dw_xfer_msg() pushes a number of bytes to transmit/receive
to/from the bus into the TX FIFO.
For master-rx transactions, the maximum amount of data that can be
received is calculated depending solely on TX and RX FIFO load.

This is racy - TX FIFO may contain master-rx data yet to be
processed, which will eventually land into the RX FIFO. This
data is not taken into account and the function may request more
data than the controller is actually capable of storing.

This patch ensures the driver takes into account the outstanding
master-rx data in TX FIFO to prevent RX FIFO overrun.

Signed-off-by: Josef Ahmad <josef.ahmad@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
i2c: designware: always clear interrupts before enabling them

If the I2C bus is put to a low power state by an ACPI method it might pull
the SDA line low (as its power is removed). Once the bus is put to full
power state again, the SDA line is pulled back to high. This transition
looks like a STOP condition from the controller point-of-view which sets
STOP detected bit in its status register causing the driver to fail
subsequent transfers.

Fix this by always clearing all interrupts before we start a transfer.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
s390/smp: fix cpu re-scan vs. cpu state

The cpu-info array starts with a list of cpus in configured state,
followed by the cpus in standby state. The comparison to decide which
state a cpu has is incorrect, this causes configured cpus appear as
standby cpus. The correct comparison is the index of the new cpu in
the cpu-info array vs. the number of configured cpus.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>