From 3f3fa452a51aa5699c409fce36103df493ad8754 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 16 Feb 2011 13:38:58 +0000 Subject: [PATCH] Update to 2.6.38-rc5 Adjust/remove patches as appropriate. svn path=/dists/trunk/linux-2.6/; revision=16898 --- debian/changelog | 12 +- ...P_SYS_ADMIN-for-filesystem-rebalance.patch | 41 --- ...-select-ACPI_VIDEO-if-its-dependenci.patch | 30 -- .../all/i2c-i801-Include-linux-slab.h.patch | 32 -- .../all/r8169-keep-firmware-in-memory.patch | 130 -------- ...ame-FREQ-macro-to-avoid-collisions-2.patch | 72 ---- .../arm/ixp4xx-add-missing-export.patch | 10 - .../sh4/sh-export-topology-core-cpumask.patch | 30 -- .../bugfix/sparc/introduce-u64-aligned.patch | 136 -------- ...igned-as-type-and-variable-attribute.patch | 283 ---------------- ...pha-Do-not-use-Werror-for-arch-alpha.patch | 68 ---- debian/patches/debian/dfsg/files-1 | 5 +- .../debian/dfsg/firmware-cleanup.patch | 10 +- .../dfsg/r8169-rtl8168d-1-2-disable.patch | 68 ---- debian/patches/debian/kernelvariables.patch | 2 +- debian/patches/debian/sysrq-mask.patch | 18 +- ...fig-Verbose-version-of-listnewconfig.patch | 12 +- ...8169-remove-the-firmware-of-RTL8111D.patch | 311 ------------------ ...r8712u-Fix-external-firmware-loading.patch | 33 -- ...itch-driver-to-use-external-firmware.patch | 5 +- .../features/arm/asoc-openrd-ultimate.patch | 55 ---- debian/patches/series/1~experimental.2 | 7 - debian/patches/series/base | 11 +- debian/patches/series/orig-0 | 1 - 24 files changed, 32 insertions(+), 1350 deletions(-) delete mode 100644 debian/patches/bugfix/all/btrfs-Require-CAP_SYS_ADMIN-for-filesystem-rebalance.patch delete mode 100644 debian/patches/bugfix/all/drm-nouveau-Only-select-ACPI_VIDEO-if-its-dependenci.patch delete mode 100644 debian/patches/bugfix/all/i2c-i801-Include-linux-slab.h.patch delete mode 100644 debian/patches/bugfix/all/r8169-keep-firmware-in-memory.patch delete mode 100644 debian/patches/bugfix/arm/arm-ixp4xx-Rename-FREQ-macro-to-avoid-collisions-2.patch delete mode 100644 debian/patches/bugfix/arm/ixp4xx-add-missing-export.patch delete mode 100644 debian/patches/bugfix/sh4/sh-export-topology-core-cpumask.patch delete mode 100644 debian/patches/bugfix/sparc/introduce-u64-aligned.patch delete mode 100644 debian/patches/bugfix/sparc/tracing-use-u64-aligned-as-type-and-variable-attribute.patch delete mode 100644 debian/patches/debian/alpha-Do-not-use-Werror-for-arch-alpha.patch delete mode 100644 debian/patches/debian/dfsg/r8169-rtl8168d-1-2-disable.patch delete mode 100644 debian/patches/features/all/r8169-remove-the-firmware-of-RTL8111D.patch delete mode 100644 debian/patches/features/all/r8712u-Fix-external-firmware-loading.patch delete mode 100644 debian/patches/features/arm/asoc-openrd-ultimate.patch delete mode 100644 debian/patches/series/1~experimental.2 diff --git a/debian/changelog b/debian/changelog index 0b6dbc203..5bb2666ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,15 +1,17 @@ -linux-2.6 (2.6.37-1~experimental.2) UNRELEASED; urgency=low +linux-2.6 (2.6.38~rc5-1~experimental.1) UNRELEASED; urgency=low + + * New upstream release candidate + - r8169: Keep firmware in memory (Closes: #609538) + - [sparc] Fix misaligned tracing information which the module loader + does not support (Closes: #609371) + - [sh4] Export cpu_core_map to fix build failure with CONFIG_SFC=m. [ Ben Hutchings ] * [arm] ixp4xx: Revert build fix, now applied upstream which resulted in another build failure - * r8169: Keep firmware in memory (Closes: #609538) * r8712u: Firmware filename is rtlwifi/rtl8712u.bin (Closes: #602450) - * [sparc] Fix misaligned tracing information which the module loader - does not support (Closes: #609371) [ Aurelien Jarno ] - * [sh4] Export cpu_core_map to fix build failure with CONFIG_SFC=m. * [mips/5kc-malta] Enable CONFIG_VGA_CONSOLE. [ Bastian Blank ] diff --git a/debian/patches/bugfix/all/btrfs-Require-CAP_SYS_ADMIN-for-filesystem-rebalance.patch b/debian/patches/bugfix/all/btrfs-Require-CAP_SYS_ADMIN-for-filesystem-rebalance.patch deleted file mode 100644 index 1adfdcdaa..000000000 --- a/debian/patches/bugfix/all/btrfs-Require-CAP_SYS_ADMIN-for-filesystem-rebalance.patch +++ /dev/null @@ -1,41 +0,0 @@ -Subject: [PATCH] btrfs: Require CAP_SYS_ADMIN for filesystem rebalance -From: Ben Hutchings -Date: Wed, 29 Dec 2010 14:55:03 +0000 - -Filesystem rebalancing (BTRFS_IOC_BALANCE) affects the entire -filesystem and may run uninterruptibly for a long time. This does not -seem to be something that an unprivileged user should be able to do. - -Reported-by: Aron Xu -Signed-off-by: Ben Hutchings ---- - fs/btrfs/volumes.c | 4 ++++ - 1 files changed, 4 insertions(+), 0 deletions(-) - -diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c -index cc04dc1..2313e8b 100644 ---- a/fs/btrfs/volumes.c -+++ b/fs/btrfs/volumes.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include "compat.h" - #include "ctree.h" -@@ -1905,6 +1906,9 @@ int btrfs_balance(struct btrfs_root *dev_root) - if (dev_root->fs_info->sb->s_flags & MS_RDONLY) - return -EROFS; - -+ if (!capable(CAP_SYS_ADMIN)) -+ return -EPERM; -+ - mutex_lock(&dev_root->fs_info->volume_mutex); - dev_root = dev_root->fs_info->dev_root; - --- -1.7.2.3 - - - diff --git a/debian/patches/bugfix/all/drm-nouveau-Only-select-ACPI_VIDEO-if-its-dependenci.patch b/debian/patches/bugfix/all/drm-nouveau-Only-select-ACPI_VIDEO-if-its-dependenci.patch deleted file mode 100644 index 798b5c8b9..000000000 --- a/debian/patches/bugfix/all/drm-nouveau-Only-select-ACPI_VIDEO-if-its-dependenci.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 9af906ea7a41ecd3de88edb95c4e8a659d273db2 Mon Sep 17 00:00:00 2001 -From: Ben Hutchings -Date: Sat, 11 Dec 2010 06:13:45 +0000 -Subject: [PATCH] drm/nouveau: Only select ACPI_VIDEO if its dependencies are met - -CONFIG_ACPI_VIDEO depends on more than just CONFIG_ACPI, so add those -dependencies to the Kconfig select condition and make the code -conditional on CONFIG_ACPI_VIDEO. - -Signed-off-by: Ben Hutchings ---- - drivers/gpu/drm/nouveau/Kconfig | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig -index 72730e9..21d6c29 100644 ---- a/drivers/gpu/drm/nouveau/Kconfig -+++ b/drivers/gpu/drm/nouveau/Kconfig -@@ -10,7 +10,7 @@ config DRM_NOUVEAU - select FB - select FRAMEBUFFER_CONSOLE if !EMBEDDED - select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT -- select ACPI_VIDEO if ACPI -+ select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT - help - Choose this option for open-source nVidia support. - --- -1.7.2.3 - diff --git a/debian/patches/bugfix/all/i2c-i801-Include-linux-slab.h.patch b/debian/patches/bugfix/all/i2c-i801-Include-linux-slab.h.patch deleted file mode 100644 index 69ef12271..000000000 --- a/debian/patches/bugfix/all/i2c-i801-Include-linux-slab.h.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Ben Hutchings -Date: Mon, 13 Dec 2010 11:39:18 +1100 -Subject: [PATCH] i2c-i801: Include - -commit 830e49925da933a9d9e4b0f86077066a368b47a1 upstream. - -Commit 5a0e3ad6af8660be21ca98a971cd00f331318c05 added direct inclusion -of to those source files that appeared to need it, but -somehow missed this. On most architectures is still -indirectly included, but there are exceptions such as alpha. - -Signed-off-by: Ben Hutchings -Signed-off-by: Jean Delvare ---- - drivers/i2c/busses/i2c-i801.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c -index 02835ce..7979aef 100644 ---- a/drivers/i2c/busses/i2c-i801.c -+++ b/drivers/i2c/busses/i2c-i801.c -@@ -72,6 +72,7 @@ - #include - #include - #include -+#include - - /* I801 SMBus address offsets */ - #define SMBHSTSTS(p) (0 + (p)->smba) --- -1.7.2.3 - diff --git a/debian/patches/bugfix/all/r8169-keep-firmware-in-memory.patch b/debian/patches/bugfix/all/r8169-keep-firmware-in-memory.patch deleted file mode 100644 index e0f5f95d1..000000000 --- a/debian/patches/bugfix/all/r8169-keep-firmware-in-memory.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 73a575b628e2ae8e0393399387445eaf1dac3fb7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?fran=C3=A7ois=20romieu?= -Date: Thu, 13 Jan 2011 13:07:53 +0000 -Subject: [PATCH] r8169: keep firmware in memory. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -commit f1e02ed109df5f99abf942b8ccc99960cb09dd38 upstream. - -The firmware agent is not available during resume. Loading the firmware -during open() (see eee3a96c6368f47df8df5bd4ed1843600652b337) is not -enough. - -close() is run during resume through rtl8169_reset_task(), whence the -mildly natural release of firmware in the driver removal method instead. - -It will help with http://bugs.debian.org/609538. It will not avoid -the 60 seconds delay when: -- there is no firmware -- the driver is loaded and the device is not up before a suspend/resume - -Signed-off-by: Francois Romieu -Tested-by: Jarek KamiƄski -Cc: Hayes -Cc: Ben Hutchings -Signed-off-by: David S. Miller ---- - drivers/net/r8169.c | 43 +++++++++++++++++++++++++++++++------------ - 1 files changed, 31 insertions(+), 12 deletions(-) - -diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c -index 49a6db6..a5b0271 100644 ---- a/drivers/net/r8169.c -+++ b/drivers/net/r8169.c -@@ -508,6 +508,8 @@ struct rtl8169_private { - struct mii_if_info mii; - struct rtl8169_counters counters; - u32 saved_wolopts; -+ -+ const struct firmware *fw; - }; - - MODULE_AUTHOR("Realtek and the Linux r8169 crew "); -@@ -1458,6 +1460,29 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw) - } - } - -+static void rtl_release_firmware(struct rtl8169_private *tp) -+{ -+ release_firmware(tp->fw); -+ tp->fw = NULL; -+} -+ -+static int rtl_apply_firmware(struct rtl8169_private *tp, const char *fw_name) -+{ -+ const struct firmware **fw = &tp->fw; -+ int rc = !*fw; -+ -+ if (rc) { -+ rc = request_firmware(fw, fw_name, &tp->pci_dev->dev); -+ if (rc < 0) -+ goto out; -+ } -+ -+ /* TODO: release firmware once rtl_phy_write_fw signals failures. */ -+ rtl_phy_write_fw(tp, *fw); -+out: -+ return rc; -+} -+ - static void rtl8169s_hw_phy_config(void __iomem *ioaddr) - { - static const struct phy_reg phy_reg_init[] = { -@@ -1833,7 +1858,6 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp) - { 0x0d, 0xf880 } - }; - void __iomem *ioaddr = tp->mmio_addr; -- const struct firmware *fw; - - rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0)); - -@@ -1897,11 +1921,8 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp) - - mdio_write(ioaddr, 0x1f, 0x0005); - mdio_write(ioaddr, 0x05, 0x001b); -- if (mdio_read(ioaddr, 0x06) == 0xbf00 && -- request_firmware(&fw, FIRMWARE_8168D_1, &tp->pci_dev->dev) == 0) { -- rtl_phy_write_fw(tp, fw); -- release_firmware(fw); -- } else { -+ if ((mdio_read(ioaddr, 0x06) != 0xbf00) || -+ (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) { - netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); - } - -@@ -1951,7 +1972,6 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp) - { 0x0d, 0xf880 } - }; - void __iomem *ioaddr = tp->mmio_addr; -- const struct firmware *fw; - - rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0)); - -@@ -2006,11 +2026,8 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp) - - mdio_write(ioaddr, 0x1f, 0x0005); - mdio_write(ioaddr, 0x05, 0x001b); -- if (mdio_read(ioaddr, 0x06) == 0xb300 && -- request_firmware(&fw, FIRMWARE_8168D_2, &tp->pci_dev->dev) == 0) { -- rtl_phy_write_fw(tp, fw); -- release_firmware(fw); -- } else { -+ if ((mdio_read(ioaddr, 0x06) != 0xb300) || -+ (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) { - netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); - } - -@@ -2706,6 +2723,8 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) - - flush_scheduled_work(); - -+ rtl_release_firmware(tp); -+ - unregister_netdev(dev); - - if (pci_dev_run_wake(pdev)) --- -1.7.2.3 - diff --git a/debian/patches/bugfix/arm/arm-ixp4xx-Rename-FREQ-macro-to-avoid-collisions-2.patch b/debian/patches/bugfix/arm/arm-ixp4xx-Rename-FREQ-macro-to-avoid-collisions-2.patch deleted file mode 100644 index 03bbe3a45..000000000 --- a/debian/patches/bugfix/arm/arm-ixp4xx-Rename-FREQ-macro-to-avoid-collisions-2.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 991f3c04fdbd9084935be1e16aef55f610f35b0c Mon Sep 17 00:00:00 2001 -From: Ben Hutchings -Date: Fri, 10 Dec 2010 02:45:03 +0000 -Subject: [PATCH 1/4] arm/ixp4xx: Rename FREQ macro to avoid collisions - -FREQ is a ridiculously short name for a platform-specific macro in a -generic header, and it now conflicts with an enumeration in the -gspca/ov519 driver. - -Signed-off-by: Ben Hutchings ---- - arch/arm/mach-ixp4xx/common.c | 4 ++-- - arch/arm/mach-ixp4xx/include/mach/timex.h | 5 +++-- - drivers/input/misc/ixp4xx-beeper.c | 6 +----- - 3 files changed, 6 insertions(+), 9 deletions(-) - -diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c -index 0bce097..f5c42fe 100644 ---- a/arch/arm/mach-ixp4xx/common.c -+++ b/arch/arm/mach-ixp4xx/common.c -@@ -415,7 +415,7 @@ static struct clocksource clocksource_ixp4xx = { - .flags = CLOCK_SOURCE_IS_CONTINUOUS, - }; - --unsigned long ixp4xx_timer_freq = FREQ; -+unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; - EXPORT_SYMBOL(ixp4xx_timer_freq); - static void __init ixp4xx_clocksource_init(void) - { -@@ -491,7 +491,7 @@ static struct clock_event_device clockevent_ixp4xx = { - - static void __init ixp4xx_clockevent_init(void) - { -- clockevent_ixp4xx.mult = div_sc(FREQ, NSEC_PER_SEC, -+ clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC, - clockevent_ixp4xx.shift); - clockevent_ixp4xx.max_delta_ns = - clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); -diff --git a/arch/arm/mach-ixp4xx/include/mach/timex.h b/arch/arm/mach-ixp4xx/include/mach/timex.h -index 2c3f93c..c9e930f 100644 ---- a/arch/arm/mach-ixp4xx/include/mach/timex.h -+++ b/arch/arm/mach-ixp4xx/include/mach/timex.h -@@ -10,6 +10,7 @@ - * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the - * timer register ignores the bottom 2 bits of the LATCH value. - */ --#define FREQ 66666000 --#define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) -+#define IXP4XX_TIMER_FREQ 66666000 -+#define CLOCK_TICK_RATE \ -+ (((IXP4XX_TIMER_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) - -diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c -index 9dfd6e5..1f38302 100644 ---- a/drivers/input/misc/ixp4xx-beeper.c -+++ b/drivers/input/misc/ixp4xx-beeper.c -@@ -69,11 +69,7 @@ static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned - } - - if (value > 20 && value < 32767) --#ifndef FREQ -- count = (ixp4xx_get_board_tick_rate() / (value * 4)) - 1; --#else -- count = (FREQ / (value * 4)) - 1; --#endif -+ count = (IXP4XX_TIMER_FREQ / (value * 4)) - 1; - - ixp4xx_spkr_control(pin, count); - --- -1.7.2.3 - diff --git a/debian/patches/bugfix/arm/ixp4xx-add-missing-export.patch b/debian/patches/bugfix/arm/ixp4xx-add-missing-export.patch deleted file mode 100644 index bac9c8760..000000000 --- a/debian/patches/bugfix/arm/ixp4xx-add-missing-export.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/arm/mach-ixp4xx/common-pci.c 2010-11-08 09:42:38.000000000 +0000 -+++ b/arch/arm/mach-ixp4xx/common-pci.c 2010-11-08 09:42:53.000000000 +0000 -@@ -511,6 +511,7 @@ - return -EIO; - } - -+EXPORT_SYMBOL(dma_set_coherent_mask); - EXPORT_SYMBOL(ixp4xx_pci_read); - EXPORT_SYMBOL(ixp4xx_pci_write); - diff --git a/debian/patches/bugfix/sh4/sh-export-topology-core-cpumask.patch b/debian/patches/bugfix/sh4/sh-export-topology-core-cpumask.patch deleted file mode 100644 index 676b7411b..000000000 --- a/debian/patches/bugfix/sh4/sh-export-topology-core-cpumask.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 24ee7d79c5885275a531431c3b687b3a7919eee4 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Tue, 18 Jan 2011 20:55:34 +0000 -Subject: [PATCH] sh: Fix sh build failure when CONFIG_SFC=m - -CONFIG_SFC=m uses topology_core_cpumask() which, for sh, expects -cpu_core_map to be exported. It is not. This patch exports the needed -symbol. - -Signed-off-by: Aurelien Jarno -Signed-off-by: Paul Mundt ---- - arch/sh/kernel/topology.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c -index 948fdb6..38e8628 100644 ---- a/arch/sh/kernel/topology.c -+++ b/arch/sh/kernel/topology.c -@@ -17,6 +17,7 @@ - static DEFINE_PER_CPU(struct cpu, cpu_devices); - - cpumask_t cpu_core_map[NR_CPUS]; -+EXPORT_SYMBOL(cpu_core_map); - - static cpumask_t cpu_coregroup_map(unsigned int cpu) - { --- -1.7.3.5 - diff --git a/debian/patches/bugfix/sparc/introduce-u64-aligned.patch b/debian/patches/bugfix/sparc/introduce-u64-aligned.patch deleted file mode 100644 index 1520699e9..000000000 --- a/debian/patches/bugfix/sparc/introduce-u64-aligned.patch +++ /dev/null @@ -1,136 +0,0 @@ -From: Mathieu Desnoyers -Subject: introduce __u64_aligned and U64_ALIGN() for structure alignment in custom sections (v3) -Date: Fri, 21 Jan 2011 15:36:31 -0500 - -Problem description: - -gcc happily align on 32-byte structures defined statically. Ftrace trace events -and Tracepoints both statically define structures into custom sections (using -the "section" attribute), to then assign these to symbols with the linker -scripts to iterate the these sections as an array. - -However, gcc uses different alignments for these structures when they are -defined statically than when they are globally visible and/or in an array. -Therefore iteration on these arrays sees "holes" of padding. gcc is within its -rights to increase the alignment of the statically defined structures because, -normally, there should be no other accesses to them than in the local object. We -are actually iterating on the generated structures as if they were an array -without letting gcc knowing anything about it. - -This patch introduces __u64_aligned to force gcc to use the u64 type and -variable alignment, up-aligning or down-aligning the target type if necessary. -The memory accesses to the target structure are efficient (does not require -bytewise memory accesses) and the atomic pointer update guarantees required by -RCU are kept. u64 is considered as the largest type that can generate a trap for -unaligned accesses (u64 on sparc32 needs to be aligned on 64-bit). - -This alignment should be used for both structure definitions and declarations -(as *both* the type and variable attribute) when using the "section" -attribute to generate arrays of structures. Given that gcc only uses the type -attribute "aligned" as a lower-bound for alignment, the structures should not -contain types which require alignment larger than that of u64. The "aligned" -variable attribute, on the other hand, forces gcc to use exactly the specified -alignment. - -Also introduce the linker script U64_ALIGN() macro for specification of custom -section alignment that matches that of __u64_aligned. - -Changelog since v2: -- Drop the "packed" type attribute, because it causes gcc to drop the padding - between consecutive "int" and "pointer"/"long" fields, which leads to - unaligned accesses on sparc64. - -Signed-off-by: Mathieu Desnoyers -CC: David Miller -CC: Steven Rostedt -CC: Frederic Weisbecker -CC: Ingo Molnar ---- - include/asm-generic/vmlinux.lds.h | 6 ++++ - include/linux/align-section.h | 54 ++++++++++++++++++++++++++++++++++++++ - include/linux/compiler.h | 2 + - 3 files changed, 62 insertions(+) - ---- a/include/linux/compiler.h -+++ b/include/linux/compiler.h -@@ -57,6 +57,8 @@ extern void __chk_io_ptr(const volatile - # include - #endif - -+#include -+ - /* - * Generic compiler-dependent macros required for kernel - * build go below this comment. Actual compiler/compiler version ---- a/include/asm-generic/vmlinux.lds.h -+++ b/include/asm-generic/vmlinux.lds.h -@@ -69,6 +69,12 @@ - */ - #define STRUCT_ALIGN() . = ALIGN(32) - -+/* -+ * Align to a 8 byte boundary. For use with custom section made from structures -+ * declared and defined with __u64_aligned. -+ */ -+#define U64_ALIGN() . = ALIGN(8) -+ - /* The actual configuration determine if the init/exit sections - * are handled as text/data or they can be discarded (which - * often happens at runtime) ---- /dev/null -+++ b/include/linux/align-section.h -@@ -0,0 +1,54 @@ -+#ifndef _LINUX_ALIGN_SECTION_H -+#define _LINUX_ALIGN_SECTION_H -+ -+/* -+ * __u64_aligned: -+ * -+ * __u64_aligned should be used as type and variable attribute for structure -+ * definitions when using the "section" attribute to generate arrays of -+ * structures. U64_ALIGN() must be used prior to these section definitions in -+ * the linker script. -+ * -+ * It forces the compiler to use the u64 type alignment, up-aligning or -+ * down-aligning the target type if necessary. The memory accesses to the target -+ * structure are efficient (does not require bytewise memory accesses) and the -+ * atomic pointer update guarantees required by RCU are kept. u64 is considered -+ * as the largest type that can generate a trap for unaligned accesses (u64 on -+ * sparc32 needs to be aligned on 64-bit). -+ * -+ * Given that gcc only uses the type attribute "aligned" as a lower-bound for -+ * alignment, the structures should not contain types which require alignment -+ * larger than that of u64. The "aligned" variable attribute, on the other hand, -+ * forces gcc to use exactly the specified alignment. -+ */ -+ -+/* -+ * Use __u64_aligned as type and variable attribute for custom section structure -+ * declaration and definition. It should also be applied to any static or -+ * extern definition of the structure that would override the definition to -+ * which the "section" attribute is applied, e.g. -+ * -+ * struct custom { -+ * unsigned long field; -+ * ... -+ * } __u64_aligned; -+ * -+ * extern struct __u64_aligned custom; -+ * struct custom __u64_aligned __attribute__((section("__custom")) identifier; -+ * -+ * The array can then be defined with: -+ * -+ * extern struct custom __start___custom[]; -+ * extern struct custom __stop___custom[]; -+ * -+ * With linking performed by the linker script: -+ * -+ * U64_ALIGN(); -+ * VMLINUX_SYMBOL(__start___custom) = .; -+ * *(__custom) -+ * VMLINUX_SYMBOL(__stop___custom) = .; -+ */ -+ -+#define __u64_aligned __attribute__((__aligned__(__alignof__(long long)))) -+ -+#endif /* _LINUX_ALIGN_SECTION_H */ diff --git a/debian/patches/bugfix/sparc/tracing-use-u64-aligned-as-type-and-variable-attribute.patch b/debian/patches/bugfix/sparc/tracing-use-u64-aligned-as-type-and-variable-attribute.patch deleted file mode 100644 index 12e4e8419..000000000 --- a/debian/patches/bugfix/sparc/tracing-use-u64-aligned-as-type-and-variable-attribute.patch +++ /dev/null @@ -1,283 +0,0 @@ -From: Mathieu Desnoyers -Subject: tracing: fix sparc64 alignment crash with __u64_aligned/U64_ALIGN() -Date: Fri, 21 Jan 2011 15:36:32 -0500 - -Problem description: - -gcc happily align structures defined statically on 32-byte. Ftrace trace events -and Tracepoints both statically define structures into sections (using the -"section" attribute), to then assign these to symbols with the linker scripts to -iterate the these sections as an array. - -However, gcc uses different alignments for these structures when they are -defined statically and when they are globally visible and/or in an array. -Therefore iteration on these arrays sees "holes" of padding. - -Use the __u64_aligned for type declarations and variable definitions to ensure -that gcc: - -a) iterates on the correctly aligned type. (type attribute) -b) generates the definitions within the sections with the appropriate alignment. - (variable attribute) - -The Ftrace code introduced the "aligned(4)" variable attribute in commit -1473e4417c79f12d91ef91a469699bfa911f510f to try to work around this problem that -showed up on x86_64, but it causes unaligned accesses on sparc64, and is -generally a bad idea on 64-bit if RCU pointers are contained within the -structure. Moreover, it did not use the same attribute as type attribute, which -could cause the iteration on the extern array structure not to match the -variable definitions for some structure sizes. - -We should also ensure proper alignment of each Ftrace section in -include/asm-generic/vmlinux.lds.h. - -Moving all STRUCT_ALIGN() for FTRACE_EVENTS() and TRACE_SYSCALLS() into the -definitions, so the alignment is only done if these infrastructures are -configured in. Use U64_ALIGN instead of STRUCT_ALIGN. - -Also align TRACE_PRINTKS on U64_ALIGN to make sure the beginning of the section -is aligned on pointer size. - -Signed-off-by: Mathieu Desnoyers -CC: David Miller -CC: Steven Rostedt -CC: Frederic Weisbecker -CC: Ingo Molnar ---- - include/asm-generic/vmlinux.lds.h | 19 ++++++++++--------- - include/linux/compiler.h | 6 +++--- - include/linux/ftrace_event.h | 2 +- - include/linux/syscalls.h | 18 ++++++++---------- - include/trace/ftrace.h | 8 ++++---- - include/trace/syscall.h | 2 +- - kernel/trace/trace.h | 2 +- - kernel/trace/trace_export.c | 2 +- - 8 files changed, 29 insertions(+), 30 deletions(-) - ---- a/include/linux/compiler.h -+++ b/include/linux/compiler.h -@@ -80,7 +80,7 @@ struct ftrace_branch_data { - }; - unsigned long miss_hit[2]; - }; --}; -+} __u64_aligned; - - /* - * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code -@@ -96,7 +96,7 @@ void ftrace_likely_update(struct ftrace_ - #define __branch_check__(x, expect) ({ \ - int ______r; \ - static struct ftrace_branch_data \ -- __attribute__((__aligned__(4))) \ -+ __u64_aligned \ - __attribute__((section("_ftrace_annotated_branch"))) \ - ______f = { \ - .func = __func__, \ -@@ -131,7 +131,7 @@ void ftrace_likely_update(struct ftrace_ - ({ \ - int ______r; \ - static struct ftrace_branch_data \ -- __attribute__((__aligned__(4))) \ -+ __u64_aligned \ - __attribute__((section("_ftrace_branch"))) \ - ______f = { \ - .func = __func__, \ ---- a/include/linux/syscalls.h -+++ b/include/linux/syscalls.h -@@ -126,12 +126,11 @@ extern struct trace_event_functions exit - - #define SYSCALL_TRACE_ENTER_EVENT(sname) \ - static struct syscall_metadata \ -- __attribute__((__aligned__(4))) __syscall_meta_##sname; \ -+ __u64_aligned __syscall_meta_##sname; \ - static struct ftrace_event_call \ -- __attribute__((__aligned__(4))) event_enter_##sname; \ -+ __u64_aligned event_enter_##sname; \ - static struct ftrace_event_call __used \ -- __attribute__((__aligned__(4))) \ -- __attribute__((section("_ftrace_events"))) \ -+ __u64_aligned __attribute__((section("_ftrace_events"))) \ - event_enter_##sname = { \ - .name = "sys_enter"#sname, \ - .class = &event_class_syscall_enter, \ -@@ -141,12 +140,11 @@ extern struct trace_event_functions exit - - #define SYSCALL_TRACE_EXIT_EVENT(sname) \ - static struct syscall_metadata \ -- __attribute__((__aligned__(4))) __syscall_meta_##sname; \ -+ __u64_aligned __syscall_meta_##sname; \ - static struct ftrace_event_call \ -- __attribute__((__aligned__(4))) event_exit_##sname; \ -+ __u64_aligned event_exit_##sname; \ - static struct ftrace_event_call __used \ -- __attribute__((__aligned__(4))) \ -- __attribute__((section("_ftrace_events"))) \ -+ __u64_aligned __attribute__((section("_ftrace_events"))) \ - event_exit_##sname = { \ - .name = "sys_exit"#sname, \ - .class = &event_class_syscall_exit, \ -@@ -158,7 +156,7 @@ extern struct trace_event_functions exit - SYSCALL_TRACE_ENTER_EVENT(sname); \ - SYSCALL_TRACE_EXIT_EVENT(sname); \ - static struct syscall_metadata __used \ -- __attribute__((__aligned__(4))) \ -+ __u64_aligned \ - __attribute__((section("__syscalls_metadata"))) \ - __syscall_meta_##sname = { \ - .name = "sys"#sname, \ -@@ -174,7 +172,7 @@ extern struct trace_event_functions exit - SYSCALL_TRACE_ENTER_EVENT(_##sname); \ - SYSCALL_TRACE_EXIT_EVENT(_##sname); \ - static struct syscall_metadata __used \ -- __attribute__((__aligned__(4))) \ -+ __u64_aligned \ - __attribute__((section("__syscalls_metadata"))) \ - __syscall_meta__##sname = { \ - .name = "sys_"#sname, \ ---- a/include/trace/ftrace.h -+++ b/include/trace/ftrace.h -@@ -69,7 +69,7 @@ - #undef DEFINE_EVENT - #define DEFINE_EVENT(template, name, proto, args) \ - static struct ftrace_event_call __used \ -- __attribute__((__aligned__(4))) event_##name -+ __u64_aligned event_##name; - - #undef DEFINE_EVENT_PRINT - #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ -@@ -434,7 +434,7 @@ static inline notrace int ftrace_get_off - * }; - * - * static struct ftrace_event_call __used -- * __attribute__((__aligned__(4))) -+ * __u64_aligned - * __attribute__((section("_ftrace_events"))) event_ = { - * .name = "", - * .class = event_class_