2010-01-28 10:02:21

by Andrew Morton

[permalink] [raw]
Subject: mmotm 2010-01-28-01-36 uploaded

The mm-of-the-moment snapshot 2010-01-28-01-36 has been uploaded to

http://userweb.kernel.org/~akpm/mmotm/

and will soon be available at

git://zen-kernel.org/kernel/mmotm.git

It contains the following patches against 2.6.33-rc5:

origin.patch
linux-next.patch
linux-next-git-rejects.patch
next-remove-localversion.patch
i-need-old-gcc.patch
hardware-latency-detector-remove-default-m.patch
revert-input-wistron_btns-switch-to-using-sparse-keymap-library.patch
drivers-media-video-cx23885-needs-kfifo-conversion.patch
idr-fix-a-critical-misallocation-bug.patch
mx3fb-some-debug-and-initialisation-fixes.patch
rtc-fm3130-add-missing-braces.patch
kfifo-fix-kernel-doc-notation.patch
mm-flush-dcache-before-writing-into-page-to-avoid-alias.patch
devmem-check-vmalloc-address-on-kmem-read-write.patch
devmem-fix-kmem-write-bug-on-memory-holes.patch
get_maintainerpl-teach-git-log-to-use-no-color.patch
markup_oopspl-fix-func_offset-error-with-x86_64.patch
cgroups-fix-to-return-errno-in-a-failure-path.patch
zlib-make-new-optimized-inflate-endian-independent.patch
zlib-make-new-optimized-inflate-endian-independent-checkpatch-fixes.patch
mm-add-swap-slot-free-callback-to-block_device_operations.patch
mm-add-swap-slot-free-callback-to-block_device_operations-fix.patch
drivers-acpi-processor_idlec-add-two-laptops-to-the-c-state-dmi-table.patch
drivers-gpu-vga-vgaarbc-fix-userspace-pointer-dereference.patch
futex_lock_pi-key-refcnt-fix.patch
mtd-nand-fix-build-failure-caused-by-typo.patch
starfire-clean-up-properly-if-firmware-loading-fails.patch
ibmphp-read-the-length-of-ebda-and-map-entire-ebda-region-fix.patch
sched-f83f9ac-causes-tasks-running-at-max_prio.patch
hpsa-fix-scsi-status-reporting-yet-again.patch
drivers-scsi-sesc-eliminate-double-free.patch
kernel-credc-use-kmem_cache_free.patch
tpm_infineon-fix-suspend-resume-handler-for-pnp_driver.patch
oprofile-x86-fix-crash-when-profiling-more-than-28-events.patch
dell_laptop-when-the-hardware-switch-is-disabled-dont-actually-allow-changing-the-softblock-status.patch
acpi-fix-confusion-in-acpi_evaluate_string-in-comment.patch
acpi-remove-superfluous-null-pointer-check-from-acpi_processor_get_throttling_info.patch
acpica-fix-acpi_ex_release_mutex-comment.patch
asus-acpi-remove-duplicate-comparison-of-asus_model-strings.patch
thinkpad-acpi-wrong-thermal-attribute_group-removed-in-thermal_exit.patch
arch-x86-mm-gupc-fix-minor-spelling-error-in-comments.patch
doc-document-nopat-parameter.patch
pci-update-pci_set_vga_state-to-call-arch-functions.patch
pci-update-pci_set_vga_state-to-call-arch-functions-fix.patch
x86_64-uv-update-uv-arch-to-target-legacy-vga-i-o-correctly.patch
vgaarb-fix-vga-arbiter-to-accept-pci-domains-other-than-0.patch
vgaarb-add-user-selectability-of-the-number-of-gpus-in-a-system.patch
arm-convert-proc-cpu-aligment-to-seq_file.patch
arch-arm-plat-pxa-dmac-correct-null-test.patch
arm-convert-to-arch_gettimeoffset.patch
gemini-wrong-registers-used-to-set-reg_level-in-gpio_set_irq_type.patch
cpufreq-ondemand-dont-synchronize-sample-rate-unless-mulitple-cpus-present.patch
cpufreq-ondemand-dont-synchronize-sample-rate-unless-mulitple-cpus-present-checkpatch-fixes.patch
cpufreq-ondemand-refactor-frequency-increase-code.patch
cpufreq-ondemand-independent-max-speed-for-nice-threads-with-nice_max_freq.patch
cpufreq-ondemand-independent-max-speed-for-nice-threads-with-nice_max_freq-fix.patch
dma-cases-ipu_pix_fmt_bgra32-bgr32-and-abgr32-are-the-same-in-ipu_ch_param_set_size.patch
powerpc-sky-cpu-redundant-or-incorrect-tests-on-unsigned.patch
kbuild-move-fno-dwarf2-cfi-asm-to-powerpc-only.patch
dnotify-move-dir_notify_enable-declaration.patch
drivers-gpu-drm-radeon-radeon_combiosc-fix-warning.patch
drivers-gpu-drm-nouveau-nouveau_grctxc-correct-null-test.patch
gpu-drm-i915-fix-potential-null-dereference.patch
drm-dont-use-own-implementation-of-atoi.patch
drivers-gpu-drm-drm_crtc_helperc-fix-setting-of-fb_changed-in-drm_crtc_helper_set_config.patch
drivers-media-video-move-dereference-after-null-test.patch
drivers-media-video-pmsc-needs-versionh.patch
drivers-media-video-kconfig-add-video_dev-dependency-as-needed-in-drivers-media-video-kconfig.patch
cx23885-wrong-command-printed-in-cmd_to_str.patch
radio-add-the-saa7706h-car-radio-dsp-to-v4l2-chip-identh.patch
timer-stats-fix-del_timer_sync-and-try_to_del_timer_sync.patch
posix-cpu-timers-reset-expire-cache-when-no-timer-is-running.patch
hrtimer-correct-a-few-numbers-in-comments.patch
clockevents-ensure-taht-min_delta_ns-is-increased-in-error-path.patch
clocksource-add-argument-to-resume-callback.patch
clocksource-start-cmt-at-clocksource-resume.patch
clocksource-add-suspend-callback.patch
posix-timersc-dont-export-local-functions.patch
timers-introduce-the-concept-of-timer-slack-for-legacy-timers.patch
cpu-timers-simplify-rlimit_cpu-handling.patch
cpu-timers-cleanup-arm_timer.patch
cpu-timers-return-correct-previous-timer-reload-value.patch
cpu-timers-change-sigev_none-timer-implementation.patch
cpu-timers-assure-to-not-iterate-over-all-threads-in-fastpath_timer_check.patch
cpu-timers-optimize-run_posix_cpu_timers.patch
kernel-timekeeping-move-xtime_cache-to-be-in-the-same-cache-line-as-the-lock.patch
ia64-wrong-attribute-of-hub-chip-written-in-uv_setup.patch
infiniband-use-rlimit-helpers.patch
input-bcm5974-retract-efi-broken-suspend_resume.patch
usbtouchscreen-convert-from-usb_device-to-usb_interface.patch
usbtouchscreen-find-input-endpoint-automatically.patch
usbtouchscreen-add-nexio-or-inexio-support.patch
usbtouchscreen-fix-nexio-ack-and-usb-disconnect.patch
usbtouchscreen-dont-send-interrupt-urbs-to-bulk-endpoints.patch
usbtouchscreen-fix-leaks-and-check-return-value-of-usb_submit_urb.patch
scripts-kallsyms-suppress-build-warning.patch
mtd-nand-davinci-correct-4-bit-error-correction.patch
jffs2-fix-memory-corruption-in-jffs2_read_inode_range.patch
jffs2-avoid-using-c-keyword-new-in-userspace-visible-header.patch
mtd-chips-cfi-remove-unneeded-null-checks.patch
mtd-hot-spin-and-code-duplication-in-nand_bcm_umi_bch_read_oobecc.patch
ntfs-use-bitmap_weight.patch
hisax-timeout-off-by-one-in-waitrecmsg.patch
hardware-misdn-misdninfineonc-bail-out-of-loop-on-error.patch
net-rds-remove-uses-of-nipquad-use-%pi4.patch
3x59x-fix-pci-resource-management.patch
net-ipv4-correct-the-size-argument-to-kzalloc.patch
video-backlight-progear-fix-pci-device-refcounting.patch
da9030_battery-fix-spelling-in-comment.patch
sunrpc-use-formatting-of-module-name-in-sunrpc.patch
net-sunrpc-remove-uses-of-nipquad-use-%pi4.patch
fs-ocfs2-cluster-tcpc-remove-use-of-nipquad-use-%pi4.patch
serial-bfin_5xx-remove-useless-gpio-handling-with-hard-flow-control.patch
serial-bfin_5xx-need-to-disable-dma-tx-interrupt-too.patch
serial-bfin_5xx-kgdboc-should-accept-gdb-break-only-when-it-is-active.patch
serial-bfin_5xx-pull-in-linux-ioh-for-ioremap-prototypes.patch
sched-cpuacct-use-bigger-percpu-counter-batch-values-for-stats-counters.patch
kernel-irq-procc-expose-the-irq_desc-node-in-proc-irq.patch
genirq-warn-about-irqf_sharedirqf_disabled-at-the-right-place.patch
scsi-add-__init-__exit-macros-to-ibmvstgtc.patch
drivers-scsi-fnic-fnic_scsic-clean-up.patch
drivers-scsi-gdthc-fix-buffer-overflow.patch
drivers-scsi-lpfc-lpfc_vportc-fix-read-buffer-overflow.patch
osst-fix-read-buffer-overflow.patch
gdth-unmap-ccb_phys-when-scsi_add_host-fails-in-gdth_eisa_probe_one.patch
drivers-scsi-libsas-use-sam_good.patch
ncr5380-bit-mr_dma_mode-set-twice-in-ncr5380_transfer_dma.patch
drivers-scsi-remove-unnecessary-null-test.patch
drivers-message-move-dereference-after-null-test.patch
scsi-pmcraid-redundant-check-in-pmcraid_check_ioctl_buffer.patch
mpt-fusion-convert-to-seq_file.patch
g_ncr5380-remove-misleading-pnp-error-message.patch
g_ncr5380-fix-broken-mmio-compilation.patch
g_ncr5380-fix-missing-pnp_device_detach-and-scsi_unregister-on-rmmod.patch
dc395x-decrease-iteration-for-tag_number-of-max_command-in-start_scsi.patch
drivers-scsi-correct-the-size-argument-to-kmalloc.patch
scsi-remove-superfluous-null-pointer-check-from-scsi_kill_request.patch
mpt2sas-fix-confusion-in-_scsih_sas_device_status_change_event.patch
drivers-scsi-remove-uses-of-nipquad-use-%pi4.patch
drivers-firmware-iscsi_ibftc-remove-nipquad_fmt-use-%pi4.patch
drivers-scsi-hpsac-fix-section-mismatch.patch
scsi-sdc-quiet-all-sparse-noise.patch
drivers-scsi-bfa-bfad_imc-eliminate-useless-code.patch
lpfc-two-branches-the-same-in-lpfc_decode_firmware_rev.patch
paride-fix-off-by-one-test.patch
drivers-staging-tm6000-tm6000-videoc-correct-null-test.patch
drivers-staging-go7007-s2250-loaderc-eliminate-useless-code.patch
rt2860-sta_ioctlc-two-branches-the-same-in-rt_ioctl_giwscan.patch
serqt_usb2-two-branches-the-same-in-qt_set_termios.patch
comedi-g1-3-status-registers-not-read-in-ni_gpct_to_660x_register.patch
musb-test-always-evaluates-to-false.patch
drivers-usb-serial-eliminate-useless-code.patch
sis-usb2vga-driver-support-kairens-usb-vga-adaptor-usb20svga-mb-plus.patch
vfs-fix-vfs_rename_dir-for-fs_rename_does_d_move-filesystems.patch
vfs-improve-comment-describing-fget_light.patch
ecryptfs-another-lockdep-issue.patch
xtensa-convert-to-asm-generic-hardirqh.patch
xtensa-includecheck-fix-vectorss.patch
modpost-support-objects-with-more-than-64k-sections.patch
mm.patch
define-madv_hugepage.patch
mm-clean-up-mm_counter.patch
mm-avoid-false-sharing-of-mm_counter.patch
mm-avoid-false-sharing-of-mm_counter-checkpatch-fixes.patch
mm-count-swap-usage.patch
mm-count-swap-usage-checkpatch-fixes.patch
mm-add-lowmem-detection-logic.patch
mm-add-lowmem-detection-logic-fix.patch
mm-count-lowmem-rss.patch
mm-count-lowmem-rss-checkpatch-fixes.patch
mm-introduce-dump_page-and-print-symbolic-flag-names.patch
page-allocator-reduce-fragmentation-in-buddy-allocator-by-adding-buddies-that-are-merging-to-the-tail-of-the-free-lists.patch
mlock_vma_pages_range-never-return-negative-value.patch
mlock_vma_pages_range-only-return-success-or-failure.patch
mm-use-rlimit-helpers.patch
vmscan-check-high-watermark-after-shrink-zone.patch
vmscan-check-high-watermark-after-shrink-zone-fix.patch
vmscan-get_scan_ratio-cleanup.patch
mm-lockdep-annotate-reclaim-context-to-zone-reclaim-too.patch
mm-page_allocc-remove-duplicate-call-to-trace_mm_page_free_direct.patch
mm-page_allocc-adjust-a-call-site-to-trace_mm_page_free_direct.patch
mm-remove-function-free_hot_page.patch
mm-remove-function-free_hot_page-fix.patch
mm-restore-zone-all_unreclaimable-to-independence-word.patch
mm-restore-zone-all_unreclaimable-to-independence-word-fix.patch
mm-restore-zone-all_unreclaimable-to-independence-word-fix-2.patch
mm-fix-mbind-vma-merge-problem.patch
mm-fix-mbind-vma-merge-problem-fix.patch
memory-hotplug-create-sys-firmware-memmap-entry-for-new-memory.patch
memory-hotplug-create-sys-firmware-memmap-entry-for-new-memory-fix.patch
mm-mempolicyc-fix-indentation-of-the-comments-of-do_migrate_pages.patch
mm-migratec-kill-anon-local-variable-from-migrate_page_copy.patch
mm-swapfilec-fix-nr_good_pages-calculation.patch
bootmem-avoid-dma32-zone-by-default.patch
vfs-take-f_lock-on-modifying-f_mode-after-open-time.patch
readahead-introduce-fmode_random-for-posix_fadv_random.patch
include-linux-fsh-convert-fmode_-constants-to-hex.patch
mm-memcontrolc-fix-integer-as-null-pointer-sparse-warning.patch
frv-remove-pci_dma_sync_single-and-pci_dma_sync_sg.patch
frv-duplicate-output_buffer-of-e03.patch
frv-duplicate-output_buffer-of-e03-checkpatch-fixes.patch
cpuidle-menu-remove-8-bytes-of-padding-on-64-bit-builds.patch
cris-convert-to-use-arch_gettimeoffset.patch
cryptocop-fix-assertion-in-create_output_descriptors.patch
cris-v32-typo-in-crisv32_arbiter_unwatch.patch
drivers-block-floppyc-convert-some-include-asm-to-include-linux.patch
drivers-block-floppyc-define-space-and-column-neatening.patch
drivers-block-floppyc-use-pr_level.patch
drivers-block-floppyc-remove-unnecessary-braces.patch
drivers-block-floppyc-remove-used-once-check_ready-macro.patch
drivers-block-floppyc-hoist-assigns-from-ifs-neatening.patch
drivers-block-floppyc-remove-last_out-macro.patch
drivers-block-floppyc-comment-neatening-and-remove-naked.patch
drivers-block-floppyc-remove-clearstruct-macro-use-memset.patch
drivers-block-floppyc-indent-a-comment.patch
drivers-block-floppyc-remove-in-out-macros-indent-switch-case.patch
drivers-block-floppyc-remove-a-few-spaces-from-function-casts.patch
drivers-block-floppyc-remove-macro-lock_fdc.patch
drivers-block-floppyc-add-debug_dcl-macro.patch
drivers-block-floppyc-remove-clearf-setf-and-testf-macros.patch
drivers-block-floppyc-remove-most-uses-of-call-and-ecall-macros.patch
drivers-block-floppyc-remove-copyin-copyout-and-ecall-macros.patch
drivers-block-floppyc-remove-macros-call-wait-and-iwait.patch
drivers-block-floppyc-convert-int-1-0-to-bool-true-false.patch
drivers-block-floppyc-move-leading-and-to-preceding-line.patch
drivers-block-floppyc-remove-define-device_name-floppy.patch
drivers-block-floppyc-convert-int-initialising-to-bool-initialized.patch
drivers-block-floppyc-add-function-is_ready_state.patch
drivers-block-floppyc-remove-unnecessary-return-and-braces.patch
drivers-block-floppyc-remove-repeat-macro.patch
drivers-block-floppyc-unclutter-redo_fd_request-logic.patch
drivers-block-floppyc-remove-unnecessary-argument-from-reschedule_timeout.patch
drivers-block-floppyc-remove-define-floppy_sanity_check.patch
drivers-block-floppyc-dprint-neatening.patch
drivers-block-floppyc-use-__func__-where-appropriate.patch
drivers-block-floppyc-use-%pf-in-logging-messages.patch
drivers-block-floppyc-remove-some-unnecessary-casting.patch
drivers-block-floppyc-convert-raw_cmd_copyin-from-while1-to-label-goto.patch
drivers-block-floppyc-add-__func__-to-debugt.patch
drivers-block-floppyc-remove-obfuscating-code2size-macro.patch
drivers-block-floppyc-remove-misleading-used-once-fd_ioctl_allowed-macro.patch
drivers-block-floppyc-remove-unnecessary-casting-in-fd_ioctl.patch
uml-linec-avoid-null-pointer-dereference.patch
uml-linec-avoid-null-pointer-dereference-simplify.patch
mfgpt-move-clocksource-menu.patch
prctl-add-pr_set_proctitle_area-option-for-prctl.patch
kernel-cpuc-delete-deprecated-definition-in-cpu_up.patch
init-mainc-improve-usability-in-case-of-init-binary-failure.patch
init-initramfsc-fix-symbol-shadows-an-earlier-one-noise.patch
cpumask-let-num__cpus-function-always-return-unsigned-values.patch
fs-use-rlimit-helpers.patch
nodemaskh-remove-macro-any_online_node.patch
smp-fix-documentation-in-include-linux-smph.patch
init-mainc-make-setup_max_cpus-static-for-smp.patch
drivers-misc-iwmc3200top-mainc-eliminate-useless-code.patch
eisa-fix-coding-style-for-eisa-bus-code.patch
resources-introduce-generic-page_is_ram.patch
resources-introduce-generic-page_is_ram-fix.patch
resources-introduce-generic-page_is_ram-fix-2.patch
x86-remove-bios-data-range-from-e820.patch
x86-use-the-generic-page_is_ram.patch
python-change-scripts-to-use-system-python-instead-of-env.patch
kernel-exitc-fix-shadows-sparse-warning.patch
scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses.patch
scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses-v2.patch
scripts-get_maintainerpl-add-sections-print-entire-matched-subsystem.patch
scripts-get_maintainerpl-change-sections-to-print-in-the-same-style-as-maintainers.patch
maintainers-remove-amd-geode-f-arch-x86-kernel-geode_32c.patch
maintainers-remove-hayes-esp-serial-driver.patch
maintainers-update-performance-events-f-patterns.patch
maintainers-starmode-radio-ip-strip-moved-to-staging.patch
maintainers-wavelan-moved-to-staging.patch
lib-stringc-simplify-stricmp.patch
lib-stringc-simplify-strnstr.patch
mmc-remove-const-from-tmio-mmc-platform-data-v2.patch
mmc-balance-tmio-mmc-cell-enable-disable-calls.patch
ricoh_mmc-port-from-driver-to-pci-quirk.patch
davinci-mmc-add-support-for-8bit-mmc-cards.patch
davinci-mmc-add-a-function-to-control-reset-state-of-the-controller.patch
davinci-mmc-updates-to-suspend-resume-implementation.patch
mmc-atmel-host-kconfig-cleanup-for-everyone-else.patch
mmc-bfin_sdh-fix-unused-sg-warning-on-bf51x-bf52x-systems.patch
mmc-bfin_sdh-drop-redundant-mmc-depend-string.patch
mmc-bfin_sdh-set-timeout-based-on-actual-card-data.patch
sdio-add-quirk-to-clamp-byte-mode-transfer.patch
sdio-recognize-io-card-without-powercycle.patch
scripts-checkpatchpl-add-warn-on-sizeof.patch
checkpatch-trivial-fix-for-trailing-statements-check.patch
checkpatchpl-allow-80-char-lines-for-logging-functions-not-just-printk.patch
checkpatch-fix-false-positive-on-__initconst.patch
checkpatchpl-add-union-and-struct-to-the-exceptions-list.patch
checkpatchpl-extend-list-of-expected-to-be-const-structures.patch
checkpatchpl-warn-if-an-adding-line-introduce-spaces-before-tabs.patch
proc-do-translation-unlink-atomically-at-remove_proc_entry.patch
proc-warn-on-non-existing-proc-entries.patch
coredump-unify-dump_seek-implementations-for-each-binfmt_c.patch
coredump-move-dump_write-and-dump_seek-into-a-header-file.patch
elf-coredump-replace-elf_core_extra_-macros-by-functions.patch
elf-coredump-make-offset-calculation-process-and-writing-process-explicit.patch
elf-coredump-add-extended-numbering-support.patch
mm-pass-mm-flags-as-a-coredump-parameter-for-consistency.patch
mm-pass-mm-flags-as-a-coredump-parameter-for-consistency-fix.patch
console-limit-the-range-of-vgacon_soft_scrollback_size.patch
console-vgaconc-mark-file-local-symbol-static.patch
xen-add-kconfig-menu.patch
rtc-mxc-fix-memory-leak.patch
rtc-ep93xxc-cleanup-probe-remove-routines.patch
rtc-add-rtc-davinci-v3.patch
rtc-pcf2123-move-pcf2123_remove-to-devexittext.patch
rtc-at91sam9-correct-size-given-to-memset.patch
rtc-twl-storage-class-should-be-before-const-qualifier.patch
gpio-add-driver-for-max7300-i2c-gpio-extender.patch
pca953x-minor-include-cleanup.patch
gpio-introduce-gpio_request_one-and-friends.patch
gpio-introduce-gpio_request_one-and-friends-update.patch
timbgpio-add-support-for-interrupt-triggering-on-both-flanks.patch
asiliantfb-fix-test-of-unsigned-in-asiliant_calc_dclk2.patch
fbdev-bf54x-lq043fb-bfin-t350mcqb-fb-drop-custom-mmap-handler.patch
broadsheetfb-add-multiple-panel-type-support.patch
viafb-deprecate-private-ioctls.patch
viafb-remove-dead-code.patch
viafb-split-global-index-up.patch
viafb-remove-the-remaining-via_res_-uses.patch
viafb-some-dvi-cleanup.patch
viafb-yet-another-dead-code-removal.patch
broadsheetfb-add-mmio-hooks.patch
imxfb-correct-location-of-callbacks-in-suspend-and-resume.patch
intelfb-new-maintainer.patch
fbdev-remove-obsolete-config_fb_soft_cursor.patch
hfsplus-identify-journal-info-block-in-volume-header.patch
hfsplus-fix-journal-detection.patch
cgroup-introduce-cancel_attach.patch
cgroup-introduce-coalesce-css_get-and-css_put.patch
cgroups-revamp-subsys-array.patch
cgroups-subsystem-module-loading-interface.patch
cgroups-subsystem-module-loading-interface-fix.patch
cgroups-subsystem-module-unloading.patch
cgroups-subsystem-module-unloading-fix.patch
cgroups-net_cls-as-module.patch
cgroups-fix-contents-in-cgroups-documentation.patch
cgroups-blkio-subsystem-as-module.patch
cgroups-clean-up-cgroup_pidlist_find-a-bit.patch
memcg-add-interface-to-move-charge-at-task-migration.patch
memcg-move-charges-of-anonymous-page.patch
memcg-move-charges-of-anonymous-page-cleanup.patch
memcg-improve-performance-in-moving-charge.patch
memcg-avoid-oom-during-moving-charge.patch
memcg-move-charges-of-anonymous-swap.patch
memcg-move-charges-of-anonymous-swap-fix.patch
memcg-move-charges-of-anonymous-swap-fix-2.patch
memcg-improve-performance-in-moving-swap-charge.patch
memcg-improve-performance-in-moving-swap-charge-fix.patch
cgroup-implement-eventfd-based-generic-api-for-notifications.patch
cgroup-implement-eventfd-based-generic-api-for-notifications-kconfig-fix.patch
cgroup-implement-eventfd-based-generic-api-for-notifications-fixes.patch
memcg-extract-mem_group_usage-from-mem_cgroup_read.patch
memcg-rework-usage-of-stats-by-soft-limit.patch
memcg-implement-memory-thresholds.patch
memcg-implement-memory-thresholds-checkpatch-fixes.patch
memcg-implement-memory-thresholds-checkpatch-fixes-fix.patch
memcg-typo-in-comment-to-mem_cgroup_print_oom_info.patch
tracehooks-kill-some-pt_ptraced-checks.patch
tracehooks-check-pt_ptraced-before-reporting-the-single-step.patch
ptrace_signal-check-pt_ptraced-before-reporting-a-signal.patch
export-__ptrace_detach-and-do_notify_parent_cldstop.patch
reorder-the-code-in-kernel-ptracec.patch
implement-utrace-ptrace.patch
utrace-core.patch
utrace-core-utrace-fix-utrace_maybe_reap-vs-find_matching_engine-race.patch
copy_signal-cleanup-use-zalloc-and-remove-initializations.patch
copy_signal-cleanup-kill-taskstats_tgid_init-and-acct_init_pacct.patch
copy_signal-cleanup-clean-thread_group_cputime_init.patch
copy_signal-cleanup-clean-tty_audit_fork.patch
ipc-use-rlimit-helpers.patch
ipmi-add-parameter-to-limit-cpu-usage-in-kipmid.patch
rcu-add-rcustring-adt-for-rcu-protected-strings.patch
add-a-kernel_address-that-works-for-data-too.patch
sysctl-add-proc_rcu_string-to-manage-sysctls-using-rcu-strings.patch
sysctl-use-rcu-strings-for-core_pattern-sysctl.patch
sysctl-add-call_usermodehelper_cleanup.patch
sysctl-convert-modprobe_path-to-proc_rcu_string.patch
sysctl-convert-poweroff_command-to-proc_rcu_string.patch
sysctl-convert-hotplug-helper-string-to-proc_rcu_string.patch
sysctl-use-rcu-protected-sysctl-for-ocfs-group-add-helper.patch
delay-accounting-re-implement-c-for-getdelaysc-to-report-information-on-a-target-command.patch
delay-accounting-re-implement-c-for-getdelaysc-to-report-information-on-a-target-command-checkpatch-fixes.patch
drivers-edac-introduce-missing-kfree.patch
documentation-dma-apitxt-remove-deprecated-function-descriptions.patch
w1-fix-test-in-ds2482_wait_1wire_idle.patch
drivers-char-mmtimerc-eliminate-useless-code.patch
markup_oopspl-add-options-to-improve-cross-compilation-environments.patch
markup_oopspl-add-options-to-improve-cross-compilation-environments-update.patch
kernel-kfifoc-fix-integer-as-null-pointer-sparse-warning.patch
vfs-take-2add-set_page_dirty_notag.patch
reiser4-vfs-add-super_operationssync_inodes-2.patch
reiser4-export-remove_from_page_cache.patch
reiser4-export-remove_from_page_cache-fix.patch
reiser4-export-find_get_pages.patch
reiser4.patch
reiser4-adjust-to-the-new-aops.patch
reiser4-adjust-to-the-new-aops-fixup.patch
reiser4-remove-simple_prepare_write-usage.patch
reiser4-remove-simple_prepare_write-usage-checkpatch-fixes.patch
fs-symlink-write_begin-allocation-context-fix-reiser4-fix.patch
reiser4-handling-error-returned-by-d_obtain_alias-fixup.patch
reiser4-update-names-of-quota-methods.patch
reiser4-use-set_page_dirty_notag.patch
fs-reiser4-add-parenths-around-x-y.patch
fs-reiser4-contextc-current_is_pdflush-got-removed.patch
reiser4-fix.patch
reiser4-rename-psched-to-dispatch.patch
reiser4-drop-journal-info.patch
reiser4-fix-compile-warnings.patch
reiser4-reduce-frame-size-of-reiser4_init_super_data.patch
reiser4-reduce-frame-size-of-reiser4_init_super_data-fixup.patch
reiser4-some-changes-from-reiser4-2631-patch.patch
reiser4-some-comments-were-still-mentioning-pdflush.patch
reiser4-generic_sync_sb_inodes-doesnt-exist-anymore.patch
reiser4-fixed-null-pointer-dereference.patch
make-sure-nobodys-leaking-resources.patch
journal_add_journal_head-debug.patch
releasing-resources-with-children.patch
make-frame_pointer-default=y.patch
mutex-subsystem-synchro-test-module.patch
mutex-subsystem-synchro-test-module-add-missing-header-file.patch
slab-leaks3-default-y.patch
put_bh-debug.patch
add-debugging-aid-for-memory-initialisation-problems.patch
workaround-for-a-pci-restoring-bug.patch
prio_tree-debugging-patch.patch
single_open-seq_release-leak-diagnostics.patch
add-a-refcount-check-in-dput.patch
getblk-handle-2tb-devices.patch
getblk-handle-2tb-devices-fix.patch
notify_change-callers-must-hold-i_mutex.patch


2010-01-28 18:57:40

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2010-01-28-01-36 uploaded (sched.c + percpu)

On 01/28/10 01:36, [email protected] wrote:
> The mm-of-the-moment snapshot 2010-01-28-01-36 has been uploaded to
>
> http://userweb.kernel.org/~akpm/mmotm/
>
> and will soon be available at
>
> git://zen-kernel.org/kernel/mmotm.git
>
> It contains the following patches against 2.6.33-rc5:


when CONFIG_SMP is not enabled:

kernel/sched.c:10915: error: 'percpu_counter_batch' undeclared (first use in this function)



--
~Randy

2010-01-28 18:59:32

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2010-01-28-01-36 uploaded (media/radio/saa7706h.c)

On 01/28/10 01:36, [email protected] wrote:
> The mm-of-the-moment snapshot 2010-01-28-01-36 has been uploaded to
>
> http://userweb.kernel.org/~akpm/mmotm/
>
> and will soon be available at
>
> git://zen-kernel.org/kernel/mmotm.git
>
> It contains the following patches against 2.6.33-rc5:


This driver needs to #include <linux/delay.h>:

drivers/media/radio/saa7706h.c:220: error: implicit declaration of function 'msleep'


--
~Randy

2010-01-28 20:50:40

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2010-01-28-01-36 uploaded (elfcore/compat_binfmt_elf)

On Thu, 28 Jan 2010 01:36:55 -0800 [email protected] wrote:

> The mm-of-the-moment snapshot 2010-01-28-01-36 has been uploaded to
>
> http://userweb.kernel.org/~akpm/mmotm/
>
> and will soon be available at
>
> git://zen-kernel.org/kernel/mmotm.git
>
> It contains the following patches against 2.6.33-rc5:


> elf-coredump-replace-elf_core_extra_-macros-by-functions.patch
> elf-coredump-make-offset-calculation-process-and-writing-process-explicit.patch
> elf-coredump-add-extended-numbering-support.patch


These patches can cause build errors. See arch/x86/Kconfig:

config IA32_EMULATION
bool "IA32 Emulation"
depends on X86_64
select COMPAT_BINFMT_ELF

COMPAT_BINFMT_ELF can be enabled (selected) even when BINFMT_ELF is not
enabled (due to "select" not looking at dependencies).

That causes the kernel/Makefile of elfcore not to be built:

diff -puN arch/ia64/kernel/Makefile~elf-coredump-replace-elf_core_extra_-macros-by-functions arch/ia64/kernel/Makefile
--- a/arch/ia64/kernel/Makefile~elf-coredump-replace-elf_core_extra_-macros-by-functions
+++ a/arch/ia64/kernel/Makefile
@@ -47,6 +47,8 @@ endif
obj-$(CONFIG_DMAR) += pci-dma.o
obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o

+obj-$(CONFIG_BINFMT_ELF) += elfcore.o

since only COMPAT_BINFMT_ELF is enabled but not BINFMT_ELF.

So then the errors are:

fs/built-in.o: In function `elf_core_dump':
compat_binfmt_elf.c:(.text+0x551e8): undefined reference to `elf_core_extra_phdrs'
compat_binfmt_elf.c:(.text+0x55413): undefined reference to `elf_core_extra_data_size'
compat_binfmt_elf.c:(.text+0x556c4): undefined reference to `elf_core_write_extra_phdrs'
compat_binfmt_elf.c:(.text+0x559fd): undefined reference to `elf_core_write_extra_data'



---
~Randy

2010-01-28 23:44:53

by Anton Blanchard

[permalink] [raw]
Subject: Re: mmotm 2010-01-28-01-36 uploaded (sched.c + percpu)


Hi Randy,

> when CONFIG_SMP is not enabled:
>
> kernel/sched.c:10915: error: 'percpu_counter_batch' undeclared (first use in this function)

Did 1/2 make it into mmotm?

Anton

---

[PATCH 1/2] percpu_counter: Make __percpu_counter_add an inline function on UP

Even though batch isn't used on UP, we may want to pass one in to keep the
SMP and UP code paths similar. Convert __percpu_counter_add to an inline
function so we wont get variable unused warnings if we do.

Signed-off-by: Anton Blanchard <[email protected]>
---

diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index a7684a5..794662b 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -98,9 +98,6 @@ static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
fbc->count = amount;
}

-#define __percpu_counter_add(fbc, amount, batch) \
- percpu_counter_add(fbc, amount)
-
static inline void
percpu_counter_add(struct percpu_counter *fbc, s64 amount)
{
@@ -109,6 +106,12 @@ percpu_counter_add(struct percpu_counter *fbc, s64 amount)
preempt_enable();
}

+static inline void
+__percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
+{
+ percpu_counter_add(fbc, amount);
+}
+
static inline s64 percpu_counter_read(struct percpu_counter *fbc)
{
return fbc->count;

2010-01-29 01:47:37

by Hatayama, Daisuke

[permalink] [raw]
Subject: Re: mmotm 2010-01-28-01-36 uploaded (elfcore/compat_binfmt_elf)

From: Randy Dunlap <[email protected]>
Subject: Re: mmotm 2010-01-28-01-36 uploaded (elfcore/compat_binfmt_elf)
Date: Thu, 28 Jan 2010 12:48:29 -0800

> On Thu, 28 Jan 2010 01:36:55 -0800 [email protected] wrote:
>
>> The mm-of-the-moment snapshot 2010-01-28-01-36 has been uploaded to
>>
>> http://userweb.kernel.org/~akpm/mmotm/
>>
>> and will soon be available at
>>
>> git://zen-kernel.org/kernel/mmotm.git
>>
>> It contains the following patches against 2.6.33-rc5:
>
>
>> elf-coredump-replace-elf_core_extra_-macros-by-functions.patch
>> elf-coredump-make-offset-calculation-process-and-writing-process-explicit.patch
>> elf-coredump-add-extended-numbering-support.patch
>
>
> These patches can cause build errors. See arch/x86/Kconfig:
>
> config IA32_EMULATION
> bool "IA32 Emulation"
> depends on X86_64
> select COMPAT_BINFMT_ELF
>
> COMPAT_BINFMT_ELF can be enabled (selected) even when BINFMT_ELF is not
> enabled (due to "select" not looking at dependencies).
>
> That causes the kernel/Makefile of elfcore not to be built:
>
> diff -puN arch/ia64/kernel/Makefile~elf-coredump-replace-elf_core_extra_-macros-by-functions arch/ia64/kernel/Makefile
> --- a/arch/ia64/kernel/Makefile~elf-coredump-replace-elf_core_extra_-macros-by-functions
> +++ a/arch/ia64/kernel/Makefile
> @@ -47,6 +47,8 @@ endif
> obj-$(CONFIG_DMAR) += pci-dma.o
> obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
>
> +obj-$(CONFIG_BINFMT_ELF) += elfcore.o
>
> since only COMPAT_BINFMT_ELF is enabled but not BINFMT_ELF.
>
> So then the errors are:
>
> fs/built-in.o: In function `elf_core_dump':
> compat_binfmt_elf.c:(.text+0x551e8): undefined reference to `elf_core_extra_phdrs'
> compat_binfmt_elf.c:(.text+0x55413): undefined reference to `elf_core_extra_data_size'
> compat_binfmt_elf.c:(.text+0x556c4): undefined reference to `elf_core_write_extra_phdrs'
> compat_binfmt_elf.c:(.text+0x559fd): undefined reference to `elf_core_write_extra_data'

It seems exactly as you say. I overlooked the case where
CONFIG_COMPAT_BINFMT_ELF is enabled but CONFIG_BINFMT_ELF disabled.

I've attached the patch reflecting the suggestion from Randy
to elf-coredump-replace-elf_core_extra_-macros-by-functions.patch.

Thanks.
HATAYAMA, Daisuke
==
elf_core_dump() and elf_fdpic_core_dump() use #ifdef and the
corresponding macro for hiding _multiline_ logics in functions. This
patch removes architectures not implemeonting ELF_CORE_EXTRA_*, we use
weak functions in order to reduce a range of modification.

This cleanup is for my next patches, but I think this cleanup itself
is worth doing regardless of my firnal purpose.

Signed-off-by: Daisuke HATAYAMA <[email protected]>
Cc: "Luck, Tony" <[email protected]>
Cc: Jeff Dike <[email protected]>
Cc: David Howells <[email protected]>
Cc: Greg Ungerer <[email protected]>
Cc: Roland McGrath <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
arch/ia64/ia32/binfmt_elf32.c | 1 +
arch/ia64/ia32/elfcore32.h | 17 ++++++++++
arch/ia64/include/asm/elf.h | 48 -----------------------------
arch/ia64/kernel/Makefile | 2 +
arch/ia64/kernel/elfcore.c | 64 +++++++++++++++++++++++++++++++++++++++
arch/um/sys-i386/Makefile | 2 +
arch/um/sys-i386/asm/elf.h | 43 --------------------------
arch/um/sys-i386/elfcore.c | 67 +++++++++++++++++++++++++++++++++++++++++
fs/binfmt_elf.c | 14 +++-----
fs/binfmt_elf_fdpic.c | 14 +++-----
include/linux/elf.h | 2 +
include/linux/elfcore.h | 16 ++++++++++
kernel/Makefile | 3 ++
kernel/elfcore.c | 23 ++++++++++++++
14 files changed, 207 insertions(+), 109 deletions(-)
create mode 100644 arch/ia64/kernel/elfcore.c
create mode 100644 arch/um/sys-i386/elfcore.c
create mode 100644 kernel/elfcore.c

diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index c69552b..2328f44 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -43,6 +43,7 @@ randomize_stack_top(unsigned long stack_top);
#undef SET_PERSONALITY
#define SET_PERSONALITY(ex) elf32_set_personality()

+#undef elf_read_implies_exec
#define elf_read_implies_exec(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack))

/* Ugly but avoids duplication */
diff --git a/arch/ia64/ia32/elfcore32.h b/arch/ia64/ia32/elfcore32.h
index 6577257..7877601 100644
--- a/arch/ia64/ia32/elfcore32.h
+++ b/arch/ia64/ia32/elfcore32.h
@@ -8,6 +8,8 @@
#ifndef _ELFCORE32_H_
#define _ELFCORE32_H_

+#include <linux/elf.h>
+
#include <asm/intrinsics.h>
#include <asm/uaccess.h>

@@ -145,4 +147,19 @@ elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
return 1;
}

+/*
+ * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
+ * extra segments containing the gate DSO contents. Dumping its
+ * contents makes post-mortem fully interpretable later without matching up
+ * the same kernel and hardware config to see what PC values meant.
+ * Dumping its extra ELF program headers includes all the other information
+ * a debugger needs to easily find how the gate DSO was being used.
+ */
+extern Elf32_Half elf_core_extra_phdrs(void);
+extern int
+elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit);
+extern int
+elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
+
#endif /* _ELFCORE32_H_ */
diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h
index e14108b..60af1ef 100644
--- a/arch/ia64/include/asm/elf.h
+++ b/arch/ia64/include/asm/elf.h
@@ -217,54 +217,6 @@ do { \
NEW_AUX_ENT(AT_SYSINFO_EHDR, (unsigned long) GATE_EHDR); \
} while (0)

-
-/*
- * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
- * extra segments containing the gate DSO contents. Dumping its
- * contents makes post-mortem fully interpretable later without matching up
- * the same kernel and hardware config to see what PC values meant.
- * Dumping its extra ELF program headers includes all the other information
- * a debugger needs to easily find how the gate DSO was being used.
- */
-#define ELF_CORE_EXTRA_PHDRS (GATE_EHDR->e_phnum)
-#define ELF_CORE_WRITE_EXTRA_PHDRS \
-do { \
- const struct elf_phdr *const gate_phdrs = \
- (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \
- int i; \
- Elf64_Off ofs = 0; \
- for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \
- struct elf_phdr phdr = gate_phdrs[i]; \
- if (phdr.p_type == PT_LOAD) { \
- phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \
- phdr.p_filesz = phdr.p_memsz; \
- if (ofs == 0) { \
- ofs = phdr.p_offset = offset; \
- offset += phdr.p_filesz; \
- } \
- else \
- phdr.p_offset = ofs; \
- } \
- else \
- phdr.p_offset += ofs; \
- phdr.p_paddr = 0; /* match other core phdrs */ \
- DUMP_WRITE(&phdr, sizeof(phdr)); \
- } \
-} while (0)
-#define ELF_CORE_WRITE_EXTRA_DATA \
-do { \
- const struct elf_phdr *const gate_phdrs = \
- (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \
- int i; \
- for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \
- if (gate_phdrs[i].p_type == PT_LOAD) { \
- DUMP_WRITE((void *) gate_phdrs[i].p_vaddr, \
- PAGE_ALIGN(gate_phdrs[i].p_memsz)); \
- break; \
- } \
- } \
-} while (0)
-
/*
* format for entries in the Global Offset Table
*/
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index e123634..3bdfe80 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -47,6 +47,8 @@ endif
obj-$(CONFIG_DMAR) += pci-dma.o
obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o

+obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+
# fp_emulate() expects f2-f5,f16-f31 to contain the user-level state.
CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31

diff --git a/arch/ia64/kernel/elfcore.c b/arch/ia64/kernel/elfcore.c
new file mode 100644
index 0000000..57a2298
--- /dev/null
+++ b/arch/ia64/kernel/elfcore.c
@@ -0,0 +1,64 @@
+#include <linux/elf.h>
+#include <linux/coredump.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+
+#include <asm/elf.h>
+
+
+Elf64_Half elf_core_extra_phdrs(void)
+{
+ return GATE_EHDR->e_phnum;
+}
+
+int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ const struct elf_phdr *const gate_phdrs =
+ (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);
+ int i;
+ Elf64_Off ofs = 0;
+
+ for (i = 0; i < GATE_EHDR->e_phnum; ++i) {
+ struct elf_phdr phdr = gate_phdrs[i];
+
+ if (phdr.p_type == PT_LOAD) {
+ phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz);
+ phdr.p_filesz = phdr.p_memsz;
+ if (ofs == 0) {
+ ofs = phdr.p_offset = offset;
+ offset += phdr.p_filesz;
+ } else {
+ phdr.p_offset = ofs;
+ }
+ } else {
+ phdr.p_offset += ofs;
+ }
+ phdr.p_paddr = 0; /* match other core phdrs */
+ *size += sizeof(phdr);
+ if (*size > limit || !dump_write(file, &phdr, sizeof(phdr)))
+ return 0;
+ }
+ return 1;
+}
+
+int elf_core_write_extra_data(struct file *file, size_t *size,
+ unsigned long limit)
+{
+ const struct elf_phdr *const gate_phdrs =
+ (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);
+ int i;
+
+ for (i = 0; i < GATE_EHDR->e_phnum; ++i) {
+ if (gate_phdrs[i].p_type == PT_LOAD) {
+ void *addr = (void *)gate_phdrs[i].p_vaddr;
+ size_t memsz = PAGE_ALIGN(gate_phdrs[i].p_memsz);
+
+ *size += memsz;
+ if (*size > limit || !dump_write(file, addr, memsz))
+ return 0;
+ break;
+ }
+ }
+ return 1;
+}
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index 1b549bc..804b28d 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -6,6 +6,8 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
sys_call_table.o tls.o

+obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+
subarch-obj-y = lib/semaphore_32.o lib/string_32.o
subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
subarch-obj-$(CONFIG_MODULES) += kernel/module.o
diff --git a/arch/um/sys-i386/asm/elf.h b/arch/um/sys-i386/asm/elf.h
index 7708854..e64cd41 100644
--- a/arch/um/sys-i386/asm/elf.h
+++ b/arch/um/sys-i386/asm/elf.h
@@ -116,47 +116,4 @@ do { \
} \
} while (0)

-/*
- * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
- * extra segments containing the vsyscall DSO contents. Dumping its
- * contents makes post-mortem fully interpretable later without matching up
- * the same kernel and hardware config to see what PC values meant.
- * Dumping its extra ELF program headers includes all the other information
- * a debugger needs to easily find how the vsyscall DSO was being used.
- */
-#define ELF_CORE_EXTRA_PHDRS \
- (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
-
-#define ELF_CORE_WRITE_EXTRA_PHDRS \
-if ( vsyscall_ehdr ) { \
- const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
- const struct elf_phdr *const phdrp = \
- (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
- int i; \
- Elf32_Off ofs = 0; \
- for (i = 0; i < ehdrp->e_phnum; ++i) { \
- struct elf_phdr phdr = phdrp[i]; \
- if (phdr.p_type == PT_LOAD) { \
- ofs = phdr.p_offset = offset; \
- offset += phdr.p_filesz; \
- } \
- else \
- phdr.p_offset += ofs; \
- phdr.p_paddr = 0; /* match other core phdrs */ \
- DUMP_WRITE(&phdr, sizeof(phdr)); \
- } \
-}
-#define ELF_CORE_WRITE_EXTRA_DATA \
-if ( vsyscall_ehdr ) { \
- const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
- const struct elf_phdr *const phdrp = \
- (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
- int i; \
- for (i = 0; i < ehdrp->e_phnum; ++i) { \
- if (phdrp[i].p_type == PT_LOAD) \
- DUMP_WRITE((void *) phdrp[i].p_vaddr, \
- phdrp[i].p_filesz); \
- } \
-}
-
#endif
diff --git a/arch/um/sys-i386/elfcore.c b/arch/um/sys-i386/elfcore.c
new file mode 100644
index 0000000..30cac52
--- /dev/null
+++ b/arch/um/sys-i386/elfcore.c
@@ -0,0 +1,67 @@
+#include <linux/elf.h>
+#include <linux/coredump.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+
+#include <asm/elf.h>
+
+
+Elf32_Half elf_core_extra_phdrs(void)
+{
+ return vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0;
+}
+
+int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ if ( vsyscall_ehdr ) {
+ const struct elfhdr *const ehdrp =
+ (struct elfhdr *) vsyscall_ehdr;
+ const struct elf_phdr *const phdrp =
+ (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff);
+ int i;
+ Elf32_Off ofs = 0;
+
+ for (i = 0; i < ehdrp->e_phnum; ++i) {
+ struct elf_phdr phdr = phdrp[i];
+
+ if (phdr.p_type == PT_LOAD) {
+ ofs = phdr.p_offset = offset;
+ offset += phdr.p_filesz;
+ } else {
+ phdr.p_offset += ofs;
+ }
+ phdr.p_paddr = 0; /* match other core phdrs */
+ *size += sizeof(phdr);
+ if (*size > limit
+ || !dump_write(file, &phdr, sizeof(phdr)))
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int elf_core_write_extra_data(struct file *file, size_t *size,
+ unsigned long limit)
+{
+ if ( vsyscall_ehdr ) {
+ const struct elfhdr *const ehdrp =
+ (struct elfhdr *) vsyscall_ehdr;
+ const struct elf_phdr *const phdrp =
+ (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff);
+ int i;
+
+ for (i = 0; i < ehdrp->e_phnum; ++i) {
+ if (phdrp[i].p_type == PT_LOAD) {
+ void *addr = (void *) phdrp[i].p_vaddr;
+ size_t filesz = phdrp[i].p_filesz;
+
+ *size += filesz;
+ if (*size > limit
+ || !dump_write(file, addr, filesz))
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index a0fe475..1b7e9de 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1901,9 +1901,7 @@ static int elf_core_dump(struct coredump_params *cprm)
* Please check DEFAULT_MAX_MAP_COUNT definition when you modify here.
*/
segs = current->mm->map_count;
-#ifdef ELF_CORE_EXTRA_PHDRS
- segs += ELF_CORE_EXTRA_PHDRS;
-#endif
+ segs += elf_core_extra_phdrs();

gate_vma = get_gate_vma(current);
if (gate_vma != NULL)
@@ -1981,9 +1979,8 @@ static int elf_core_dump(struct coredump_params *cprm)
goto end_coredump;
}

-#ifdef ELF_CORE_WRITE_EXTRA_PHDRS
- ELF_CORE_WRITE_EXTRA_PHDRS;
-#endif
+ if (!elf_core_write_extra_phdrs(cprm->file, offset, &size, cprm->limit))
+ goto end_coredump;

/* write out the notes section */
if (!write_note_info(&info, cprm->file, &foffset))
@@ -2022,9 +2019,8 @@ static int elf_core_dump(struct coredump_params *cprm)
}
}

-#ifdef ELF_CORE_WRITE_EXTRA_DATA
- ELF_CORE_WRITE_EXTRA_DATA;
-#endif
+ if (!elf_core_write_extra_data(cprm->file, &size, cprm->limit))
+ goto end_coredump;

end_coredump:
set_fs(fs);
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index f587bc4..e2163b4 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -1661,9 +1661,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
elf_core_copy_regs(&prstatus->pr_reg, cprm->regs);

segs = current->mm->map_count;
-#ifdef ELF_CORE_EXTRA_PHDRS
- segs += ELF_CORE_EXTRA_PHDRS;
-#endif
+ segs += elf_core_extra_phdrs();

/* Set up header */
fill_elf_fdpic_header(elf, segs + 1); /* including notes section */
@@ -1770,9 +1768,8 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
goto end_coredump;
}

-#ifdef ELF_CORE_WRITE_EXTRA_PHDRS
- ELF_CORE_WRITE_EXTRA_PHDRS;
-#endif
+ if (!elf_core_write_extra_phdrs(cprm->file, offset, &size, cprm->limit))
+ goto end_coredump;

/* write out the notes section */
for (i = 0; i < numnote; i++)
@@ -1796,9 +1793,8 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
mm_flags) < 0)
goto end_coredump;

-#ifdef ELF_CORE_WRITE_EXTRA_DATA
- ELF_CORE_WRITE_EXTRA_DATA;
-#endif
+ if (!elf_core_write_extra_data(cprm->file, &size, cprm->limit))
+ goto end_coredump;

if (cprm->file->f_pos != offset) {
/* Sanity check */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 0cc4d55..f26e67a 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -386,6 +386,7 @@ extern Elf32_Dyn _DYNAMIC [];
#define elf_phdr elf32_phdr
#define elf_note elf32_note
#define elf_addr_t Elf32_Off
+#define Elf_Half Elf32_Half

#else

@@ -394,6 +395,7 @@ extern Elf64_Dyn _DYNAMIC [];
#define elf_phdr elf64_phdr
#define elf_note elf64_note
#define elf_addr_t Elf64_Off
+#define Elf_Half Elf64_Half

#endif

diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 00d6a68..cfda74f 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -8,6 +8,8 @@
#include <linux/user.h>
#endif
#include <linux/ptrace.h>
+#include <linux/elf.h>
+#include <linux/fs.h>

struct elf_siginfo
{
@@ -150,5 +152,19 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse

#endif /* __KERNEL__ */

+/*
+ * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
+ * extra segments containing the gate DSO contents. Dumping its
+ * contents makes post-mortem fully interpretable later without matching up
+ * the same kernel and hardware config to see what PC values meant.
+ * Dumping its extra ELF program headers includes all the other information
+ * a debugger needs to easily find how the gate DSO was being used.
+ */
+extern Elf_Half elf_core_extra_phdrs(void);
+extern int
+elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit);
+extern int
+elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);

#endif /* _LINUX_ELFCORE_H */
diff --git a/kernel/Makefile b/kernel/Makefile
index 702260a..77c2e87 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -91,6 +91,9 @@ obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
obj-$(CONFIG_TRACEPOINTS) += tracepoint.o
obj-$(CONFIG_LATENCYTOP) += latencytop.o
+obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+obj-$(CONFIG_COMPAT_BINFMT_ELF) += elfcore.o
+obj-$(CONFIG_BINFMT_ELF_FDPIC) += elfcore.o
obj-$(CONFIG_FUNCTION_TRACER) += trace/
obj-$(CONFIG_TRACING) += trace/
obj-$(CONFIG_X86_DS) += trace/
diff --git a/kernel/elfcore.c b/kernel/elfcore.c
new file mode 100644
index 0000000..5445741
--- /dev/null
+++ b/kernel/elfcore.c
@@ -0,0 +1,23 @@
+#include <linux/elf.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+
+#include <asm/elf.h>
+
+
+Elf_Half __weak elf_core_extra_phdrs(void)
+{
+ return 0;
+}
+
+int __weak elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ return 1;
+}
+
+int __weak elf_core_write_extra_data(struct file *file, size_t *size,
+ unsigned long limit)
+{
+ return 1;
+}
--
1.6.5.1

2010-01-29 08:11:34

by Hatayama, Daisuke

[permalink] [raw]
Subject: Re: mmotm 2010-01-28-01-36 uploaded (elfcore/compat_binfmt_elf)

I'd apologize for unnecessary Signed-off-by and Cc, which I should not
have written.

I resend the really intended version.

Thanks.
HATAYAMA, Daisuke
==
elf_core_dump() and elf_fdpic_core_dump() use #ifdef and the
corresponding macro for hiding _multiline_ logics in functions. This
patch removes architectures not implemeonting ELF_CORE_EXTRA_*, we use
weak functions in order to reduce a range of modification.

This cleanup is for my next patches, but I think this cleanup itself
is worth doing regardless of my firnal purpose.

Signed-off-by: Daisuke HATAYAMA <[email protected]>
---
arch/ia64/ia32/binfmt_elf32.c | 1 +
arch/ia64/ia32/elfcore32.h | 17 ++++++++++
arch/ia64/include/asm/elf.h | 48 -----------------------------
arch/ia64/kernel/Makefile | 2 +
arch/ia64/kernel/elfcore.c | 64 +++++++++++++++++++++++++++++++++++++++
arch/um/sys-i386/Makefile | 2 +
arch/um/sys-i386/asm/elf.h | 43 --------------------------
arch/um/sys-i386/elfcore.c | 67 +++++++++++++++++++++++++++++++++++++++++
fs/binfmt_elf.c | 14 +++-----
fs/binfmt_elf_fdpic.c | 14 +++-----
include/linux/elf.h | 2 +
include/linux/elfcore.h | 16 ++++++++++
kernel/Makefile | 3 ++
kernel/elfcore.c | 23 ++++++++++++++
14 files changed, 207 insertions(+), 109 deletions(-)
create mode 100644 arch/ia64/kernel/elfcore.c
create mode 100644 arch/um/sys-i386/elfcore.c
create mode 100644 kernel/elfcore.c

diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index c69552b..2328f44 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -43,6 +43,7 @@ randomize_stack_top(unsigned long stack_top);
#undef SET_PERSONALITY
#define SET_PERSONALITY(ex) elf32_set_personality()

+#undef elf_read_implies_exec
#define elf_read_implies_exec(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack))

/* Ugly but avoids duplication */
diff --git a/arch/ia64/ia32/elfcore32.h b/arch/ia64/ia32/elfcore32.h
index 6577257..7877601 100644
--- a/arch/ia64/ia32/elfcore32.h
+++ b/arch/ia64/ia32/elfcore32.h
@@ -8,6 +8,8 @@
#ifndef _ELFCORE32_H_
#define _ELFCORE32_H_

+#include <linux/elf.h>
+
#include <asm/intrinsics.h>
#include <asm/uaccess.h>

@@ -145,4 +147,19 @@ elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
return 1;
}

+/*
+ * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
+ * extra segments containing the gate DSO contents. Dumping its
+ * contents makes post-mortem fully interpretable later without matching up
+ * the same kernel and hardware config to see what PC values meant.
+ * Dumping its extra ELF program headers includes all the other information
+ * a debugger needs to easily find how the gate DSO was being used.
+ */
+extern Elf32_Half elf_core_extra_phdrs(void);
+extern int
+elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit);
+extern int
+elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
+
#endif /* _ELFCORE32_H_ */
diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h
index e14108b..60af1ef 100644
--- a/arch/ia64/include/asm/elf.h
+++ b/arch/ia64/include/asm/elf.h
@@ -217,54 +217,6 @@ do { \
NEW_AUX_ENT(AT_SYSINFO_EHDR, (unsigned long) GATE_EHDR); \
} while (0)

-
-/*
- * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
- * extra segments containing the gate DSO contents. Dumping its
- * contents makes post-mortem fully interpretable later without matching up
- * the same kernel and hardware config to see what PC values meant.
- * Dumping its extra ELF program headers includes all the other information
- * a debugger needs to easily find how the gate DSO was being used.
- */
-#define ELF_CORE_EXTRA_PHDRS (GATE_EHDR->e_phnum)
-#define ELF_CORE_WRITE_EXTRA_PHDRS \
-do { \
- const struct elf_phdr *const gate_phdrs = \
- (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \
- int i; \
- Elf64_Off ofs = 0; \
- for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \
- struct elf_phdr phdr = gate_phdrs[i]; \
- if (phdr.p_type == PT_LOAD) { \
- phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz); \
- phdr.p_filesz = phdr.p_memsz; \
- if (ofs == 0) { \
- ofs = phdr.p_offset = offset; \
- offset += phdr.p_filesz; \
- } \
- else \
- phdr.p_offset = ofs; \
- } \
- else \
- phdr.p_offset += ofs; \
- phdr.p_paddr = 0; /* match other core phdrs */ \
- DUMP_WRITE(&phdr, sizeof(phdr)); \
- } \
-} while (0)
-#define ELF_CORE_WRITE_EXTRA_DATA \
-do { \
- const struct elf_phdr *const gate_phdrs = \
- (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); \
- int i; \
- for (i = 0; i < GATE_EHDR->e_phnum; ++i) { \
- if (gate_phdrs[i].p_type == PT_LOAD) { \
- DUMP_WRITE((void *) gate_phdrs[i].p_vaddr, \
- PAGE_ALIGN(gate_phdrs[i].p_memsz)); \
- break; \
- } \
- } \
-} while (0)
-
/*
* format for entries in the Global Offset Table
*/
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index e123634..3bdfe80 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -47,6 +47,8 @@ endif
obj-$(CONFIG_DMAR) += pci-dma.o
obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o

+obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+
# fp_emulate() expects f2-f5,f16-f31 to contain the user-level state.
CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31

diff --git a/arch/ia64/kernel/elfcore.c b/arch/ia64/kernel/elfcore.c
new file mode 100644
index 0000000..57a2298
--- /dev/null
+++ b/arch/ia64/kernel/elfcore.c
@@ -0,0 +1,64 @@
+#include <linux/elf.h>
+#include <linux/coredump.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+
+#include <asm/elf.h>
+
+
+Elf64_Half elf_core_extra_phdrs(void)
+{
+ return GATE_EHDR->e_phnum;
+}
+
+int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ const struct elf_phdr *const gate_phdrs =
+ (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);
+ int i;
+ Elf64_Off ofs = 0;
+
+ for (i = 0; i < GATE_EHDR->e_phnum; ++i) {
+ struct elf_phdr phdr = gate_phdrs[i];
+
+ if (phdr.p_type == PT_LOAD) {
+ phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz);
+ phdr.p_filesz = phdr.p_memsz;
+ if (ofs == 0) {
+ ofs = phdr.p_offset = offset;
+ offset += phdr.p_filesz;
+ } else {
+ phdr.p_offset = ofs;
+ }
+ } else {
+ phdr.p_offset += ofs;
+ }
+ phdr.p_paddr = 0; /* match other core phdrs */
+ *size += sizeof(phdr);
+ if (*size > limit || !dump_write(file, &phdr, sizeof(phdr)))
+ return 0;
+ }
+ return 1;
+}
+
+int elf_core_write_extra_data(struct file *file, size_t *size,
+ unsigned long limit)
+{
+ const struct elf_phdr *const gate_phdrs =
+ (const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff);
+ int i;
+
+ for (i = 0; i < GATE_EHDR->e_phnum; ++i) {
+ if (gate_phdrs[i].p_type == PT_LOAD) {
+ void *addr = (void *)gate_phdrs[i].p_vaddr;
+ size_t memsz = PAGE_ALIGN(gate_phdrs[i].p_memsz);
+
+ *size += memsz;
+ if (*size > limit || !dump_write(file, addr, memsz))
+ return 0;
+ break;
+ }
+ }
+ return 1;
+}
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile
index 1b549bc..804b28d 100644
--- a/arch/um/sys-i386/Makefile
+++ b/arch/um/sys-i386/Makefile
@@ -6,6 +6,8 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
sys_call_table.o tls.o

+obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+
subarch-obj-y = lib/semaphore_32.o lib/string_32.o
subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem_32.o
subarch-obj-$(CONFIG_MODULES) += kernel/module.o
diff --git a/arch/um/sys-i386/asm/elf.h b/arch/um/sys-i386/asm/elf.h
index 7708854..e64cd41 100644
--- a/arch/um/sys-i386/asm/elf.h
+++ b/arch/um/sys-i386/asm/elf.h
@@ -116,47 +116,4 @@ do { \
} \
} while (0)

-/*
- * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out
- * extra segments containing the vsyscall DSO contents. Dumping its
- * contents makes post-mortem fully interpretable later without matching up
- * the same kernel and hardware config to see what PC values meant.
- * Dumping its extra ELF program headers includes all the other information
- * a debugger needs to easily find how the vsyscall DSO was being used.
- */
-#define ELF_CORE_EXTRA_PHDRS \
- (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 )
-
-#define ELF_CORE_WRITE_EXTRA_PHDRS \
-if ( vsyscall_ehdr ) { \
- const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
- const struct elf_phdr *const phdrp = \
- (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
- int i; \
- Elf32_Off ofs = 0; \
- for (i = 0; i < ehdrp->e_phnum; ++i) { \
- struct elf_phdr phdr = phdrp[i]; \
- if (phdr.p_type == PT_LOAD) { \
- ofs = phdr.p_offset = offset; \
- offset += phdr.p_filesz; \
- } \
- else \
- phdr.p_offset += ofs; \
- phdr.p_paddr = 0; /* match other core phdrs */ \
- DUMP_WRITE(&phdr, sizeof(phdr)); \
- } \
-}
-#define ELF_CORE_WRITE_EXTRA_DATA \
-if ( vsyscall_ehdr ) { \
- const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \
- const struct elf_phdr *const phdrp = \
- (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \
- int i; \
- for (i = 0; i < ehdrp->e_phnum; ++i) { \
- if (phdrp[i].p_type == PT_LOAD) \
- DUMP_WRITE((void *) phdrp[i].p_vaddr, \
- phdrp[i].p_filesz); \
- } \
-}
-
#endif
diff --git a/arch/um/sys-i386/elfcore.c b/arch/um/sys-i386/elfcore.c
new file mode 100644
index 0000000..30cac52
--- /dev/null
+++ b/arch/um/sys-i386/elfcore.c
@@ -0,0 +1,67 @@
+#include <linux/elf.h>
+#include <linux/coredump.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+
+#include <asm/elf.h>
+
+
+Elf32_Half elf_core_extra_phdrs(void)
+{
+ return vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0;
+}
+
+int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ if ( vsyscall_ehdr ) {
+ const struct elfhdr *const ehdrp =
+ (struct elfhdr *) vsyscall_ehdr;
+ const struct elf_phdr *const phdrp =
+ (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff);
+ int i;
+ Elf32_Off ofs = 0;
+
+ for (i = 0; i < ehdrp->e_phnum; ++i) {
+ struct elf_phdr phdr = phdrp[i];
+
+ if (phdr.p_type == PT_LOAD) {
+ ofs = phdr.p_offset = offset;
+ offset += phdr.p_filesz;
+ } else {
+ phdr.p_offset += ofs;
+ }
+ phdr.p_paddr = 0; /* match other core phdrs */
+ *size += sizeof(phdr);
+ if (*size > limit
+ || !dump_write(file, &phdr, sizeof(phdr)))
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int elf_core_write_extra_data(struct file *file, size_t *size,
+ unsigned long limit)
+{
+ if ( vsyscall_ehdr ) {
+ const struct elfhdr *const ehdrp =
+ (struct elfhdr *) vsyscall_ehdr;
+ const struct elf_phdr *const phdrp =
+ (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff);
+ int i;
+
+ for (i = 0; i < ehdrp->e_phnum; ++i) {
+ if (phdrp[i].p_type == PT_LOAD) {
+ void *addr = (void *) phdrp[i].p_vaddr;
+ size_t filesz = phdrp[i].p_filesz;
+
+ *size += filesz;
+ if (*size > limit
+ || !dump_write(file, addr, filesz))
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index a0fe475..1b7e9de 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1901,9 +1901,7 @@ static int elf_core_dump(struct coredump_params *cprm)
* Please check DEFAULT_MAX_MAP_COUNT definition when you modify here.
*/
segs = current->mm->map_count;
-#ifdef ELF_CORE_EXTRA_PHDRS
- segs += ELF_CORE_EXTRA_PHDRS;
-#endif
+ segs += elf_core_extra_phdrs();

gate_vma = get_gate_vma(current);
if (gate_vma != NULL)
@@ -1981,9 +1979,8 @@ static int elf_core_dump(struct coredump_params *cprm)
goto end_coredump;
}

-#ifdef ELF_CORE_WRITE_EXTRA_PHDRS
- ELF_CORE_WRITE_EXTRA_PHDRS;
-#endif
+ if (!elf_core_write_extra_phdrs(cprm->file, offset, &size, cprm->limit))
+ goto end_coredump;

/* write out the notes section */
if (!write_note_info(&info, cprm->file, &foffset))
@@ -2022,9 +2019,8 @@ static int elf_core_dump(struct coredump_params *cprm)
}
}

-#ifdef ELF_CORE_WRITE_EXTRA_DATA
- ELF_CORE_WRITE_EXTRA_DATA;
-#endif
+ if (!elf_core_write_extra_data(cprm->file, &size, cprm->limit))
+ goto end_coredump;

end_coredump:
set_fs(fs);
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index f587bc4..e2163b4 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -1661,9 +1661,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
elf_core_copy_regs(&prstatus->pr_reg, cprm->regs);

segs = current->mm->map_count;
-#ifdef ELF_CORE_EXTRA_PHDRS
- segs += ELF_CORE_EXTRA_PHDRS;
-#endif
+ segs += elf_core_extra_phdrs();

/* Set up header */
fill_elf_fdpic_header(elf, segs + 1); /* including notes section */
@@ -1770,9 +1768,8 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
goto end_coredump;
}

-#ifdef ELF_CORE_WRITE_EXTRA_PHDRS
- ELF_CORE_WRITE_EXTRA_PHDRS;
-#endif
+ if (!elf_core_write_extra_phdrs(cprm->file, offset, &size, cprm->limit))
+ goto end_coredump;

/* write out the notes section */
for (i = 0; i < numnote; i++)
@@ -1796,9 +1793,8 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
mm_flags) < 0)
goto end_coredump;

-#ifdef ELF_CORE_WRITE_EXTRA_DATA
- ELF_CORE_WRITE_EXTRA_DATA;
-#endif
+ if (!elf_core_write_extra_data(cprm->file, &size, cprm->limit))
+ goto end_coredump;

if (cprm->file->f_pos != offset) {
/* Sanity check */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 0cc4d55..f26e67a 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -386,6 +386,7 @@ extern Elf32_Dyn _DYNAMIC [];
#define elf_phdr elf32_phdr
#define elf_note elf32_note
#define elf_addr_t Elf32_Off
+#define Elf_Half Elf32_Half

#else

@@ -394,6 +395,7 @@ extern Elf64_Dyn _DYNAMIC [];
#define elf_phdr elf64_phdr
#define elf_note elf64_note
#define elf_addr_t Elf64_Off
+#define Elf_Half Elf64_Half

#endif

diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 00d6a68..cfda74f 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -8,6 +8,8 @@
#include <linux/user.h>
#endif
#include <linux/ptrace.h>
+#include <linux/elf.h>
+#include <linux/fs.h>

struct elf_siginfo
{
@@ -150,5 +152,19 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse

#endif /* __KERNEL__ */

+/*
+ * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
+ * extra segments containing the gate DSO contents. Dumping its
+ * contents makes post-mortem fully interpretable later without matching up
+ * the same kernel and hardware config to see what PC values meant.
+ * Dumping its extra ELF program headers includes all the other information
+ * a debugger needs to easily find how the gate DSO was being used.
+ */
+extern Elf_Half elf_core_extra_phdrs(void);
+extern int
+elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit);
+extern int
+elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);

#endif /* _LINUX_ELFCORE_H */
diff --git a/kernel/Makefile b/kernel/Makefile
index 702260a..77c2e87 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -91,6 +91,9 @@ obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
obj-$(CONFIG_TRACEPOINTS) += tracepoint.o
obj-$(CONFIG_LATENCYTOP) += latencytop.o
+obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+obj-$(CONFIG_COMPAT_BINFMT_ELF) += elfcore.o
+obj-$(CONFIG_BINFMT_ELF_FDPIC) += elfcore.o
obj-$(CONFIG_FUNCTION_TRACER) += trace/
obj-$(CONFIG_TRACING) += trace/
obj-$(CONFIG_X86_DS) += trace/
diff --git a/kernel/elfcore.c b/kernel/elfcore.c
new file mode 100644
index 0000000..5445741
--- /dev/null
+++ b/kernel/elfcore.c
@@ -0,0 +1,23 @@
+#include <linux/elf.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+
+#include <asm/elf.h>
+
+
+Elf_Half __weak elf_core_extra_phdrs(void)
+{
+ return 0;
+}
+
+int __weak elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
+ unsigned long limit)
+{
+ return 1;
+}
+
+int __weak elf_core_write_extra_data(struct file *file, size_t *size,
+ unsigned long limit)
+{
+ return 1;
+}
--
1.6.5.1

2010-01-29 17:37:37

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2010-01-28-01-36 uploaded (sched.c + percpu)

On 01/28/10 15:41, Anton Blanchard wrote:
>
> Hi Randy,
>
>> when CONFIG_SMP is not enabled:
>>
>> kernel/sched.c:10915: error: 'percpu_counter_batch' undeclared (first use in this function)
>
> Did 1/2 make it into mmotm?

I only see one patch from you in mmotm.


> Anton
>
> ---
>
> [PATCH 1/2] percpu_counter: Make __percpu_counter_add an inline function on UP
>
> Even though batch isn't used on UP, we may want to pass one in to keep the
> SMP and UP code paths similar. Convert __percpu_counter_add to an inline
> function so we wont get variable unused warnings if we do.
>
> Signed-off-by: Anton Blanchard<[email protected]>
> ---
>
> diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
> index a7684a5..794662b 100644
> --- a/include/linux/percpu_counter.h
> +++ b/include/linux/percpu_counter.h
> @@ -98,9 +98,6 @@ static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
> fbc->count = amount;
> }
>
> -#define __percpu_counter_add(fbc, amount, batch) \
> - percpu_counter_add(fbc, amount)
> -
> static inline void
> percpu_counter_add(struct percpu_counter *fbc, s64 amount)
> {
> @@ -109,6 +106,12 @@ percpu_counter_add(struct percpu_counter *fbc, s64 amount)
> preempt_enable();
> }
>
> +static inline void
> +__percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
> +{
> + percpu_counter_add(fbc, amount);
> +}
> +
> static inline s64 percpu_counter_read(struct percpu_counter *fbc)
> {
> return fbc->count;
>


--
~Randy