--- /dev/null
+From f2e4c5e004691dfe37d0e4b363296f28abdb9bc7 Mon Sep 17 00:00:00 2001
+From: Antti Palosaari <crope@iki.fi>
+Date: Thu, 16 Jan 2014 08:59:30 -0300
+Subject: [media] af9035: add ID [2040:f900] Hauppauge WinTV-MiniStick 2
+
+From: Antti Palosaari <crope@iki.fi>
+
+commit f2e4c5e004691dfe37d0e4b363296f28abdb9bc7 upstream.
+
+Add USB ID [2040:f900] for Hauppauge WinTV-MiniStick 2.
+Device is build upon IT9135 chipset.
+
+Tested-by: Stefan Becker <schtefan@gmx.net>
+Signed-off-by: Antti Palosaari <crope@iki.fi>
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/dvb-usb-v2/af9035.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/media/usb/dvb-usb-v2/af9035.c
++++ b/drivers/media/usb/dvb-usb-v2/af9035.c
+@@ -1517,6 +1517,8 @@ static const struct usb_device_id af9035
+ &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) },
+ { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6a05,
+ &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) },
++ { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900,
++ &af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) },
+ { }
+ };
+ MODULE_DEVICE_TABLE(usb, af9035_id_table);
--- /dev/null
+From c7579fed1f1b2567529aea64ef19871337403ab3 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 5 Feb 2014 07:28:10 +0100
+Subject: ALSA: hda - Add missing mixer widget for AD1983
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit c7579fed1f1b2567529aea64ef19871337403ab3 upstream.
+
+The mixer widget on AD1983 at NID 0x0e was missing in the commit
+[f2f8be43c5c9: ALSA: hda - Add aamix NID to AD codecs].
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70011
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_analog.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_analog.c
++++ b/sound/pci/hda/patch_analog.c
+@@ -1680,6 +1680,7 @@ static int ad1983_parse_auto_config(stru
+ return err;
+ spec = codec->spec;
+
++ spec->gen.mixer_nid = 0x0e;
+ spec->gen.beep_nid = 0x10;
+ set_beep_amp(spec, 0x10, 0, HDA_OUTPUT);
+ err = ad198x_parse_auto_config(codec);
--- /dev/null
+From c20f31ec421ea4fabea5e95a6afd46c5f41e5599 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 3 Feb 2014 11:02:10 +0100
+Subject: ALSA: hda - Fix missing VREF setup for Mac Pro 1,1
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit c20f31ec421ea4fabea5e95a6afd46c5f41e5599 upstream.
+
+Mac Pro 1,1 with ALC889A codec needs the VREF setup on NID 0x18 to
+VREF50, in order to make the speaker working. The same fixup was
+already needed for MacBook Air 1,1, so we can reuse it.
+
+Reported-by: Nicolai Beuermann <mail@nico-beuermann.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -1765,6 +1765,7 @@ enum {
+ ALC889_FIXUP_IMAC91_VREF,
+ ALC889_FIXUP_MBA11_VREF,
+ ALC889_FIXUP_MBA21_VREF,
++ ALC889_FIXUP_MP11_VREF,
+ ALC882_FIXUP_INV_DMIC,
+ ALC882_FIXUP_NO_PRIMARY_HP,
+ ALC887_FIXUP_ASUS_BASS,
+@@ -2119,6 +2120,12 @@ static const struct hda_fixup alc882_fix
+ .chained = true,
+ .chain_id = ALC889_FIXUP_MBP_VREF,
+ },
++ [ALC889_FIXUP_MP11_VREF] = {
++ .type = HDA_FIXUP_FUNC,
++ .v.func = alc889_fixup_mba11_vref,
++ .chained = true,
++ .chain_id = ALC885_FIXUP_MACPRO_GPIO,
++ },
+ [ALC882_FIXUP_INV_DMIC] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc_fixup_inv_dmic_0x12,
+@@ -2176,7 +2183,7 @@ static const struct snd_pci_quirk alc882
+ SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
+ SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
+ SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
+- SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_FIXUP_MACPRO_GPIO),
++ SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
+ SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
+ SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
+ SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
--- /dev/null
+From d3c56568f43807135f2c2a09582a69f809f0d8b7 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 3 Feb 2014 09:56:13 +0100
+Subject: ALSA: hda/realtek - Avoid invalid COEFs for ALC271X
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit d3c56568f43807135f2c2a09582a69f809f0d8b7 upstream.
+
+We've seen often problems after suspend/resume on Acer Aspire One
+AO725 with ALC271X codec as reported in kernel bugzilla, and it turned
+out that some COEFs doesn't work and triggers the codec communication
+stall.
+
+Since these magic COEF setups are specific to ALC269VB for some PLL
+configurations, the machine works even without these manual
+adjustment. So, let's simply avoid applying them for ALC271X.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52181
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -3790,6 +3790,9 @@ static void alc269_fill_coef(struct hda_
+
+ if (spec->codec_variant != ALC269_TYPE_ALC269VB)
+ return;
++ /* ALC271X doesn't seem to support these COEFs (bko#52181) */
++ if (!strcmp(codec->chip_name, "ALC271X"))
++ return;
+
+ if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
+ alc_write_coef_idx(codec, 0xf, 0x960b);
--- /dev/null
+From 4fa71c1550a857ff1dbfe9e99acc1f4cfec5f0d0 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 3 Feb 2014 09:37:59 +0100
+Subject: ALSA: usb-audio: Add missing kconfig dependecy
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 4fa71c1550a857ff1dbfe9e99acc1f4cfec5f0d0 upstream.
+
+The commit 44dcbbb1cd61 introduced the usage of bitreverse helpers but
+forgot to add the dependency. This patch adds the selection for
+CONFIG_BITREVERSE.
+
+Fixes: 44dcbbb1cd61 ('ALSA: snd-usb: add support for bit-reversed byte formats')
+Reported-by: Fengguang Wu <fengguang.wu@intel.com>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/usb/Kconfig
++++ b/sound/usb/Kconfig
+@@ -14,6 +14,7 @@ config SND_USB_AUDIO
+ select SND_HWDEP
+ select SND_RAWMIDI
+ select SND_PCM
++ select BITREVERSE
+ help
+ Say Y here to include support for USB audio and USB MIDI
+ devices.
--- /dev/null
+From 227d53b397a32a7614667b3ecaf1d89902fb6c12 Mon Sep 17 00:00:00 2001
+From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Date: Thu, 6 Feb 2014 12:04:28 -0800
+Subject: mm: __set_page_dirty uses spin_lock_irqsave instead of spin_lock_irq
+
+From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+
+commit 227d53b397a32a7614667b3ecaf1d89902fb6c12 upstream.
+
+To use spin_{un}lock_irq is dangerous if caller disabled interrupt.
+During aio buffer migration, we have a possibility to see the following
+call stack.
+
+aio_migratepage [disable interrupt]
+ migrate_page_copy
+ clear_page_dirty_for_io
+ set_page_dirty
+ __set_page_dirty_buffers
+ __set_page_dirty
+ spin_lock_irq
+
+This mean, current aio migration is a deadlockable. spin_lock_irqsave
+is a safer alternative and we should use it.
+
+Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Reported-by: David Rientjes rientjes@google.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/buffer.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/fs/buffer.c
++++ b/fs/buffer.c
+@@ -620,14 +620,16 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode);
+ static void __set_page_dirty(struct page *page,
+ struct address_space *mapping, int warn)
+ {
+- spin_lock_irq(&mapping->tree_lock);
++ unsigned long flags;
++
++ spin_lock_irqsave(&mapping->tree_lock, flags);
+ if (page->mapping) { /* Race with truncate? */
+ WARN_ON_ONCE(warn && !PageUptodate(page));
+ account_page_dirtied(page, mapping);
+ radix_tree_tag_set(&mapping->page_tree,
+ page_index(page), PAGECACHE_TAG_DIRTY);
+ }
+- spin_unlock_irq(&mapping->tree_lock);
++ spin_unlock_irqrestore(&mapping->tree_lock, flags);
+ __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
+ }
+
--- /dev/null
+From a85d9df1ea1d23682a0ed1e100e6965006595d06 Mon Sep 17 00:00:00 2001
+From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Date: Thu, 6 Feb 2014 12:04:24 -0800
+Subject: mm: __set_page_dirty_nobuffers() uses spin_lock_irqsave() instead of spin_lock_irq()
+
+From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+
+commit a85d9df1ea1d23682a0ed1e100e6965006595d06 upstream.
+
+During aio stress test, we observed the following lockdep warning. This
+mean AIO+numa_balancing is currently deadlockable.
+
+The problem is, aio_migratepage disable interrupt, but
+__set_page_dirty_nobuffers unintentionally enable it again.
+
+Generally, all helper function should use spin_lock_irqsave() instead of
+spin_lock_irq() because they don't know caller at all.
+
+ other info that might help us debug this:
+ Possible unsafe locking scenario:
+
+ CPU0
+ ----
+ lock(&(&ctx->completion_lock)->rlock);
+ <Interrupt>
+ lock(&(&ctx->completion_lock)->rlock);
+
+ *** DEADLOCK ***
+
+ dump_stack+0x19/0x1b
+ print_usage_bug+0x1f7/0x208
+ mark_lock+0x21d/0x2a0
+ mark_held_locks+0xb9/0x140
+ trace_hardirqs_on_caller+0x105/0x1d0
+ trace_hardirqs_on+0xd/0x10
+ _raw_spin_unlock_irq+0x2c/0x50
+ __set_page_dirty_nobuffers+0x8c/0xf0
+ migrate_page_copy+0x434/0x540
+ aio_migratepage+0xb1/0x140
+ move_to_new_page+0x7d/0x230
+ migrate_pages+0x5e5/0x700
+ migrate_misplaced_page+0xbc/0xf0
+ do_numa_page+0x102/0x190
+ handle_pte_fault+0x241/0x970
+ handle_mm_fault+0x265/0x370
+ __do_page_fault+0x172/0x5a0
+ do_page_fault+0x1a/0x70
+ page_fault+0x28/0x30
+
+Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
+Cc: Larry Woodman <lwoodman@redhat.com>
+Cc: Rik van Riel <riel@redhat.com>
+Cc: Johannes Weiner <jweiner@redhat.com>
+Acked-by: David Rientjes <rientjes@google.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/page-writeback.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/mm/page-writeback.c
++++ b/mm/page-writeback.c
+@@ -2026,11 +2026,12 @@ int __set_page_dirty_nobuffers(struct pa
+ if (!TestSetPageDirty(page)) {
+ struct address_space *mapping = page_mapping(page);
+ struct address_space *mapping2;
++ unsigned long flags;
+
+ if (!mapping)
+ return 1;
+
+- spin_lock_irq(&mapping->tree_lock);
++ spin_lock_irqsave(&mapping->tree_lock, flags);
+ mapping2 = page_mapping(page);
+ if (mapping2) { /* Race with truncate? */
+ BUG_ON(mapping2 != mapping);
+@@ -2039,7 +2040,7 @@ int __set_page_dirty_nobuffers(struct pa
+ radix_tree_tag_set(&mapping->page_tree,
+ page_index(page), PAGECACHE_TAG_DIRTY);
+ }
+- spin_unlock_irq(&mapping->tree_lock);
++ spin_unlock_irqrestore(&mapping->tree_lock, flags);
+ if (mapping->host) {
+ /* !PageAnon && !swapper_space */
+ __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
--- /dev/null
+From 13e1b87c986100169b0695aeb26970943665eda9 Mon Sep 17 00:00:00 2001
+From: Dave Jones <davej@fedoraproject.org>
+Date: Thu, 30 Jan 2014 00:17:09 -0300
+Subject: [media] mxl111sf: Fix compile when CONFIG_DVB_USB_MXL111SF is unset
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Dave Jones <davej@fedoraproject.org>
+
+commit 13e1b87c986100169b0695aeb26970943665eda9 upstream.
+
+Fix the following build error:
+
+drivers/media/usb/dvb-usb-v2/
+mxl111sf-tuner.h:72:9: error: expected ‘;’, ‘,’ or ‘)’ before ‘struct’
+ struct mxl111sf_tuner_config *cfg)
+
+Signed-off-by: Dave Jones <davej@fedoraproject.org>
+Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
++++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
+@@ -68,7 +68,7 @@ struct dvb_frontend *mxl111sf_tuner_atta
+ #else
+ static inline
+ struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe,
+- struct mxl111sf_state *mxl_state
++ struct mxl111sf_state *mxl_state,
+ struct mxl111sf_tuner_config *cfg)
+ {
+ printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
--- /dev/null
+From 7b320cb1ed2dbd2c5f2a778197baf76fd6bf545a Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+Date: Tue, 4 Feb 2014 09:07:09 +0100
+Subject: pinctrl: protect pinctrl_list add
+
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit 7b320cb1ed2dbd2c5f2a778197baf76fd6bf545a upstream.
+
+We have few fedora bug reports about list corruption on pinctrl,
+for example:
+https://bugzilla.redhat.com/show_bug.cgi?id=1051918
+
+Most likely corruption happen due lack of protection of pinctrl_list
+when adding new nodes to it. Patch corrects that.
+
+Fixes: 42fed7ba44e ("pinctrl: move subsystem mutex to pinctrl_dev struct")
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+Acked-by: Stephen Warren <swarren@nvidia.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/core.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/pinctrl/core.c
++++ b/drivers/pinctrl/core.c
+@@ -807,7 +807,9 @@ static struct pinctrl *create_pinctrl(st
+ kref_init(&p->users);
+
+ /* Add the pinctrl handle to the global list */
++ mutex_lock(&pinctrl_list_mutex);
+ list_add_tail(&p->node, &pinctrl_list);
++ mutex_unlock(&pinctrl_list_mutex);
+
+ return p;
+ }
--- /dev/null
+From f17248ed868767567298e1cdf06faf8159a81f7c Mon Sep 17 00:00:00 2001
+From: Tony Prisk <linux@prisktech.co.nz>
+Date: Thu, 23 Jan 2014 21:57:33 +1300
+Subject: pinctrl: vt8500: Change devicetree data parsing
+
+From: Tony Prisk <linux@prisktech.co.nz>
+
+commit f17248ed868767567298e1cdf06faf8159a81f7c upstream.
+
+Due to an assumption in the VT8500 pinctrl driver, the value passed
+from devicetree for 'wm,pull' was not explicitly translated before
+being passed to pinconf.
+
+Since v3.10, changes to 'enum pin_config_param', PIN_CONFIG_BIAS_PULL_(UP/DOWN)
+no longer map 1-to-1 with the expected values in devicetree.
+
+This patch adds a small translation between the devicetree values (0..2)
+and the enum pin_config_param equivalent values.
+
+Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pinctrl/vt8500/pinctrl-wmt.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
++++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
+@@ -276,7 +276,20 @@ static int wmt_pctl_dt_node_to_map_pull(
+ if (!configs)
+ return -ENOMEM;
+
+- configs[0] = pull;
++ switch (pull) {
++ case 0:
++ configs[0] = PIN_CONFIG_BIAS_DISABLE;
++ break;
++ case 1:
++ configs[0] = PIN_CONFIG_BIAS_PULL_DOWN;
++ break;
++ case 2:
++ configs[0] = PIN_CONFIG_BIAS_PULL_UP;
++ break;
++ default:
++ configs[0] = PIN_CONFIG_BIAS_DISABLE;
++ dev_err(data->dev, "invalid pull state %d - disabling\n", pull);
++ }
+
+ map->type = PIN_MAP_TYPE_CONFIGS_PIN;
+ map->data.configs.group_or_pin = data->groups[group];
arm64-invalidate-the-tlb-when-replacing-pmd-entries-during-boot.patch
arm64-vdso-fix-coarse-clock-handling.patch
arm64-add-dsb-after-icache-flush-in-__flush_icache_all.patch
+alsa-usb-audio-add-missing-kconfig-dependecy.patch
+alsa-hda-realtek-avoid-invalid-coefs-for-alc271x.patch
+alsa-hda-fix-missing-vref-setup-for-mac-pro-1-1.patch
+alsa-hda-add-missing-mixer-widget-for-ad1983.patch
+mm-__set_page_dirty_nobuffers-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch
+mm-__set_page_dirty-uses-spin_lock_irqsave-instead-of-spin_lock_irq.patch
+x86-mm-change-tlb_flushall_shift-for-ivybridge.patch
+af9035-add-id-hauppauge-wintv-ministick-2.patch
+mxl111sf-fix-compile-when-config_dvb_usb_mxl111sf-is-unset.patch
+x86-hweight-fix-bug-when-booting-with-config_gcov_profile_all-y.patch
+pinctrl-vt8500-change-devicetree-data-parsing.patch
+pinctrl-protect-pinctrl_list-add.patch
--- /dev/null
+From 6583327c4dd55acbbf2a6f25e775b28b3abf9a42 Mon Sep 17 00:00:00 2001
+From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
+Date: Thu, 6 Feb 2014 15:58:20 +0100
+Subject: x86, hweight: Fix BUG when booting with CONFIG_GCOV_PROFILE_ALL=y
+
+From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
+
+commit 6583327c4dd55acbbf2a6f25e775b28b3abf9a42 upstream.
+
+Commit d61931d89b, "x86: Add optimized popcnt variants" introduced
+compile flag -fcall-saved-rdi for lib/hweight.c. When combined with
+options -fprofile-arcs and -O2, this flag causes gcc to generate
+broken constructor code. As a result, a 64 bit x86 kernel compiled
+with CONFIG_GCOV_PROFILE_ALL=y prints message "gcov: could not create
+file" and runs into sproadic BUGs during boot.
+
+The gcc people indicate that these kinds of problems are endemic when
+using ad hoc calling conventions. It is therefore best to treat any
+file compiled with ad hoc calling conventions as an isolated
+environment and avoid things like profiling or coverage analysis,
+since those subsystems assume a "normal" calling conventions.
+
+This patch avoids the bug by excluding lib/hweight.o from coverage
+profiling.
+
+Reported-by: Meelis Roos <mroos@linux.ee>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
+Link: http://lkml.kernel.org/r/52F3A30C.7050205@linux.vnet.ibm.com
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ lib/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -45,6 +45,7 @@ lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) +=
+ lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
+ lib-$(CONFIG_PERCPU_RWSEM) += percpu-rwsem.o
+
++GCOV_PROFILE_hweight.o := n
+ CFLAGS_hweight.o = $(subst $(quote),,$(CONFIG_ARCH_HWEIGHT_CFLAGS))
+ obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
+
--- /dev/null
+From f98b7a772ab51b52ca4d2a14362fc0e0c8a2e0f3 Mon Sep 17 00:00:00 2001
+From: Mel Gorman <mgorman@suse.de>
+Date: Tue, 21 Jan 2014 14:33:21 -0800
+Subject: x86: mm: change tlb_flushall_shift for IvyBridge
+
+From: Mel Gorman <mgorman@suse.de>
+
+commit f98b7a772ab51b52ca4d2a14362fc0e0c8a2e0f3 upstream.
+
+There was a large performance regression that was bisected to
+commit 611ae8e3 ("x86/tlb: enable tlb flush range support for
+x86"). This patch simply changes the default balance point
+between a local and global flush for IvyBridge.
+
+In the interest of allowing the tests to be reproduced, this
+patch was tested using mmtests 0.15 with the following
+configurations
+
+ configs/config-global-dhp__tlbflush-performance
+ configs/config-global-dhp__scheduler-performance
+ configs/config-global-dhp__network-performance
+
+Results are from two machines
+
+Ivybridge 4 threads: Intel(R) Core(TM) i3-3240 CPU @ 3.40GHz
+Ivybridge 8 threads: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
+
+Page fault microbenchmark showed nothing interesting.
+
+Ebizzy was configured to run multiple iterations and threads.
+Thread counts ranged from 1 to NR_CPUS*2. For each thread count,
+it ran 100 iterations and each iteration lasted 10 seconds.
+
+Ivybridge 4 threads
+ 3.13.0-rc7 3.13.0-rc7
+ vanilla altshift-v3
+Mean 1 6395.44 ( 0.00%) 6789.09 ( 6.16%)
+Mean 2 7012.85 ( 0.00%) 8052.16 ( 14.82%)
+Mean 3 6403.04 ( 0.00%) 6973.74 ( 8.91%)
+Mean 4 6135.32 ( 0.00%) 6582.33 ( 7.29%)
+Mean 5 6095.69 ( 0.00%) 6526.68 ( 7.07%)
+Mean 6 6114.33 ( 0.00%) 6416.64 ( 4.94%)
+Mean 7 6085.10 ( 0.00%) 6448.51 ( 5.97%)
+Mean 8 6120.62 ( 0.00%) 6462.97 ( 5.59%)
+
+Ivybridge 8 threads
+ 3.13.0-rc7 3.13.0-rc7
+ vanilla altshift-v3
+Mean 1 7336.65 ( 0.00%) 7787.02 ( 6.14%)
+Mean 2 8218.41 ( 0.00%) 9484.13 ( 15.40%)
+Mean 3 7973.62 ( 0.00%) 8922.01 ( 11.89%)
+Mean 4 7798.33 ( 0.00%) 8567.03 ( 9.86%)
+Mean 5 7158.72 ( 0.00%) 8214.23 ( 14.74%)
+Mean 6 6852.27 ( 0.00%) 7952.45 ( 16.06%)
+Mean 7 6774.65 ( 0.00%) 7536.35 ( 11.24%)
+Mean 8 6510.50 ( 0.00%) 6894.05 ( 5.89%)
+Mean 12 6182.90 ( 0.00%) 6661.29 ( 7.74%)
+Mean 16 6100.09 ( 0.00%) 6608.69 ( 8.34%)
+
+Ebizzy hits the worst case scenario for TLB range flushing every
+time and it shows for these Ivybridge CPUs at least that the
+default choice is a poor on. The patch addresses the problem.
+
+Next was a tlbflush microbenchmark written by Alex Shi at
+http://marc.info/?l=linux-kernel&m=133727348217113 . It
+measures access costs while the TLB is being flushed. The
+expectation is that if there are always full TLB flushes that
+the benchmark would suffer and it benefits from range flushing
+
+There are 320 iterations of the test per thread count. The
+number of entries is randomly selected with a min of 1 and max
+of 512. To ensure a reasonably even spread of entries, the full
+range is broken up into 8 sections and a random number selected
+within that section.
+
+iteration 1, random number between 0-64
+iteration 2, random number between 64-128 etc
+
+This is still a very weak methodology. When you do not know
+what are typical ranges, random is a reasonable choice but it
+can be easily argued that the opimisation was for smaller ranges
+and an even spread is not representative of any workload that
+matters. To improve this, we'd need to know the probability
+distribution of TLB flush range sizes for a set of workloads
+that are considered "common", build a synthetic trace and feed
+that into this benchmark. Even that is not perfect because it
+would not account for the time between flushes but there are
+limits of what can be reasonably done and still be doing
+something useful. If a representative synthetic trace is
+provided then this benchmark could be revisited and the shift values retuned.
+
+Ivybridge 4 threads
+ 3.13.0-rc7 3.13.0-rc7
+ vanilla altshift-v3
+Mean 1 10.50 ( 0.00%) 10.50 ( 0.03%)
+Mean 2 17.59 ( 0.00%) 17.18 ( 2.34%)
+Mean 3 22.98 ( 0.00%) 21.74 ( 5.41%)
+Mean 5 47.13 ( 0.00%) 46.23 ( 1.92%)
+Mean 8 43.30 ( 0.00%) 42.56 ( 1.72%)
+
+Ivybridge 8 threads
+ 3.13.0-rc7 3.13.0-rc7
+ vanilla altshift-v3
+Mean 1 9.45 ( 0.00%) 9.36 ( 0.93%)
+Mean 2 9.37 ( 0.00%) 9.70 ( -3.54%)
+Mean 3 9.36 ( 0.00%) 9.29 ( 0.70%)
+Mean 5 14.49 ( 0.00%) 15.04 ( -3.75%)
+Mean 8 41.08 ( 0.00%) 38.73 ( 5.71%)
+Mean 13 32.04 ( 0.00%) 31.24 ( 2.49%)
+Mean 16 40.05 ( 0.00%) 39.04 ( 2.51%)
+
+For both CPUs, average access time is reduced which is good as
+this is the benchmark that was used to tune the shift values in
+the first place albeit it is now known *how* the benchmark was
+used.
+
+The scheduler benchmarks were somewhat inconclusive. They
+showed gains and losses and makes me reconsider how stable those
+benchmarks really are or if something else might be interfering
+with the test results recently.
+
+Network benchmarks were inconclusive. Almost all results were
+flat except for netperf-udp tests on the 4 thread machine.
+These results were unstable and showed large variations between
+reboots. It is unknown if this is a recent problems but I've
+noticed before that netperf-udp results tend to vary.
+
+Based on these results, changing the default for Ivybridge seems
+like a logical choice.
+
+Signed-off-by: Mel Gorman <mgorman@suse.de>
+Tested-by: Davidlohr Bueso <davidlohr@hp.com>
+Reviewed-by: Alex Shi <alex.shi@linaro.org>
+Reviewed-by: Rik van Riel <riel@redhat.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Link: http://lkml.kernel.org/n/tip-cqnadffh1tiqrshthRj3Esge@git.kernel.org
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/cpu/intel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/cpu/intel.c
++++ b/arch/x86/kernel/cpu/intel.c
+@@ -628,7 +628,7 @@ static void __cpuinit intel_tlb_flushall
+ tlb_flushall_shift = 5;
+ break;
+ case 0x63a: /* Ivybridge */
+- tlb_flushall_shift = 1;
++ tlb_flushall_shift = 2;
+ break;
+ default:
+ tlb_flushall_shift = 6;