cpufreq_cpu_data is protected by cpufreq_driver_lock and one of the instances
has missed this. And as a result we get this:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 4 at include/linux/kref.h:47
kobject_get+0x41/0x50()
Modules linked in: acpi_cpufreq(+) nfsd auth_rpcgss nfs_acl
lockd grace sunrpc xfs libcrc32c sd_mod ixgbe igb mdio ahci hwmon
...
Call Trace:
[<ffffffff81661b14>] dump_stack+0x46/0x58
[<ffffffff81072b61>] warn_slowpath_common+0x81/0xa0
[<ffffffff81072c7a>] warn_slowpath_null+0x1a/0x20
[<ffffffff812e16d1>] kobject_get+0x41/0x50
[<ffffffff815262a5>] cpufreq_cpu_get+0x75/0xc0
[<ffffffff81527c3e>] cpufreq_update_policy+0x2e/0x1f0
[<ffffffff810b8cb2>] ? up+0x32/0x50
[<ffffffff81381aa9>] ? acpi_ns_get_node+0xcb/0xf2
[<ffffffff81381efd>] ? acpi_evaluate_object+0x22c/0x252
[<ffffffff813824f6>] ? acpi_get_handle+0x95/0xc0
[<ffffffff81360967>] ? acpi_has_method+0x25/0x40
[<ffffffff81391e08>] acpi_processor_ppc_has_changed+0x77/0x82
[<ffffffff81089566>] ? move_linked_works+0x66/0x90
[<ffffffff8138e8ed>] acpi_processor_notify+0x58/0xe7
[<ffffffff8137410c>] acpi_ev_notify_dispatch+0x44/0x5c
[<ffffffff8135f293>] acpi_os_execute_deferred+0x15/0x22
[<ffffffff8108c910>] process_one_work+0x160/0x410
[<ffffffff8108d05b>] worker_thread+0x11b/0x520
[<ffffffff8108cf40>] ? rescuer_thread+0x380/0x380
[<ffffffff81092421>] kthread+0xe1/0x100
[<ffffffff81092340>] ? kthread_create_on_node+0x1b0/0x1b0
[<ffffffff81669ebc>] ret_from_fork+0x7c/0xb0
[<ffffffff81092340>] ? kthread_create_on_node+0x1b0/0x1b0
---[ end trace 89e66eb9795efdf7 ]---
And here is the race:
Thread A: Workqueue: kacpi_notify
acpi_processor_notify()
acpi_processor_ppc_has_changed()
cpufreq_update_policy()
cpufreq_cpu_get()
kobject_get()
Thread B: xenbus_thread()
xenbus_thread()
msg->u.watch.handle->callback()
handle_vcpu_hotplug_event()
vcpu_hotplug()
cpu_down()
__cpu_notify(CPU_POST_DEAD..)
cpufreq_cpu_callback()
__cpufreq_remove_dev_finish()
cpufreq_policy_put_kobj()
kobject_put()
cpufreq_cpu_get() gets the policy from per-cpu variable cpufreq_cpu_data under
cpufreq_driver_lock, and once it gets a valid policy it expects it to not be
freed until cpufreq_cpu_put() is called.
But the race happens when another thread puts the kobject first and updates
cpufreq_cpu_data later and that too without these locks. And so the first thread
gets a valid policy structure and before it does kobject_get() on it, the second
one does kobject_put(). And so this WARN().
Fix this by setting cpufreq_cpu_data to NULL before putting the kobject and that
too under locks.
Cc: <stable(a)vger.kernel.org> # 3.12+
Reported-by: Ethan Zhao <ethan.zhao(a)oracle.com>
Reported-and-tested-by: Santosh Shilimkar <santosh.shilimkar(a)oracle.com>
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
@Santosh: I have changed read locks to write locks here and so you need to test
again.
drivers/cpufreq/cpufreq.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 4473eba1d6b0..e3bf702b5588 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1409,9 +1409,10 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
unsigned long flags;
struct cpufreq_policy *policy;
- read_lock_irqsave(&cpufreq_driver_lock, flags);
+ write_lock_irqsave(&cpufreq_driver_lock, flags);
policy = per_cpu(cpufreq_cpu_data, cpu);
- read_unlock_irqrestore(&cpufreq_driver_lock, flags);
+ per_cpu(cpufreq_cpu_data, cpu) = NULL;
+ write_unlock_irqrestore(&cpufreq_driver_lock, flags);
if (!policy) {
pr_debug("%s: No cpu_data found\n", __func__);
@@ -1466,7 +1467,6 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
}
}
- per_cpu(cpufreq_cpu_data, cpu) = NULL;
return 0;
}
--
2.3.0.rc0.44.ga94655d
Hi All,
This discussion is triggered once again from recent chat with Stephen Boyd and
my need to access qfprom for tsens driver.
On MSM parts there are some efuses (called qfprom) these fuses store things like
calibration data, speed bins.. etc. Drivers like cpufreq, thermal sensors would
read out this data for configuring the driver. As qfprom is a mmio on QCOM parts
and is kinda shared resource, drivers which need data from qfrom can access it
by using syscon or use eeprom/efuse framework. Both of them, will do the job,
but as of today there is no eeprom, framework in the kernel, so accessing qfprom
via syscon seems to be more generic and the only option with current kernel
situation.
But there are some side effects of this approach,
1> code duplication: drivers which needs to access qfprom have to talk to syscon
and get hold of regmap, offset, size and then do regmap reads. This will be
kinda redone in every driver which needs access to qfprom.
2> handling multiple resources: with out some extra dt code in drivers its not
easy to get hold of multple qfprom resources.
3> register stride: syscon by default has a register stride of word size.
So this wrapper + "a syscon fix" addresses the above issues making syscon more
friendly for qfprom.
With this approach DT looks like:
qfprom: qfprom@00700000 {
compatible = "qcom,qfprom", "syscon";
reg = <0x00700000 0x1000>;
stride = <1>;
};
tsens: tsens {
#thermal-sensor-cells = <1>;
compatible = "qcom,apq8064-tsens";
qcom,qfprom = <&qfprom 0x404 0x10>, <&qfprom 0x414 0x10>;
qcom,qfprom-names = "calib", "backup_calib";
};
and the driver side looks like:
cdata = qfprom_get_data(dev, 0, &sz);
cdata_backup = qfprom_get_data(dev, 1, &sz);
Questions:
- Should we wait for more generic eeprom/efuse interfaces? With no time line in place?
- Should we take a simplistic approach and move to using these wrappers till we
get some eeprom/efuse apis in the kernel?
- Are there any better ways to represent qfprom via DT nodes?
Stephen had similar discussions [1] some time back in July 2014, but nothing
really changed since then. With the given situation Am proposing these patches
to get something that works on top of mainline which will unblock upstreaming
tsens and hopefully help other drivers like cpufreq an abstracted way to get
hold of qfprom data.
So here are my WIP patches for your comments/disussions.. :-)
Thanks,
srini
[1] http://comments.gmane.org/gmane.linux.ports.arm.msm/8142
Srinivas Kandagatla (2):
WIP: mfd: syscon: Add register stride to DT bindings.
WIP: Add wrappers for qfprom access via syscon
Documentation/devicetree/bindings/mfd/syscon.txt | 3 +
.../devicetree/bindings/soc/qcom/qfprom.txt | 29 +++++
drivers/mfd/syscon.c | 9 ++
drivers/soc/qcom/Kconfig | 7 ++
drivers/soc/qcom/Makefile | 1 +
drivers/soc/qcom/qfprom.c | 134 +++++++++++++++++++++
6 files changed, 183 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/qcom/qfprom.txt
create mode 100644 drivers/soc/qcom/qfprom.c
--
1.9.1
Hi,
The following patchset adds coupled cpuidle support for Exynos4210
to an existing cpuidle-exynos driver. As a result it enables AFTR
mode to be used by default on Exynos4210 without the need to hot
unplug CPU1 first.
This work is heavily based on earlier cpuidle-exynos4210 driver from
Daniel Lezcano:
http://www.spinics.net/lists/linux-samsung-soc/msg28134.html
Changes from Daniel's code include:
- porting code to current kernels
- fixing it to work on my setup (by using S5P_INFORM register
instead of S5P_VA_SYSRAM one on Revison 1.1 and retrying poking
CPU1 out of the BOOT ROM if necessary)
- fixing rare lockup caused by waiting for CPU1 to get stuck in
the BOOT ROM (CPU hotplug code in arch/arm/mach-exynos/platsmp.c
doesn't require this and works fine)
- moving Exynos specific code to arch/arm/mach-exynos/pm.c
- using cpu_boot_reg_base() helper instead of BOOT_VECTOR macro
- using exynos_cpu_*() helpers instead of accessing registers
directly
- using arch_send_wakeup_ipi_mask() instead of dsb_sev()
(this matches CPU hotplug code in arch/arm/mach-exynos/platsmp.c)
- integrating separate exynos4210-cpuidle driver into existing
exynos-cpuidle one
patch #1 is a fix for Exynos platform PM code preparing it for
coupled cpuidle support
patch #2 adds coupled cpuidle AFTR mode for Exynos4210
The patchset depends on:
- for-next branch (commit: 9663ad71912b) of linux-samsung.git
kernel tree
Changes since v2:
- rebased on top of for-next branch (commit: 9663ad71912b) of
linux-samsung.git kernel tree
Changes since v1:
- rebased on top of for-next branch (commit: 760a7d4763c8) of
linux-samsung.git kernel tree (the patchset also applies fine
to next-20141126 branch of linux-next kernel tree but needs
CPUIDLE_FLAG_TIME_VALID flag usage removed to fix build)
- added Signed-off-by from Daniel Lezcano to patch #2
- added separate struct cpuidle_driver exynos_coupled_idle_driver
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Bartlomiej Zolnierkiewicz (2):
ARM: EXYNOS: apply S5P_CENTRAL_SEQ_OPTION fix only when necessary
cpuidle: exynos: add coupled cpuidle support for Exynos4210
arch/arm/mach-exynos/common.h | 4 +
arch/arm/mach-exynos/exynos.c | 4 +
arch/arm/mach-exynos/platsmp.c | 2 +-
arch/arm/mach-exynos/pm.c | 133 ++++++++++++++++++++++++++-
arch/arm/mach-exynos/suspend.c | 4 +
drivers/cpuidle/Kconfig.arm | 1 +
drivers/cpuidle/cpuidle-exynos.c | 76 ++++++++++++++-
include/linux/platform_data/cpuidle-exynos.h | 20 ++++
8 files changed, 234 insertions(+), 10 deletions(-)
create mode 100644 include/linux/platform_data/cpuidle-exynos.h
--
1.8.2.3
Tree/Branch: master
Git describe: v3.19-rc6-132-ga2ae004a9883
Commit: a2ae004a98 Merge tag 'sound-3.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Build Time: 22 min 35 sec
Passed: 8 / 8 (100.00 %)
Failed: 0 / 8 ( 0.00 %)
Errors: 0
Warnings: 23
Section Mismatches: 0
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
9 warnings 0 mismatches : arm64-allmodconfig
1 warnings 0 mismatches : arm-multi_v7_defconfig
16 warnings 0 mismatches : arm-allmodconfig
1 warnings 0 mismatches : arm64-defconfig
-------------------------------------------------------------------------------
Warnings Summary: 23
2 ../include/linux/dynamic_debug.h:78:3: warning: unsupported argument to '__builtin_return_address'
2 ../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
2 ../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
2 ../drivers/clocksource/timer-marco.c:260:6: warning: unused variable 'timer_div' [-Wunused-variable]
1 ../net/rds/iw_rdma.c:200:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../lib/lz4/lz4hc_compress.c:514:1: warning: the frame size of 1480 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../include/uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
1 ../include/linux/kernel.h:710:17: warning: comparison of distinct pointer types lacks a cast
1 ../include/linux/dynamic_debug.h:64:16: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
1 ../drivers/usb/renesas_usbhs/common.c:471:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/usb/gadget/udc/udc-xilinx.c:2135:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/net/ethernet/rocker/rocker.c:809:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:467:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:307:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:303:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/net/ethernet/dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! [-Wcpp]
1 ../drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../drivers/infiniband/hw/qib/qib_qp.c:44:0: warning: "BITS_PER_PAGE" redefined
1 ../drivers/gpio/gpio-74xx-mmio.c:132:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/block/drbd/drbd_bitmap.c:483:0: warning: "BITS_PER_PAGE_MASK" redefined
1 ../drivers/block/drbd/drbd_bitmap.c:482:0: warning: "BITS_PER_PAGE" redefined
1 ../arch/arm64/kernel/efi.c:276:20: warning: 'free_end' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../arch/arm/mach-cns3xxx/pcie.c:313:1: warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allmodconfig : PASS, 0 errors, 9 warnings, 0 section mismatches
Warnings:
../drivers/block/drbd/drbd_bitmap.c:482:0: warning: "BITS_PER_PAGE" redefined
../drivers/block/drbd/drbd_bitmap.c:483:0: warning: "BITS_PER_PAGE_MASK" redefined
../drivers/gpio/gpio-74xx-mmio.c:132:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/infiniband/hw/qib/qib_qp.c:44:0: warning: "BITS_PER_PAGE" redefined
../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
../drivers/net/ethernet/dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! [-Wcpp]
../drivers/usb/gadget/udc/udc-xilinx.c:2135:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/usb/renesas_usbhs/common.c:471:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
-------------------------------------------------------------------------------
arm-multi_v7_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../drivers/clocksource/timer-marco.c:260:6: warning: unused variable 'timer_div' [-Wunused-variable]
-------------------------------------------------------------------------------
arm-allmodconfig : PASS, 0 errors, 16 warnings, 0 section mismatches
Warnings:
../arch/arm/mach-cns3xxx/pcie.c:313:1: warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../lib/lz4/lz4hc_compress.c:514:1: warning: the frame size of 1480 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../drivers/clocksource/timer-marco.c:260:6: warning: unused variable 'timer_div' [-Wunused-variable]
../net/rds/iw_rdma.c:200:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../include/linux/kernel.h:710:17: warning: comparison of distinct pointer types lacks a cast
../include/linux/dynamic_debug.h:78:3: warning: unsupported argument to '__builtin_return_address'
../include/linux/dynamic_debug.h:78:3: warning: unsupported argument to '__builtin_return_address'
../drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../include/linux/dynamic_debug.h:64:16: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:303:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:307:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:467:46: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../include/uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
../drivers/net/ethernet/rocker/rocker.c:809:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
-------------------------------------------------------------------------------
arm64-defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../arch/arm64/kernel/efi.c:276:20: warning: 'free_end' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
arm64-allnoconfig
x86_64-allnoconfig
arm-allnoconfig
x86_64-defconfig
Tree/Branch: next-20150129
Git describe: next-20150129
Commit: 828f79f97f Add linux-next specific files for 20150129
Build Time: 23 min 29 sec
Passed: 7 / 8 ( 87.50 %)
Failed: 1 / 8 ( 12.50 %)
Errors: 2
Warnings: 32
Section Mismatches: 4
Failed defconfigs:
arm-allmodconfig
Errors:
arm-allmodconfig
../fs/dax.c:266:2: error: implicit declaration of function 'copy_user_page' [-Werror=implicit-function-declaration]
../include/linux/dynamic_debug.h:66:14: error: 'KBUILD_MODNAME' undeclared (first use in this function)
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
25 warnings 4 mismatches : arm64-allmodconfig
1 warnings 0 mismatches : x86_64-defconfig
1 warnings 0 mismatches : arm-multi_v7_defconfig
11 warnings 0 mismatches : arm-allmodconfig
5 warnings 0 mismatches : arm64-defconfig
-------------------------------------------------------------------------------
Errors summary: 2
1 ../include/linux/dynamic_debug.h:66:14: error: 'KBUILD_MODNAME' undeclared (first use in this function)
1 ../fs/dax.c:266:2: error: implicit declaration of function 'copy_user_page' [-Werror=implicit-function-declaration]
Warnings Summary: 32
5 ../fs/eventfd.c:121:16: warning: unused variable 'flags' [-Wunused-variable]
2 ../drivers/staging/sm7xxfb/sm7xxfb.c:117:19: warning: 'sm7xx_vga_setup' defined but not used [-Wunused-function]
2 ../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
2 ../drivers/pci/host/pci-xgene.c:144:13: warning: initialization from incompatible pointer type
2 ../drivers/pci/host/pci-xgene.c:144:13: warning: (near initialization for 'xgene_pcie_ops.map_bus')
2 ../drivers/pci/host/pci-xgene.c:140:2: warning: return makes integer from pointer without a cast
2 ../drivers/pci/host/pci-xgene.c:137:3: warning: return makes integer from pointer without a cast
2 ../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
1 ../sound/soc/samsung/dmaengine.c:60:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../sound/soc/samsung/dmaengine.c:53:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../net/rds/iw_rdma.c:200:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../lib/lz4/lz4hc_compress.c:514:1: warning: the frame size of 1480 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../include/uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
1 ../drivers/usb/renesas_usbhs/common.c:482:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/usb/gadget/udc/udc-xilinx.c:2135:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/staging/fbtft/fbtft-io.c:63:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
1 ../drivers/staging/fbtft/fbtft-io.c:110:5: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
1 ../drivers/staging/fbtft/fbtft-core.c:1004:4: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
1 ../drivers/staging/dgap/dgap.h:124:0: warning: "PCI_IO_SIZE" redefined
1 ../drivers/spi/spi-s3c64xx.c:336:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/spi/spi-s3c64xx.c:327:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 ../drivers/net/ethernet/dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! [-Wcpp]
1 ../drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ../drivers/iommu/arm-smmu.c:1255:3: warning: right shift count >= width of type
1 ../drivers/infiniband/hw/qib/qib_qp.c:44:0: warning: "BITS_PER_PAGE" redefined
1 ../drivers/gpu/drm/drm_gem_cma_helper.c:393:4: warning: format '%d' expects argument of type 'int', but argument 8 has type 'size_t' [-Wformat=]
1 ../drivers/gpu/drm/drm_gem_cma_helper.c:114:4: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
1 ../drivers/gpio/gpio-74xx-mmio.c:132:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1 ../drivers/block/drbd/drbd_bitmap.c:483:0: warning: "BITS_PER_PAGE_MASK" redefined
1 ../drivers/block/drbd/drbd_bitmap.c:482:0: warning: "BITS_PER_PAGE" redefined
1 ../arch/arm/mach-integrator/pci_v3.c:614:16: warning: unused variable 'flags' [-Wunused-variable]
1 ../arch/arm/mach-cns3xxx/pcie.c:266:1: warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]
Section Mismatch Summary: 4
1 WARNING: vmlinux.o(.text+0x26740): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
1 WARNING: vmlinux.o(.text+0x2671c): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
1 WARNING: arch/arm64/mm/built-in.o(.text+0x31a0): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
1 WARNING: arch/arm64/mm/built-in.o(.text+0x317c): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allmodconfig : PASS, 0 errors, 25 warnings, 4 section mismatches
Warnings:
../drivers/block/drbd/drbd_bitmap.c:482:0: warning: "BITS_PER_PAGE" redefined
../drivers/block/drbd/drbd_bitmap.c:483:0: warning: "BITS_PER_PAGE_MASK" redefined
../drivers/gpio/gpio-74xx-mmio.c:132:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../fs/eventfd.c:121:16: warning: unused variable 'flags' [-Wunused-variable]
../sound/soc/samsung/dmaengine.c:53:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../sound/soc/samsung/dmaengine.c:60:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/infiniband/hw/qib/qib_qp.c:44:0: warning: "BITS_PER_PAGE" redefined
../drivers/gpu/drm/drm_gem_cma_helper.c:114:4: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
../drivers/gpu/drm/drm_gem_cma_helper.c:393:4: warning: format '%d' expects argument of type 'int', but argument 8 has type 'size_t' [-Wformat=]
../drivers/pci/host/pci-xgene.c:137:3: warning: return makes integer from pointer without a cast
../drivers/pci/host/pci-xgene.c:140:2: warning: return makes integer from pointer without a cast
../drivers/pci/host/pci-xgene.c:144:13: warning: initialization from incompatible pointer type
../drivers/pci/host/pci-xgene.c:144:13: warning: (near initialization for 'xgene_pcie_ops.map_bus')
../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
../drivers/spi/spi-s3c64xx.c:327:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/spi/spi-s3c64xx.c:336:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../drivers/net/ethernet/dec/tulip/tulip_core.c:101:2: warning: #warning Processor architecture undefined! [-Wcpp]
../drivers/staging/dgap/dgap.h:124:0: warning: "PCI_IO_SIZE" redefined
../drivers/staging/fbtft/fbtft-core.c:1004:4: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]
../drivers/staging/fbtft/fbtft-io.c:63:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
../drivers/staging/fbtft/fbtft-io.c:110:5: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
../drivers/usb/gadget/udc/udc-xilinx.c:2135:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
../drivers/staging/sm7xxfb/sm7xxfb.c:117:19: warning: 'sm7xx_vga_setup' defined but not used [-Wunused-function]
../drivers/usb/renesas_usbhs/common.c:482:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Section Mismatches:
WARNING: arch/arm64/mm/built-in.o(.text+0x317c): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
WARNING: arch/arm64/mm/built-in.o(.text+0x31a0): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
WARNING: vmlinux.o(.text+0x2671c): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
WARNING: vmlinux.o(.text+0x26740): Section mismatch in reference from the function __create_mapping.isra.8() to the variable .init.text:$x
-------------------------------------------------------------------------------
x86_64-defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../fs/eventfd.c:121:16: warning: unused variable 'flags' [-Wunused-variable]
-------------------------------------------------------------------------------
arm-multi_v7_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../fs/eventfd.c:121:16: warning: unused variable 'flags' [-Wunused-variable]
-------------------------------------------------------------------------------
arm-allmodconfig : FAIL, 2 errors, 11 warnings, 0 section mismatches
Errors:
../fs/dax.c:266:2: error: implicit declaration of function 'copy_user_page' [-Werror=implicit-function-declaration]
../include/linux/dynamic_debug.h:66:14: error: 'KBUILD_MODNAME' undeclared (first use in this function)
Warnings:
../arch/arm/mach-cns3xxx/pcie.c:266:1: warning: the frame size of 1080 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../arch/arm/mach-integrator/pci_v3.c:614:16: warning: unused variable 'flags' [-Wunused-variable]
../lib/lz4/lz4hc_compress.c:514:1: warning: the frame size of 1480 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../fs/eventfd.c:121:16: warning: unused variable 'flags' [-Wunused-variable]
../net/rds/iw_rdma.c:200:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../drivers/iommu/arm-smmu.c:1255:3: warning: right shift count >= width of type
../drivers/mtd/chips/cfi_cmdset_0020.c:651:1: warning: the frame size of 1208 bytes is larger than 1024 bytes [-Wframe-larger-than=]
../drivers/net/ethernet/dec/tulip/winbond-840.c:910:2: warning: #warning Processor architecture undefined [-Wcpp]
../include/uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
../drivers/scsi/ips.c:210:2: warning: #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" [-Wcpp]
../drivers/staging/sm7xxfb/sm7xxfb.c:117:19: warning: 'sm7xx_vga_setup' defined but not used [-Wunused-function]
-------------------------------------------------------------------------------
arm64-defconfig : PASS, 0 errors, 5 warnings, 0 section mismatches
Warnings:
../fs/eventfd.c:121:16: warning: unused variable 'flags' [-Wunused-variable]
../drivers/pci/host/pci-xgene.c:137:3: warning: return makes integer from pointer without a cast
../drivers/pci/host/pci-xgene.c:140:2: warning: return makes integer from pointer without a cast
../drivers/pci/host/pci-xgene.c:144:13: warning: initialization from incompatible pointer type
../drivers/pci/host/pci-xgene.c:144:13: warning: (near initialization for 'xgene_pcie_ops.map_bus')
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
arm64-allnoconfig
x86_64-allnoconfig
arm-allnoconfig
(This patchset was already acked by the maintainers, and
re-targeting v3.17. See change history.)
(I don't think that discussions below about ptrace() have impact on
this patchset.
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/268923.html
)
This patchset adds system call audit support on arm64.
Both 32-bit (AUDIT_ARCH_ARM) and 64-bit tasks (AUDIT_ARCH_AARCH64)
are supported. Since arm64 has the exact same set of system calls
on LE and BE, we don't care about endianness (or more specifically
__AUDIT_ARCH_64BIT bit in AUDIT_ARCH_*).
This patch should work correctly with:
* userspace audit tool (v2.3.6 or later)
This code was tested on both 32-bit and 64-bit LE userland
in the following two ways:
1) basic operations with auditctl/autrace
# auditctl -a exit,always -S openat -F path=/etc/inittab
# auditctl -a exit,always -F dir=/tmp -F perm=rw
# auditctl -a task,always
# autrace /bin/ls
by comparing output from autrace with one from strace
2) audit-test-code (+ my workarounds for arm/arm64)
by running "audit-tool", "filter" and "syscalls" test categories.
Changes v9 -> v10:
* rebased on 3.16-rc3
* included Catalin's patch[1/3] and added more syscall definitions for 3.16
Changes v8 -> v9:
* rebased on 3.15-rc, especially due to the change of syscall_get_arch()
interface [1,2/2]
Changes v7 -> v8:
* aligned with the change in "audit: generic compat system call audit
support" v5 [1/2]
* aligned with the change in "arm64: split syscall_trace() into separate
functions for enter/exit" v5 [2/2]
Changes v6 -> v7:
* changed an include file in syscall.h from <linux/audit.h> to
<uapi/linux/audit.h> [1/2]
* aligned with the patch, "arm64: split syscall_trace() into separate
functions for enter/exit" [2/2]
Changes v5 -> v6:
* removed and put "arm64: Add regs_return_value() in syscall.h" patch into
a separate set
* aligned with the change in "arm64: make a single hook to syscall_trace()
for all syscall features" v3 [1/2]
Changes v4 -> v5:
* rebased to 3.14-rcX
* added a guard against TIF_SYSCALL_AUDIT [3/3]
* aligned with the change in "arm64: make a single hook to syscall_trace()
for all syscall features" v2 [3/3]
Changes v3 -> v4:
* Modified to sync with the patch, "make a single hook to syscall_trace()
for all syscall features"
* aligned with "audit: Add CONFIG_HAVE_ARCH_AUDITSYSCALL" patch
Changes v2 -> v3:
* Remove asm/audit.h.
See "generic compat syscall audit support" patch v4
* Remove endianness dependency, ie. AUDIT_ARCH_ARMEB/AARCH64EB.
* Remove kernel/syscalls/Makefile which was used to create unistd32.h.
See Catalin's "Add __NR_* definitions for compat syscalls" patch
Changes v1 -> v2:
* Modified to utilize "generic compat system call audit" [3/6, 4/6, 5/6]
Please note that a required header, unistd_32.h, is automatically
generated from unistd32.h.
* Refer to regs->orig_x0 instead of regs->x0 as the first argument of
system call in audit_syscall_entry() [6/6]
* Include "Add regs_return_value() in syscall.h" patch [2/6],
which was not intentionally included in v1 because it could be added
by "kprobes support".
AKASHI Takahiro (2):
arm64: Add audit support
arm64: audit: Add audit hook in syscall_trace_enter/exit()
Catalin Marinas (1):
arm64: Add __NR_* definitions for compat syscalls
arch/arm64/Kconfig | 2 +
arch/arm64/include/asm/syscall.h | 14 +
arch/arm64/include/asm/unistd.h | 17 +
arch/arm64/include/asm/unistd32.h | 1166 ++++++++++++++++++++++++-------------
arch/arm64/kernel/entry.S | 1 -
arch/arm64/kernel/kuser32.S | 2 +-
arch/arm64/kernel/ptrace.c | 7 +
arch/arm64/kernel/signal32.c | 2 +-
arch/arm64/kernel/sys_compat.c | 2 +-
include/uapi/linux/audit.h | 1 +
10 files changed, 810 insertions(+), 404 deletions(-)
--
1.7.9.5