aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-12-15rtlwifi: rtl8192cu: Fix sparse non static symbol warningWei Yongjun1-1/+1
Fixes the following sparse warning: drivers/net/wireless/rtlwifi/rtl8192cu/hw.c:1595:6: warning: symbol 'usb_cmd_send_packet' was not declared. Should it be static? Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Larry Finger <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2014-12-15rtlwifi: rtl8821ae: fix misspelling of current function in stringJulia Lawall1-6/+5
Replace a misspelled function name by %s and then __func__. 8821 was written as 8812. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2014-12-15hostap_cs: fix misspelling of current function in stringJulia Lawall1-10/+5
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2014-12-15zd1211rw: fix misspelling of current function in stringJulia Lawall1-3/+3
Replace a misspelled function name by %s and then __func__. This was done using Coccinelle, including the use of Levenshtein distance, as proposed by Rasmus Villemoes. Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2014-12-15Merge branch 'for-upstream' of ↵John W. Linville8-54/+126
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
2014-12-15ASoC: Intel: fix return value check in sst_acpi_probe()Wei Yongjun1-4/+4
In case of error, the function platform_device_register_data() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2014-12-15platform/x86/acerhdf: Still depends on THERMALRandy Dunlap1-1/+1
acerhdf uses thermal interfaces so it should depend on THERMAL. It also should not select a thermal driver without checking that THERMAL is enabled. This fixes the following build errors when THERMAL=m and ACERHDF=y. drivers/built-in.o: In function `acerhdf_set_mode': acerhdf.c:(.text+0x3e02e1): undefined reference to `thermal_zone_device_update' drivers/built-in.o: In function `acerhdf_unbind': acerhdf.c:(.text+0x3e052d): undefined reference to `thermal_zone_unbind_cooling_device' drivers/built-in.o: In function `acerhdf_bind': acerhdf.c:(.text+0x3e0593): undefined reference to `thermal_zone_bind_cooling_device' drivers/built-in.o: In function `acerhdf_init': acerhdf.c:(.init.text+0x1c2f5): undefined reference to `thermal_cooling_device_register' acerhdf.c:(.init.text+0x1c360): undefined reference to `thermal_zone_device_register' drivers/built-in.o: In function `acerhdf_unregister_thermal': acerhdf.c:(.text.unlikely+0x3c67): undefined reference to `thermal_cooling_device_unregister' acerhdf.c:(.text.unlikely+0x3c91): undefined reference to `thermal_zone_device_unregister' Signed-off-by: Randy Dunlap <[email protected]> Acked-by: Peter Feuerer <[email protected]> Signed-off-by: Darren Hart <[email protected]>
2014-12-15Merge branch 'macb'David S. Miller1-16/+9
Cyrille Pitchen says: ==================== net/macb: fix multiqueue support patch up This series of patches is a fixup for the multiqueue support patch. The first patch fixes a bug introduced by the multiqueue support patch. The second one doesn't fix a bug but simplify the source code by removing useless calls to devm_free_irq() since we use managed device resources for IRQs. They were applied on the net-next tree and tested with a sama5d36ek board. ==================== Signed-off-by: David S. Miller <[email protected]>
2014-12-15net/macb: remove useless calls of devm_free_irq()Cyrille Pitchen1-15/+8
Inside macb_probe(), when devm_request_irq() fails on queue q, there is no need to call devm_free_irq() on queues 0..q-1 because the managed device resources are released later when calling free_netdev(). Also removing devm_free_irq() call from macb_remove() for the same reason. Signed-off-by: Cyrille Pitchen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15net/macb: fix misplaced call of free_netdev() in macb_remove()Cyrille Pitchen1-1/+1
fix a bug introduced by the multiqueue support patch: "net/macb: add TX multiqueue support for gem" the "bp" pointer to the netdev private data was dereferenced and used after the associated memory had been freed by calling free_netdev(). Signed-off-by: Cyrille Pitchen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15rds: Fix min() warning in rds_message_inc_copy_to_user()Geert Uytterhoeven1-1/+2
net/rds/message.c: In function ‘rds_message_inc_copy_to_user’: net/rds/message.c:328: warning: comparison of distinct pointer types lacks a cast Use min_t(unsigned long, ...) like is done in rds_message_copy_from_user(). Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15net: stmmac: sti: Fix uninitialized pointer dereference if !OFGeert Uytterhoeven1-5/+5
If CONFIG_OF is not set: drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c: In function ‘sti_dwmac_parse_data’: drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c:318: warning: ‘rs’ is used uninitialized in this function of_property_read_string() will return -ENOSYS in this case, and rs will be an uninitialized pointer. While the fallback clock selection is already selected correctly in this case, the string comparisons should be skipped too, else the system will crash while dereferencing the uninitialized pointer. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15net: smc91x: Fix build without gpiolibTobias Klauser1-1/+1
If GPIOLIB=n the following build errors occur: drivers/net/ethernet/smsc/smc91x.c: In function 'try_toggle_control_gpio': drivers/net/ethernet/smsc/smc91x.c:2204:2: error: implicit declaration of function 'devm_gpiod_get_index' [-Werror=implicit-function-declaration] drivers/net/ethernet/smsc/smc91x.c:2204:7: warning: assignment makes pointer from integer without a cast [enabled by default] drivers/net/ethernet/smsc/smc91x.c:2213:2: error: implicit declaration of function 'gpiod_direction_output' [-Werror=implicit-function-declaration] drivers/net/ethernet/smsc/smc91x.c:2216:3: error: implicit declaration of function 'devm_gpiod_put' [-Werror=implicit-function-declaration] drivers/net/ethernet/smsc/smc91x.c:2222:2: error: implicit declaration of function 'gpiod_set_value_cansleep' [-Werror=implicit-function-declaration] Fix this by letting the driver depend on GPIOLIB if OF is selected. Fixes: 7d2911c4381 ("net: smc91x: Fix gpios for device tree based booting") Cc: Tony Lindgren <[email protected]> Signed-off-by: Tobias Klauser <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15gre: fix the inner mac header in nbma tunnel xmit pathTimo Teräs1-4/+5
The NBMA GRE tunnels temporarily push GRE header that contain the per-packet NBMA destination on the skb via header ops early in xmit path. It is the later pulled before the real GRE header is constructed. The inner mac was thus set differently in nbma case: the GRE header has been pushed by neighbor layer, and mac header points to beginning of the temporary gre header (set by dev_queue_xmit). Now that the offloads expect mac header to point to the gre payload, fix the xmit patch to: - pull first the temporary gre header away - and reset mac header to point to gre payload This fixes tso to work again with nbma tunnels. Fixes: 14051f0452a2 ("gre: Use inner mac length when computing tunnel length") Signed-off-by: Timo Teräs <[email protected]> Cc: Tom Herbert <[email protected]> Cc: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15fib_trie.txt: fix typoDuan Jiong1-2/+2
Fix the typo, there should be "It". On the other hand, fix whitespace errors detected by checkpatch.pl Signed-off-by: Duan Jiong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15cirrus: cs89x0: fix time comparisonAsaf Vertz1-13/+14
To be future-proof and for better readability the time comparisons are modified to use time_before, time_after, and time_after_eq instead of plain, error-prone math. Signed-off-by: Asaf Vertz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15Merge branch 'devel/for-linus-3.19' into stable/for-linus-3.19David Vrabel7-965/+779
2014-12-15Merge branch 'mlx4'David S. Miller3-39/+50
Or Gerlitz says: ==================== mlx4 driver fixes for 3.19-rc1 Just fixes for two small issues introduced in the 3.19 merge window ==================== Signed-off-by: David S. Miller <[email protected]>
2014-12-15net/mlx4_core: Avoid double dumping of the PF device capabilitiesOr Gerlitz3-11/+17
To support asymmetric EQ allocations, we should query the device capabilities prior to enabling SRIOV. As a side effect of adding that, we are dumping the PF device capabilities twice. Avoid that by moving the printing into a helper function which is called once. Fixes: 7ae0e400cd93 ('net/mlx4_core: Flexible (asymmetric) allocation of EQs and MSI-X vectors for PF/VFs') Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15net/mlx4_core: Fixed memory leak and incorrect refcount in mlx4_load_oneMatan Barak1-28/+33
The current mlx4_load_one has a memory leak as it always allocates dev_cap, but frees it only on error. In addition, even if VFs exist when mlx4_load_one is called, we still need to notify probed VFs that we're loading (by incrementing pf_loading). Fixes: a0eacca948d2 ('net/mlx4_core: Refactor mlx4_load_one') Signed-off-by: Matan Barak <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-12-15Revert "blk-mq: Micro-optimize bt_get()"Jens Axboe1-1/+3
This reverts commit 52f7eb945f2ba62b324bb9ae16d945326a961dcf. The optimization is only really safe for a single queue, otherwise 'bs' and 'bt' can indeed change, and if we don't do a finish_wait() for each loop, we'll potentially change the wait structure and corrupt task wait list. Reported-by: Jan Kara <[email protected]>
2014-12-15tracing: Add tp_printk cmdline to have tracepoints go to printk()Steven Rostedt (Red Hat)6-0/+76
Add the kernel command line tp_printk option that will have tracepoints that are active sent to printk() as well as to the trace buffer. Passing "tp_printk" will activate this. To turn it off, the sysctl /proc/sys/kernel/tracepoint_printk can have '0' echoed into it. Note, this only works if the cmdline option is used. Echoing 1 into the sysctl file without the cmdline option will have no affect. Note, this is a dangerous option. Having high frequency tracepoints send their data to printk() can possibly cause a live lock. This is another reason why this is only active if the command line option is used. Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1412121539300.16494@nanos Suggested-by: Thomas Gleixner <[email protected]> Tested-by: Thomas Gleixner <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
2014-12-15tracing: Move enabling tracepoints to just after rcu_init()Steven Rostedt (Red Hat)6-8/+40
Enabling tracepoints at boot up can be very useful. The tracepoint can be initialized right after RCU has been. There's no need to wait for the early_initcall() to be called. That's too late for some things that can use tracepoints for debugging. Move the logic to enable tracepoints out of the initcalls and into init/main.c to right after rcu_init(). This also allows trace_printk() to be used early too. Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1412121539300.16494@nanos Link: http://lkml.kernel.org/r/[email protected] Reviewed-by: Paul E. McKenney <[email protected]> Suggested-by: Thomas Gleixner <[email protected]> Tested-by: Thomas Gleixner <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
2014-12-15x86, mpx: Give MPX a real config option promptDave Hansen2-5/+31
Give MPX a real config option. The CPUs that support it (referenced here): https://software.intel.com/en-us/forums/topic/402393 are not available publicly yet. Right now only the software emulator provides MPX for the general public. [ tglx: Make it default off. There is no point in having it on right now as no hardware and no proper tooling support are available ] Signed-off-by: Dave Hansen <[email protected]> Cc: Dave Hansen <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-12-15x86, mpx: Update documentationDave Hansen1-3/+9
I was writing some MPX test programs and realized that the current design makes it tricky. I did something like: bndcfgu |= bnd_dir | BNDCFGU_ENABLE; xrstor(); printf("xrstor done"); // #BR bounds exception here prctl(MPX_ENABLE_MANAGEMENT); and then compiled the app with "-fcheck-pointer-bounds -mmpx" to enable MPX instrumentation. The problem is that there is MPX instrumentation inserted in to the area of the printf(). The kernel gets a bounds exception and since management isn't yet enabled, it SIGSEGV's. Add a bit to the documentation to explain a way around this and where apps need to be careful. Signed-off-by: Dave Hansen <[email protected]> Cc: Dave Hansen <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-12-15isofs: Fix infinite looping over CE entriesJan Kara1-0/+6
Rock Ridge extensions define so called Continuation Entries (CE) which define where is further space with Rock Ridge data. Corrupted isofs image can contain arbitrarily long chain of these, including a one containing loop and thus causing kernel to end in an infinite loop when traversing these entries. Limit the traversal to 32 entries which should be more than enough space to store all the Rock Ridge data. Reported-by: P J P <[email protected]> CC: [email protected] Signed-off-by: Jan Kara <[email protected]>
2014-12-15ACPI / video: update the skip case for acpi_video_device_in_dod()Aaron Lu1-2/+8
If the firmware has declared more than 8 video output devices, and the one that control the internal panel's backlight is listed after the first 8 output devices, the _DOD will not include it due to the current i915 operation region implementation. As a result, we will not create a backlight device for it while we should. Solve this problem by special case the firmware that has 8+ output devices in that if we see such a firmware, we do not test if the device is in _DOD list. The creation of the backlight device will also enable the firmware to emit events on backlight hotkey press when the acpi_osi= cmdline option is specified on those affected ASUS laptops. Link: https://bugzilla.kernel.org/show_bug.cgi?id=70241 Reported-and-tested-by: Oleksij Rempel <[email protected]> Reported-and-tested-by: Dmitry Tunin <[email protected]> Reported-and-tested-by: Jimbo <[email protected]> Cc: 3.18+ <[email protected]> # 3.18+ Signed-off-by: Aaron Lu <[email protected]> Acked-by: Jani Nikula <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2014-12-15power / PM: Eliminate CONFIG_PM_RUNTIMERafael J. Wysocki1-4/+0
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME within #ifdef blocks depending on CONFIG_PM may be dropped now. Do that in drivers/power/pm2301_charger.c. Signed-off-by: Rafael J. Wysocki <[email protected]>
2014-12-15NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMRafael J. Wysocki1-1/+1
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM in drivers/nfc/trf7970a.c. Signed-off-by: Rafael J. Wysocki <[email protected]>
2014-12-15SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PMRafael J. Wysocki5-29/+12
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under drivers/scsi/ and in include/scsi/scsi_device.h. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Aaron Lu <[email protected]> Acked-by: Christoph Hellwig <[email protected]>
2014-12-15ACPI / EC: Fix unexpected ec_remove_handlers() invocationsLv Zheng1-0/+2
The ec_remove_handlers() is invoked without checking EC_FLAGS_HANDLERS_INSTALLED, this patch enhances this check to avoid issues that acpi_disable_gpe() is invoked unexpectedly to reduce the GPE runtime count. This may happen when the EC handler installation failed on some platforms. Reported-by: Venkat Raghavulu <[email protected]> Signed-off-by: Lv Zheng <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2014-12-15ALSA: hda - Make add_stereo_mix_input flag tristateTakashi Iwai5-10/+16
... for distinguishing whether it's explicitly enabled via a user hint or enabled by a driver as a fallback. Now the former case corresponds to HDA_HINT_STEREO_MIX_ENABLE while the latter to HDA_HINT_STEREO_MIX_AUTO. Signed-off-by: Takashi Iwai <[email protected]>
2014-12-15ALSA: hda - Create capture source ctls when stereo mix input is addedTakashi Iwai1-0/+2
When the stereo mix input is explicitly enabled via a user hint, the driver should create always a capture source enum ctl and disable the auto-mic switch. Otherwise the behavior gets confused. For doing it, this patch just sets spec->suppress_auto_mic flag appropriately. Signed-off-by: Takashi Iwai <[email protected]>
2014-12-15ALSA: hda - Fix typos in snd_hda_get_int_hint() kerneldoc commentsTakashi Iwai1-1/+1
Signed-off-by: Takashi Iwai <[email protected]>
2014-12-15storvsc: ring buffer failures may result in I/O freezeLong Li1-4/+3
When ring buffer returns an error indicating retry, storvsc may not return a proper error code to SCSI when bounce buffer is not used. This has introduced I/O freeze on RAID running atop storvsc devices. This patch fixes it by always returning a proper error code. Signed-off-by: Long Li <[email protected]> Reviewed-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> cc: [email protected]
2014-12-15ipr: set scsi_level correctly for disk arraysBrian King1-0/+1
Set the scsi_level correctly for disk arrays such that things like the rotational field get set properly by sd.c. Signed-off-by: Brian King <[email protected]> Reviewed-by: Wen Xiong<[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-12-15ipr: add support for async scanning to speed up bootBrian King2-48/+44
Switch device scanning logic in the ipr driver to use the async scan API. This speeds up boot times, particularly on large systems. Signed-off-by: Brian King <[email protected]> Reviewed-by: Wen Xiong<[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-12-15scsi_debug: fix missing "break;" in SDEBUG_UA_CAPACITY_CHANGED caseEwan D. Milne1-0/+1
This eliminates a superfluous log message when the capacity is changed: "check_readiness: unexpected unit attention code=3" Signed-off-by: Ewan D. Milne <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-12-15scsi_debug: take sdebug_host_list_lock when changing capacityEwan D. Milne1-0/+2
All other traversals of the sdebug_host_list take the lock. Signed-off-by: Ewan D. Milne <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-12-15scsi_debug: improve driver description in KconfigDouglas Gilbert1-9/+8
Try to give a more accurate driver description and some extra information in less lines. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Douglas Gilbert <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]>
2014-12-15scsi_debug: fix compare and write errorsDouglas Gilbert1-15/+16
Kernel build tools pointed out a memory leak so that has been fixed and its error paths strengthened with a goto. Testing showed compare and write was only working for lba=0; correcting the length of the LBA field fixed that. Signed-off-by: Douglas Gilbert <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-12-15qla2xxx: fix race in handling rport deletion during recovery causes panicLaurence Oberman1-2/+0
When we have an rport disconnect we race during rport deletion and re-connection resulting in a panic. When we do this, we call fc_remote_port_del() just before we do the calls to re-establish the session with the FC transport with fc_remote_port_add() and then fc_remote_port_rolechg(). If we remove the call to fc_remote_port_del() before re-establishing the connection this prevents the race. This patch has resolved this for multiple customers via test kernels. Suggested by Chad Dupuis, implemented and tested by Laurence Oberman. Signed-off-by: Laurence Oberman <[email protected]> Acked-by: Chad Dupuis <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2014-12-15KVM: PPC: Book3S HV: Check wait conditions before sleeping in ↵Suresh E. Warrier1-0/+20
kvmppc_vcore_blocked The kvmppc_vcore_blocked() code does not check for the wait condition after putting the process on the wait queue. This means that it is possible for an external interrupt to become pending, but the vcpu to remain asleep until the next decrementer interrupt. The fix is to make one last check for pending exceptions and ceded state before calling schedule(). Signed-off-by: Suresh Warrier <[email protected]> Signed-off-by: Paul Mackerras <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
2014-12-15KVM: PPC: Book3S HV: ptes are big endianCédric Le Goater1-1/+7
When being restored from qemu, the kvm_get_htab_header are in native endian, but the ptes are big endian. This patch fixes restore on a KVM LE host. Qemu also needs a fix for this : http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg00008.html Signed-off-by: Cédric Le Goater <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
2014-12-15KVM: PPC: Book3S HV: Fix inaccuracies in ICP emulation for H_IPISuresh E. Warrier3-15/+52
This fixes some inaccuracies in the state machine for the virtualized ICP when implementing the H_IPI hcall (Set_MFFR and related states): 1. The old code wipes out any pending interrupts when the new MFRR is more favored than the CPPR but less favored than a pending interrupt (by always modifying xisr and the pending_pri). This can cause us to lose a pending external interrupt. The correct code here is to only modify the pending_pri and xisr in the ICP if the MFRR is equal to or more favored than the current pending pri (since in this case, it is guaranteed that that there cannot be a pending external interrupt). The code changes are required in both kvmppc_rm_h_ipi and kvmppc_h_ipi. 2. Again, in both kvmppc_rm_h_ipi and kvmppc_h_ipi, there is a check for whether MFRR is being made less favored AND further if new MFFR is also less favored than the current CPPR, we check for any resends pending in the ICP. These checks look like they are designed to cover the case where if the MFRR is being made less favored, we opportunistically trigger a resend of any interrupts that had been previously rejected. Although, this is not a state described by PAPR, this is an action we actually need to do especially if the CPPR is already at 0xFF. Because in this case, the resend bit will stay on until another ICP state change which may be a long time coming and the interrupt stays pending until then. The current code which checks for MFRR < CPPR is broken when CPPR is 0xFF since it will not get triggered in that case. Ideally, we would want to do a resend only if prio(pending_interrupt) < mfrr && prio(pending_interrupt) < cppr where pending interrupt is the one that was rejected. But we don't have the priority of the pending interrupt state saved, so we simply trigger a resend whenever the MFRR is made less favored. 3. In kvmppc_rm_h_ipi, where we save state to pass resends to the virtual mode, we also need to save the ICP whose need_resend we reset since this does not need to be my ICP (vcpu->arch.icp) as is incorrectly assumed by the current code. A new field rm_resend_icp is added to the kvmppc_icp structure for this purpose. Signed-off-by: Suresh Warrier <[email protected]> Signed-off-by: Paul Mackerras <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
2014-12-15KVM: PPC: Book3S HV: Fix KSM memory corruptionPaul Mackerras1-27/+17
Testing with KSM active in the host showed occasional corruption of guest memory. Typically a page that should have contained zeroes would contain values that look like the contents of a user process stack (values such as 0x0000_3fff_xxxx_xxx). Code inspection in kvmppc_h_protect revealed that there was a race condition with the possibility of granting write access to a page which is read-only in the host page tables. The code attempts to keep the host mapping read-only if the host userspace PTE is read-only, but if that PTE had been temporarily made invalid for any reason, the read-only check would not trigger and the host HPTE could end up read-write. Examination of the guest HPT in the failure situation revealed that there were indeed shared pages which should have been read-only that were mapped read-write. To close this race, we don't let a page go from being read-only to being read-write, as far as the real HPTE mapping the page is concerned (the guest view can go to read-write, but the actual mapping stays read-only). When the guest tries to write to the page, we take an HDSI and let kvmppc_book3s_hv_page_fault take care of providing a writable HPTE for the page. This eliminates the occasional corruption of shared pages that was previously seen with KSM active. Signed-off-by: Paul Mackerras <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
2014-12-15KVM: PPC: Book3S HV: Fix an issue where guest is paused on receiving HMIMahesh Salgaonkar1-0/+2
When we get an HMI (hypervisor maintenance interrupt) while in a guest, we see that guest enters into paused state. The reason is, in kvmppc_handle_exit_hv it falls through default path and returns to host instead of resuming guest. This causes guest to enter into paused state. HMI is a hypervisor only interrupt and it is safe to resume the guest since the host has handled it already. This patch adds a switch case to resume the guest. Without this patch we see guest entering into paused state with following console messages: [ 3003.329351] Severe Hypervisor Maintenance interrupt [Recovered] [ 3003.329356] Error detail: Timer facility experienced an error [ 3003.329359] HMER: 0840000000000000 [ 3003.329360] TFMR: 4a12000980a84000 [ 3003.329366] vcpu c0000007c35094c0 (40): [ 3003.329368] pc = c0000000000c2ba0 msr = 8000000000009032 trap = e60 [ 3003.329370] r 0 = c00000000021ddc0 r16 = 0000000000000046 [ 3003.329372] r 1 = c00000007a02bbd0 r17 = 00003ffff27d5d98 [ 3003.329375] r 2 = c0000000010980b8 r18 = 00001fffffc9a0b0 [ 3003.329377] r 3 = c00000000142d6b8 r19 = c00000000142d6b8 [ 3003.329379] r 4 = 0000000000000002 r20 = 0000000000000000 [ 3003.329381] r 5 = c00000000524a110 r21 = 0000000000000000 [ 3003.329383] r 6 = 0000000000000001 r22 = 0000000000000000 [ 3003.329386] r 7 = 0000000000000000 r23 = c00000000524a110 [ 3003.329388] r 8 = 0000000000000000 r24 = 0000000000000001 [ 3003.329391] r 9 = 0000000000000001 r25 = c00000007c31da38 [ 3003.329393] r10 = c0000000014280b8 r26 = 0000000000000002 [ 3003.329395] r11 = 746f6f6c2f68656c r27 = c00000000524a110 [ 3003.329397] r12 = 0000000028004484 r28 = c00000007c31da38 [ 3003.329399] r13 = c00000000fe01400 r29 = 0000000000000002 [ 3003.329401] r14 = 0000000000000046 r30 = c000000003011e00 [ 3003.329403] r15 = ffffffffffffffba r31 = 0000000000000002 [ 3003.329404] ctr = c00000000041a670 lr = c000000000272520 [ 3003.329405] srr0 = c00000000007e8d8 srr1 = 9000000000001002 [ 3003.329406] sprg0 = 0000000000000000 sprg1 = c00000000fe01400 [ 3003.329407] sprg2 = c00000000fe01400 sprg3 = 0000000000000005 [ 3003.329408] cr = 48004482 xer = 2000000000000000 dsisr = 42000000 [ 3003.329409] dar = 0000010015020048 [ 3003.329410] fault dar = 0000010015020048 dsisr = 42000000 [ 3003.329411] SLB (8 entries): [ 3003.329412] ESID = c000000008000000 VSID = 40016e7779000510 [ 3003.329413] ESID = d000000008000001 VSID = 400142add1000510 [ 3003.329414] ESID = f000000008000004 VSID = 4000eb1a81000510 [ 3003.329415] ESID = 00001f000800000b VSID = 40004fda0a000d90 [ 3003.329416] ESID = 00003f000800000c VSID = 400039f536000d90 [ 3003.329417] ESID = 000000001800000d VSID = 0001251b35150d90 [ 3003.329417] ESID = 000001000800000e VSID = 4001e46090000d90 [ 3003.329418] ESID = d000080008000019 VSID = 40013d349c000400 [ 3003.329419] lpcr = c048800001847001 sdr1 = 0000001b19000006 last_inst = ffffffff [ 3003.329421] trap=0xe60 | pc=0xc0000000000c2ba0 | msr=0x8000000000009032 [ 3003.329524] Severe Hypervisor Maintenance interrupt [Recovered] [ 3003.329526] Error detail: Timer facility experienced an error [ 3003.329527] HMER: 0840000000000000 [ 3003.329527] TFMR: 4a12000980a94000 [ 3006.359786] Severe Hypervisor Maintenance interrupt [Recovered] [ 3006.359792] Error detail: Timer facility experienced an error [ 3006.359795] HMER: 0840000000000000 [ 3006.359797] TFMR: 4a12000980a84000 Id Name State ---------------------------------------------------- 2 guest2 running 3 guest3 paused 4 guest4 running Signed-off-by: Mahesh Salgaonkar <[email protected]> Signed-off-by: Paul Mackerras <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
2014-12-15KVM: PPC: Book3S HV: Fix computation of tlbie operandPaul Mackerras1-1/+1
The B (segment size) field in the RB operand for the tlbie instruction is two bits, which we get from the top two bits of the first doubleword of the HPT entry to be invalidated. These bits go in bits 8 and 9 of the RB operand (bits 54 and 55 in IBM bit numbering). The compute_tlbie_rb() function gets these bits as v >> (62 - 8), which is not correct as it will bring in the top 10 bits, not just the top two. These extra bits could corrupt the AP, AVAL and L fields in the RB value. To fix this we shift right 62 bits and then shift left 8 bits, so we only get the two bits of the B field. The first doubleword of the HPT entry is under the control of the guest kernel. In fact, Linux guests will always put zeroes in bits 54 -- 61 (IBM bits 2 -- 9), but we should not rely on guests doing this. Signed-off-by: Paul Mackerras <[email protected]> Reviewed-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
2014-12-15KVM: PPC: Book3S HV: Add missing HPTE unlockAneesh Kumar K.V1-1/+4
In kvm_test_clear_dirty(), if we find an invalid HPTE we move on to the next HPTE without unlocking the invalid one. In fact we should never find an invalid and unlocked HPTE in the rmap chain, but for robustness we should unlock it. This adds the missing unlock. Reported-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Paul Mackerras <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
2014-12-15KVM: PPC: BookE: Improve irq inject tracepointAlexander Graf1-2/+45
When injecting an IRQ, we only document which IRQ priority (which translates to IRQ type) gets injected. However, when reading traces you don't necessarily have all the numbers in your head to know which IRQ really is meant. This patch converts the IRQ number field to a symbolic name that is in sync with the respective define. That way it's a lot easier for readers to figure out what interrupt gets injected. Signed-off-by: Alexander Graf <[email protected]>