Merge branch 'akpm' (Andrew's incoming)
Linus Torvalds [Tue, 1 Nov 2011 00:46:07 +0000 (17:46 -0700)]
Quoth Andrew:

 - Most of MM.  Still waiting for the poweroc guys to get off their
   butts and review some threaded hugepages patches.

 - alpha

 - vfs bits

 - drivers/misc

 - a few core kerenl tweaks

 - printk() features

 - MAINTAINERS updates

 - backlight merge

 - leds merge

 - various lib/ updates

 - checkpatch updates

* akpm: (127 commits)
  epoll: fix spurious lockdep warnings
  checkpatch: add a --strict check for utf-8 in commit logs
  kernel.h/checkpatch: mark strict_strto<foo> and simple_strto<foo> as obsolete
  llist-return-whether-list-is-empty-before-adding-in-llist_add-fix
  wireless: at76c50x: follow rename pack_hex_byte to hex_byte_pack
  fat: follow rename pack_hex_byte() to hex_byte_pack()
  security: follow rename pack_hex_byte() to hex_byte_pack()
  kgdb: follow rename pack_hex_byte() to hex_byte_pack()
  lib: rename pack_hex_byte() to hex_byte_pack()
  lib/string.c: fix strim() semantics for strings that have only blanks
  lib/idr.c: fix comment for ida_get_new_above()
  lib/percpu_counter.c: enclose hotplug only variables in hotplug ifdef
  lib/bitmap.c: quiet sparse noise about address space
  lib/spinlock_debug.c: print owner on spinlock lockup
  lib/kstrtox: common code between kstrto*() and simple_strto*() functions
  drivers/leds/leds-lp5521.c: check if reset is successful
  leds: turn the blink_timer off before starting to blink
  leds: save the delay values after a successful call to blink_set()
  drivers/leds/leds-gpio.c: use gpio_get_value_cansleep() when initializing
  drivers/leds/leds-lm3530.c: add __devexit_p where needed
  ...

558 files changed:
Documentation/ABI/testing/debugfs-ideapad [new file with mode: 0644]
Documentation/ABI/testing/sysfs-platform-ideapad-laptop
Documentation/DocBook/media/dvb/dvbproperty.xml
Documentation/DocBook/media/dvb/intro.xml
Documentation/DocBook/media/v4l/compat.xml
Documentation/DocBook/media/v4l/dev-subdev.xml
Documentation/DocBook/media/v4l/v4l2.xml
Documentation/DocBook/media/v4l/vidioc-dqevent.xml
Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml
Documentation/dvb/get_dvb_firmware
Documentation/dvb/it9137.txt [new file with mode: 0644]
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
Documentation/video4linux/CARDLIST.tm6000 [moved from drivers/staging/tm6000/CARDLIST with 100% similarity]
Documentation/video4linux/gspca.txt
Documentation/video4linux/omap3isp.txt
Documentation/video4linux/v4l2-controls.txt
MAINTAINERS
arch/microblaze/include/asm/dma-mapping.h
arch/microblaze/include/asm/elf.h
arch/microblaze/include/asm/system.h
arch/microblaze/include/asm/uaccess.h
arch/microblaze/kernel/cpu/cpuinfo.c
arch/microblaze/kernel/dma.c
arch/microblaze/kernel/exceptions.c
arch/microblaze/kernel/process.c
arch/microblaze/kernel/ptrace.c
arch/microblaze/kernel/timer.c
arch/microblaze/lib/Makefile
arch/microblaze/lib/uaccess_old.S
arch/microblaze/lib/ucmpdi2.c [new file with mode: 0644]
arch/s390/Kconfig
arch/s390/boot/compressed/misc.c
arch/s390/defconfig
arch/s390/include/asm/ccwdev.h
arch/s390/include/asm/compat.h
arch/s390/include/asm/ipl.h
arch/s390/include/asm/irq.h
arch/s390/include/asm/kexec.h
arch/s390/include/asm/kvm_host.h
arch/s390/include/asm/lowcore.h
arch/s390/include/asm/page.h
arch/s390/include/asm/pgtable.h
arch/s390/include/asm/processor.h
arch/s390/include/asm/ptrace.h
arch/s390/include/asm/reset.h
arch/s390/include/asm/setup.h
arch/s390/include/asm/sfp-util.h
arch/s390/include/asm/smp.h
arch/s390/include/asm/spinlock.h
arch/s390/include/asm/syscall.h
arch/s390/include/asm/system.h
arch/s390/include/asm/thread_info.h
arch/s390/include/asm/timex.h
arch/s390/include/asm/tlbflush.h
arch/s390/kernel/Makefile
arch/s390/kernel/asm-offsets.c
arch/s390/kernel/base.S
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_signal.c
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/crash_dump.c [new file with mode: 0644]
arch/s390/kernel/early.c
arch/s390/kernel/entry.S
arch/s390/kernel/entry.h
arch/s390/kernel/entry64.S
arch/s390/kernel/head.S
arch/s390/kernel/head31.S
arch/s390/kernel/head64.S
arch/s390/kernel/head_kdump.S [new file with mode: 0644]
arch/s390/kernel/ipl.c
arch/s390/kernel/irq.c
arch/s390/kernel/kprobes.c
arch/s390/kernel/machine_kexec.c
arch/s390/kernel/mem_detect.c
arch/s390/kernel/process.c
arch/s390/kernel/processor.c
arch/s390/kernel/ptrace.c
arch/s390/kernel/reipl.S
arch/s390/kernel/reipl64.S
arch/s390/kernel/setup.c
arch/s390/kernel/signal.c
arch/s390/kernel/smp.c
arch/s390/kernel/suspend.c
arch/s390/kernel/sysinfo.c
arch/s390/kernel/time.c
arch/s390/kernel/topology.c
arch/s390/kernel/traps.c
arch/s390/kernel/vtime.c
arch/s390/kvm/diag.c
arch/s390/kvm/kvm-s390.c
arch/s390/lib/delay.c
arch/s390/lib/uaccess_pt.c
arch/s390/mm/fault.c
arch/s390/mm/maccess.c
arch/s390/mm/mmap.c
arch/s390/mm/pageattr.c
arch/s390/mm/pgtable.c
arch/s390/mm/vmem.c
arch/s390/oprofile/hwsampler.c
drivers/input/misc/Kconfig
drivers/input/misc/Makefile
drivers/media/common/saa7146_core.c
drivers/media/common/saa7146_fops.c
drivers/media/common/saa7146_hlp.c
drivers/media/common/saa7146_i2c.c
drivers/media/common/saa7146_vbi.c
drivers/media/common/saa7146_video.c
drivers/media/common/tuners/Makefile
drivers/media/common/tuners/mt20xx.c
drivers/media/common/tuners/mxl5005s.c
drivers/media/common/tuners/tda18212.c
drivers/media/common/tuners/tda18271-common.c
drivers/media/common/tuners/tda18271-fe.c
drivers/media/common/tuners/tda18271-priv.h
drivers/media/common/tuners/tda827x.c
drivers/media/common/tuners/tuner-xc2028.c
drivers/media/common/tuners/tuner-xc2028.h
drivers/media/dvb/b2c2/Makefile
drivers/media/dvb/bt8xx/Makefile
drivers/media/dvb/ddbridge/Makefile
drivers/media/dvb/ddbridge/ddbridge-core.c
drivers/media/dvb/dm1105/Makefile
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/dvb/dvb-core/dvb_frontend.h
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/Makefile
drivers/media/dvb/dvb-usb/a800.c
drivers/media/dvb/dvb-usb/af9005-fe.c
drivers/media/dvb/dvb-usb/af9005.c
drivers/media/dvb/dvb-usb/af9015.c
drivers/media/dvb/dvb-usb/anysee.c
drivers/media/dvb/dvb-usb/anysee.h
drivers/media/dvb/dvb-usb/au6610.c
drivers/media/dvb/dvb-usb/az6027.c
drivers/media/dvb/dvb-usb/ce6230.c
drivers/media/dvb/dvb-usb/cinergyT2-core.c
drivers/media/dvb/dvb-usb/cxusb.c
drivers/media/dvb/dvb-usb/dib0700_core.c
drivers/media/dvb/dvb-usb/dib0700_devices.c
drivers/media/dvb/dvb-usb/dibusb-common.c
drivers/media/dvb/dvb-usb/dibusb-mb.c
drivers/media/dvb/dvb-usb/dibusb-mc.c
drivers/media/dvb/dvb-usb/digitv.c
drivers/media/dvb/dvb-usb/dtt200u.c
drivers/media/dvb/dvb-usb/dtv5100.c
drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
drivers/media/dvb/dvb-usb/dvb-usb-ids.h
drivers/media/dvb/dvb-usb/dvb-usb-init.c
drivers/media/dvb/dvb-usb/dvb-usb-urb.c
drivers/media/dvb/dvb-usb/dvb-usb.h
drivers/media/dvb/dvb-usb/dw2102.c
drivers/media/dvb/dvb-usb/ec168.c
drivers/media/dvb/dvb-usb/friio.c
drivers/media/dvb/dvb-usb/gl861.c
drivers/media/dvb/dvb-usb/gp8psk-fe.c
drivers/media/dvb/dvb-usb/gp8psk.c
drivers/media/dvb/dvb-usb/it913x.c [new file with mode: 0644]
drivers/media/dvb/dvb-usb/lmedm04.c
drivers/media/dvb/dvb-usb/m920x.c
drivers/media/dvb/dvb-usb/mxl111sf-gpio.c [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-gpio.h [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-i2c.c [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-i2c.h [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-phy.c [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-phy.h [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-reg.h [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-tuner.c [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf-tuner.h [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf.c [new file with mode: 0644]
drivers/media/dvb/dvb-usb/mxl111sf.h [new file with mode: 0644]
drivers/media/dvb/dvb-usb/nova-t-usb2.c
drivers/media/dvb/dvb-usb/opera1.c
drivers/media/dvb/dvb-usb/pctv452e.c [new file with mode: 0644]
drivers/media/dvb/dvb-usb/technisat-usb2.c
drivers/media/dvb/dvb-usb/ttusb2.c
drivers/media/dvb/dvb-usb/umt-010.c
drivers/media/dvb/dvb-usb/usb-urb.c
drivers/media/dvb/dvb-usb/vp702x.c
drivers/media/dvb/dvb-usb/vp7045.c
drivers/media/dvb/frontends/Kconfig
drivers/media/dvb/frontends/Makefile
drivers/media/dvb/frontends/a8293.c [new file with mode: 0644]
drivers/media/dvb/frontends/a8293.h [moved from drivers/media/common/tuners/tda18212_priv.h with 58% similarity]
drivers/media/dvb/frontends/cxd2820r.h
drivers/media/dvb/frontends/cxd2820r_c.c
drivers/media/dvb/frontends/cxd2820r_core.c
drivers/media/dvb/frontends/cxd2820r_priv.h
drivers/media/dvb/frontends/cxd2820r_t.c
drivers/media/dvb/frontends/cxd2820r_t2.c
drivers/media/dvb/frontends/dib0070.c
drivers/media/dvb/frontends/dib0090.c
drivers/media/dvb/frontends/dib7000m.c
drivers/media/dvb/frontends/dib7000p.c
drivers/media/dvb/frontends/dib8000.c
drivers/media/dvb/frontends/dib9000.c
drivers/media/dvb/frontends/dibx000_common.c
drivers/media/dvb/frontends/dibx000_common.h
drivers/media/dvb/frontends/drxd_hard.c
drivers/media/dvb/frontends/drxk_hard.c
drivers/media/dvb/frontends/it913x-fe-priv.h [new file with mode: 0644]
drivers/media/dvb/frontends/it913x-fe.c [new file with mode: 0644]
drivers/media/dvb/frontends/it913x-fe.h [new file with mode: 0644]
drivers/media/dvb/frontends/lnbp22.c [new file with mode: 0644]
drivers/media/dvb/frontends/lnbp22.h [new file with mode: 0644]
drivers/media/dvb/frontends/stb0899_algo.c
drivers/media/dvb/frontends/stb0899_drv.c
drivers/media/dvb/frontends/stv0288.c
drivers/media/dvb/frontends/stv090x.c
drivers/media/dvb/frontends/tda10048.c
drivers/media/dvb/frontends/tda10048.h
drivers/media/dvb/frontends/tda10071.c [new file with mode: 0644]
drivers/media/dvb/frontends/tda10071.h [new file with mode: 0644]
drivers/media/dvb/frontends/tda10071_priv.h [new file with mode: 0644]
drivers/media/dvb/frontends/tda18271c2dd.c
drivers/media/dvb/mantis/Makefile
drivers/media/dvb/mantis/hopper_cards.c
drivers/media/dvb/mantis/mantis_cards.c
drivers/media/dvb/mantis/mantis_common.h
drivers/media/dvb/mantis/mantis_dma.c
drivers/media/dvb/mantis/mantis_vp1041.c
drivers/media/dvb/ngene/Makefile
drivers/media/dvb/pluto2/Makefile
drivers/media/dvb/pt1/Makefile
drivers/media/dvb/siano/Makefile
drivers/media/dvb/ttpci/Makefile
drivers/media/dvb/ttpci/av7110_v4l.c
drivers/media/dvb/ttpci/budget-av.c
drivers/media/dvb/ttpci/budget-ci.c
drivers/media/dvb/ttpci/budget-core.c
drivers/media/dvb/ttpci/budget.h
drivers/media/dvb/ttpci/ttpci-eeprom.c
drivers/media/dvb/ttpci/ttpci-eeprom.h
drivers/media/dvb/ttusb-budget/Makefile
drivers/media/dvb/ttusb-dec/Makefile
drivers/media/radio/Makefile
drivers/media/radio/radio-si4713.c
drivers/media/radio/radio-wl1273.c
drivers/media/radio/si470x/radio-si470x-usb.c
drivers/media/radio/wl128x/fmdrv_v4l2.c
drivers/media/rc/Kconfig
drivers/media/rc/Makefile
drivers/media/rc/ati_remote.c [moved from drivers/input/misc/ati_remote.c with 77% similarity]
drivers/media/rc/ene_ir.c
drivers/media/rc/ene_ir.h
drivers/media/rc/imon.c
drivers/media/rc/ir-lirc-codec.c
drivers/media/rc/keymaps/Makefile
drivers/media/rc/keymaps/rc-ati-x10.c [new file with mode: 0644]
drivers/media/rc/keymaps/rc-medion-x10.c [new file with mode: 0644]
drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c
drivers/media/rc/keymaps/rc-snapstream-firefly.c [new file with mode: 0644]
drivers/media/rc/mceusb.c
drivers/media/rc/rc-core-priv.h
drivers/media/rc/rc-main.c
drivers/media/rc/redrat3.c
drivers/media/rc/winbond-cir.c
drivers/media/video/Kconfig
drivers/media/video/Makefile
drivers/media/video/adp1653.c
drivers/media/video/adv7175.c
drivers/media/video/atmel-isi.c
drivers/media/video/au0828/Makefile
drivers/media/video/bt819.c
drivers/media/video/bt8xx/Makefile
drivers/media/video/bt8xx/bttv-cards.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/bt8xx/bttv-gpio.c
drivers/media/video/bt8xx/bttv-i2c.c
drivers/media/video/bt8xx/bttv-input.c
drivers/media/video/bt8xx/bttv-risc.c
drivers/media/video/bt8xx/bttv-vbi.c
drivers/media/video/bt8xx/bttvp.h
drivers/media/video/cx18/Makefile
drivers/media/video/cx18/cx18-driver.h
drivers/media/video/cx18/cx18-fileops.c
drivers/media/video/cx18/cx18-ioctl.c
drivers/media/video/cx18/cx18-mailbox.c
drivers/media/video/cx18/cx18-streams.c
drivers/media/video/cx231xx/Makefile
drivers/media/video/cx23885/Kconfig
drivers/media/video/cx23885/Makefile
drivers/media/video/cx23885/cx23885-alsa.c [new file with mode: 0644]
drivers/media/video/cx23885/cx23885-cards.c
drivers/media/video/cx23885/cx23885-core.c
drivers/media/video/cx23885/cx23885-dvb.c
drivers/media/video/cx23885/cx23885-i2c.c
drivers/media/video/cx23885/cx23885-reg.h
drivers/media/video/cx23885/cx23885-vbi.c
drivers/media/video/cx23885/cx23885-video.c
drivers/media/video/cx23885/cx23885.h
drivers/media/video/cx23885/cx23888-ir.c
drivers/media/video/cx25840/Makefile
drivers/media/video/cx25840/cx25840-audio.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx25840/cx25840-ir.c
drivers/media/video/cx88/Makefile
drivers/media/video/cx88/cx88-core.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/davinci/vpbe_display.c
drivers/media/video/davinci/vpbe_osd.c
drivers/media/video/em28xx/Kconfig
drivers/media/video/em28xx/Makefile
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx-core.c
drivers/media/video/em28xx/em28xx-dvb.c
drivers/media/video/em28xx/em28xx-input.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/em28xx/em28xx.h
drivers/media/video/et61x251/et61x251.h
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/et61x251/et61x251_tas5130d1b.c
drivers/media/video/gspca/Kconfig
drivers/media/video/gspca/Makefile
drivers/media/video/gspca/benq.c
drivers/media/video/gspca/conex.c
drivers/media/video/gspca/cpia1.c
drivers/media/video/gspca/etoms.c
drivers/media/video/gspca/finepix.c
drivers/media/video/gspca/gl860/Makefile
drivers/media/video/gspca/gl860/gl860.c
drivers/media/video/gspca/gspca.c
drivers/media/video/gspca/gspca.h
drivers/media/video/gspca/jeilinj.c
drivers/media/video/gspca/kinect.c
drivers/media/video/gspca/konica.c
drivers/media/video/gspca/m5602/Makefile
drivers/media/video/gspca/m5602/m5602_core.c
drivers/media/video/gspca/m5602/m5602_mt9m111.c
drivers/media/video/gspca/m5602/m5602_ov7660.c
drivers/media/video/gspca/m5602/m5602_ov9650.c
drivers/media/video/gspca/m5602/m5602_po1030.c
drivers/media/video/gspca/m5602/m5602_s5k4aa.c
drivers/media/video/gspca/m5602/m5602_s5k83a.c
drivers/media/video/gspca/mars.c
drivers/media/video/gspca/mr97310a.c
drivers/media/video/gspca/nw80x.c
drivers/media/video/gspca/ov519.c
drivers/media/video/gspca/ov534.c
drivers/media/video/gspca/ov534_9.c
drivers/media/video/gspca/pac207.c
drivers/media/video/gspca/pac7302.c
drivers/media/video/gspca/pac7311.c
drivers/media/video/gspca/se401.c
drivers/media/video/gspca/sn9c2028.c
drivers/media/video/gspca/sn9c20x.c
drivers/media/video/gspca/sonixj.c
drivers/media/video/gspca/spca1528.c
drivers/media/video/gspca/spca500.c
drivers/media/video/gspca/spca501.c
drivers/media/video/gspca/spca505.c
drivers/media/video/gspca/spca508.c
drivers/media/video/gspca/spca561.c
drivers/media/video/gspca/sq905.c
drivers/media/video/gspca/sq905c.c
drivers/media/video/gspca/sq930x.c
drivers/media/video/gspca/stk014.c
drivers/media/video/gspca/stv0680.c
drivers/media/video/gspca/stv06xx/Makefile
drivers/media/video/gspca/stv06xx/stv06xx.c
drivers/media/video/gspca/stv06xx/stv06xx.h
drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
drivers/media/video/gspca/stv06xx/stv06xx_pb0100.c
drivers/media/video/gspca/stv06xx/stv06xx_st6422.c
drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c
drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h
drivers/media/video/gspca/sunplus.c
drivers/media/video/gspca/t613.c
drivers/media/video/gspca/topro.c [new file with mode: 0644]
drivers/media/video/gspca/vc032x.c
drivers/media/video/gspca/vicam.c
drivers/media/video/gspca/w996Xcf.c
drivers/media/video/gspca/xirlink_cit.c
drivers/media/video/gspca/zc3xx.c
drivers/media/video/hdpvr/Makefile
drivers/media/video/hexium_gemini.c
drivers/media/video/hexium_orion.c
drivers/media/video/ivtv/Makefile
drivers/media/video/ivtv/ivtv-ioctl.c
drivers/media/video/m5mols/m5mols_core.c
drivers/media/video/marvell-ccic/mcam-core.c
drivers/media/video/marvell-ccic/mmp-driver.c
drivers/media/video/mem2mem_testdev.c
drivers/media/video/msp3400-driver.c
drivers/media/video/msp3400-driver.h
drivers/media/video/msp3400-kthreads.c
drivers/media/video/mt9m111.c
drivers/media/video/mt9p031.c [new file with mode: 0644]
drivers/media/video/mt9t001.c [new file with mode: 0644]
drivers/media/video/mx3_camera.c
drivers/media/video/mxb.c
drivers/media/video/noon010pc30.c
drivers/media/video/omap3isp/Makefile
drivers/media/video/omap3isp/isp.c
drivers/media/video/omap3isp/isp.h
drivers/media/video/omap3isp/ispccdc.c
drivers/media/video/omap3isp/ispccp2.c
drivers/media/video/omap3isp/ispqueue.c
drivers/media/video/omap3isp/ispvideo.c
drivers/media/video/pvrusb2/Makefile
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-hdw.h
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/pwc/pwc-v4l.c
drivers/media/video/s5p-fimc/Makefile
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-fimc/fimc-core.c
drivers/media/video/s5p-fimc/fimc-core.h
drivers/media/video/s5p-fimc/fimc-mdevice.c [new file with mode: 0644]
drivers/media/video/s5p-fimc/fimc-mdevice.h [new file with mode: 0644]
drivers/media/video/s5p-fimc/fimc-reg.c
drivers/media/video/s5p-fimc/mipi-csis.c
drivers/media/video/s5p-fimc/regs-fimc.h
drivers/media/video/s5p-mfc/s5p_mfc.c
drivers/media/video/s5p-mfc/s5p_mfc_dec.c
drivers/media/video/s5p-mfc/s5p_mfc_enc.c
drivers/media/video/s5p-mfc/s5p_mfc_opr.c
drivers/media/video/s5p-tv/Kconfig
drivers/media/video/s5p-tv/hdmi_drv.c
drivers/media/video/s5p-tv/mixer.h
drivers/media/video/s5p-tv/mixer_grp_layer.c
drivers/media/video/s5p-tv/mixer_reg.c
drivers/media/video/s5p-tv/mixer_video.c
drivers/media/video/s5p-tv/mixer_vp_layer.c
drivers/media/video/s5p-tv/regs-hdmi.h
drivers/media/video/s5p-tv/regs-mixer.h
drivers/media/video/s5p-tv/sdo_drv.c
drivers/media/video/saa7115.c
drivers/media/video/saa7134/Makefile
drivers/media/video/saa7164/Makefile
drivers/media/video/saa7164/saa7164-cards.c
drivers/media/video/saa7164/saa7164-dvb.c
drivers/media/video/saa7164/saa7164.h
drivers/media/video/sh_mobile_ceu_camera.c
drivers/media/video/sr030pc30.c
drivers/media/video/stk-webcam.c
drivers/media/video/tlg2300/Makefile
drivers/media/video/tm6000/Kconfig [moved from drivers/staging/tm6000/Kconfig with 100% similarity]
drivers/media/video/tm6000/Makefile [moved from drivers/staging/tm6000/Makefile with 100% similarity]
drivers/media/video/tm6000/tm6000-alsa.c [moved from drivers/staging/tm6000/tm6000-alsa.c with 97% similarity]
drivers/media/video/tm6000/tm6000-cards.c [moved from drivers/staging/tm6000/tm6000-cards.c with 97% similarity]
drivers/media/video/tm6000/tm6000-core.c [moved from drivers/staging/tm6000/tm6000-core.c with 91% similarity]
drivers/media/video/tm6000/tm6000-dvb.c [moved from drivers/staging/tm6000/tm6000-dvb.c with 95% similarity]
drivers/media/video/tm6000/tm6000-i2c.c [moved from drivers/staging/tm6000/tm6000-i2c.c with 95% similarity]
drivers/media/video/tm6000/tm6000-input.c [moved from drivers/staging/tm6000/tm6000-input.c with 99% similarity]
drivers/media/video/tm6000/tm6000-regs.h [moved from drivers/staging/tm6000/tm6000-regs.h with 99% similarity]
drivers/media/video/tm6000/tm6000-stds.c [new file with mode: 0644]
drivers/media/video/tm6000/tm6000-usb-isoc.h [moved from drivers/staging/tm6000/tm6000-usb-isoc.h with 97% similarity]
drivers/media/video/tm6000/tm6000-video.c [moved from drivers/staging/tm6000/tm6000-video.c with 96% similarity]
drivers/media/video/tm6000/tm6000.h [moved from drivers/staging/tm6000/tm6000.h with 98% similarity]
drivers/media/video/tvaudio.c
drivers/media/video/tvp5150_reg.h
drivers/media/video/tvp7002.c
drivers/media/video/usbvision/Makefile
drivers/media/video/uvc/uvc_driver.c
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/uvc/uvc_video.c
drivers/media/video/uvc/uvcvideo.h
drivers/media/video/v4l2-ctrls.c
drivers/media/video/v4l2-ioctl.c
drivers/media/video/v4l2-mem2mem.c
drivers/media/video/v4l2-subdev.c
drivers/media/video/videobuf2-core.c
drivers/media/video/videobuf2-dma-contig.c
drivers/media/video/videobuf2-dma-sg.c
drivers/media/video/videobuf2-memops.c
drivers/media/video/vivi.c
drivers/media/video/vpx3220.c
drivers/media/video/zr364xx.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/altera-stapl/Kconfig [moved from drivers/staging/altera-stapl/Kconfig with 77% similarity]
drivers/misc/altera-stapl/Makefile [new file with mode: 0644]
drivers/misc/altera-stapl/altera-comp.c [moved from drivers/staging/altera-stapl/altera-comp.c with 100% similarity]
drivers/misc/altera-stapl/altera-exprt.h [moved from drivers/staging/altera-stapl/altera-exprt.h with 100% similarity]
drivers/misc/altera-stapl/altera-jtag.c [moved from drivers/staging/altera-stapl/altera-jtag.c with 99% similarity]
drivers/misc/altera-stapl/altera-jtag.h [moved from drivers/staging/altera-stapl/altera-jtag.h with 100% similarity]
drivers/misc/altera-stapl/altera-lpt.c [moved from drivers/staging/altera-stapl/altera-lpt.c with 100% similarity]
drivers/misc/altera-stapl/altera.c [moved from drivers/staging/altera-stapl/altera.c with 99% similarity]
drivers/platform/x86/Kconfig
drivers/platform/x86/acer-wmi.c
drivers/platform/x86/asus-laptop.c
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/dell-laptop.c
drivers/platform/x86/eeepc-laptop.c
drivers/platform/x86/hp_accel.c
drivers/platform/x86/ideapad-laptop.c
drivers/platform/x86/intel_scu_ipcutil.c
drivers/platform/x86/samsung-laptop.c
drivers/platform/x86/sony-laptop.c
drivers/platform/x86/topstar-laptop.c
drivers/platform/x86/toshiba_acpi.c
drivers/platform/x86/wmi.c
drivers/s390/block/dasd.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_fba.c
drivers/s390/block/dasd_int.h
drivers/s390/char/con3215.c
drivers/s390/char/raw3270.c
drivers/s390/char/sclp_cmd.c
drivers/s390/char/sclp_quiesce.c
drivers/s390/char/tape_34xx.c
drivers/s390/char/tape_3590.c
drivers/s390/char/tape_core.c
drivers/s390/char/vmur.c
drivers/s390/char/zcore.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/ccwreq.c
drivers/s390/cio/chsc_sch.c
drivers/s390/cio/cio.c
drivers/s390/cio/css.h
drivers/s390/cio/device.c
drivers/s390/cio/device.h
drivers/s390/cio/io_sch.h
drivers/s390/cio/qdio.h
drivers/s390/cio/qdio_debug.c
drivers/s390/cio/qdio_main.c
drivers/s390/cio/qdio_thinint.c
drivers/s390/kvm/kvm_virtio.c
drivers/s390/net/claw.c
drivers/s390/net/ctcm_main.c
drivers/s390/net/ctcm_sysfs.c
drivers/s390/net/lcs.c
drivers/s390/net/qeth_l3_main.c
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/altera-stapl/Makefile [deleted file]
drivers/staging/dt3155v4l/dt3155v4l.c
drivers/staging/tm6000/README [deleted file]
drivers/staging/tm6000/TODO [deleted file]
drivers/staging/tm6000/tm6000-stds.c [deleted file]
include/linux/crash_dump.h
include/linux/dvb/frontend.h
include/linux/dvb/version.h
include/linux/elf.h
include/linux/kexec.h
include/linux/omap3isp.h
include/linux/usb/Kbuild
include/linux/videodev2.h
include/media/m5mols.h
include/media/mt9p031.h [new file with mode: 0644]
include/media/mt9t001.h [new file with mode: 0644]
include/media/omap3isp.h [new file with mode: 0644]
include/media/rc-core.h
include/media/rc-map.h
include/media/s5p_fimc.h
include/media/saa7146.h
include/media/v4l2-chip-ident.h
include/media/v4l2-ctrls.h
include/media/v4l2-mediabus.h
include/media/videobuf2-core.h
include/media/videobuf2-dma-contig.h
include/misc/altera.h [moved from drivers/staging/altera-stapl/altera.h with 100% similarity]
kernel/crash_dump.c
kernel/kexec.c
kernel/sysctl.c

diff --git a/Documentation/ABI/testing/debugfs-ideapad b/Documentation/ABI/testing/debugfs-ideapad
new file mode 100644 (file)
index 0000000..7079c0b
--- /dev/null
@@ -0,0 +1,19 @@
+What:          /sys/kernel/debug/ideapad/cfg
+Date:          Sep 2011
+KernelVersion: 3.2
+Contact:       Ike Panhc <ike.pan@canonical.com>
+Description:
+
+cfg shows the return value of _CFG method in VPC2004 device. It tells machine
+capability and what graphic component within the machine.
+
+
+What:          /sys/kernel/debug/ideapad/status
+Date:          Sep 2011
+KernelVersion: 3.2
+Contact:       Ike Panhc <ike.pan@canonical.com>
+Description:
+
+status shows infos we can read and tells its meaning and value.
+
+
index ff53183..814b013 100644 (file)
@@ -5,19 +5,4 @@ Contact:       "Ike Panhc <ike.pan@canonical.com>"
 Description:
                Control the power of camera module. 1 means on, 0 means off.
 
-What:          /sys/devices/platform/ideapad/cfg
-Date:          Jun 2011
-KernelVersion: 3.1
-Contact:       "Ike Panhc <ike.pan@canonical.com>"
-Description:
-               Ideapad capability bits.
-               Bit 8-10: 1 - Intel graphic only
-                         2 - ATI graphic only
-                         3 - Nvidia graphic only
-                         4 - Intel and ATI graphic
-                         5 - Intel and Nvidia graphic
-               Bit 16: Bluetooth exist (1 for exist)
-               Bit 17: 3G exist (1 for exist)
-               Bit 18: Wifi exist (1 for exist)
-               Bit 19: Camera exist (1 for exist)
 
index 207e1a5..3bc8a61 100644 (file)
@@ -352,6 +352,7 @@ typedef enum fe_delivery_system {
        SYS_CMMB,
        SYS_DAB,
        SYS_DVBT2,
+       SYS_TURBO,
 } fe_delivery_system_t;
 </programlisting>
                </section>
@@ -809,6 +810,8 @@ typedef enum fe_hierarchy {
                        <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
                        <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
                        <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
+                       <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem>
+                       <listitem><para><link linkend="DTV-TONE"><constant>DTV_TONE</constant></link></para></listitem>
                </itemizedlist>
                <para>Future implementations might add those two missing parameters:</para>
                <itemizedlist mark='opencircle'>
@@ -818,25 +821,18 @@ typedef enum fe_hierarchy {
        </section>
        <section id="dvbs2-params">
                <title>DVB-S2 delivery system</title>
-               <para>The following parameters are valid for DVB-S2:</para>
+               <para>In addition to all parameters valid for DVB-S, DVB-S2 supports the following parameters:</para>
                <itemizedlist mark='opencircle'>
-                       <listitem><para><link linkend="DTV-API-VERSION"><constant>DTV_API_VERSION</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-DELIVERY-SYSTEM"><constant>DTV_DELIVERY_SYSTEM</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-TUNE"><constant>DTV_TUNE</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-CLEAR"><constant>DTV_CLEAR</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-FREQUENCY"><constant>DTV_FREQUENCY</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-INVERSION"><constant>DTV_INVERSION</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-SYMBOL-RATE"><constant>DTV_SYMBOL_RATE</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-INNER-FEC"><constant>DTV_INNER_FEC</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-VOLTAGE"><constant>DTV_VOLTAGE</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-TONE"><constant>DTV_TONE</constant></link></para></listitem>
+                       <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
                        <listitem><para><link linkend="DTV-PILOT"><constant>DTV_PILOT</constant></link></para></listitem>
                        <listitem><para><link linkend="DTV-ROLLOFF"><constant>DTV_ROLLOFF</constant></link></para></listitem>
                </itemizedlist>
-               <para>Future implementations might add those two missing parameters:</para>
+       </section>
+       <section id="turbo-params">
+               <title>Turbo code delivery system</title>
+               <para>In addition to all parameters valid for DVB-S, turbo code supports the following parameters:</para>
                <itemizedlist mark='opencircle'>
-                       <listitem><para><link linkend="DTV-DISEQC-MASTER"><constant>DTV_DISEQC_MASTER</constant></link></para></listitem>
-                       <listitem><para><link linkend="DTV-DISEQC-SLAVE-REPLY"><constant>DTV_DISEQC_SLAVE_REPLY</constant></link></para></listitem>
+                       <listitem><para><link linkend="DTV-MODULATION"><constant>DTV_MODULATION</constant></link></para></listitem>
                </itemizedlist>
        </section>
        <section id="isdbs-params">
index c75dc7c..170064a 100644 (file)
@@ -205,7 +205,7 @@ a partial path like:</para>
 additional include file <emphasis
 role="tt">linux/dvb/version.h</emphasis> exists, which defines the
 constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document
-describes <emphasis role="tt">DVB_API_VERSION&#x00A0;3</emphasis>.
+describes <emphasis role="tt">DVB_API_VERSION 5.4</emphasis>.
 </para>
 
 </section>
index ce1004a..91410b6 100644 (file)
@@ -2370,6 +2370,14 @@ that used it. It was originally scheduled for removal in 2.6.35.
         </listitem>
       </orderedlist>
     </section>
+    <section>
+      <title>V4L2 in Linux 3.2</title>
+      <orderedlist>
+        <listitem>
+         <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para>
+        </listitem>
+      </orderedlist>
+    </section>
 
     <section id="other">
       <title>Relation of V4L2 to other Linux multimedia APIs</title>
index 05c8fef..0916a73 100644 (file)
 
       <para>When satisfied with the try results, applications can set the active
       formats by setting the <structfield>which</structfield> argument to
-      <constant>V4L2_SUBDEV_FORMAT_TRY</constant>. Active formats are changed
+      <constant>V4L2_SUBDEV_FORMAT_ACTIVE</constant>. Active formats are changed
       exactly as try formats by drivers. To avoid modifying the hardware state
       during format negotiation, applications should negotiate try formats first
       and then modify the active settings using the try formats returned during
index 0d05e87..40132c2 100644 (file)
@@ -128,6 +128,13 @@ structs, ioctls) must be noted in more detail in the history chapter
 applications. -->
 
       <revision>
+       <revnumber>3.2</revnumber>
+       <date>2011-08-26</date>
+       <authorinitials>hv</authorinitials>
+       <revremark>Added V4L2_CTRL_FLAG_VOLATILE.</revremark>
+      </revision>
+
+      <revision>
        <revnumber>3.1</revnumber>
        <date>2011-06-27</date>
        <authorinitials>mcc, po, hv</authorinitials>
@@ -410,7 +417,7 @@ and discussions on the V4L mailing list.</revremark>
 </partinfo>
 
 <title>Video for Linux Two API Specification</title>
- <subtitle>Revision 3.1</subtitle>
+ <subtitle>Revision 3.2</subtitle>
 
   <chapter id="common">
     &sub-common;
index 7769642..e8714aa 100644 (file)
          </row>
          <row>
            <entry></entry>
+           <entry>&v4l2-event-frame-sync;</entry>
+            <entry><structfield>frame</structfield></entry>
+           <entry>Event data for event V4L2_EVENT_FRAME_SYNC.</entry>
+         </row>
+         <row>
+           <entry></entry>
            <entry>__u8</entry>
             <entry><structfield>data</structfield>[64]</entry>
            <entry>Event data. Defined by the event type. The union
       </tgroup>
     </table>
 
+    <table frame="none" pgwide="1" id="v4l2-event-vsync">
+      <title>struct <structname>v4l2_event_vsync</structname></title>
+      <tgroup cols="3">
+       &cs-str;
+       <tbody valign="top">
+         <row>
+           <entry>__u8</entry>
+           <entry><structfield>field</structfield></entry>
+           <entry>The upcoming field. See &v4l2-field;.</entry>
+         </row>
+       </tbody>
+      </tgroup>
+    </table>
+
+    <table frame="none" pgwide="1" id="v4l2-event-ctrl">
+      <title>struct <structname>v4l2_event_ctrl</structname></title>
+      <tgroup cols="4">
+       &cs-str;
+       <tbody valign="top">
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>changes</structfield></entry>
+           <entry></entry>
+           <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry>
+         </row>
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>type</structfield></entry>
+           <entry></entry>
+           <entry>The type of the control. See &v4l2-ctrl-type;.</entry>
+         </row>
+         <row>
+           <entry>union (anonymous)</entry>
+           <entry></entry>
+           <entry></entry>
+           <entry></entry>
+         </row>
+         <row>
+           <entry></entry>
+           <entry>__s32</entry>
+           <entry><structfield>value</structfield></entry>
+           <entry>The 32-bit value of the control for 32-bit control types.
+               This is 0 for string controls since the value of a string
+               cannot be passed using &VIDIOC-DQEVENT;.</entry>
+         </row>
+         <row>
+           <entry></entry>
+           <entry>__s64</entry>
+           <entry><structfield>value64</structfield></entry>
+           <entry>The 64-bit value of the control for 64-bit control types.</entry>
+         </row>
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>flags</structfield></entry>
+           <entry></entry>
+           <entry>The control flags. See <xref linkend="control-flags" />.</entry>
+         </row>
+         <row>
+           <entry>__s32</entry>
+           <entry><structfield>minimum</structfield></entry>
+           <entry></entry>
+           <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry>
+         </row>
+         <row>
+           <entry>__s32</entry>
+           <entry><structfield>maximum</structfield></entry>
+           <entry></entry>
+           <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry>
+         </row>
+         <row>
+           <entry>__s32</entry>
+           <entry><structfield>step</structfield></entry>
+           <entry></entry>
+           <entry>The step value of the control. See &v4l2-queryctrl;.</entry>
+         </row>
+         <row>
+           <entry>__s32</entry>
+           <entry><structfield>default_value</structfield></entry>
+           <entry></entry>
+           <entry>The default value value of the control. See &v4l2-queryctrl;.</entry>
+         </row>
+       </tbody>
+      </tgroup>
+    </table>
+
+    <table frame="none" pgwide="1" id="v4l2-event-frame-sync">
+      <title>struct <structname>v4l2_event_frame_sync</structname></title>
+      <tgroup cols="3">
+       &cs-str;
+       <tbody valign="top">
+         <row>
+           <entry>__u32</entry>
+           <entry><structfield>frame_sequence</structfield></entry>
+           <entry>
+             The sequence number of the frame being received.
+           </entry>
+         </row>
+       </tbody>
+      </tgroup>
+    </table>
+
+    <table pgwide="1" frame="none" id="changes-flags">
+      <title>Changes</title>
+      <tgroup cols="3">
+       &cs-def;
+       <tbody valign="top">
+         <row>
+           <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry>
+           <entry>0x0001</entry>
+           <entry>This control event was triggered because the value of the control
+               changed. Special case: if a button control is pressed, then this
+               event is sent as well, even though there is not explicit value
+               associated with a button control.</entry>
+         </row>
+         <row>
+           <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
+           <entry>0x0002</entry>
+           <entry>This control event was triggered because the control flags
+               changed.</entry>
+         </row>
+       </tbody>
+      </tgroup>
+    </table>
   </refsect1>
   <refsect1>
     &return-value;
index 677ea64..0ac0057 100644 (file)
@@ -406,6 +406,15 @@ flag is typically present for relative controls or action controls where
 writing a value will cause the device to carry out a given action
 (&eg; motor control) but no meaningful value can be returned.</entry>
          </row>
+         <row>
+           <entry><constant>V4L2_CTRL_FLAG_VOLATILE</constant></entry>
+           <entry>0x0080</entry>
+           <entry>This control is volatile, which means that the value of the control
+changes continuously. A typical example would be the current gain value if the device
+is in auto-gain mode. In such a case the hardware calculates the gain value based on
+the lighting conditions which can change over time. Note that setting a new value for
+a volatile control will have no effect. The new value will just be ignored.</entry>
+         </row>
        </tbody>
       </tgroup>
     </table>
index 69c0d8a..5c70b61 100644 (file)
            </entry>
          </row>
          <row>
+           <entry><constant>V4L2_EVENT_FRAME_SYNC</constant></entry>
+           <entry>4</entry>
+           <entry>
+             <para>Triggered immediately when the reception of a
+             frame has begun. This event has a
+             &v4l2-event-frame-sync; associated with it.</para>
+
+             <para>If the hardware needs to be stopped in the case of a
+             buffer underrun it might not be able to generate this event.
+             In such cases the <structfield>frame_sequence</structfield>
+             field in &v4l2-event-frame-sync; will not be incremented. This
+             causes two consecutive frame sequence numbers to have n times
+             frame interval in between them.</para>
+           </entry>
+         </row>
+         <row>
            <entry><constant>V4L2_EVENT_PRIVATE_START</constant></entry>
            <entry>0x08000000</entry>
            <entry>Base event number for driver-private events.</entry>
       </tgroup>
     </table>
 
-    <table frame="none" pgwide="1" id="v4l2-event-vsync">
-      <title>struct <structname>v4l2_event_vsync</structname></title>
-      <tgroup cols="3">
-       &cs-str;
-       <tbody valign="top">
-         <row>
-           <entry>__u8</entry>
-           <entry><structfield>field</structfield></entry>
-           <entry>The upcoming field. See &v4l2-field;.</entry>
-         </row>
-       </tbody>
-      </tgroup>
-    </table>
-
-    <table frame="none" pgwide="1" id="v4l2-event-ctrl">
-      <title>struct <structname>v4l2_event_ctrl</structname></title>
-      <tgroup cols="4">
-       &cs-str;
-       <tbody valign="top">
-         <row>
-           <entry>__u32</entry>
-           <entry><structfield>changes</structfield></entry>
-           <entry></entry>
-           <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry>
-         </row>
-         <row>
-           <entry>__u32</entry>
-           <entry><structfield>type</structfield></entry>
-           <entry></entry>
-           <entry>The type of the control. See &v4l2-ctrl-type;.</entry>
-         </row>
-         <row>
-           <entry>union (anonymous)</entry>
-           <entry></entry>
-           <entry></entry>
-           <entry></entry>
-         </row>
-         <row>
-           <entry></entry>
-           <entry>__s32</entry>
-           <entry><structfield>value</structfield></entry>
-           <entry>The 32-bit value of the control for 32-bit control types.
-               This is 0 for string controls since the value of a string
-               cannot be passed using &VIDIOC-DQEVENT;.</entry>
-         </row>
-         <row>
-           <entry></entry>
-           <entry>__s64</entry>
-           <entry><structfield>value64</structfield></entry>
-           <entry>The 64-bit value of the control for 64-bit control types.</entry>
-         </row>
-         <row>
-           <entry>__u32</entry>
-           <entry><structfield>flags</structfield></entry>
-           <entry></entry>
-           <entry>The control flags. See <xref linkend="control-flags" />.</entry>
-         </row>
-         <row>
-           <entry>__s32</entry>
-           <entry><structfield>minimum</structfield></entry>
-           <entry></entry>
-           <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry>
-         </row>
-         <row>
-           <entry>__s32</entry>
-           <entry><structfield>maximum</structfield></entry>
-           <entry></entry>
-           <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry>
-         </row>
-         <row>
-           <entry>__s32</entry>
-           <entry><structfield>step</structfield></entry>
-           <entry></entry>
-           <entry>The step value of the control. See &v4l2-queryctrl;.</entry>
-         </row>
-         <row>
-           <entry>__s32</entry>
-           <entry><structfield>default_value</structfield></entry>
-           <entry></entry>
-           <entry>The default value value of the control. See &v4l2-queryctrl;.</entry>
-         </row>
-       </tbody>
-      </tgroup>
-    </table>
-
-    <table pgwide="1" frame="none" id="changes-flags">
-      <title>Changes</title>
-      <tgroup cols="3">
-       &cs-def;
-       <tbody valign="top">
-         <row>
-           <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry>
-           <entry>0x0001</entry>
-           <entry>This control event was triggered because the value of the control
-               changed. Special case: if a button control is pressed, then this
-               event is sent as well, even though there is not explicit value
-               associated with a button control.</entry>
-         </row>
-         <row>
-           <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
-           <entry>0x0002</entry>
-           <entry>This control event was triggered because the control flags
-               changed.</entry>
-         </row>
-       </tbody>
-      </tgroup>
-    </table>
   </refsect1>
   <refsect1>
     &return-value;
index c466f58..e67be7a 100755 (executable)
@@ -27,7 +27,8 @@ use IO::Handle;
                "or51211", "or51132_qam", "or51132_vsb", "bluebird",
                "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
                "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
-               "lme2510c_s7395_old", "drxk", "drxk_terratec_h5");
+               "lme2510c_s7395_old", "drxk", "drxk_terratec_h5", "tda10071",
+               "it9135" );
 
 # Check args
 syntax() if (scalar(@ARGV) != 1);
@@ -575,19 +576,10 @@ sub ngene {
 }
 
 sub az6027{
-    my $file = "AZ6027_Linux_Driver.tar.gz";
-    my $url = "http://linux.terratec.de/files/$file";
     my $firmware = "dvb-usb-az6027-03.fw";
+    my $url = "http://linux.terratec.de/files/TERRATEC_S7/$firmware";
 
-    wgetfile($file, $url);
-
-    #untar
-    if( system("tar xzvf $file $firmware")){
-        die "failed to untar firmware";
-    }
-    if( system("rm $file")){
-        die ("unable to remove unnecessary files");
-    }
+    wgetfile($firmware, $url);
 
     $firmware;
 }
@@ -665,6 +657,41 @@ sub drxk_terratec_h5 {
     "$fwfile"
 }
 
+sub it9135 {
+    my $url = "http://kworld.server261.com/kworld/CD/ITE_TiVme/V1.00/";
+    my $zipfile = "Driver_V10.323.1.0412.100412.zip";
+    my $hash = "79b597dc648698ed6820845c0c9d0d37";
+    my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0);
+    my $drvfile = "Driver_V10.323.1.0412.100412/Data/x86/IT9135BDA.sys";
+    my $fwfile = "dvb-usb-it9137-01.fw";
+
+    checkstandard();
+
+    wgetfile($zipfile, $url . $zipfile);
+    verify($zipfile, $hash);
+    unzip($zipfile, $tmpdir);
+    extract("$tmpdir/$drvfile", 69632, 5731, "$fwfile");
+
+    "$fwfile"
+}
+
+sub tda10071 {
+    my $sourcefile = "PCTV_460e_reference.zip";
+    my $url = "ftp://ftp.pctvsystems.com/TV/driver/PCTV%2070e%2080e%20100e%20320e%20330e%20800e/";
+    my $hash = "4403de903bf2593464c8d74bbc200a57";
+    my $fwfile = "dvb-fe-tda10071.fw";
+    my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
+
+    checkstandard();
+
+    wgetfile($sourcefile, $url . $sourcefile);
+    verify($sourcefile, $hash);
+    unzip($sourcefile, $tmpdir);
+    extract("$tmpdir/PCTV\ 70e\ 80e\ 100e\ 320e\ 330e\ 800e/32\ bit/emOEM.sys", 0x67d38, 40504, $fwfile);
+
+    "$fwfile";
+}
+
 # ---------------------------------------------------------------
 # Utilities
 
diff --git a/Documentation/dvb/it9137.txt b/Documentation/dvb/it9137.txt
new file mode 100644 (file)
index 0000000..9e6726e
--- /dev/null
@@ -0,0 +1,9 @@
+To extract firmware for Kworld UB499-2T (id 1b80:e409) you need to copy the
+following file(s) to this directory.
+
+IT9135BDA.sys Dated Mon 22 Mar 2010 02:20:08 GMT
+
+extract using dd
+dd if=IT9135BDA.sys ibs=1 skip=69632 count=5731 of=dvb-usb-it9137-01.fw
+
+copy to default firmware location.
index d5ac362..7c799fc 100644 (file)
@@ -495,29 +495,6 @@ Who:       Jean Delvare <khali@linux-fr.org>
 
 ----------------------------
 
-What:  Support for UVCIOC_CTRL_ADD in the uvcvideo driver
-When:  3.2
-Why:   The information passed to the driver by this ioctl is now queried
-       dynamically from the device.
-Who:   Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
-----------------------------
-
-What:  Support for UVCIOC_CTRL_MAP_OLD in the uvcvideo driver
-When:  3.2
-Why:   Used only by applications compiled against older driver versions.
-       Superseded by UVCIOC_CTRL_MAP which supports V4L2 menu controls.
-Who:   Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
-----------------------------
-
-What:  Support for UVCIOC_CTRL_GET and UVCIOC_CTRL_SET in the uvcvideo driver
-When:  3.2
-Why:   Superseded by the UVCIOC_CTRL_QUERY ioctl.
-Who:   Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
-----------------------------
-
 What:  Support for driver specific ioctls in the pwc driver (everything
        defined in media/pwc-ioctl.h)
 When:  3.3
index c2efe28..a0c5c5f 100644 (file)
@@ -741,10 +741,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                        See Documentation/block/cfq-iosched.txt and
                        Documentation/block/deadline-iosched.txt for details.
 
-       elfcorehdr=     [IA-64,PPC,SH,X86]
+       elfcorehdr=[size[KMG]@]offset[KMG] [IA64,PPC,SH,X86,S390]
                        Specifies physical address of start of kernel core
-                       image elf header. Generally kexec loader will
-                       pass this option to capture kernel.
+                       image elf header and optionally the size. Generally
+                       kexec loader will pass this option to capture kernel.
                        See Documentation/kdump/kdump.txt for details.
 
        enable_mtrr_cleanup [X86]
index 5bfa9a7..b15e29f 100644 (file)
@@ -8,6 +8,7 @@ xxxx            vend:prod
 ----
 spca501                0000:0000       MystFromOri Unknown Camera
 spca508                0130:0130       Clone Digital Webcam 11043
+zc3xx          03f0:1b07       HP Premium Starter Cam
 m5602          0402:5602       ALi Video Camera Controller
 spca501                040a:0002       Kodak DVC-325
 spca500                040a:0300       Kodak EZ200
@@ -190,6 +191,7 @@ ov519               05a9:0519       OV519 Microphone
 ov519          05a9:0530       OmniVision
 ov519          05a9:2800       OmniVision SuperCAM
 ov519          05a9:4519       Webcam Classic
+ov534_9                05a9:8065       OmniVision test kit ov538+ov9712
 ov519          05a9:8519       OmniVision
 ov519          05a9:a511       D-Link USB Digital Video Camera
 ov519          05a9:a518       D-Link DSB-C310 Webcam
@@ -199,6 +201,8 @@ gl860               05e3:0503       Genesys Logic PC Camera
 gl860          05e3:f191       Genesys Logic PC Camera
 spca561                060b:a001       Maxell Compact Pc PM3
 zc3xx          0698:2003       CTX M730V built in
+topro          06a2:0003       TP6800 PC Camera, CmoX CX0342 webcam
+topro          06a2:6810       Creative Qmax
 nw80x          06a5:0000       Typhoon Webcam 100 USB
 nw80x          06a5:d001       Divio based webcams
 nw80x          06a5:d800       Divio Chicony TwinkleCam, Trust SpaceCam
index 69be2c7..5dd1439 100644 (file)
@@ -70,10 +70,11 @@ Events
 The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and
 statistics (AEWB, AF and histogram) subdevs.
 
-The CCDC subdev produces V4L2_EVENT_OMAP3ISP_HS_VS type event on HS_VS
-interrupt which is used to signal frame start. The event is triggered exactly
-when the reception of the first line of the frame starts in the CCDC module.
-The event can be subscribed on the CCDC subdev.
+The CCDC subdev produces V4L2_EVENT_FRAME_SYNC type event on HS_VS
+interrupt which is used to signal frame start. Earlier version of this
+driver used V4L2_EVENT_OMAP3ISP_HS_VS for this purpose. The event is
+triggered exactly when the reception of the first line of the frame starts
+in the CCDC module. The event can be subscribed on the CCDC subdev.
 
 (When using parallel interface one must pay account to correct configuration
 of the VS signal polarity. This is automatically correct when using the serial
index 9346fc8..26aa057 100644 (file)
@@ -285,11 +285,11 @@ implement g_volatile_ctrl like this:
 Note that you use the 'new value' union as well in g_volatile_ctrl. In general
 controls that need to implement g_volatile_ctrl are read-only controls.
 
-To mark a control as volatile you have to set the is_volatile flag:
+To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE:
 
        ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...);
        if (ctrl)
-               ctrl->is_volatile = 1;
+               ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
 
 For try/s_ctrl the new values (i.e. as passed by the user) are filled in and
 you can modify them in try_ctrl or set them in s_ctrl. The 'cur' union
@@ -367,8 +367,7 @@ Driver specific controls can be created using v4l2_ctrl_new_custom():
 The last argument is the priv pointer which can be set to driver-specific
 private data.
 
-The v4l2_ctrl_config struct also has fields to set the is_private and is_volatile
-flags.
+The v4l2_ctrl_config struct also has a field to set the is_private flag.
 
 If the name field is not set, then the framework will assume this is a standard
 control and will fill in the name, type and flags fields accordingly.
@@ -496,18 +495,20 @@ Handling autogain/gain-type Controls with Auto Clusters
 
 A common type of control cluster is one that handles 'auto-foo/foo'-type
 controls. Typical examples are autogain/gain, autoexposure/exposure,
-autowhitebalance/red balance/blue balance. In all cases you have one controls
+autowhitebalance/red balance/blue balance. In all cases you have one control
 that determines whether another control is handled automatically by the hardware,
 or whether it is under manual control from the user.
 
 If the cluster is in automatic mode, then the manual controls should be
-marked inactive. When the volatile controls are read the g_volatile_ctrl
-operation should return the value that the hardware's automatic mode set up
-automatically.
+marked inactive and volatile. When the volatile controls are read the
+g_volatile_ctrl operation should return the value that the hardware's automatic
+mode set up automatically.
 
 If the cluster is put in manual mode, then the manual controls should become
-active again and the is_volatile flag should be ignored (so g_volatile_ctrl is
-no longer called while in manual mode).
+active again and the volatile flag is cleared (so g_volatile_ctrl is no longer
+called while in manual mode). In addition just before switching to manual mode
+the current values as determined by the auto mode are copied as the new manual
+values.
 
 Finally the V4L2_CTRL_FLAG_UPDATE should be set for the auto control since
 changing that control affects the control flags of the manual controls.
@@ -520,7 +521,11 @@ void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls,
 
 The first two arguments are identical to v4l2_ctrl_cluster. The third argument
 tells the framework which value switches the cluster into manual mode. The
-last argument will optionally set the is_volatile flag for the non-auto controls.
+last argument will optionally set V4L2_CTRL_FLAG_VOLATILE for the non-auto controls.
+If it is false, then the manual controls are never volatile. You would typically
+use that if the hardware does not give you the option to read back to values as
+determined by the auto mode (e.g. if autogain is on, the hardware doesn't allow
+you to obtain the current gain value).
 
 The first control of the cluster is assumed to be the 'auto' control.
 
@@ -681,16 +686,6 @@ if there are no controls at all.
 count if nothing was done yet. If it is less than count then only the controls
 up to error_idx-1 were successfully applied.
 
-3) When attempting to read a button control the framework will return -EACCES
-instead of -EINVAL as stated in the spec. It seems to make more sense since
-button controls are write-only controls.
-
-4) Attempting to write to a read-only control will return -EACCES instead of
--EINVAL as the spec says.
-
-5) The spec does not mention what should happen when you try to set/get a
-control class controls. The framework will return -EACCES.
-
 
 Proposals for Extensions
 ========================
@@ -703,9 +698,3 @@ decimal. Useful for e.g. video_mute_yuv.
 2) It is possible to mark in the controls array which controls have been
 successfully written and which failed by for example adding a bit to the
 control ID. Not sure if it is worth the effort, though.
-
-3) Trying to set volatile inactive controls should result in -EACCESS.
-
-4) Add a new flag to mark volatile controls. Any application that wants
-to store the state of the controls can then skip volatile inactive controls.
-Currently it is not possible to detect such controls.
index 3c17a20..4befa12 100644 (file)
@@ -1089,6 +1089,24 @@ F:       arch/arm/plat-s5p/dev-fimc*
 F:     arch/arm/plat-samsung/include/plat/*fimc*
 F:     drivers/media/video/s5p-fimc/
 
+ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT
+M:     Kyungmin Park <kyungmin.park@samsung.com>
+M:     Kamil Debski <k.debski@samsung.com>
+L:     linux-arm-kernel@lists.infradead.org
+L:     linux-media@vger.kernel.org
+S:     Maintained
+F:     arch/arm/plat-s5p/dev-mfc.c
+F:     drivers/media/video/s5p-mfc/
+
+ARM/SAMSUNG S5P SERIES TV SUBSYSTEM SUPPORT
+M:     Kyungmin Park <kyungmin.park@samsung.com>
+M:     Tomasz Stanislawski <t.stanislaws@samsung.com>
+L:     linux-arm-kernel@lists.infradead.org
+L:     linux-media@vger.kernel.org
+S:     Maintained
+F:     arch/arm/plat-s5p/dev-tv.c
+F:     drivers/media/video/s5p-tv/
+
 ARM/SHMOBILE ARM ARCHITECTURE
 M:     Paul Mundt <lethal@linux-sh.org>
 M:     Magnus Damm <magnus.damm@gmail.com>
index a569514..3a3e5b8 100644 (file)
 #include <linux/dma-attrs.h>
 #include <asm/io.h>
 #include <asm-generic/dma-coherent.h>
+#include <asm/cacheflush.h>
 
 #define DMA_ERROR_CODE         (~(dma_addr_t)0x0)
 
 #define __dma_alloc_coherent(dev, gfp, size, handle)   NULL
 #define __dma_free_coherent(size, addr)                ((void)0)
-#define __dma_sync(addr, size, rw)             ((void)0)
 
 static inline unsigned long device_to_mask(struct device *dev)
 {
@@ -95,6 +95,22 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
 
 #include <asm-generic/dma-mapping-common.h>
 
+static inline void __dma_sync(unsigned long paddr,
+                             size_t size, enum dma_data_direction direction)
+{
+       switch (direction) {
+       case DMA_TO_DEVICE:
+       case DMA_BIDIRECTIONAL:
+               flush_dcache_range(paddr, paddr + size);
+               break;
+       case DMA_FROM_DEVICE:
+               invalidate_dcache_range(paddr, paddr + size);
+               break;
+       default:
+               BUG();
+       }
+}
+
 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
        struct dma_map_ops *ops = get_dma_ops(dev);
@@ -135,7 +151,7 @@ static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                enum dma_data_direction direction)
 {
        BUG_ON(direction == DMA_NONE);
-       __dma_sync(vaddr, size, (int)direction);
+       __dma_sync(virt_to_phys(vaddr), size, (int)direction);
 }
 
 #endif /* _ASM_MICROBLAZE_DMA_MAPPING_H */
index 098dfdd..834849f 100644 (file)
  * I've snaffled the value from the microblaze binutils source code
  * /binutils/microblaze/include/elf/microblaze.h
  */
-#define EM_XILINX_MICROBLAZE   0xbaab
-#define ELF_ARCH               EM_XILINX_MICROBLAZE
+#define EM_MICROBLAZE          189
+#define EM_MICROBLAZE_OLD      0xbaab
+#define ELF_ARCH               EM_MICROBLAZE
 
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
-#define elf_check_arch(x)      ((x)->e_machine == EM_XILINX_MICROBLAZE)
+#define elf_check_arch(x)      ((x)->e_machine == EM_MICROBLAZE \
+                                || (x)->e_machine == EM_MICROBLAZE_OLD)
 
 /*
  * These are used to set parameters in the core dumps.
index e6a2284..5a433cb 100644 (file)
@@ -17,8 +17,6 @@
 #include <asm-generic/cmpxchg.h>
 #include <asm-generic/cmpxchg-local.h>
 
-#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
-
 struct task_struct;
 struct thread_info;
 
@@ -96,11 +94,4 @@ extern struct dentry *of_debugfs_root;
 
 #define arch_align_stack(x) (x)
 
-/*
- * MicroBlaze doesn't handle unaligned accesses in hardware.
- *
- * Based on this we force the IP header alignment in network drivers.
- */
-#define NET_IP_ALIGN   2
-
 #endif /* _ASM_MICROBLAZE_SYSTEM_H */
index 5bb95a1..072b007 100644 (file)
@@ -95,7 +95,7 @@ static inline int ___range_ok(unsigned long addr, unsigned long size)
  *  - "addr", "addr + size" and "size" are all below the limit
  */
 #define access_ok(type, addr, size) \
-       (get_fs().seg > (((unsigned long)(addr)) | \
+       (get_fs().seg >= (((unsigned long)(addr)) | \
                (size) | ((unsigned long)(addr) + (size))))
 
 /* || printk("access_ok failed for %s at 0x%08lx (size %d), seg 0x%08x\n",
index 44394d8..54194b2 100644 (file)
@@ -34,6 +34,7 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
        {"8.00.a", 0x12},
        {"8.00.b", 0x13},
        {"8.10.a", 0x14},
+       {"8.20.a", 0x15},
        {NULL, 0},
 };
 
index 393e6b2..dc6416d 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/gfp.h>
 #include <linux/dma-debug.h>
 #include <asm/bug.h>
-#include <asm/cacheflush.h>
 
 /*
  * Generic direct DMA implementation
  * can set archdata.dma_data to an unsigned long holding the offset. By
  * default the offset is PCI_DRAM_OFFSET.
  */
-static inline void __dma_sync_page(unsigned long paddr, unsigned long offset,
-                               size_t size, enum dma_data_direction direction)
-{
-       switch (direction) {
-       case DMA_TO_DEVICE:
-       case DMA_BIDIRECTIONAL:
-               flush_dcache_range(paddr + offset, paddr + offset + size);
-               break;
-       case DMA_FROM_DEVICE:
-               invalidate_dcache_range(paddr + offset, paddr + offset + size);
-               break;
-       default:
-               BUG();
-       }
-}
 
 static unsigned long get_dma_direct_offset(struct device *dev)
 {
@@ -91,7 +75,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
        /* FIXME this part of code is untested */
        for_each_sg(sgl, sg, nents, i) {
                sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
-               __dma_sync_page(page_to_phys(sg_page(sg)), sg->offset,
+               __dma_sync(page_to_phys(sg_page(sg)) + sg->offset,
                                                        sg->length, direction);
        }
 
@@ -116,7 +100,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev,
                                             enum dma_data_direction direction,
                                             struct dma_attrs *attrs)
 {
-       __dma_sync_page(page_to_phys(page), offset, size, direction);
+       __dma_sync(page_to_phys(page) + offset, size, direction);
        return page_to_phys(page) + offset + get_dma_direct_offset(dev);
 }
 
@@ -131,7 +115,63 @@ static inline void dma_direct_unmap_page(struct device *dev,
  * phys_to_virt is here because in __dma_sync_page is __virt_to_phys and
  * dma_address is physical address
  */
-       __dma_sync_page(dma_address, 0 , size, direction);
+       __dma_sync(dma_address, size, direction);
+}
+
+static inline void
+dma_direct_sync_single_for_cpu(struct device *dev,
+                              dma_addr_t dma_handle, size_t size,
+                              enum dma_data_direction direction)
+{
+       /*
+        * It's pointless to flush the cache as the memory segment
+        * is given to the CPU
+        */
+
+       if (direction == DMA_FROM_DEVICE)
+               __dma_sync(dma_handle, size, direction);
+}
+
+static inline void
+dma_direct_sync_single_for_device(struct device *dev,
+                                 dma_addr_t dma_handle, size_t size,
+                                 enum dma_data_direction direction)
+{
+       /*
+        * It's pointless to invalidate the cache if the device isn't
+        * supposed to write to the relevant region
+        */
+
+       if (direction == DMA_TO_DEVICE)
+               __dma_sync(dma_handle, size, direction);
+}
+
+static inline void
+dma_direct_sync_sg_for_cpu(struct device *dev,
+                          struct scatterlist *sgl, int nents,
+                          enum dma_data_direction direction)
+{
+       struct scatterlist *sg;
+       int i;
+
+       /* FIXME this part of code is untested */
+       if (direction == DMA_FROM_DEVICE)
+               for_each_sg(sgl, sg, nents, i)
+                       __dma_sync(sg->dma_address, sg->length, direction);
+}
+
+static inline void
+dma_direct_sync_sg_for_device(struct device *dev,
+                             struct scatterlist *sgl, int nents,
+                             enum dma_data_direction direction)
+{
+       struct scatterlist *sg;
+       int i;
+
+       /* FIXME this part of code is untested */
+       if (direction == DMA_TO_DEVICE)
+               for_each_sg(sgl, sg, nents, i)
+                       __dma_sync(sg->dma_address, sg->length, direction);
 }
 
 struct dma_map_ops dma_direct_ops = {
@@ -142,6 +182,10 @@ struct dma_map_ops dma_direct_ops = {
        .dma_supported  = dma_direct_dma_supported,
        .map_page       = dma_direct_map_page,
        .unmap_page     = dma_direct_unmap_page,
+       .sync_single_for_cpu            = dma_direct_sync_single_for_cpu,
+       .sync_single_for_device         = dma_direct_sync_single_for_device,
+       .sync_sg_for_cpu                = dma_direct_sync_sg_for_cpu,
+       .sync_sg_for_device             = dma_direct_sync_sg_for_device,
 };
 EXPORT_SYMBOL(dma_direct_ops);
 
index 66fad23..6348dc8 100644 (file)
@@ -119,7 +119,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type,
        case MICROBLAZE_DIV_ZERO_EXCEPTION:
                if (user_mode(regs)) {
                        pr_debug("Divide by zero exception in user mode\n");
-                       _exception(SIGILL, regs, FPE_INTDIV, addr);
+                       _exception(SIGFPE, regs, FPE_INTDIV, addr);
                        return;
                }
                printk(KERN_WARNING "Divide by zero exception " \
index dbb8124..95cc295 100644 (file)
@@ -179,6 +179,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 
        ti->cpu_context.msr = (childregs->msr|MSR_VM);
        ti->cpu_context.msr &= ~MSR_UMS; /* switch_to to kernel mode */
+       ti->cpu_context.msr &= ~MSR_IE;
 #endif
        ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8;
 
index 6a8e0cc..043cb58 100644 (file)
@@ -148,7 +148,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
                ret = -1L;
 
        if (unlikely(current->audit_context))
-               audit_syscall_entry(EM_XILINX_MICROBLAZE, regs->r12,
+               audit_syscall_entry(EM_MICROBLAZE, regs->r12,
                                    regs->r5, regs->r6,
                                    regs->r7, regs->r8);
 
index e5550ce..af74b11 100644 (file)
@@ -308,7 +308,8 @@ unsigned long long notrace sched_clock(void)
 {
        if (timer_initialized) {
                struct clocksource *cs = &clocksource_microblaze;
-               cycle_t cyc = cnt32_to_63(cs->read(NULL));
+
+               cycle_t cyc = cnt32_to_63(cs->read(NULL)) & LLONG_MAX;
                return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
        }
        return 0;
index 10c320a..c13067b 100644 (file)
@@ -25,5 +25,6 @@ lib-y += lshrdi3.o
 lib-y += modsi3.o
 lib-y += muldi3.o
 lib-y += mulsi3.o
+lib-y += ucmpdi2.o
 lib-y += udivsi3.o
 lib-y += umodsi3.o
index 5810cec..f037266 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <linux/errno.h>
 #include <linux/linkage.h>
+#include <asm/page.h>
 
 /*
  * int __strncpy_user(char *to, char *from, int len);
@@ -33,8 +34,8 @@ __strncpy_user:
         * r3 - temp count
         * r4 - temp val
         */
+       beqid   r7,3f
        addik   r3,r7,0         /* temp_count = len */
-       beqi    r3,3f
 1:
        lbu     r4,r6,r0
        sb      r4,r5,r0
@@ -76,8 +77,8 @@ __strncpy_user:
 .type  __strnlen_user, @function
 .align 4;
 __strnlen_user:
+       beqid   r6,3f
        addik   r3,r6,0
-       beqi    r3,3f
 1:
        lbu     r4,r5,r0
        beqid   r4,2f           /* break on NUL */
@@ -102,6 +103,49 @@ __strnlen_user:
        .section        __ex_table,"a"
        .word   1b,4b
 
+/* Loop unrolling for __copy_tofrom_user */
+#define COPY(offset)   \
+1:     lwi     r4 , r6, 0x0000 + offset;       \
+2:     lwi     r19, r6, 0x0004 + offset;       \
+3:     lwi     r20, r6, 0x0008 + offset;       \
+4:     lwi     r21, r6, 0x000C + offset;       \
+5:     lwi     r22, r6, 0x0010 + offset;       \
+6:     lwi     r23, r6, 0x0014 + offset;       \
+7:     lwi     r24, r6, 0x0018 + offset;       \
+8:     lwi     r25, r6, 0x001C + offset;       \
+9:     swi     r4 , r5, 0x0000 + offset;       \
+10:    swi     r19, r5, 0x0004 + offset;       \
+11:    swi     r20, r5, 0x0008 + offset;       \
+12:    swi     r21, r5, 0x000C + offset;       \
+13:    swi     r22, r5, 0x0010 + offset;       \
+14:    swi     r23, r5, 0x0014 + offset;       \
+15:    swi     r24, r5, 0x0018 + offset;       \
+16:    swi     r25, r5, 0x001C + offset;       \
+       .section __ex_table,"a";                \
+       .word   1b, 0f;                         \
+       .word   2b, 0f;                         \
+       .word   3b, 0f;                         \
+       .word   4b, 0f;                         \
+       .word   5b, 0f;                         \
+       .word   6b, 0f;                         \
+       .word   7b, 0f;                         \
+       .word   8b, 0f;                         \
+       .word   9b, 0f;                         \
+       .word   10b, 0f;                        \
+       .word   11b, 0f;                        \
+       .word   12b, 0f;                        \
+       .word   13b, 0f;                        \
+       .word   14b, 0f;                        \
+       .word   15b, 0f;                        \
+       .word   16b, 0f;                        \
+       .text
+
+#define COPY_80(offset)        \
+       COPY(0x00 + offset);\
+       COPY(0x20 + offset);\
+       COPY(0x40 + offset);\
+       COPY(0x60 + offset);
+
 /*
  * int __copy_tofrom_user(char *to, char *from, int len)
  * Return:
@@ -119,34 +163,79 @@ __copy_tofrom_user:
         * r7, r3 - count
         * r4 - tempval
         */
-       beqid   r7, 3f /* zero size is not likely */
-       andi    r3, r7, 0x3 /* filter add count */
-       bneid   r3, 4f /* if is odd value then byte copying */
+       beqid   r7, 0f /* zero size is not likely */
        or      r3, r5, r6 /* find if is any to/from unaligned */
-       andi    r3, r3, 0x3 /* mask unaligned */
-       bneid   r3, 1f /* it is unaligned -> then jump */
+       or      r3, r3, r7 /* find if count is unaligned */
+       andi    r3, r3, 0x3 /* mask last 3 bits */
+       bneid   r3, bu1 /* if r3 is not zero then byte copying */
+       or      r3, r0, r0
+
+       rsubi   r3, r7, PAGE_SIZE /* detect PAGE_SIZE */
+       beqid   r3, page;
        or      r3, r0, r0
 
-/* at least one 4 byte copy */
-5:     lw      r4, r6, r3
-6:     sw      r4, r5, r3
+w1:    lw      r4, r6, r3 /* at least one 4 byte copy */
+w2:    sw      r4, r5, r3
        addik   r7, r7, -4
-       bneid   r7, 5b
+       bneid   r7, w1
        addik   r3, r3, 4
        addik   r3, r7, 0
        rtsd    r15, 8
        nop
-4:     or      r3, r0, r0
-1:     lbu     r4,r6,r3
-2:     sb      r4,r5,r3
+
+       .section        __ex_table,"a"
+       .word   w1, 0f;
+       .word   w2, 0f;
+       .text
+
+.align 4 /* Alignment is important to keep icache happy */
+page:  /* Create room on stack and save registers for storign values */
+       addik   r1, r1, -32
+       swi     r19, r1, 4
+       swi     r20, r1, 8
+       swi     r21, r1, 12
+       swi     r22, r1, 16
+       swi     r23, r1, 20
+       swi     r24, r1, 24
+       swi     r25, r1, 28
+loop:  /* r4, r19, r20, r21, r22, r23, r24, r25 are used for storing values */
+       /* Loop unrolling to get performance boost */
+       COPY_80(0x000);
+       COPY_80(0x080);
+       COPY_80(0x100);
+       COPY_80(0x180);
+       /* copy loop */
+       addik   r6, r6, 0x200
+       addik   r7, r7, -0x200
+       bneid   r7, loop
+       addik   r5, r5, 0x200
+       /* Restore register content */
+       lwi     r19, r1, 4
+       lwi     r20, r1, 8
+       lwi     r21, r1, 12
+       lwi     r22, r1, 16
+       lwi     r23, r1, 20
+       lwi     r24, r1, 24
+       lwi     r25, r1, 28
+       addik   r1, r1, 32
+       /* return back */
+       addik   r3, r7, 0
+       rtsd    r15, 8
+       nop
+
+.align 4 /* Alignment is important to keep icache happy */
+bu1:   lbu     r4,r6,r3
+bu2:   sb      r4,r5,r3
        addik   r7,r7,-1
-       bneid   r7,1b
+       bneid   r7,bu1
        addik   r3,r3,1         /* delay slot */
-3:
+0:
        addik   r3,r7,0
        rtsd    r15,8
        nop
        .size   __copy_tofrom_user, . - __copy_tofrom_user
 
        .section        __ex_table,"a"
-       .word   1b,3b,2b,3b,5b,3b,6b,3b
+       .word   bu1, 0b;
+       .word   bu2, 0b;
+       .text
diff --git a/arch/microblaze/lib/ucmpdi2.c b/arch/microblaze/lib/ucmpdi2.c
new file mode 100644 (file)
index 0000000..63ca105
--- /dev/null
@@ -0,0 +1,20 @@
+#include <linux/module.h>
+
+#include "libgcc.h"
+
+word_type __ucmpdi2(unsigned long long a, unsigned long long b)
+{
+       const DWunion au = {.ll = a};
+       const DWunion bu = {.ll = b};
+
+       if ((unsigned int) au.s.high < (unsigned int) bu.s.high)
+               return 0;
+       else if ((unsigned int) au.s.high > (unsigned int) bu.s.high)
+               return 2;
+       if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
+               return 0;
+       else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
+               return 2;
+       return 1;
+}
+EXPORT_SYMBOL(__ucmpdi2);
index 6b99fc3..a9fbd43 100644 (file)
@@ -569,6 +569,16 @@ config KEXEC
          current kernel, and to start another kernel.  It is like a reboot
          but is independent of hardware/microcode support.
 
+config CRASH_DUMP
+       bool "kernel crash dumps"
+       depends on 64BIT
+       help
+         Generate crash dump after being started by kexec.
+         Crash dump kernels are loaded in the main kernel with kexec-tools
+         into a specially reserved region and then later executed after
+         a crash by kdump/kexec.
+         For more details see Documentation/kdump/kdump.txt
+
 config ZFCPDUMP
        def_bool n
        prompt "zfcpdump support"
index 028f23e..465eca7 100644 (file)
@@ -61,7 +61,7 @@ static unsigned long free_mem_end_ptr;
 
 extern _sclp_print_early(const char *);
 
-int puts(const char *s)
+static int puts(const char *s)
 {
        _sclp_print_early(s);
        return 0;
index 29c82c6..6cf8e26 100644 (file)
@@ -68,7 +68,7 @@ CONFIG_NET_CLS_RSVP6=m
 CONFIG_NET_CLS_ACT=y
 CONFIG_NET_ACT_POLICE=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_DEVTMPFS=y
 CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
index 623f2fb..9381c92 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/device.h>
 #include <linux/mod_devicetable.h>
 #include <asm/fcx.h>
+#include <asm/irq.h>
 
 /* structs from asm/cio.h */
 struct irb;
@@ -127,6 +128,7 @@ enum uc_todo {
  * @restore: callback for restoring after hibernation
  * @uc_handler: callback for unit check handler
  * @driver: embedded device driver structure
+ * @int_class: interruption class to use for accounting interrupts
  */
 struct ccw_driver {
        struct ccw_device_id *ids;
@@ -144,6 +146,7 @@ struct ccw_driver {
        int (*restore)(struct ccw_device *);
        enum uc_todo (*uc_handler) (struct ccw_device *, struct irb *);
        struct device_driver driver;
+       enum interruption_class int_class;
 };
 
 extern struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv,
index cdb9b78..2e49748 100644 (file)
@@ -12,6 +12,7 @@
 #define PSW32_MASK_IO          0x02000000UL
 #define PSW32_MASK_EXT         0x01000000UL
 #define PSW32_MASK_KEY         0x00F00000UL
+#define PSW32_MASK_BASE                0x00080000UL    /* Always one */
 #define PSW32_MASK_MCHECK      0x00040000UL
 #define PSW32_MASK_WAIT                0x00020000UL
 #define PSW32_MASK_PSTATE      0x00010000UL
 #define PSW32_MASK_CC          0x00003000UL
 #define PSW32_MASK_PM          0x00000f00UL
 
-#define PSW32_ADDR_AMODE31     0x80000000UL
+#define PSW32_MASK_USER                0x00003F00UL
+
+#define PSW32_ADDR_AMODE       0x80000000UL
 #define PSW32_ADDR_INSN                0x7FFFFFFFUL
 
-#define PSW32_BASE_BITS                0x00080000UL
+#define PSW32_DEFAULT_KEY      (((u32) PAGE_DEFAULT_ACC) << 20)
 
 #define PSW32_ASC_PRIMARY      0x00000000UL
 #define PSW32_ASC_ACCREG       0x00004000UL
 #define PSW32_ASC_SECONDARY    0x00008000UL
 #define PSW32_ASC_HOME         0x0000C000UL
 
-#define PSW32_MASK_MERGE(CURRENT,NEW) \
-       (((CURRENT) & ~(PSW32_MASK_CC|PSW32_MASK_PM)) | \
-        ((NEW) & (PSW32_MASK_CC|PSW32_MASK_PM)))
-
-extern long psw32_user_bits;
+extern u32 psw32_user_bits;
 
 #define COMPAT_USER_HZ         100
 #define COMPAT_UTS_MACHINE     "s390\0\0\0\0"
index 97cc440..6940abf 100644 (file)
@@ -168,5 +168,6 @@ enum diag308_rc {
 
 extern int diag308(unsigned long subcode, void *addr);
 extern void diag308_reset(void);
+extern void store_status(void);
 
 #endif /* _ASM_S390_IPL_H */
index ba7b01c..ba6d85f 100644 (file)
@@ -8,7 +8,8 @@ enum interruption_class {
        EXTERNAL_INTERRUPT,
        IO_INTERRUPT,
        EXTINT_CLK,
-       EXTINT_IPI,
+       EXTINT_EXC,
+       EXTINT_EMS,
        EXTINT_TMR,
        EXTINT_TLA,
        EXTINT_PFL,
@@ -17,8 +18,8 @@ enum interruption_class {
        EXTINT_SCP,
        EXTINT_IUC,
        EXTINT_CPM,
+       IOINT_CIO,
        IOINT_QAI,
-       IOINT_QDI,
        IOINT_DAS,
        IOINT_C15,
        IOINT_C70,
@@ -28,6 +29,7 @@ enum interruption_class {
        IOINT_CLW,
        IOINT_CTC,
        IOINT_APB,
+       IOINT_CSC,
        NMI_NMI,
        NR_IRQS,
 };
index bb729b8..cf4e47b 100644 (file)
 /* Not more than 2GB */
 #define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31)
 
+/* Maximum address we can use for the crash control pages */
+#define KEXEC_CRASH_CONTROL_MEMORY_LIMIT (-1UL)
+
 /* Allocate one page for the pdp and the second for the code */
 #define KEXEC_CONTROL_PAGE_SIZE 4096
 
+/* Alignment of crashkernel memory */
+#define KEXEC_CRASH_MEM_ALIGN HPAGE_SIZE
+
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_S390
 
index 1ca5de0..24e1847 100644 (file)
@@ -145,6 +145,7 @@ struct kvm_vcpu_stat {
        u32 instruction_sigp_arch;
        u32 instruction_sigp_prefix;
        u32 instruction_sigp_restart;
+       u32 diagnose_10;
        u32 diagnose_44;
 };
 
index e85c911..9e13c7d 100644 (file)
@@ -151,10 +151,8 @@ struct _lowcore {
         */
        __u32   ipib;                           /* 0x0e00 */
        __u32   ipib_checksum;                  /* 0x0e04 */
-
-       /* 64 bit save area */
-       __u64   save_area_64;                   /* 0x0e08 */
-       __u8    pad_0x0e10[0x0f00-0x0e10];      /* 0x0e10 */
+       __u32   vmcore_info;                    /* 0x0e08 */
+       __u8    pad_0x0e0c[0x0f00-0x0e0c];      /* 0x0e0c */
 
        /* Extended facility list */
        __u64   stfle_fac_list[32];             /* 0x0f00 */
@@ -290,9 +288,7 @@ struct _lowcore {
         */
        __u64   ipib;                           /* 0x0e00 */
        __u32   ipib_checksum;                  /* 0x0e08 */
-
-       /* 64 bit save area */
-       __u64   save_area_64;                   /* 0x0e0c */
+       __u64   vmcore_info;                    /* 0x0e0c */
        __u8    pad_0x0e14[0x0f00-0x0e14];      /* 0x0e14 */
 
        /* Extended facility list */
index accb372..f7ec548 100644 (file)
@@ -177,6 +177,7 @@ static inline int page_test_and_clear_young(unsigned long pfn)
 struct page;
 void arch_free_page(struct page *page, int order);
 void arch_alloc_page(struct page *page, int order);
+void arch_set_page_states(int make_stable);
 
 static inline int devmem_is_allowed(unsigned long pfn)
 {
index c0cb794..34ede0e 100644 (file)
@@ -696,7 +696,9 @@ void gmap_disable(struct gmap *gmap);
 int gmap_map_segment(struct gmap *gmap, unsigned long from,
                     unsigned long to, unsigned long length);
 int gmap_unmap_segment(struct gmap *gmap, unsigned long to, unsigned long len);
+unsigned long __gmap_fault(unsigned long address, struct gmap *);
 unsigned long gmap_fault(unsigned long address, struct gmap *);
+void gmap_discard(unsigned long from, unsigned long to, struct gmap *);
 
 /*
  * Certain architectures need to do special things when PTEs
index a4b6229..5f33d37 100644 (file)
@@ -33,6 +33,8 @@ static inline void get_cpu_id(struct cpuid *ptr)
 
 extern void s390_adjust_jiffies(void);
 extern int get_cpu_capability(unsigned int *);
+extern const struct seq_operations cpuinfo_op;
+extern int sysctl_ieee_emulation_warnings;
 
 /*
  * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit.
@@ -118,17 +120,17 @@ struct stack_frame {
 /*
  * Do necessary setup to start up a new thread.
  */
-#define start_thread(regs, new_psw, new_stackp) do {           \
-       regs->psw.mask  = psw_user_bits;                        \
-       regs->psw.addr  = new_psw | PSW_ADDR_AMODE;             \
-       regs->gprs[15]  = new_stackp;                           \
+#define start_thread(regs, new_psw, new_stackp) do {                   \
+       regs->psw.mask  = psw_user_bits | PSW_MASK_EA | PSW_MASK_BA;    \
+       regs->psw.addr  = new_psw | PSW_ADDR_AMODE;                     \
+       regs->gprs[15]  = new_stackp;                                   \
 } while (0)
 
-#define start_thread31(regs, new_psw, new_stackp) do {         \
-       regs->psw.mask  = psw_user32_bits;                      \
-       regs->psw.addr  = new_psw | PSW_ADDR_AMODE;             \
-       regs->gprs[15]  = new_stackp;                           \
-       crst_table_downgrade(current->mm, 1UL << 31);           \
+#define start_thread31(regs, new_psw, new_stackp) do {                 \
+       regs->psw.mask  = psw_user_bits | PSW_MASK_BA;                  \
+       regs->psw.addr  = new_psw | PSW_ADDR_AMODE;                     \
+       regs->gprs[15]  = new_stackp;                                   \
+       crst_table_downgrade(current->mm, 1UL << 31);                   \
 } while (0)
 
 /* Forward declaration, a strange C thing */
@@ -187,7 +189,6 @@ static inline void __load_psw(psw_t psw)
  * Set PSW mask to specified value, while leaving the
  * PSW addr pointing to the next instruction.
  */
-
 static inline void __load_psw_mask (unsigned long mask)
 {
        unsigned long addr;
@@ -212,26 +213,37 @@ static inline void __load_psw_mask (unsigned long mask)
                : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc");
 #endif /* __s390x__ */
 }
+
 /*
- * Function to stop a processor until an interruption occurred
+ * Rewind PSW instruction address by specified number of bytes.
  */
-static inline void enabled_wait(void)
+static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc)
 {
-       __load_psw_mask(PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT |
-                       PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY);
-}
+#ifndef __s390x__
+       if (psw.addr & PSW_ADDR_AMODE)
+               /* 31 bit mode */
+               return (psw.addr - ilc) | PSW_ADDR_AMODE;
+       /* 24 bit mode */
+       return (psw.addr - ilc) & ((1UL << 24) - 1);
+#else
+       unsigned long mask;
 
+       mask = (psw.mask & PSW_MASK_EA) ? -1UL :
+              (psw.mask & PSW_MASK_BA) ? (1UL << 31) - 1 :
+                                         (1UL << 24) - 1;
+       return (psw.addr - ilc) & mask;
+#endif
+}
 /*
  * Function to drop a processor into disabled wait state
  */
-
 static inline void ATTRIB_NORET disabled_wait(unsigned long code)
 {
         unsigned long ctl_buf;
         psw_t dw_psw;
 
-        dw_psw.mask = PSW_BASE_BITS | PSW_MASK_WAIT;
+       dw_psw.mask = PSW_MASK_BASE | PSW_MASK_WAIT | PSW_MASK_BA | PSW_MASK_EA;
         dw_psw.addr = code;
         /* 
          * Store status and then load disabled wait psw,
index 62fd80c..a658463 100644 (file)
@@ -230,17 +230,21 @@ typedef struct
 #define PSW_MASK_IO            0x02000000UL
 #define PSW_MASK_EXT           0x01000000UL
 #define PSW_MASK_KEY           0x00F00000UL
+#define PSW_MASK_BASE          0x00080000UL    /* always one */
 #define PSW_MASK_MCHECK                0x00040000UL
 #define PSW_MASK_WAIT          0x00020000UL
 #define PSW_MASK_PSTATE                0x00010000UL
 #define PSW_MASK_ASC           0x0000C000UL
 #define PSW_MASK_CC            0x00003000UL
 #define PSW_MASK_PM            0x00000F00UL
+#define PSW_MASK_EA            0x00000000UL
+#define PSW_MASK_BA            0x00000000UL
+
+#define PSW_MASK_USER          0x00003F00UL
 
 #define PSW_ADDR_AMODE         0x80000000UL
 #define PSW_ADDR_INSN          0x7FFFFFFFUL
 
-#define PSW_BASE_BITS          0x00080000UL
 #define PSW_DEFAULT_KEY                (((unsigned long) PAGE_DEFAULT_ACC) << 20)
 
 #define PSW_ASC_PRIMARY                0x00000000UL
@@ -254,6 +258,7 @@ typedef struct
 #define PSW_MASK_DAT           0x0400000000000000UL
 #define PSW_MASK_IO            0x0200000000000000UL
 #define PSW_MASK_EXT           0x0100000000000000UL
+#define PSW_MASK_BASE          0x0000000000000000UL
 #define PSW_MASK_KEY           0x00F0000000000000UL
 #define PSW_MASK_MCHECK                0x0004000000000000UL
 #define PSW_MASK_WAIT          0x0002000000000000UL
@@ -261,12 +266,14 @@ typedef struct
 #define PSW_MASK_ASC           0x0000C00000000000UL
 #define PSW_MASK_CC            0x0000300000000000UL
 #define PSW_MASK_PM            0x00000F0000000000UL
+#define PSW_MASK_EA            0x0000000100000000UL
+#define PSW_MASK_BA            0x0000000080000000UL
+
+#define PSW_MASK_USER          0x00003F0180000000UL
 
 #define PSW_ADDR_AMODE         0x0000000000000000UL
 #define PSW_ADDR_INSN          0xFFFFFFFFFFFFFFFFUL
 
-#define PSW_BASE_BITS          0x0000000180000000UL
-#define PSW_BASE32_BITS                0x0000000080000000UL
 #define PSW_DEFAULT_KEY                (((unsigned long) PAGE_DEFAULT_ACC) << 52)
 
 #define PSW_ASC_PRIMARY                0x0000000000000000UL
@@ -279,18 +286,7 @@ typedef struct
 #ifdef __KERNEL__
 extern long psw_kernel_bits;
 extern long psw_user_bits;
-#ifdef CONFIG_64BIT
-extern long psw_user32_bits;
 #endif
-#endif
-
-/* This macro merges a NEW PSW mask specified by the user into
-   the currently active PSW mask CURRENT, modifying only those
-   bits in CURRENT that the user may be allowed to change: this
-   is the condition code and the program mask bits.  */
-#define PSW_MASK_MERGE(CURRENT,NEW) \
-       (((CURRENT) & ~(PSW_MASK_CC|PSW_MASK_PM)) | \
-        ((NEW) & (PSW_MASK_CC|PSW_MASK_PM)))
 
 /*
  * The s390_regs structure is used to define the elf_gregset_t.
@@ -328,8 +324,7 @@ struct pt_regs
        psw_t psw;
        unsigned long gprs[NUM_GPRS];
        unsigned long orig_gpr2;
-       unsigned short ilc;
-       unsigned short svcnr;
+       unsigned int svc_code;
 };
 
 /*
@@ -487,6 +482,8 @@ typedef struct
 #define PTRACE_POKETEXT_AREA         0x5004
 #define PTRACE_POKEDATA_AREA         0x5005
 #define PTRACE_GET_LAST_BREAK        0x5006
+#define PTRACE_PEEK_SYSTEM_CALL       0x5007
+#define PTRACE_POKE_SYSTEM_CALL              0x5008
 
 /*
  * PT_PROT definition is loosely based on hppa bsd definition in
index f584f4a..3d6ad4a 100644 (file)
@@ -17,5 +17,5 @@ struct reset_call {
 
 extern void register_reset_call(struct reset_call *reset);
 extern void unregister_reset_call(struct reset_call *reset);
-extern void s390_reset_system(void);
+extern void s390_reset_system(void (*func)(void *), void *data);
 #endif /* _ASM_S390_RESET_H */
index d5e2ef1..5a09971 100644 (file)
 #define IPL_DEVICE        (*(unsigned long *)  (0x10404))
 #define INITRD_START      (*(unsigned long *)  (0x1040C))
 #define INITRD_SIZE       (*(unsigned long *)  (0x10414))
+#define OLDMEM_BASE      (*(unsigned long *)  (0x1041C))
+#define OLDMEM_SIZE      (*(unsigned long *)  (0x10424))
 #else /* __s390x__ */
 #define IPL_DEVICE        (*(unsigned long *)  (0x10400))
 #define INITRD_START      (*(unsigned long *)  (0x10408))
 #define INITRD_SIZE       (*(unsigned long *)  (0x10410))
+#define OLDMEM_BASE      (*(unsigned long *)  (0x10418))
+#define OLDMEM_SIZE      (*(unsigned long *)  (0x10420))
 #endif /* __s390x__ */
 #define COMMAND_LINE      ((char *)            (0x10480))
 
 #define CHUNK_READ_WRITE 0
 #define CHUNK_READ_ONLY  1
+#define CHUNK_OLDMEM    4
+#define CHUNK_CRASHK    5
 
 struct mem_chunk {
        unsigned long addr;
@@ -48,6 +54,8 @@ extern int memory_end_set;
 extern unsigned long memory_end;
 
 void detect_memory_layout(struct mem_chunk chunk[]);
+void create_mem_hole(struct mem_chunk memory_chunk[], unsigned long addr,
+                    unsigned long size, int type);
 
 #define PRIMARY_SPACE_MODE     0
 #define ACCESS_REGISTER_MODE   1
@@ -106,6 +114,7 @@ extern unsigned int user_mode;
 #endif /* __s390x__ */
 
 #define ZFCPDUMP_HSA_SIZE      (32UL<<20)
+#define ZFCPDUMP_HSA_SIZE_MAX  (64UL<<20)
 
 /*
  * Console mode. Override with conmode=
@@ -134,10 +143,14 @@ extern char kernel_nss_name[];
 #define IPL_DEVICE        0x10404
 #define INITRD_START      0x1040C
 #define INITRD_SIZE       0x10414
+#define OLDMEM_BASE      0x1041C
+#define OLDMEM_SIZE      0x10424
 #else /* __s390x__ */
 #define IPL_DEVICE        0x10400
 #define INITRD_START      0x10408
 #define INITRD_SIZE       0x10410
+#define OLDMEM_BASE      0x10418
+#define OLDMEM_SIZE      0x10420
 #endif /* __s390x__ */
 #define COMMAND_LINE      0x10480
 
index 0addc64..ca3f881 100644 (file)
@@ -72,6 +72,6 @@ extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int,
 
 #define UDIV_NEEDS_NORMALIZATION 0
 
-#define abort() return 0
+#define abort() BUG()
 
 #define __BYTE_ORDER __BIG_ENDIAN
index 045e009..ab47a69 100644 (file)
@@ -33,6 +33,7 @@ extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
 extern void smp_switch_to_ipl_cpu(void (*func)(void *), void *);
 extern void smp_switch_to_cpu(void (*)(void *), void *, unsigned long sp,
                              int from, int to);
+extern void smp_restart_with_online_cpu(void);
 extern void smp_restart_cpu(void);
 
 /*
@@ -64,6 +65,10 @@ static inline void smp_switch_to_ipl_cpu(void (*func)(void *), void *data)
        func(data);
 }
 
+static inline void smp_restart_with_online_cpu(void)
+{
+}
+
 #define smp_vcpu_scheduled     (1)
 
 #endif /* CONFIG_SMP */
index 56612fc..fd94dfe 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <linux/smp.h>
 
+extern int spin_retry;
+
 static inline int
 _raw_compare_and_swap(volatile unsigned int *lock,
                      unsigned int old, unsigned int new)
index 5c0246b..b239ff5 100644 (file)
@@ -13,6 +13,7 @@
 #define _ASM_SYSCALL_H 1
 
 #include <linux/sched.h>
+#include <linux/err.h>
 #include <asm/ptrace.h>
 
 /*
@@ -25,7 +26,8 @@ extern const unsigned int sys_call_table[];
 static inline long syscall_get_nr(struct task_struct *task,
                                  struct pt_regs *regs)
 {
-       return regs->svcnr ? regs->svcnr : -1;
+       return test_tsk_thread_flag(task, TIF_SYSCALL) ?
+               (regs->svc_code & 0xffff) : -1;
 }
 
 static inline void syscall_rollback(struct task_struct *task,
@@ -37,7 +39,7 @@ static inline void syscall_rollback(struct task_struct *task,
 static inline long syscall_get_error(struct task_struct *task,
                                     struct pt_regs *regs)
 {
-       return (regs->gprs[2] >= -4096UL) ? -regs->gprs[2] : 0;
+       return IS_ERR_VALUE(regs->gprs[2]) ? regs->gprs[2] : 0;
 }
 
 static inline long syscall_get_return_value(struct task_struct *task,
index 6582f69..ef573c1 100644 (file)
@@ -20,6 +20,8 @@
 
 struct task_struct;
 
+extern int sysctl_userprocess_debug;
+
 extern struct task_struct *__switch_to(void *, void *);
 extern void update_per_regs(struct task_struct *task);
 
@@ -114,6 +116,8 @@ extern void pfault_fini(void);
 extern void cmma_init(void);
 extern int memcpy_real(void *, void *, size_t);
 extern void copy_to_absolute_zero(void *dest, void *src, size_t count);
+extern int copy_to_user_real(void __user *dest, void *src, size_t count);
+extern int copy_from_user_real(void *dest, void __user *src, size_t count);
 
 #define finish_arch_switch(prev) do {                                       \
        set_fs(current->thread.mm_segment);                                  \
@@ -210,8 +214,10 @@ __set_psw_mask(unsigned long mask)
        __load_psw_mask(mask | (arch_local_save_flags() & ~(-1UL >> 8)));
 }
 
-#define local_mcck_enable()  __set_psw_mask(psw_kernel_bits)
-#define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK)
+#define local_mcck_enable() \
+       __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK)
+#define local_mcck_disable() \
+       __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT)
 
 #ifdef CONFIG_SMP
 
index 1a5dbb6..a231834 100644 (file)
@@ -48,6 +48,7 @@ struct thread_info {
        unsigned int            cpu;            /* current CPU */
        int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
        struct restart_block    restart_block;
+       unsigned int            system_call;
        __u64                   user_timer;
        __u64                   system_timer;
        unsigned long           last_break;     /* last breaking-event-address. */
@@ -84,10 +85,10 @@ static inline struct thread_info *current_thread_info(void)
 /*
  * thread information flags bit numbers
  */
+#define TIF_SYSCALL            0       /* inside a system call */
 #define TIF_NOTIFY_RESUME      1       /* callback before returning to user */
 #define TIF_SIGPENDING         2       /* signal pending */
 #define TIF_NEED_RESCHED       3       /* rescheduling necessary */
-#define TIF_RESTART_SVC                4       /* restart svc with new svc number */
 #define TIF_PER_TRAP           6       /* deliver sigtrap on return to user */
 #define TIF_MCCK_PENDING       7       /* machine check handling is pending */
 #define TIF_SYSCALL_TRACE      8       /* syscall trace active */
@@ -103,11 +104,11 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_SINGLE_STEP                20      /* This task is single stepped */
 #define TIF_FREEZE             21      /* thread is freezing for suspend */
 
+#define _TIF_SYSCALL           (1<<TIF_SYSCALL)
 #define _TIF_NOTIFY_RESUME     (1<<TIF_NOTIFY_RESUME)
 #define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
 #define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
-#define _TIF_RESTART_SVC       (1<<TIF_RESTART_SVC)
 #define _TIF_PER_TRAP          (1<<TIF_PER_TRAP)
 #define _TIF_MCCK_PENDING      (1<<TIF_MCCK_PENDING)
 #define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
@@ -117,7 +118,7 @@ static inline struct thread_info *current_thread_info(void)
 #define _TIF_SIE               (1<<TIF_SIE)
 #define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
 #define _TIF_31BIT             (1<<TIF_31BIT)
-#define _TIF_SINGLE_STEP       (1<<TIF_FREEZE)
+#define _TIF_SINGLE_STEP       (1<<TIF_SINGLE_STEP)
 #define _TIF_FREEZE            (1<<TIF_FREEZE)
 
 #ifdef CONFIG_64BIT
index 88829a4..d610bef 100644 (file)
@@ -86,6 +86,17 @@ static inline void get_clock_ext(char *clk)
        asm volatile("stcke %0" : "=Q" (*clk) : : "cc");
 }
 
+static inline unsigned long long get_clock_fast(void)
+{
+       unsigned long long clk;
+
+       if (test_facility(25))
+               asm volatile(".insn     s,0xb27c0000,%0" : "=Q" (clk) : : "cc");
+       else
+               clk = get_clock();
+       return clk;
+}
+
 static inline unsigned long long get_clock_xt(void)
 {
        unsigned char clk[16];
index 3044453..1d8648c 100644 (file)
@@ -59,6 +59,7 @@ static inline void __tlb_flush_full(struct mm_struct *mm)
 }
 #else
 #define __tlb_flush_full(mm)   __tlb_flush_local()
+#define __tlb_flush_global()   __tlb_flush_local()
 #endif
 
 /*
index df37322..dd4f076 100644 (file)
@@ -48,6 +48,7 @@ obj-$(CONFIG_FUNCTION_TRACER) += $(if $(CONFIG_64BIT),mcount64.o,mcount.o)
 obj-$(CONFIG_DYNAMIC_FTRACE)   += ftrace.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
 obj-$(CONFIG_FTRACE_SYSCALLS)  += ftrace.o
+obj-$(CONFIG_CRASH_DUMP)       += crash_dump.o
 
 # Kexec part
 S390_KEXEC_OBJS := machine_kexec.o crash.o
index 2b45591..7513187 100644 (file)
@@ -45,8 +45,7 @@ int main(void)
        DEFINE(__PT_PSW, offsetof(struct pt_regs, psw));
        DEFINE(__PT_GPRS, offsetof(struct pt_regs, gprs));
        DEFINE(__PT_ORIG_GPR2, offsetof(struct pt_regs, orig_gpr2));
-       DEFINE(__PT_ILC, offsetof(struct pt_regs, ilc));
-       DEFINE(__PT_SVCNR, offsetof(struct pt_regs, svcnr));
+       DEFINE(__PT_SVC_CODE, offsetof(struct pt_regs, svc_code));
        DEFINE(__PT_SIZE, sizeof(struct pt_regs));
        BLANK();
        DEFINE(__SF_BACKCHAIN, offsetof(struct stack_frame, back_chain));
@@ -141,7 +140,6 @@ int main(void)
        DEFINE(__LC_FPREGS_SAVE_AREA, offsetof(struct _lowcore, floating_pt_save_area));
        DEFINE(__LC_GPREGS_SAVE_AREA, offsetof(struct _lowcore, gpregs_save_area));
        DEFINE(__LC_CREGS_SAVE_AREA, offsetof(struct _lowcore, cregs_save_area));
-       DEFINE(__LC_SAVE_AREA_64, offsetof(struct _lowcore, save_area_64));
 #ifdef CONFIG_32BIT
        DEFINE(SAVE_AREA_BASE, offsetof(struct _lowcore, extended_save_area_addr));
 #else /* CONFIG_32BIT */
index 2554356..f8828d3 100644 (file)
@@ -86,6 +86,8 @@ s390_base_pgm_handler_fn:
 ENTRY(diag308_reset)
        larl    %r4,.Lctlregs           # Save control registers
        stctg   %c0,%c15,0(%r4)
+       larl    %r4,.Lfpctl             # Floating point control register
+       stfpc   0(%r4)
        larl    %r4,.Lrestart_psw       # Setup restart PSW at absolute 0
        lghi    %r3,0
        lg      %r4,0(%r4)              # Save PSW
@@ -99,6 +101,8 @@ ENTRY(diag308_reset)
        sam64                           # Switch to 64 bit addressing mode
        larl    %r4,.Lctlregs           # Restore control registers
        lctlg   %c0,%c15,0(%r4)
+       larl    %r4,.Lfpctl             # Restore floating point ctl register
+       lfpc    0(%r4)
        br      %r14
 .align 16
 .Lrestart_psw:
@@ -110,6 +114,8 @@ ENTRY(diag308_reset)
        .rept   16
        .quad   0
        .endr
+.Lfpctl:
+       .long   0
        .previous
 
 #else /* CONFIG_64BIT */
index 53acaa8..84a9828 100644 (file)
 
 #include "compat_linux.h"
 
-long psw_user32_bits   = (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME |
-                          PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK |
-                          PSW_MASK_PSTATE | PSW_DEFAULT_KEY);
-long psw32_user_bits   = (PSW32_BASE_BITS | PSW32_MASK_DAT | PSW32_ASC_HOME |
-                          PSW32_MASK_IO | PSW32_MASK_EXT | PSW32_MASK_MCHECK |
-                          PSW32_MASK_PSTATE);
+u32 psw32_user_bits = PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT |
+                     PSW32_DEFAULT_KEY | PSW32_MASK_BASE | PSW32_MASK_MCHECK |
+                     PSW32_MASK_PSTATE | PSW32_ASC_HOME;
  
 /* For this source file, we want overflow handling. */
 
@@ -365,12 +362,7 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
        if (set) {
                if (copy_from_user (&s32, set, sizeof(compat_sigset_t)))
                        return -EFAULT;
-               switch (_NSIG_WORDS) {
-               case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
-               case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
-               case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
-               case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
-               }
+               s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
        }
        set_fs (KERNEL_DS);
        ret = sys_rt_sigprocmask(how,
@@ -380,12 +372,8 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
        set_fs (old_fs);
        if (ret) return ret;
        if (oset) {
-               switch (_NSIG_WORDS) {
-               case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
-               case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
-               case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
-               case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
-               }
+               s32.sig[1] = (s.sig[0] >> 32);
+               s32.sig[0] = s.sig[0];
                if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
                        return -EFAULT;
        }
@@ -404,12 +392,8 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
        ret = sys_rt_sigpending((sigset_t __force __user *) &s, sigsetsize);
        set_fs (old_fs);
        if (!ret) {
-               switch (_NSIG_WORDS) {
-               case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
-               case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
-               case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
-               case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
-               }
+               s32.sig[1] = (s.sig[0] >> 32);
+               s32.sig[0] = s.sig[0];
                if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
                        return -EFAULT;
        }
index a9a285b..4f68c81 100644 (file)
@@ -141,7 +141,8 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
                        break;
                case __SI_FAULT >> 16:
                        err |= __get_user(tmp, &from->si_addr);
-                       to->si_addr = (void __user *)(u64) (tmp & PSW32_ADDR_INSN);
+                       to->si_addr = (void __force __user *)
+                               (u64) (tmp & PSW32_ADDR_INSN);
                        break;
                case __SI_POLL >> 16:
                        err |= __get_user(to->si_band, &from->si_band);
@@ -213,16 +214,8 @@ sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
                ret = get_user(sa_handler, &act->sa_handler);
                ret |= __copy_from_user(&set32, &act->sa_mask,
                                        sizeof(compat_sigset_t));
-               switch (_NSIG_WORDS) {
-               case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6]
-                               | (((long)set32.sig[7]) << 32);
-               case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4]
-                               | (((long)set32.sig[5]) << 32);
-               case 2: new_ka.sa.sa_mask.sig[1] = set32.sig[2]
-                               | (((long)set32.sig[3]) << 32);
-               case 1: new_ka.sa.sa_mask.sig[0] = set32.sig[0]
-                               | (((long)set32.sig[1]) << 32);
-               }
+               new_ka.sa.sa_mask.sig[0] =
+                       set32.sig[0] | (((long)set32.sig[1]) << 32);
                ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
                
                if (ret)
@@ -233,20 +226,8 @@ sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
        ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
 
        if (!ret && oact) {
-               switch (_NSIG_WORDS) {
-               case 4:
-                       set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32);
-                       set32.sig[6] = old_ka.sa.sa_mask.sig[3];
-               case 3:
-                       set32.sig[5] = (old_ka.sa.sa_mask.sig[2] >> 32);
-                       set32.sig[4] = old_ka.sa.sa_mask.sig[2];
-               case 2:
-                       set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32);
-                       set32.sig[2] = old_ka.sa.sa_mask.sig[1];
-               case 1:
-                       set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32);
-                       set32.sig[0] = old_ka.sa.sa_mask.sig[0];
-               }
+               set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32);
+               set32.sig[0] = old_ka.sa.sa_mask.sig[0];
                ret = put_user((unsigned long)old_ka.sa.sa_handler, &oact->sa_handler);
                ret |= __copy_to_user(&oact->sa_mask, &set32,
                                      sizeof(compat_sigset_t));
@@ -300,9 +281,10 @@ static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
        _s390_regs_common32 regs32;
        int err, i;
 
-       regs32.psw.mask = PSW32_MASK_MERGE(psw32_user_bits,
-                                          (__u32)(regs->psw.mask >> 32));
-       regs32.psw.addr = PSW32_ADDR_AMODE31 | (__u32) regs->psw.addr;
+       regs32.psw.mask = psw32_user_bits |
+               ((__u32)(regs->psw.mask >> 32) & PSW32_MASK_USER);
+       regs32.psw.addr = (__u32) regs->psw.addr |
+               (__u32)(regs->psw.mask & PSW_MASK_BA);
        for (i = 0; i < NUM_GPRS; i++)
                regs32.gprs[i] = (__u32) regs->gprs[i];
        save_access_regs(current->thread.acrs);
@@ -327,8 +309,9 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
        err = __copy_from_user(&regs32, &sregs->regs, sizeof(regs32));
        if (err)
                return err;
-       regs->psw.mask = PSW_MASK_MERGE(regs->psw.mask,
-                                       (__u64)regs32.psw.mask << 32);
+       regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
+               (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32 |
+               (__u64)(regs32.psw.addr & PSW32_ADDR_AMODE);
        regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN);
        for (i = 0; i < NUM_GPRS; i++)
                regs->gprs[i] = (__u64) regs32.gprs[i];
@@ -342,7 +325,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
                return err;
 
        restore_fp_regs(&current->thread.fp_regs);
-       regs->svcnr = 0;        /* disable syscall checks */
+       clear_thread_flag(TIF_SYSCALL); /* No longer in a system call */
        return 0;
 }
 
@@ -496,11 +479,11 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
        /* Set up to return from userspace.  If provided, use a stub
           already in userspace.  */
        if (ka->sa.sa_flags & SA_RESTORER) {
-               regs->gprs[14] = (__u64) ka->sa.sa_restorer;
+               regs->gprs[14] = (__u64) ka->sa.sa_restorer | PSW32_ADDR_AMODE;
        } else {
-               regs->gprs[14] = (__u64) frame->retcode;
+               regs->gprs[14] = (__u64) frame->retcode | PSW32_ADDR_AMODE;
                if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
-                              (u16 __user *)(frame->retcode)))
+                              (u16 __force __user *)(frame->retcode)))
                        goto give_sigsegv;
         }
 
@@ -509,11 +492,12 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
                goto give_sigsegv;
 
        /* Set up registers for signal handler */
-       regs->gprs[15] = (__u64) frame;
-       regs->psw.addr = (__u64) ka->sa.sa_handler;
+       regs->gprs[15] = (__force __u64) frame;
+       regs->psw.mask |= PSW_MASK_BA;          /* force amode 31 */
+       regs->psw.addr = (__force __u64) ka->sa.sa_handler;
 
        regs->gprs[2] = map_signal(sig);
-       regs->gprs[3] = (__u64) &frame->sc;
+       regs->gprs[3] = (__force __u64) &frame->sc;
 
        /* We forgot to include these in the sigcontext.
           To avoid breaking binary compatibility, they are passed as args. */
@@ -521,7 +505,7 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
        regs->gprs[5] = current->thread.prot_addr;
 
        /* Place signal number on stack to allow backtrace from handler.  */
-       if (__put_user(regs->gprs[2], (int __user *) &frame->signo))
+       if (__put_user(regs->gprs[2], (int __force __user *) &frame->signo))
                goto give_sigsegv;
        return 0;
 
@@ -564,20 +548,21 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
        } else {
                regs->gprs[14] = (__u64) frame->retcode;
                err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
-                                 (u16 __user *)(frame->retcode));
+                                 (u16 __force __user *)(frame->retcode));
        }
 
        /* Set up backchain. */
-       if (__put_user(regs->gprs[15], (unsigned int __user *) frame))
+       if (__put_user(regs->gprs[15], (unsigned int __force __user *) frame))
                goto give_sigsegv;
 
        /* Set up registers for signal handler */
-       regs->gprs[15] = (__u64) frame;
+       regs->gprs[15] = (__force __u64) frame;
+       regs->psw.mask |= PSW_MASK_BA;          /* force amode 31 */
        regs->psw.addr = (__u64) ka->sa.sa_handler;
 
        regs->gprs[2] = map_signal(sig);
-       regs->gprs[3] = (__u64) &frame->info;
-       regs->gprs[4] = (__u64) &frame->uc;
+       regs->gprs[3] = (__force __u64) &frame->info;
+       regs->gprs[4] = (__force __u64) &frame->uc;
        return 0;
 
 give_sigsegv:
index 7526db6..5006a1d 100644 (file)
@@ -1623,8 +1623,7 @@ ENTRY(sys_syncfs_wrapper)
        lgfr    %r2,%r2                 # int
        jg      sys_syncfs
 
-       .globl  sys_setns_wrapper
-sys_setns_wrapper:
+ENTRY(sys_setns_wrapper)
        lgfr    %r2,%r2                 # int
        lgfr    %r3,%r3                 # int
        jg      sys_setns
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
new file mode 100644 (file)
index 0000000..39f8fd4
--- /dev/null
@@ -0,0 +1,426 @@
+/*
+ * S390 kdump implementation
+ *
+ * Copyright IBM Corp. 2011
+ * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
+ */
+
+#include <linux/crash_dump.h>
+#include <asm/lowcore.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/gfp.h>
+#include <linux/slab.h>
+#include <linux/crash_dump.h>
+#include <linux/bootmem.h>
+#include <linux/elf.h>
+#include <asm/ipl.h>
+
+#define PTR_ADD(x, y) (((char *) (x)) + ((unsigned long) (y)))
+#define PTR_SUB(x, y) (((char *) (x)) - ((unsigned long) (y)))
+#define PTR_DIFF(x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y))))
+
+/*
+ * Copy one page from "oldmem"
+ *
+ * For the kdump reserved memory this functions performs a swap operation:
+ *  - [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE] is mapped to [0 - OLDMEM_SIZE].
+ *  - [0 - OLDMEM_SIZE] is mapped to [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE]
+ */
+ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
+                        size_t csize, unsigned long offset, int userbuf)
+{
+       unsigned long src;
+
+       if (!csize)
+               return 0;
+
+       src = (pfn << PAGE_SHIFT) + offset;
+       if (src < OLDMEM_SIZE)
+               src += OLDMEM_BASE;
+       else if (src > OLDMEM_BASE &&
+                src < OLDMEM_BASE + OLDMEM_SIZE)
+               src -= OLDMEM_BASE;
+       if (userbuf)
+               copy_to_user_real((void __force __user *) buf, (void *) src,
+                                 csize);
+       else
+               memcpy_real(buf, (void *) src, csize);
+       return csize;
+}
+
+/*
+ * Copy memory from old kernel
+ */
+static int copy_from_oldmem(void *dest, void *src, size_t count)
+{
+       unsigned long copied = 0;
+       int rc;
+
+       if ((unsigned long) src < OLDMEM_SIZE) {
+               copied = min(count, OLDMEM_SIZE - (unsigned long) src);
+               rc = memcpy_real(dest, src + OLDMEM_BASE, copied);
+               if (rc)
+                       return rc;
+       }
+       return memcpy_real(dest + copied, src + copied, count - copied);
+}
+
+/*
+ * Alloc memory and panic in case of ENOMEM
+ */
+static void *kzalloc_panic(int len)
+{
+       void *rc;
+
+       rc = kzalloc(len, GFP_KERNEL);
+       if (!rc)
+               panic("s390 kdump kzalloc (%d) failed", len);
+       return rc;
+}
+
+/*
+ * Get memory layout and create hole for oldmem
+ */
+static struct mem_chunk *get_memory_layout(void)
+{
+       struct mem_chunk *chunk_array;
+
+       chunk_array = kzalloc_panic(MEMORY_CHUNKS * sizeof(struct mem_chunk));
+       detect_memory_layout(chunk_array);
+       create_mem_hole(chunk_array, OLDMEM_BASE, OLDMEM_SIZE, CHUNK_CRASHK);
+       return chunk_array;
+}
+
+/*
+ * Initialize ELF note
+ */
+static void *nt_init(void *buf, Elf64_Word type, void *desc, int d_len,
+                    const char *name)
+{
+       Elf64_Nhdr *note;
+       u64 len;
+
+       note = (Elf64_Nhdr *)buf;
+       note->n_namesz = strlen(name) + 1;
+       note->n_descsz = d_len;
+       note->n_type = type;
+       len = sizeof(Elf64_Nhdr);
+
+       memcpy(buf + len, name, note->n_namesz);
+       len = roundup(len + note->n_namesz, 4);
+
+       memcpy(buf + len, desc, note->n_descsz);
+       len = roundup(len + note->n_descsz, 4);
+
+       return PTR_ADD(buf, len);
+}
+
+/*
+ * Initialize prstatus note
+ */
+static void *nt_prstatus(void *ptr, struct save_area *sa)
+{
+       struct elf_prstatus nt_prstatus;
+       static int cpu_nr = 1;
+
+       memset(&nt_prstatus, 0, sizeof(nt_prstatus));
+       memcpy(&nt_prstatus.pr_reg.gprs, sa->gp_regs, sizeof(sa->gp_regs));
+       memcpy(&nt_prstatus.pr_reg.psw, sa->psw, sizeof(sa->psw));
+       memcpy(&nt_prstatus.pr_reg.acrs, sa->acc_regs, sizeof(sa->acc_regs));
+       nt_prstatus.pr_pid = cpu_nr;
+       cpu_nr++;
+
+       return nt_init(ptr, NT_PRSTATUS, &nt_prstatus, sizeof(nt_prstatus),
+                        "CORE");
+}
+
+/*
+ * Initialize fpregset (floating point) note
+ */
+static void *nt_fpregset(void *ptr, struct save_area *sa)
+{
+       elf_fpregset_t nt_fpregset;
+
+       memset(&nt_fpregset, 0, sizeof(nt_fpregset));
+       memcpy(&nt_fpregset.fpc, &sa->fp_ctrl_reg, sizeof(sa->fp_ctrl_reg));
+       memcpy(&nt_fpregset.fprs, &sa->fp_regs, sizeof(sa->fp_regs));
+
+       return nt_init(ptr, NT_PRFPREG, &nt_fpregset, sizeof(nt_fpregset),
+                      "CORE");
+}
+
+/*
+ * Initialize timer note
+ */
+static void *nt_s390_timer(void *ptr, struct save_area *sa)
+{
+       return nt_init(ptr, NT_S390_TIMER, &sa->timer, sizeof(sa->timer),
+                        KEXEC_CORE_NOTE_NAME);
+}
+
+/*
+ * Initialize TOD clock comparator note
+ */
+static void *nt_s390_tod_cmp(void *ptr, struct save_area *sa)
+{
+       return nt_init(ptr, NT_S390_TODCMP, &sa->clk_cmp,
+                      sizeof(sa->clk_cmp), KEXEC_CORE_NOTE_NAME);
+}
+
+/*
+ * Initialize TOD programmable register note
+ */
+static void *nt_s390_tod_preg(void *ptr, struct save_area *sa)
+{
+       return nt_init(ptr, NT_S390_TODPREG, &sa->tod_reg,
+                      sizeof(sa->tod_reg), KEXEC_CORE_NOTE_NAME);
+}
+
+/*
+ * Initialize control register note
+ */
+static void *nt_s390_ctrs(void *ptr, struct save_area *sa)
+{
+       return nt_init(ptr, NT_S390_CTRS, &sa->ctrl_regs,
+                      sizeof(sa->ctrl_regs), KEXEC_CORE_NOTE_NAME);
+}
+
+/*
+ * Initialize prefix register note
+ */
+static void *nt_s390_prefix(void *ptr, struct save_area *sa)
+{
+       return nt_init(ptr, NT_S390_PREFIX, &sa->pref_reg,
+                        sizeof(sa->pref_reg), KEXEC_CORE_NOTE_NAME);
+}
+
+/*
+ * Fill ELF notes for one CPU with save area registers
+ */
+void *fill_cpu_elf_notes(void *ptr, struct save_area *sa)
+{
+       ptr = nt_prstatus(ptr, sa);
+       ptr = nt_fpregset(ptr, sa);
+       ptr = nt_s390_timer(ptr, sa);
+       ptr = nt_s390_tod_cmp(ptr, sa);
+       ptr = nt_s390_tod_preg(ptr, sa);
+       ptr = nt_s390_ctrs(ptr, sa);
+       ptr = nt_s390_prefix(ptr, sa);
+       return ptr;
+}
+
+/*
+ * Initialize prpsinfo note (new kernel)
+ */
+static void *nt_prpsinfo(void *ptr)
+{
+       struct elf_prpsinfo prpsinfo;
+
+       memset(&prpsinfo, 0, sizeof(prpsinfo));
+       prpsinfo.pr_sname = 'R';
+       strcpy(prpsinfo.pr_fname, "vmlinux");
+       return nt_init(ptr, NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo),
+                      KEXEC_CORE_NOTE_NAME);
+}
+
+/*
+ * Initialize vmcoreinfo note (new kernel)
+ */
+static void *nt_vmcoreinfo(void *ptr)
+{
+       char nt_name[11], *vmcoreinfo;
+       Elf64_Nhdr note;
+       void *addr;
+
+       if (copy_from_oldmem(&addr, &S390_lowcore.vmcore_info, sizeof(addr)))
+               return ptr;
+       memset(nt_name, 0, sizeof(nt_name));
+       if (copy_from_oldmem(&note, addr, sizeof(note)))
+               return ptr;
+       if (copy_from_oldmem(nt_name, addr + sizeof(note), sizeof(nt_name) - 1))
+               return ptr;
+       if (strcmp(nt_name, "VMCOREINFO") != 0)
+               return ptr;
+       vmcoreinfo = kzalloc_panic(note.n_descsz + 1);
+       if (copy_from_oldmem(vmcoreinfo, addr + 24, note.n_descsz))
+               return ptr;
+       vmcoreinfo[note.n_descsz + 1] = 0;
+       return nt_init(ptr, 0, vmcoreinfo, note.n_descsz, "VMCOREINFO");
+}
+
+/*
+ * Initialize ELF header (new kernel)
+ */
+static void *ehdr_init(Elf64_Ehdr *ehdr, int mem_chunk_cnt)
+{
+       memset(ehdr, 0, sizeof(*ehdr));
+       memcpy(ehdr->e_ident, ELFMAG, SELFMAG);
+       ehdr->e_ident[EI_CLASS] = ELFCLASS64;
+       ehdr->e_ident[EI_DATA] = ELFDATA2MSB;
+       ehdr->e_ident[EI_VERSION] = EV_CURRENT;
+       memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD);
+       ehdr->e_type = ET_CORE;
+       ehdr->e_machine = EM_S390;
+       ehdr->e_version = EV_CURRENT;
+       ehdr->e_phoff = sizeof(Elf64_Ehdr);
+       ehdr->e_ehsize = sizeof(Elf64_Ehdr);
+       ehdr->e_phentsize = sizeof(Elf64_Phdr);
+       ehdr->e_phnum = mem_chunk_cnt + 1;
+       return ehdr + 1;
+}
+
+/*
+ * Return CPU count for ELF header (new kernel)
+ */
+static int get_cpu_cnt(void)
+{
+       int i, cpus = 0;
+
+       for (i = 0; zfcpdump_save_areas[i]; i++) {
+               if (zfcpdump_save_areas[i]->pref_reg == 0)
+                       continue;
+               cpus++;
+       }
+       return cpus;
+}
+
+/*
+ * Return memory chunk count for ELF header (new kernel)
+ */
+static int get_mem_chunk_cnt(void)
+{
+       struct mem_chunk *chunk_array, *mem_chunk;
+       int i, cnt = 0;
+
+       chunk_array = get_memory_layout();
+       for (i = 0; i < MEMORY_CHUNKS; i++) {
+               mem_chunk = &chunk_array[i];
+               if (chunk_array[i].type != CHUNK_READ_WRITE &&
+                   chunk_array[i].type != CHUNK_READ_ONLY)
+                       continue;
+               if (mem_chunk->size == 0)
+                       continue;
+               cnt++;
+       }
+       kfree(chunk_array);
+       return cnt;
+}
+
+/*
+ * Relocate pointer in order to allow vmcore code access the data
+ */
+static inline unsigned long relocate(unsigned long addr)
+{
+       return OLDMEM_BASE + addr;
+}
+
+/*
+ * Initialize ELF loads (new kernel)
+ */
+static int loads_init(Elf64_Phdr *phdr, u64 loads_offset)
+{
+       struct mem_chunk *chunk_array, *mem_chunk;
+       int i;
+
+       chunk_array = get_memory_layout();
+       for (i = 0; i < MEMORY_CHUNKS; i++) {
+               mem_chunk = &chunk_array[i];
+               if (mem_chunk->size == 0)
+                       break;
+               if (chunk_array[i].type != CHUNK_READ_WRITE &&
+                   chunk_array[i].type != CHUNK_READ_ONLY)
+                       continue;
+               else
+                       phdr->p_filesz = mem_chunk->size;
+               phdr->p_type = PT_LOAD;
+               phdr->p_offset = mem_chunk->addr;
+               phdr->p_vaddr = mem_chunk->addr;
+               phdr->p_paddr = mem_chunk->addr;
+               phdr->p_memsz = mem_chunk->size;
+               phdr->p_flags = PF_R | PF_W | PF_X;
+               phdr->p_align = PAGE_SIZE;
+               phdr++;
+       }
+       kfree(chunk_array);
+       return i;
+}
+
+/*
+ * Initialize notes (new kernel)
+ */
+static void *notes_init(Elf64_Phdr *phdr, void *ptr, u64 notes_offset)
+{
+       struct save_area *sa;
+       void *ptr_start = ptr;
+       int i;
+
+       ptr = nt_prpsinfo(ptr);
+
+       for (i = 0; zfcpdump_save_areas[i]; i++) {
+               sa = zfcpdump_save_areas[i];
+               if (sa->pref_reg == 0)
+                       continue;
+               ptr = fill_cpu_elf_notes(ptr, sa);
+       }
+       ptr = nt_vmcoreinfo(ptr);
+       memset(phdr, 0, sizeof(*phdr));
+       phdr->p_type = PT_NOTE;
+       phdr->p_offset = relocate(notes_offset);
+       phdr->p_filesz = (unsigned long) PTR_SUB(ptr, ptr_start);
+       phdr->p_memsz = phdr->p_filesz;
+       return ptr;
+}
+
+/*
+ * Create ELF core header (new kernel)
+ */
+static void s390_elf_corehdr_create(char **elfcorebuf, size_t *elfcorebuf_sz)
+{
+       Elf64_Phdr *phdr_notes, *phdr_loads;
+       int mem_chunk_cnt;
+       void *ptr, *hdr;
+       u32 alloc_size;
+       u64 hdr_off;
+
+       mem_chunk_cnt = get_mem_chunk_cnt();
+
+       alloc_size = 0x1000 + get_cpu_cnt() * 0x300 +
+               mem_chunk_cnt * sizeof(Elf64_Phdr);
+       hdr = kzalloc_panic(alloc_size);
+       /* Init elf header */
+       ptr = ehdr_init(hdr, mem_chunk_cnt);
+       /* Init program headers */
+       phdr_notes = ptr;
+       ptr = PTR_ADD(ptr, sizeof(Elf64_Phdr));
+       phdr_loads = ptr;
+       ptr = PTR_ADD(ptr, sizeof(Elf64_Phdr) * mem_chunk_cnt);
+       /* Init notes */
+       hdr_off = PTR_DIFF(ptr, hdr);
+       ptr = notes_init(phdr_notes, ptr, ((unsigned long) hdr) + hdr_off);
+       /* Init loads */
+       hdr_off = PTR_DIFF(ptr, hdr);
+       loads_init(phdr_loads, ((unsigned long) hdr) + hdr_off);
+       *elfcorebuf_sz = hdr_off;
+       *elfcorebuf = (void *) relocate((unsigned long) hdr);
+       BUG_ON(*elfcorebuf_sz > alloc_size);
+}
+
+/*
+ * Create kdump ELF core header in new kernel, if it has not been passed via
+ * the "elfcorehdr" kernel parameter
+ */
+static int setup_kdump_elfcorehdr(void)
+{
+       size_t elfcorebuf_sz;
+       char *elfcorebuf;
+
+       if (!OLDMEM_BASE || is_kdump_kernel())
+               return -EINVAL;
+       s390_elf_corehdr_create(&elfcorebuf, &elfcorebuf_sz);
+       elfcorehdr_addr = (unsigned long long) elfcorebuf;
+       elfcorehdr_size = elfcorebuf_sz;
+       return 0;
+}
+
+subsys_initcall(setup_kdump_elfcorehdr);
index f297456..37394b3 100644 (file)
@@ -252,7 +252,7 @@ static noinline __init void setup_lowcore_early(void)
 {
        psw_t psw;
 
-       psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY;
+       psw.mask = PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA;
        psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_ext_handler;
        S390_lowcore.external_new_psw = psw;
        psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler;
index 02ec8fe..b131570 100644 (file)
@@ -43,16 +43,15 @@ SP_R13           =  STACK_FRAME_OVERHEAD + __PT_GPRS + 52
 SP_R14      =  STACK_FRAME_OVERHEAD + __PT_GPRS + 56
 SP_R15      =  STACK_FRAME_OVERHEAD + __PT_GPRS + 60
 SP_ORIG_R2   = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2
-SP_ILC      =  STACK_FRAME_OVERHEAD + __PT_ILC
-SP_SVCNR     = STACK_FRAME_OVERHEAD + __PT_SVCNR
+SP_SVC_CODE  = STACK_FRAME_OVERHEAD + __PT_SVC_CODE
 SP_SIZE      = STACK_FRAME_OVERHEAD + __PT_SIZE
 
 _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
-                _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_PER_TRAP )
+                _TIF_MCCK_PENDING | _TIF_PER_TRAP )
 _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
                 _TIF_MCCK_PENDING)
-_TIF_SYSCALL = (_TIF_SYSCALL_TRACE>>8 | _TIF_SYSCALL_AUDIT>>8 | \
-               _TIF_SECCOMP>>8 | _TIF_SYSCALL_TRACEPOINT>>8)
+_TIF_TRACE    = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \
+                _TIF_SYSCALL_TRACEPOINT)
 
 STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER
 STACK_SIZE  = 1 << STACK_SHIFT
@@ -228,9 +227,10 @@ ENTRY(system_call)
 sysc_saveall:
        SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       mvc     SP_PSW(8,%r15),__LC_SVC_OLD_PSW
-       mvc     SP_ILC(4,%r15),__LC_SVC_ILC
        l       %r12,__LC_THREAD_INFO   # load pointer to thread_info struct
+       mvc     SP_PSW(8,%r15),__LC_SVC_OLD_PSW
+       mvc     SP_SVC_CODE(4,%r15),__LC_SVC_ILC
+       oi      __TI_flags+3(%r12),_TIF_SYSCALL
 sysc_vtime:
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
 sysc_stime:
@@ -239,17 +239,17 @@ sysc_update:
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
 sysc_do_svc:
        xr      %r7,%r7
-       icm     %r7,3,SP_SVCNR(%r15)    # load svc number and test for svc 0
+       icm     %r7,3,SP_SVC_CODE+2(%r15)# load svc number and test for svc 0
        bnz     BASED(sysc_nr_ok)       # svc number > 0
        # svc 0: system call number in %r1
        cl      %r1,BASED(.Lnr_syscalls)
        bnl     BASED(sysc_nr_ok)
-       sth     %r1,SP_SVCNR(%r15)
+       sth     %r1,SP_SVC_CODE+2(%r15)
        lr      %r7,%r1           # copy svc number to %r7
 sysc_nr_ok:
        sll     %r7,2             # svc number *4
        l       %r10,BASED(.Lsysc_table)
-       tm      __TI_flags+2(%r12),_TIF_SYSCALL
+       tm      __TI_flags+2(%r12),_TIF_TRACE >> 8
        mvc     SP_ARGS(4,%r15),SP_R7(%r15)
        l       %r8,0(%r7,%r10)   # get system call addr.
        bnz     BASED(sysc_tracesys)
@@ -259,23 +259,19 @@ sysc_nr_ok:
 sysc_return:
        LOCKDEP_SYS_EXIT
 sysc_tif:
+       tm      SP_PSW+1(%r15),0x01     # returning to user ?
+       bno     BASED(sysc_restore)
        tm      __TI_flags+3(%r12),_TIF_WORK_SVC
        bnz     BASED(sysc_work)  # there is work to do (signals etc.)
+       ni      __TI_flags+3(%r12),255-_TIF_SYSCALL
 sysc_restore:
        RESTORE_ALL __LC_RETURN_PSW,1
 sysc_done:
 
 #
-# There is work to do, but first we need to check if we return to userspace.
-#
-sysc_work:
-       tm      SP_PSW+1(%r15),0x01     # returning to user ?
-       bno     BASED(sysc_restore)
-
-#
 # One of the work bits is on. Find out which one.
 #
-sysc_work_tif:
+sysc_work:
        tm      __TI_flags+3(%r12),_TIF_MCCK_PENDING
        bo      BASED(sysc_mcck_pending)
        tm      __TI_flags+3(%r12),_TIF_NEED_RESCHED
@@ -284,8 +280,6 @@ sysc_work_tif:
        bo      BASED(sysc_sigpending)
        tm      __TI_flags+3(%r12),_TIF_NOTIFY_RESUME
        bo      BASED(sysc_notify_resume)
-       tm      __TI_flags+3(%r12),_TIF_RESTART_SVC
-       bo      BASED(sysc_restart)
        tm      __TI_flags+3(%r12),_TIF_PER_TRAP
        bo      BASED(sysc_singlestep)
        b       BASED(sysc_return)      # beware of critical section cleanup
@@ -314,11 +308,14 @@ sysc_sigpending:
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        l       %r1,BASED(.Ldo_signal)
        basr    %r14,%r1                # call do_signal
-       tm      __TI_flags+3(%r12),_TIF_RESTART_SVC
-       bo      BASED(sysc_restart)
-       tm      __TI_flags+3(%r12),_TIF_PER_TRAP
-       bo      BASED(sysc_singlestep)
-       b       BASED(sysc_return)
+       tm      __TI_flags+3(%r12),_TIF_SYSCALL
+       bno     BASED(sysc_return)
+       lm      %r2,%r6,SP_R2(%r15)     # load svc arguments
+       xr      %r7,%r7                 # svc 0 returns -ENOSYS
+       clc     SP_SVC_CODE+2(2,%r15),BASED(.Lnr_syscalls+2)
+       bnl     BASED(sysc_nr_ok)       # invalid svc number -> do svc 0
+       icm     %r7,3,SP_SVC_CODE+2(%r15)# load new svc number
+       b       BASED(sysc_nr_ok)       # restart svc
 
 #
 # _TIF_NOTIFY_RESUME is set, call do_notify_resume
@@ -329,24 +326,11 @@ sysc_notify_resume:
        la      %r14,BASED(sysc_return)
        br      %r1                     # call do_notify_resume
 
-
-#
-# _TIF_RESTART_SVC is set, set up registers and restart svc
-#
-sysc_restart:
-       ni      __TI_flags+3(%r12),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
-       l       %r7,SP_R2(%r15)         # load new svc number
-       mvc     SP_R2(4,%r15),SP_ORIG_R2(%r15) # restore first argument
-       lm      %r2,%r6,SP_R2(%r15)     # load svc arguments
-       sth     %r7,SP_SVCNR(%r15)
-       b       BASED(sysc_nr_ok)       # restart svc
-
 #
 # _TIF_PER_TRAP is set, call do_per_trap
 #
 sysc_singlestep:
-       ni      __TI_flags+3(%r12),255-_TIF_PER_TRAP # clear TIF_PER_TRAP
-       xc      SP_SVCNR(2,%r15),SP_SVCNR(%r15)         # clear svc number
+       ni      __TI_flags+3(%r12),255-(_TIF_SYSCALL | _TIF_PER_TRAP)
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        l       %r1,BASED(.Lhandle_per) # load adr. of per handler
        la      %r14,BASED(sysc_return) # load adr. of system return
@@ -361,7 +345,7 @@ sysc_tracesys:
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        la      %r3,0
        xr      %r0,%r0
-       icm     %r0,3,SP_SVCNR(%r15)
+       icm     %r0,3,SP_SVC_CODE(%r15)
        st      %r0,SP_R2(%r15)
        basr    %r14,%r1
        cl      %r2,BASED(.Lnr_syscalls)
@@ -376,7 +360,7 @@ sysc_tracego:
        basr    %r14,%r8                # call sys_xxx
        st      %r2,SP_R2(%r15)         # store return value
 sysc_tracenogo:
-       tm      __TI_flags+2(%r12),_TIF_SYSCALL
+       tm      __TI_flags+2(%r12),_TIF_TRACE >> 8
        bz      BASED(sysc_return)
        l       %r1,BASED(.Ltrace_exit)
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
@@ -454,7 +438,6 @@ ENTRY(pgm_check_handler)
        bnz     BASED(pgm_per)          # got per exception -> special case
        SAVE_ALL_PGM __LC_PGM_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       xc      SP_ILC(4,%r15),SP_ILC(%r15)
        mvc     SP_PSW(8,%r15),__LC_PGM_OLD_PSW
        l       %r12,__LC_THREAD_INFO   # load pointer to thread_info struct
        tm      SP_PSW+1(%r15),0x01     # interrupting from user ?
@@ -530,9 +513,10 @@ pgm_exit2:
 pgm_svcper:
        SAVE_ALL_PGM __LC_SVC_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       mvc     SP_PSW(8,%r15),__LC_SVC_OLD_PSW
-       mvc     SP_ILC(4,%r15),__LC_SVC_ILC
        l       %r12,__LC_THREAD_INFO   # load pointer to thread_info struct
+       mvc     SP_PSW(8,%r15),__LC_SVC_OLD_PSW
+       mvc     SP_SVC_CODE(4,%r15),__LC_SVC_ILC
+       oi      __TI_flags+3(%r12),(_TIF_SYSCALL | _TIF_PER_TRAP)
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
@@ -540,7 +524,6 @@ pgm_svcper:
        mvc     __THREAD_per_cause(2,%r8),__LC_PER_CAUSE
        mvc     __THREAD_per_address(4,%r8),__LC_PER_ADDRESS
        mvc     __THREAD_per_paid(1,%r8),__LC_PER_PAID
-       oi      __TI_flags+3(%r12),_TIF_PER_TRAP # set TIF_PER_TRAP
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        lm      %r2,%r6,SP_R2(%r15)     # load svc arguments
        b       BASED(sysc_do_svc)
@@ -550,7 +533,6 @@ pgm_svcper:
 #
 kernel_per:
        REENABLE_IRQS
-       xc      SP_SVCNR(2,%r15),SP_SVCNR(%r15)
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        l       %r1,BASED(.Lhandle_per) # load adr. of per handler
        basr    %r14,%r1                # branch to do_single_step
@@ -853,13 +835,13 @@ restart_go:
 # PSW restart interrupt handler
 #
 ENTRY(psw_restart_int_handler)
-       st      %r15,__LC_SAVE_AREA_64(%r0)     # save r15
+       st      %r15,__LC_SAVE_AREA+48(%r0)     # save r15
        basr    %r15,0
 0:     l       %r15,.Lrestart_stack-0b(%r15)   # load restart stack
        l       %r15,0(%r15)
        ahi     %r15,-SP_SIZE                   # make room for pt_regs
        stm     %r0,%r14,SP_R0(%r15)            # store gprs %r0-%r14 to stack
-       mvc     SP_R15(4,%r15),__LC_SAVE_AREA_64(%r0)# store saved %r15 to stack
+       mvc     SP_R15(4,%r15),__LC_SAVE_AREA+48(%r0)# store saved %r15 to stack
        mvc     SP_PSW(8,%r15),__LC_RST_OLD_PSW(%r0) # store restart old psw
        xc      __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # set backchain to 0
        basr    %r14,0
@@ -965,9 +947,11 @@ cleanup_system_call:
        s       %r15,BASED(.Lc_spsize)  # make room for registers & psw
        st      %r15,12(%r12)
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       mvc     SP_PSW(8,%r15),__LC_SVC_OLD_PSW
-       mvc     SP_ILC(4,%r15),__LC_SVC_ILC
        mvc     0(4,%r12),__LC_THREAD_INFO
+       l       %r12,__LC_THREAD_INFO
+       mvc     SP_PSW(8,%r15),__LC_SVC_OLD_PSW
+       mvc     SP_SVC_CODE(4,%r15),__LC_SVC_ILC
+       oi      __TI_flags+3(%r12),_TIF_SYSCALL
 cleanup_vtime:
        clc     __LC_RETURN_PSW+4(4),BASED(cleanup_system_call_insn+12)
        bhe     BASED(cleanup_stime)
index 66729eb..ef8fb1d 100644 (file)
@@ -5,24 +5,33 @@
 #include <linux/signal.h>
 #include <asm/ptrace.h>
 
+
+extern void (*pgm_check_table[128])(struct pt_regs *, long, unsigned long);
+extern void *restart_stack;
+
+asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
+asmlinkage void do_syscall_trace_exit(struct pt_regs *regs);
+
 void do_protection_exception(struct pt_regs *, long, unsigned long);
 void do_dat_exception(struct pt_regs *, long, unsigned long);
 void do_asce_exception(struct pt_regs *, long, unsigned long);
 
-extern int sysctl_userprocess_debug;
-
 void do_per_trap(struct pt_regs *regs);
 void syscall_trace(struct pt_regs *regs, int entryexit);
 void kernel_stack_overflow(struct pt_regs * regs);
 void do_signal(struct pt_regs *regs);
 int handle_signal32(unsigned long sig, struct k_sigaction *ka,
                    siginfo_t *info, sigset_t *oldset, struct pt_regs *regs);
+void do_notify_resume(struct pt_regs *regs);
 
 void do_extint(struct pt_regs *regs, unsigned int, unsigned int, unsigned long);
+void do_restart(void);
 int __cpuinit start_secondary(void *cpuvoid);
 void __init startup_init(void);
 void die(const char * str, struct pt_regs * regs, long err);
 
+void __init time_init(void);
+
 struct s390_mmap_arg_struct;
 struct fadvise64_64_args;
 struct old_sigaction;
index 713da07..83a9374 100644 (file)
@@ -43,19 +43,18 @@ SP_R13           =  STACK_FRAME_OVERHEAD + __PT_GPRS + 104
 SP_R14      =  STACK_FRAME_OVERHEAD + __PT_GPRS + 112
 SP_R15      =  STACK_FRAME_OVERHEAD + __PT_GPRS + 120
 SP_ORIG_R2   = STACK_FRAME_OVERHEAD + __PT_ORIG_GPR2
-SP_ILC      =  STACK_FRAME_OVERHEAD + __PT_ILC
-SP_SVCNR      =        STACK_FRAME_OVERHEAD + __PT_SVCNR
+SP_SVC_CODE  = STACK_FRAME_OVERHEAD + __PT_SVC_CODE
 SP_SIZE      = STACK_FRAME_OVERHEAD + __PT_SIZE
 
 STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER
 STACK_SIZE  = 1 << STACK_SHIFT
 
 _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
-                _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_PER_TRAP )
+                _TIF_MCCK_PENDING | _TIF_PER_TRAP )
 _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
                 _TIF_MCCK_PENDING)
-_TIF_SYSCALL = (_TIF_SYSCALL_TRACE>>8 | _TIF_SYSCALL_AUDIT>>8 | \
-               _TIF_SECCOMP>>8 | _TIF_SYSCALL_TRACEPOINT>>8)
+_TIF_TRACE    = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \
+                _TIF_SYSCALL_TRACEPOINT)
 _TIF_EXIT_SIE = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_MCCK_PENDING)
 
 #define BASED(name) name-system_call(%r13)
@@ -249,9 +248,10 @@ ENTRY(system_call)
 sysc_saveall:
        SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       mvc     SP_PSW(16,%r15),__LC_SVC_OLD_PSW
-       mvc     SP_ILC(4,%r15),__LC_SVC_ILC
        lg      %r12,__LC_THREAD_INFO   # load pointer to thread_info struct
+       mvc     SP_PSW(16,%r15),__LC_SVC_OLD_PSW
+       mvc     SP_SVC_CODE(4,%r15),__LC_SVC_ILC
+       oi      __TI_flags+7(%r12),_TIF_SYSCALL
 sysc_vtime:
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
 sysc_stime:
@@ -260,14 +260,14 @@ sysc_update:
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
        LAST_BREAK
 sysc_do_svc:
-       llgh    %r7,SP_SVCNR(%r15)
+       llgh    %r7,SP_SVC_CODE+2(%r15)
        slag    %r7,%r7,2       # shift and test for svc 0
        jnz     sysc_nr_ok
        # svc 0: system call number in %r1
        llgfr   %r1,%r1         # clear high word in r1
        cghi    %r1,NR_syscalls
        jnl     sysc_nr_ok
-       sth     %r1,SP_SVCNR(%r15)
+       sth     %r1,SP_SVC_CODE+2(%r15)
        slag    %r7,%r1,2       # shift and test for svc 0
 sysc_nr_ok:
        larl    %r10,sys_call_table
@@ -277,7 +277,7 @@ sysc_nr_ok:
        larl    %r10,sys_call_table_emu  # use 31 bit emulation system calls
 sysc_noemu:
 #endif
-       tm      __TI_flags+6(%r12),_TIF_SYSCALL
+       tm      __TI_flags+6(%r12),_TIF_TRACE >> 8
        mvc     SP_ARGS(8,%r15),SP_R7(%r15)
        lgf     %r8,0(%r7,%r10) # load address of system call routine
        jnz     sysc_tracesys
@@ -287,23 +287,19 @@ sysc_noemu:
 sysc_return:
        LOCKDEP_SYS_EXIT
 sysc_tif:
+       tm      SP_PSW+1(%r15),0x01     # returning to user ?
+       jno     sysc_restore
        tm      __TI_flags+7(%r12),_TIF_WORK_SVC
        jnz     sysc_work       # there is work to do (signals etc.)
+       ni      __TI_flags+7(%r12),255-_TIF_SYSCALL
 sysc_restore:
        RESTORE_ALL __LC_RETURN_PSW,1
 sysc_done:
 
 #
-# There is work to do, but first we need to check if we return to userspace.
-#
-sysc_work:
-       tm      SP_PSW+1(%r15),0x01     # returning to user ?
-       jno     sysc_restore
-
-#
 # One of the work bits is on. Find out which one.
 #
-sysc_work_tif:
+sysc_work:
        tm      __TI_flags+7(%r12),_TIF_MCCK_PENDING
        jo      sysc_mcck_pending
        tm      __TI_flags+7(%r12),_TIF_NEED_RESCHED
@@ -312,8 +308,6 @@ sysc_work_tif:
        jo      sysc_sigpending
        tm      __TI_flags+7(%r12),_TIF_NOTIFY_RESUME
        jo      sysc_notify_resume
-       tm      __TI_flags+7(%r12),_TIF_RESTART_SVC
-       jo      sysc_restart
        tm      __TI_flags+7(%r12),_TIF_PER_TRAP
        jo      sysc_singlestep
        j       sysc_return             # beware of critical section cleanup
@@ -339,11 +333,15 @@ sysc_sigpending:
        ni      __TI_flags+7(%r12),255-_TIF_PER_TRAP # clear TIF_PER_TRAP
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        brasl   %r14,do_signal          # call do_signal
-       tm      __TI_flags+7(%r12),_TIF_RESTART_SVC
-       jo      sysc_restart
-       tm      __TI_flags+7(%r12),_TIF_PER_TRAP
-       jo      sysc_singlestep
-       j       sysc_return
+       tm      __TI_flags+7(%r12),_TIF_SYSCALL
+       jno     sysc_return
+       lmg     %r2,%r6,SP_R2(%r15)     # load svc arguments
+       lghi    %r7,0                   # svc 0 returns -ENOSYS
+       lh      %r1,SP_SVC_CODE+2(%r15) # load new svc number
+       cghi    %r1,NR_syscalls
+       jnl     sysc_nr_ok              # invalid svc number -> do svc 0
+       slag    %r7,%r1,2
+       j       sysc_nr_ok              # restart svc
 
 #
 # _TIF_NOTIFY_RESUME is set, call do_notify_resume
@@ -354,23 +352,10 @@ sysc_notify_resume:
        jg      do_notify_resume        # call do_notify_resume
 
 #
-# _TIF_RESTART_SVC is set, set up registers and restart svc
-#
-sysc_restart:
-       ni      __TI_flags+7(%r12),255-_TIF_RESTART_SVC # clear TIF_RESTART_SVC
-       lg      %r7,SP_R2(%r15)         # load new svc number
-       mvc     SP_R2(8,%r15),SP_ORIG_R2(%r15) # restore first argument
-       lmg     %r2,%r6,SP_R2(%r15)     # load svc arguments
-       sth     %r7,SP_SVCNR(%r15)
-       slag    %r7,%r7,2
-       j       sysc_nr_ok              # restart svc
-
-#
 # _TIF_PER_TRAP is set, call do_per_trap
 #
 sysc_singlestep:
-       ni      __TI_flags+7(%r12),255-_TIF_PER_TRAP    # clear TIF_PER_TRAP
-       xc      SP_SVCNR(2,%r15),SP_SVCNR(%r15)         # clear svc number
+       ni      __TI_flags+7(%r12),255-(_TIF_SYSCALL | _TIF_PER_TRAP)
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        larl    %r14,sysc_return        # load adr. of system return
        jg      do_per_trap
@@ -382,7 +367,7 @@ sysc_singlestep:
 sysc_tracesys:
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        la      %r3,0
-       llgh    %r0,SP_SVCNR(%r15)
+       llgh    %r0,SP_SVC_CODE+2(%r15)
        stg     %r0,SP_R2(%r15)
        brasl   %r14,do_syscall_trace_enter
        lghi    %r0,NR_syscalls
@@ -397,7 +382,7 @@ sysc_tracego:
        basr    %r14,%r8                # call sys_xxx
        stg     %r2,SP_R2(%r15)         # store return value
 sysc_tracenogo:
-       tm      __TI_flags+6(%r12),_TIF_SYSCALL
+       tm      __TI_flags+6(%r12),_TIF_TRACE >> 8
        jz      sysc_return
        la      %r2,SP_PTREGS(%r15)     # load pt_regs
        larl    %r14,sysc_return        # return point is sysc_return
@@ -470,7 +455,6 @@ ENTRY(pgm_check_handler)
        jnz     pgm_per                  # got per exception -> special case
        SAVE_ALL_PGM __LC_PGM_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       xc      SP_ILC(4,%r15),SP_ILC(%r15)
        mvc     SP_PSW(16,%r15),__LC_PGM_OLD_PSW
        lg      %r12,__LC_THREAD_INFO   # load pointer to thread_info struct
        HANDLE_SIE_INTERCEPT
@@ -550,9 +534,10 @@ pgm_exit2:
 pgm_svcper:
        SAVE_ALL_PGM __LC_SVC_OLD_PSW,__LC_SAVE_AREA
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       mvc     SP_PSW(16,%r15),__LC_SVC_OLD_PSW
-       mvc     SP_ILC(4,%r15),__LC_SVC_ILC
        lg      %r12,__LC_THREAD_INFO   # load pointer to thread_info struct
+       mvc     SP_PSW(16,%r15),__LC_SVC_OLD_PSW
+       mvc     SP_SVC_CODE(4,%r15),__LC_SVC_ILC
+       oi      __TI_flags+7(%r12),(_TIF_SYSCALL | _TIF_PER_TRAP)
        UPDATE_VTIME __LC_EXIT_TIMER,__LC_SYNC_ENTER_TIMER,__LC_USER_TIMER
        UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
        mvc     __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
@@ -561,7 +546,6 @@ pgm_svcper:
        mvc     __THREAD_per_cause(2,%r8),__LC_PER_CAUSE
        mvc     __THREAD_per_address(8,%r8),__LC_PER_ADDRESS
        mvc     __THREAD_per_paid(1,%r8),__LC_PER_PAID
-       oi      __TI_flags+7(%r12),_TIF_PER_TRAP # set TIF_PER_TRAP
        stosm   __SF_EMPTY(%r15),0x03   # reenable interrupts
        lmg     %r2,%r6,SP_R2(%r15)     # load svc arguments
        j       sysc_do_svc
@@ -571,7 +555,6 @@ pgm_svcper:
 #
 kernel_per:
        REENABLE_IRQS
-       xc      SP_SVCNR(2,%r15),SP_SVCNR(%r15) # clear svc number
        la      %r2,SP_PTREGS(%r15)     # address of register-save area
        brasl   %r14,do_per_trap
        j       pgm_exit
@@ -869,12 +852,12 @@ restart_go:
 # PSW restart interrupt handler
 #
 ENTRY(psw_restart_int_handler)
-       stg     %r15,__LC_SAVE_AREA_64(%r0)     # save r15
+       stg     %r15,__LC_SAVE_AREA+120(%r0)    # save r15
        larl    %r15,restart_stack              # load restart stack
        lg      %r15,0(%r15)
        aghi    %r15,-SP_SIZE                   # make room for pt_regs
        stmg    %r0,%r14,SP_R0(%r15)            # store gprs %r0-%r14 to stack
-       mvc     SP_R15(8,%r15),__LC_SAVE_AREA_64(%r0)# store saved %r15 to stack
+       mvc     SP_R15(8,%r15),__LC_SAVE_AREA+120(%r0)# store saved %r15 to stack
        mvc     SP_PSW(16,%r15),__LC_RST_OLD_PSW(%r0)# store restart old psw
        xc      __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) # set backchain to 0
        brasl   %r14,do_restart
@@ -972,9 +955,11 @@ cleanup_system_call:
        stg     %r15,32(%r12)
        stg     %r11,0(%r12)
        CREATE_STACK_FRAME __LC_SAVE_AREA
-       mvc     SP_PSW(16,%r15),__LC_SVC_OLD_PSW
-       mvc     SP_ILC(4,%r15),__LC_SVC_ILC
        mvc     8(8,%r12),__LC_THREAD_INFO
+       lg      %r12,__LC_THREAD_INFO
+       mvc     SP_PSW(16,%r15),__LC_SVC_OLD_PSW
+       mvc     SP_SVC_CODE(4,%r15),__LC_SVC_ILC
+       oi      __TI_flags+7(%r12),_TIF_SYSCALL
 cleanup_vtime:
        clc     __LC_RETURN_PSW+8(8),BASED(cleanup_system_call_insn+24)
        jhe     cleanup_stime
@@ -1096,6 +1081,7 @@ sie_exit:
        lghi    %r2,0
        br      %r14
 sie_fault:
+       lctlg   %c1,%c1,__LC_USER_ASCE          # load primary asce
        lg      %r14,__LC_THREAD_INFO           # pointer thread_info struct
        ni      __TI_flags+6(%r14),255-(_TIF_SIE>>8)
        lg      %r14,__SF_EMPTY+8(%r15)         # load guest register save area
index 2d781ba..900068d 100644 (file)
@@ -449,10 +449,28 @@ ENTRY(start)
 #
        .org    0x10000
 ENTRY(startup)
+       j       .Lep_startup_normal
+       .org    0x10008
+#
+# This is a list of s390 kernel entry points. At address 0x1000f the number of
+# valid entry points is stored.
+#
+# IMPORTANT: Do not change this table, it is s390 kernel ABI!
+#
+       .ascii  "S390EP"
+       .byte   0x00,0x01
+#
+# kdump startup-code at 0x10010, running in 64 bit absolute addressing mode
+#
+       .org    0x10010
+ENTRY(startup_kdump)
+       j       .Lep_startup_kdump
+.Lep_startup_normal:
        basr    %r13,0                  # get base
 .LPG0:
        xc      0x200(256),0x200        # partially clear lowcore
        xc      0x300(256),0x300
+       xc      0xe00(256),0xe00
        stck    __LC_LAST_UPDATE_CLOCK
        spt     5f-.LPG0(%r13)
        mvc     __LC_LAST_UPDATE_TIMER(8),5f-.LPG0(%r13)
@@ -534,6 +552,8 @@ ENTRY(startup)
        .align  8
 5:     .long   0x7fffffff,0xffffffff
 
+#include "head_kdump.S"
+
 #
 # params at 10400 (setup.h)
 #
@@ -541,6 +561,8 @@ ENTRY(startup)
        .long   0,0                     # IPL_DEVICE
        .long   0,0                     # INITRD_START
        .long   0,0                     # INITRD_SIZE
+       .long   0,0                     # OLDMEM_BASE
+       .long   0,0                     # OLDMEM_SIZE
 
        .org    COMMAND_LINE
        .byte   "root=/dev/ram0 ro"
index f21954b..d3f1ab7 100644 (file)
@@ -92,7 +92,7 @@ ENTRY(_stext)
 .LPG3:
 # check control registers
        stctl   %c0,%c15,0(%r15)
-       oi      2(%r15),0x40            # enable sigp emergency signal
+       oi      2(%r15),0x60            # enable sigp emergency & external call
        oi      0(%r15),0x10            # switch on low address protection
        lctl    %c0,%c15,0(%r15)
 
index ae5d492..99348c0 100644 (file)
@@ -90,7 +90,7 @@ ENTRY(_stext)
 .LPG3:
 # check control registers
        stctg   %c0,%c15,0(%r15)
-       oi      6(%r15),0x40            # enable sigp emergency signal
+       oi      6(%r15),0x60            # enable sigp emergency & external call
        oi      4(%r15),0x10            # switch on low address proctection
        lctlg   %c0,%c15,0(%r15)
 
diff --git a/arch/s390/kernel/head_kdump.S b/arch/s390/kernel/head_kdump.S
new file mode 100644 (file)
index 0000000..e1ac389
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * S390 kdump lowlevel functions (new kernel)
+ *
+ * Copyright IBM Corp. 2011
+ * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
+ */
+
+#define DATAMOVER_ADDR 0x4000
+#define COPY_PAGE_ADDR 0x6000
+
+#ifdef CONFIG_CRASH_DUMP
+
+#
+# kdump entry (new kernel - not yet relocated)
+#
+# Note: This code has to be position independent
+#
+
+.align 2
+.Lep_startup_kdump:
+       lhi     %r1,2                           # mode 2 = esame (dump)
+       sigp    %r1,%r0,0x12                    # Switch to esame mode
+       sam64                                   # Switch to 64 bit addressing
+       basr    %r13,0
+.Lbase:
+       larl    %r2,.Lbase_addr                 # Check, if we have been
+       lg      %r2,0(%r2)                      # already relocated:
+       clgr    %r2,%r13                        #
+       jne     .Lrelocate                      # No : Start data mover
+       lghi    %r2,0                           # Yes: Start kdump kernel
+       brasl   %r14,startup_kdump_relocated
+
+.Lrelocate:
+       larl    %r4,startup
+       lg      %r2,0x418(%r4)                  # Get kdump base
+       lg      %r3,0x420(%r4)                  # Get kdump size
+
+       larl    %r10,.Lcopy_start               # Source of data mover
+       lghi    %r8,DATAMOVER_ADDR              # Target of data mover
+       mvc     0(256,%r8),0(%r10)              # Copy data mover code
+
+       agr     %r8,%r2                         # Copy data mover to
+       mvc     0(256,%r8),0(%r10)              # reserved mem
+
+       lghi    %r14,DATAMOVER_ADDR             # Jump to copied data mover
+       basr    %r14,%r14
+.Lbase_addr:
+       .quad   .Lbase
+
+#
+# kdump data mover code (runs at address DATAMOVER_ADDR)
+#
+# r2: kdump base address
+# r3: kdump size
+#
+.Lcopy_start:
+       basr    %r13,0                          # Base
+0:
+       lgr     %r11,%r2                        # Save kdump base address
+       lgr     %r12,%r2
+       agr     %r12,%r3                        # Compute kdump end address
+
+       lghi    %r5,0
+       lghi    %r10,COPY_PAGE_ADDR             # Load copy page address
+1:
+       mvc     0(256,%r10),0(%r5)              # Copy old kernel to tmp
+       mvc     0(256,%r5),0(%r11)              # Copy new kernel to old
+       mvc     0(256,%r11),0(%r10)             # Copy tmp to new
+       aghi    %r11,256
+       aghi    %r5,256
+       clgr    %r11,%r12
+       jl      1b
+
+       lg      %r14,.Lstartup_kdump-0b(%r13)
+       basr    %r14,%r14                       # Start relocated kernel
+.Lstartup_kdump:
+       .long   0x00000000,0x00000000 + startup_kdump_relocated
+.Lcopy_end:
+
+#
+# Startup of kdump (relocated new kernel)
+#
+.align 2
+startup_kdump_relocated:
+       basr    %r13,0
+0:
+       mvc     0(8,%r0),.Lrestart_psw-0b(%r13) # Setup restart PSW
+       mvc     464(16,%r0),.Lpgm_psw-0b(%r13)  # Setup pgm check PSW
+       lhi     %r1,1                           # Start new kernel
+       diag    %r1,%r1,0x308                   # with diag 308
+
+.Lno_diag308:                                  # No diag 308
+       sam31                                   # Switch to 31 bit addr mode
+       sr      %r1,%r1                         # Erase register r1
+       sr      %r2,%r2                         # Erase register r2
+       sigp    %r1,%r2,0x12                    # Switch to 31 bit arch mode
+       lpsw    0                               # Start new kernel...
+.align 8
+.Lrestart_psw:
+       .long   0x00080000,0x80000000 + startup
+.Lpgm_psw:
+       .quad   0x0000000180000000,0x0000000000000000 + .Lno_diag308
+#else
+.align 2
+.Lep_startup_kdump:
+#ifdef CONFIG_64BIT
+       larl    %r13,startup_kdump_crash
+       lpswe   0(%r13)
+.align 8
+startup_kdump_crash:
+       .quad   0x0002000080000000,0x0000000000000000 + startup_kdump_crash
+#else
+       basr    %r13,0
+0:     lpsw    startup_kdump_crash-0b(%r13)
+.align 8
+startup_kdump_crash:
+       .long   0x000a0000,0x00000000 + startup_kdump_crash
+#endif /* CONFIG_64BIT */
+#endif /* CONFIG_CRASH_DUMP */
index 48c7102..affa8e6 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/ctype.h>
 #include <linux/fs.h>
 #include <linux/gfp.h>
+#include <linux/crash_dump.h>
 #include <asm/ipl.h>
 #include <asm/smp.h>
 #include <asm/setup.h>
@@ -26,6 +27,7 @@
 #include <asm/sclp.h>
 #include <asm/sigp.h>
 #include <asm/checksum.h>
+#include "entry.h"
 
 #define IPL_PARM_BLOCK_VERSION 0
 
@@ -275,8 +277,8 @@ static ssize_t ipl_type_show(struct kobject *kobj, struct kobj_attribute *attr,
 static struct kobj_attribute sys_ipl_type_attr = __ATTR_RO(ipl_type);
 
 /* VM IPL PARM routines */
-size_t reipl_get_ascii_vmparm(char *dest, size_t size,
-                                  const struct ipl_parameter_block *ipb)
+static size_t reipl_get_ascii_vmparm(char *dest, size_t size,
+                                    const struct ipl_parameter_block *ipb)
 {
        int i;
        size_t len;
@@ -338,8 +340,8 @@ static size_t scpdata_length(const char* buf, size_t count)
        return count;
 }
 
-size_t reipl_append_ascii_scpdata(char *dest, size_t size,
-                                 const struct ipl_parameter_block *ipb)
+static size_t reipl_append_ascii_scpdata(char *dest, size_t size,
+                                        const struct ipl_parameter_block *ipb)
 {
        size_t count;
        size_t i;
@@ -1738,7 +1740,11 @@ static struct kobj_attribute on_restart_attr =
 
 void do_restart(void)
 {
+       smp_restart_with_online_cpu();
        smp_send_stop();
+#ifdef CONFIG_CRASH_DUMP
+       crash_kexec(NULL);
+#endif
        on_restart_trigger.action->fn(&on_restart_trigger);
        stop_run(&on_restart_trigger);
 }
@@ -2009,7 +2015,7 @@ static void do_reset_calls(void)
 
 u32 dump_prefix_page;
 
-void s390_reset_system(void)
+void s390_reset_system(void (*func)(void *), void *data)
 {
        struct _lowcore *lc;
 
@@ -2028,15 +2034,19 @@ void s390_reset_system(void)
        __ctl_clear_bit(0,28);
 
        /* Set new machine check handler */
-       S390_lowcore.mcck_new_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK;
+       S390_lowcore.mcck_new_psw.mask = psw_kernel_bits | PSW_MASK_DAT;
        S390_lowcore.mcck_new_psw.addr =
                PSW_ADDR_AMODE | (unsigned long) s390_base_mcck_handler;
 
        /* Set new program check handler */
-       S390_lowcore.program_new_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK;
+       S390_lowcore.program_new_psw.mask = psw_kernel_bits | PSW_MASK_DAT;
        S390_lowcore.program_new_psw.addr =
                PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler;
 
+       /* Store status at absolute zero */
+       store_status();
+
        do_reset_calls();
+       if (func)
+               func(data);
 }
-
index 1f4050d..b9a7fdd 100644 (file)
@@ -33,7 +33,8 @@ static const struct irq_class intrclass_names[] = {
        {.name = "EXT" },
        {.name = "I/O" },
        {.name = "CLK", .desc = "[EXT] Clock Comparator" },
-       {.name = "IPI", .desc = "[EXT] Signal Processor" },
+       {.name = "EXC", .desc = "[EXT] External Call" },
+       {.name = "EMS", .desc = "[EXT] Emergency Signal" },
        {.name = "TMR", .desc = "[EXT] CPU Timer" },
        {.name = "TAL", .desc = "[EXT] Timing Alert" },
        {.name = "PFL", .desc = "[EXT] Pseudo Page Fault" },
@@ -42,8 +43,8 @@ static const struct irq_class intrclass_names[] = {
        {.name = "SCP", .desc = "[EXT] Service Call" },
        {.name = "IUC", .desc = "[EXT] IUCV" },
        {.name = "CPM", .desc = "[EXT] CPU Measurement" },
+       {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt" },
        {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt" },
-       {.name = "QDI", .desc = "[I/O] QDIO Interrupt" },
        {.name = "DAS", .desc = "[I/O] DASD" },
        {.name = "C15", .desc = "[I/O] 3215" },
        {.name = "C70", .desc = "[I/O] 3270" },
@@ -53,6 +54,7 @@ static const struct irq_class intrclass_names[] = {
        {.name = "CLW", .desc = "[I/O] CLAW" },
        {.name = "CTC", .desc = "[I/O] CTC" },
        {.name = "APB", .desc = "[I/O] AP Bus" },
+       {.name = "CSC", .desc = "[I/O] CHSC Subchannel" },
        {.name = "NMI", .desc = "[NMI] Machine Check" },
 };
 
index 1d05d66..64b761a 100644 (file)
@@ -635,7 +635,7 @@ void __kprobes jprobe_return(void)
        asm volatile(".word 0x0002");
 }
 
-void __kprobes jprobe_return_end(void)
+static void __used __kprobes jprobe_return_end(void)
 {
        asm volatile("bcr 0,0");
 }
index b09b9c6..3cd0f25 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * arch/s390/kernel/machine_kexec.c
  *
- * Copyright IBM Corp. 2005,2006
+ * Copyright IBM Corp. 2005,2011
  *
  * Author(s): Rolf Adelsberger,
  *           Heiko Carstens <heiko.carstens@de.ibm.com>
+ *           Michael Holzheu <holzheu@linux.vnet.ibm.com>
  */
 
 #include <linux/device.h>
 #include <asm/smp.h>
 #include <asm/reset.h>
 #include <asm/ipl.h>
+#include <asm/diag.h>
+#include <asm/asm-offsets.h>
 
 typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long);
 
 extern const unsigned char relocate_kernel[];
 extern const unsigned long long relocate_kernel_len;
 
+#ifdef CONFIG_CRASH_DUMP
+
+void *fill_cpu_elf_notes(void *ptr, struct save_area *sa);
+
+/*
+ * Create ELF notes for one CPU
+ */
+static void add_elf_notes(int cpu)
+{
+       struct save_area *sa = (void *) 4608 + store_prefix();
+       void *ptr;
+
+       memcpy((void *) (4608UL + sa->pref_reg), sa, sizeof(*sa));
+       ptr = (u64 *) per_cpu_ptr(crash_notes, cpu);
+       ptr = fill_cpu_elf_notes(ptr, sa);
+       memset(ptr, 0, sizeof(struct elf_note));
+}
+
+/*
+ * Store status of next available physical CPU
+ */
+static int store_status_next(int start_cpu, int this_cpu)
+{
+       struct save_area *sa = (void *) 4608 + store_prefix();
+       int cpu, rc;
+
+       for (cpu = start_cpu; cpu < 65536; cpu++) {
+               if (cpu == this_cpu)
+                       continue;
+               do {
+                       rc = raw_sigp(cpu, sigp_stop_and_store_status);
+               } while (rc == sigp_busy);
+               if (rc != sigp_order_code_accepted)
+                       continue;
+               if (sa->pref_reg)
+                       return cpu;
+       }
+       return -1;
+}
+
+/*
+ * Initialize CPU ELF notes
+ */
+void setup_regs(void)
+{
+       unsigned long sa = S390_lowcore.prefixreg_save_area + SAVE_AREA_BASE;
+       int cpu, this_cpu, phys_cpu = 0, first = 1;
+
+       this_cpu = stap();
+
+       if (!S390_lowcore.prefixreg_save_area)
+               first = 0;
+       for_each_online_cpu(cpu) {
+               if (first) {
+                       add_elf_notes(cpu);
+                       first = 0;
+                       continue;
+               }
+               phys_cpu = store_status_next(phys_cpu, this_cpu);
+               if (phys_cpu == -1)
+                       break;
+               add_elf_notes(cpu);
+               phys_cpu++;
+       }
+       /* Copy dump CPU store status info to absolute zero */
+       memcpy((void *) SAVE_AREA_BASE, (void *) sa, sizeof(struct save_area));
+}
+
+#endif
+
+/*
+ * Start kdump: We expect here that a store status has been done on our CPU
+ */
+static void __do_machine_kdump(void *image)
+{
+#ifdef CONFIG_CRASH_DUMP
+       int (*start_kdump)(int) = (void *)((struct kimage *) image)->start;
+
+       __load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA);
+       setup_regs();
+       start_kdump(1);
+#endif
+}
+
+/*
+ * Check if kdump checksums are valid: We call purgatory with parameter "0"
+ */
+static int kdump_csum_valid(struct kimage *image)
+{
+#ifdef CONFIG_CRASH_DUMP
+       int (*start_kdump)(int) = (void *)image->start;
+       int rc;
+
+       __arch_local_irq_stnsm(0xfb); /* disable DAT */
+       rc = start_kdump(0);
+       __arch_local_irq_stosm(0x04); /* enable DAT */
+       return rc ? 0 : -EINVAL;
+#else
+       return -EINVAL;
+#endif
+}
+
+/*
+ * Map or unmap crashkernel memory
+ */
+static void crash_map_pages(int enable)
+{
+       unsigned long size = resource_size(&crashk_res);
+
+       BUG_ON(crashk_res.start % KEXEC_CRASH_MEM_ALIGN ||
+              size % KEXEC_CRASH_MEM_ALIGN);
+       if (enable)
+               vmem_add_mapping(crashk_res.start, size);
+       else
+               vmem_remove_mapping(crashk_res.start, size);
+}
+
+/*
+ * Map crashkernel memory
+ */
+void crash_map_reserved_pages(void)
+{
+       crash_map_pages(1);
+}
+
+/*
+ * Unmap crashkernel memory
+ */
+void crash_unmap_reserved_pages(void)
+{
+       crash_map_pages(0);
+}
+
+/*
+ * Give back memory to hypervisor before new kdump is loaded
+ */
+static int machine_kexec_prepare_kdump(void)
+{
+#ifdef CONFIG_CRASH_DUMP
+       if (MACHINE_IS_VM)
+               diag10_range(PFN_DOWN(crashk_res.start),
+                            PFN_DOWN(crashk_res.end - crashk_res.start + 1));
+       return 0;
+#else
+       return -EINVAL;
+#endif
+}
+
 int machine_kexec_prepare(struct kimage *image)
 {
        void *reboot_code_buffer;
@@ -35,6 +186,9 @@ int machine_kexec_prepare(struct kimage *image)
        if (ipl_flags & IPL_NSS_VALID)
                return -ENOSYS;
 
+       if (image->type == KEXEC_TYPE_CRASH)
+               return machine_kexec_prepare_kdump();
+
        /* We don't support anything but the default image type for now. */
        if (image->type != KEXEC_TYPE_DEFAULT)
                return -EINVAL;
@@ -51,27 +205,53 @@ void machine_kexec_cleanup(struct kimage *image)
 {
 }
 
+void arch_crash_save_vmcoreinfo(void)
+{
+       VMCOREINFO_SYMBOL(lowcore_ptr);
+       VMCOREINFO_LENGTH(lowcore_ptr, NR_CPUS);
+}
+
 void machine_shutdown(void)
 {
 }
 
-static void __machine_kexec(void *data)
+/*
+ * Do normal kexec
+ */
+static void __do_machine_kexec(void *data)
 {
        relocate_kernel_t data_mover;
        struct kimage *image = data;
 
-       pfault_fini();
-       s390_reset_system();
-
        data_mover = (relocate_kernel_t) page_to_phys(image->control_code_page);
 
        /* Call the moving routine */
        (*data_mover)(&image->head, image->start);
-       for (;;);
 }
 
+/*
+ * Reset system and call either kdump or normal kexec
+ */
+static void __machine_kexec(void *data)
+{
+       struct kimage *image = data;
+
+       pfault_fini();
+       if (image->type == KEXEC_TYPE_CRASH)
+               s390_reset_system(__do_machine_kdump, data);
+       else
+               s390_reset_system(__do_machine_kexec, data);
+       disabled_wait((unsigned long) __builtin_return_address(0));
+}
+
+/*
+ * Do either kdump or normal kexec. In case of kdump we first ask
+ * purgatory, if kdump checksums are valid.
+ */
 void machine_kexec(struct kimage *image)
 {
+       if (image->type == KEXEC_TYPE_CRASH && !kdump_csum_valid(image))
+               return;
        tracer_disable();
        smp_send_stop();
        smp_switch_to_ipl_cpu(__machine_kexec, image);
index 0fbe4e3..19b4568 100644 (file)
@@ -62,3 +62,72 @@ void detect_memory_layout(struct mem_chunk chunk[])
        arch_local_irq_restore(flags);
 }
 EXPORT_SYMBOL(detect_memory_layout);
+
+/*
+ * Create memory hole with given address, size, and type
+ */
+void create_mem_hole(struct mem_chunk chunks[], unsigned long addr,
+                    unsigned long size, int type)
+{
+       unsigned long start, end, new_size;
+       int i;
+
+       for (i = 0; i < MEMORY_CHUNKS; i++) {
+               if (chunks[i].size == 0)
+                       continue;
+               if (addr + size < chunks[i].addr)
+                       continue;
+               if (addr >= chunks[i].addr + chunks[i].size)
+                       continue;
+               start = max(addr, chunks[i].addr);
+               end = min(addr + size, chunks[i].addr + chunks[i].size);
+               new_size = end - start;
+               if (new_size == 0)
+                       continue;
+               if (start == chunks[i].addr &&
+                   end == chunks[i].addr + chunks[i].size) {
+                       /* Remove chunk */
+                       chunks[i].type = type;
+               } else if (start == chunks[i].addr) {
+                       /* Make chunk smaller at start */
+                       if (i >= MEMORY_CHUNKS - 1)
+                               panic("Unable to create memory hole");
+                       memmove(&chunks[i + 1], &chunks[i],
+                               sizeof(struct mem_chunk) *
+                               (MEMORY_CHUNKS - (i + 1)));
+                       chunks[i + 1].addr = chunks[i].addr + new_size;
+                       chunks[i + 1].size = chunks[i].size - new_size;
+                       chunks[i].size = new_size;
+                       chunks[i].type = type;
+                       i += 1;
+               } else if (end == chunks[i].addr + chunks[i].size) {
+                       /* Make chunk smaller at end */
+                       if (i >= MEMORY_CHUNKS - 1)
+                               panic("Unable to create memory hole");
+                       memmove(&chunks[i + 1], &chunks[i],
+                               sizeof(struct mem_chunk) *
+                               (MEMORY_CHUNKS - (i + 1)));
+                       chunks[i + 1].addr = start;
+                       chunks[i + 1].size = new_size;
+                       chunks[i + 1].type = type;
+                       chunks[i].size -= new_size;
+                       i += 1;
+               } else {
+                       /* Create memory hole */
+                       if (i >= MEMORY_CHUNKS - 2)
+                               panic("Unable to create memory hole");
+                       memmove(&chunks[i + 2], &chunks[i],
+                               sizeof(struct mem_chunk) *
+                               (MEMORY_CHUNKS - (i + 2)));
+                       chunks[i + 1].addr = addr;
+                       chunks[i + 1].size = size;
+                       chunks[i + 1].type = type;
+                       chunks[i + 2].addr = addr + size;
+                       chunks[i + 2].size =
+                               chunks[i].addr + chunks[i].size - (addr + size);
+                       chunks[i + 2].type = chunks[i].type;
+                       chunks[i].size = addr - chunks[i].addr;
+                       i += 2;
+               }
+       }
+}
index 541a750..9451b21 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
+#include <linux/elfcore.h>
 #include <linux/smp.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -117,7 +118,8 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
        struct pt_regs regs;
 
        memset(&regs, 0, sizeof(regs));
-       regs.psw.mask = psw_kernel_bits | PSW_MASK_IO | PSW_MASK_EXT;
+       regs.psw.mask = psw_kernel_bits |
+               PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK;
        regs.psw.addr = (unsigned long) kernel_thread_starter | PSW_ADDR_AMODE;
        regs.gprs[9] = (unsigned long) fn;
        regs.gprs[10] = (unsigned long) arg;
index 311e9d7..6e0073e 100644 (file)
@@ -74,7 +74,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
-       return *pos < NR_CPUS ? (void *)((unsigned long) *pos + 1) : NULL;
+       return *pos < nr_cpu_ids ? (void *)((unsigned long) *pos + 1) : NULL;
 }
 
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
index ef86ad2..450931a 100644 (file)
@@ -42,34 +42,37 @@ enum s390_regset {
        REGSET_GENERAL,
        REGSET_FP,
        REGSET_LAST_BREAK,
+       REGSET_SYSTEM_CALL,
        REGSET_GENERAL_EXTENDED,
 };
 
 void update_per_regs(struct task_struct *task)
 {
-       static const struct per_regs per_single_step = {
-               .control = PER_EVENT_IFETCH,
-               .start = 0,
-               .end = PSW_ADDR_INSN,
-       };
        struct pt_regs *regs = task_pt_regs(task);
        struct thread_struct *thread = &task->thread;
-       const struct per_regs *new;
-       struct per_regs old;
-
-       /* TIF_SINGLE_STEP overrides the user specified PER registers. */
-       new = test_tsk_thread_flag(task, TIF_SINGLE_STEP) ?
-               &per_single_step : &thread->per_user;
+       struct per_regs old, new;
+
+       /* Copy user specified PER registers */
+       new.control = thread->per_user.control;
+       new.start = thread->per_user.start;
+       new.end = thread->per_user.end;
+
+       /* merge TIF_SINGLE_STEP into user specified PER registers. */
+       if (test_tsk_thread_flag(task, TIF_SINGLE_STEP)) {
+               new.control |= PER_EVENT_IFETCH;
+               new.start = 0;
+               new.end = PSW_ADDR_INSN;
+       }
 
        /* Take care of the PER enablement bit in the PSW. */
-       if (!(new->control & PER_EVENT_MASK)) {
+       if (!(new.control & PER_EVENT_MASK)) {
                regs->psw.mask &= ~PSW_MASK_PER;
                return;
        }
        regs->psw.mask |= PSW_MASK_PER;
        __ctl_store(old, 9, 11);
-       if (memcmp(new, &old, sizeof(struct per_regs)) != 0)
-               __ctl_load(*new, 9, 11);
+       if (memcmp(&new, &old, sizeof(struct per_regs)) != 0)
+               __ctl_load(new, 9, 11);
 }
 
 void user_enable_single_step(struct task_struct *task)
@@ -166,8 +169,8 @@ static unsigned long __peek_user(struct task_struct *child, addr_t addr)
                 */
                tmp = *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr);
                if (addr == (addr_t) &dummy->regs.psw.mask)
-                       /* Remove per bit from user psw. */
-                       tmp &= ~PSW_MASK_PER;
+                       /* Return a clean psw mask. */
+                       tmp = psw_user_bits | (tmp & PSW_MASK_USER);
 
        } else if (addr < (addr_t) &dummy->regs.orig_gpr2) {
                /*
@@ -289,18 +292,17 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
                 * psw and gprs are stored on the stack
                 */
                if (addr == (addr_t) &dummy->regs.psw.mask &&
-#ifdef CONFIG_COMPAT
-                   data != PSW_MASK_MERGE(psw_user32_bits, data) &&
-#endif
-                   data != PSW_MASK_MERGE(psw_user_bits, data))
+                   ((data & ~PSW_MASK_USER) != psw_user_bits ||
+                    ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA))))
                        /* Invalid psw mask. */
                        return -EINVAL;
-#ifndef CONFIG_64BIT
                if (addr == (addr_t) &dummy->regs.psw.addr)
-                       /* I'd like to reject addresses without the
-                          high order bit but older gdb's rely on it */
-                       data |= PSW_ADDR_AMODE;
-#endif
+                       /*
+                        * The debugger changed the instruction address,
+                        * reset system call restart, see signal.c:do_signal
+                        */
+                       task_thread_info(child)->system_call = 0;
+
                *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;
 
        } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
@@ -495,21 +497,21 @@ static u32 __peek_user_compat(struct task_struct *child, addr_t addr)
        __u32 tmp;
 
        if (addr < (addr_t) &dummy32->regs.acrs) {
+               struct pt_regs *regs = task_pt_regs(child);
                /*
                 * psw and gprs are stored on the stack
                 */
                if (addr == (addr_t) &dummy32->regs.psw.mask) {
                        /* Fake a 31 bit psw mask. */
-                       tmp = (__u32)(task_pt_regs(child)->psw.mask >> 32);
-                       tmp = PSW32_MASK_MERGE(psw32_user_bits, tmp);
+                       tmp = (__u32)(regs->psw.mask >> 32);
+                       tmp = psw32_user_bits | (tmp & PSW32_MASK_USER);
                } else if (addr == (addr_t) &dummy32->regs.psw.addr) {
                        /* Fake a 31 bit psw address. */
-                       tmp = (__u32) task_pt_regs(child)->psw.addr |
-                               PSW32_ADDR_AMODE31;
+                       tmp = (__u32) regs->psw.addr |
+                               (__u32)(regs->psw.mask & PSW_MASK_BA);
                } else {
                        /* gpr 0-15 */
-                       tmp = *(__u32 *)((addr_t) &task_pt_regs(child)->psw +
-                                        addr*2 + 4);
+                       tmp = *(__u32 *)((addr_t) &regs->psw + addr*2 + 4);
                }
        } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) {
                /*
@@ -594,24 +596,32 @@ static int __poke_user_compat(struct task_struct *child,
        addr_t offset;
 
        if (addr < (addr_t) &dummy32->regs.acrs) {
+               struct pt_regs *regs = task_pt_regs(child);
                /*
                 * psw, gprs, acrs and orig_gpr2 are stored on the stack
                 */
                if (addr == (addr_t) &dummy32->regs.psw.mask) {
                        /* Build a 64 bit psw mask from 31 bit mask. */
-                       if (tmp != PSW32_MASK_MERGE(psw32_user_bits, tmp))
+                       if ((tmp & ~PSW32_MASK_USER) != psw32_user_bits)
                                /* Invalid psw mask. */
                                return -EINVAL;
-                       task_pt_regs(child)->psw.mask =
-                               PSW_MASK_MERGE(psw_user32_bits, (__u64) tmp << 32);
+                       regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
+                               (regs->psw.mask & PSW_MASK_BA) |
+                               (__u64)(tmp & PSW32_MASK_USER) << 32;
                } else if (addr == (addr_t) &dummy32->regs.psw.addr) {
                        /* Build a 64 bit psw address from 31 bit address. */
-                       task_pt_regs(child)->psw.addr =
-                               (__u64) tmp & PSW32_ADDR_INSN;
+                       regs->psw.addr = (__u64) tmp & PSW32_ADDR_INSN;
+                       /* Transfer 31 bit amode bit to psw mask. */
+                       regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
+                               (__u64)(tmp & PSW32_ADDR_AMODE);
+                       /*
+                        * The debugger changed the instruction address,
+                        * reset system call restart, see signal.c:do_signal
+                        */
+                       task_thread_info(child)->system_call = 0;
                } else {
                        /* gpr 0-15 */
-                       *(__u32*)((addr_t) &task_pt_regs(child)->psw
-                                 + addr*2 + 4) = tmp;
+                       *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;
                }
        } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) {
                /*
@@ -735,7 +745,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
                 * debugger stored an invalid system call number. Skip
                 * the system call and the system call restart handling.
                 */
-               regs->svcnr = 0;
+               clear_thread_flag(TIF_SYSCALL);
                ret = -1;
        }
 
@@ -897,6 +907,26 @@ static int s390_last_break_get(struct task_struct *target,
 
 #endif
 
+static int s390_system_call_get(struct task_struct *target,
+                               const struct user_regset *regset,
+                               unsigned int pos, unsigned int count,
+                               void *kbuf, void __user *ubuf)
+{
+       unsigned int *data = &task_thread_info(target)->system_call;
+       return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
+                                  data, 0, sizeof(unsigned int));
+}
+
+static int s390_system_call_set(struct task_struct *target,
+                               const struct user_regset *regset,
+                               unsigned int pos, unsigned int count,
+                               const void *kbuf, const void __user *ubuf)
+{
+       unsigned int *data = &task_thread_info(target)->system_call;
+       return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                 data, 0, sizeof(unsigned int));
+}
+
 static const struct user_regset s390_regsets[] = {
        [REGSET_GENERAL] = {
                .core_note_type = NT_PRSTATUS,
@@ -923,6 +953,14 @@ static const struct user_regset s390_regsets[] = {
                .get = s390_last_break_get,
        },
 #endif
+       [REGSET_SYSTEM_CALL] = {
+               .core_note_type = NT_S390_SYSTEM_CALL,
+               .n = 1,
+               .size = sizeof(unsigned int),
+               .align = sizeof(unsigned int),
+               .get = s390_system_call_get,
+               .set = s390_system_call_set,
+       },
 };
 
 static const struct user_regset_view user_s390_view = {
@@ -1102,6 +1140,14 @@ static const struct user_regset s390_compat_regsets[] = {
                .align = sizeof(long),
                .get = s390_compat_last_break_get,
        },
+       [REGSET_SYSTEM_CALL] = {
+               .core_note_type = NT_S390_SYSTEM_CALL,
+               .n = 1,
+               .size = sizeof(compat_uint_t),
+               .align = sizeof(compat_uint_t),
+               .get = s390_system_call_get,
+               .set = s390_system_call_set,
+       },
        [REGSET_GENERAL_EXTENDED] = {
                .core_note_type = NT_S390_HIGH_GPRS,
                .n = sizeof(s390_compat_regs_high) / sizeof(compat_long_t),
index 303d961..ad67c21 100644 (file)
 #include <asm/asm-offsets.h>
 
 #
+# store_status: Empty implementation until kdump is supported on 31 bit
+#
+ENTRY(store_status)
+               br      %r14
+
+#
 # do_reipl_asm
 # Parameter: r2 = schid of reipl device
 #
index e690975..732a793 100644 (file)
 #
 ENTRY(store_status)
        /* Save register one and load save area base */
-       stg     %r1,__LC_SAVE_AREA_64(%r0)
+       stg     %r1,__LC_SAVE_AREA+120(%r0)
        lghi    %r1,SAVE_AREA_BASE
        /* General purpose registers */
        stmg    %r0,%r15,__LC_GPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1)
-       lg      %r2,__LC_SAVE_AREA_64(%r0)
+       lg      %r2,__LC_SAVE_AREA+120(%r0)
        stg     %r2,__LC_GPREGS_SAVE_AREA-SAVE_AREA_BASE+8(%r1)
        /* Control registers */
        stctg   %c0,%c15,__LC_CREGS_SAVE_AREA-SAVE_AREA_BASE(%r1)
@@ -62,8 +62,11 @@ ENTRY(store_status)
        larl    %r2,store_status
        stg     %r2,__LC_PSW_SAVE_AREA-SAVE_AREA_BASE + 8(%r1)
        br      %r14
-.align 8
+
+       .section .bss
+       .align  8
 .Lclkcmp:      .quad   0x0000000000000000
+       .previous
 
 #
 # do_reipl_asm
index 7b371c3..8ac6bfa 100644 (file)
@@ -42,6 +42,9 @@
 #include <linux/reboot.h>
 #include <linux/topology.h>
 #include <linux/ftrace.h>
+#include <linux/kexec.h>
+#include <linux/crash_dump.h>
+#include <linux/memory.h>
 
 #include <asm/ipl.h>
 #include <asm/uaccess.h>
 #include <asm/ebcdic.h>
 #include <asm/compat.h>
 #include <asm/kvm_virtio.h>
+#include <asm/diag.h>
 
-long psw_kernel_bits   = (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY |
-                          PSW_MASK_MCHECK | PSW_DEFAULT_KEY);
-long psw_user_bits     = (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME |
-                          PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK |
-                          PSW_MASK_PSTATE | PSW_DEFAULT_KEY);
+long psw_kernel_bits   = PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_ASC_PRIMARY |
+                         PSW_MASK_EA | PSW_MASK_BA;
+long psw_user_bits     = PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT |
+                         PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_MCHECK |
+                         PSW_MASK_PSTATE | PSW_ASC_HOME;
 
 /*
  * User copy operations.
@@ -274,22 +278,14 @@ early_param("mem", early_parse_mem);
 unsigned int user_mode = HOME_SPACE_MODE;
 EXPORT_SYMBOL_GPL(user_mode);
 
-static int set_amode_and_uaccess(unsigned long user_amode,
-                                unsigned long user32_amode)
+static int set_amode_primary(void)
 {
-       psw_user_bits = PSW_BASE_BITS | PSW_MASK_DAT | user_amode |
-                       PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK |
-                       PSW_MASK_PSTATE | PSW_DEFAULT_KEY;
+       psw_kernel_bits = (psw_kernel_bits & ~PSW_MASK_ASC) | PSW_ASC_HOME;
+       psw_user_bits = (psw_user_bits & ~PSW_MASK_ASC) | PSW_ASC_PRIMARY;
 #ifdef CONFIG_COMPAT
-       psw_user32_bits = PSW_BASE32_BITS | PSW_MASK_DAT | user_amode |
-                         PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK |
-                         PSW_MASK_PSTATE | PSW_DEFAULT_KEY;
-       psw32_user_bits = PSW32_BASE_BITS | PSW32_MASK_DAT | user32_amode |
-                         PSW32_MASK_IO | PSW32_MASK_EXT | PSW32_MASK_MCHECK |
-                         PSW32_MASK_PSTATE;
+       psw32_user_bits =
+               (psw32_user_bits & ~PSW32_MASK_ASC) | PSW32_ASC_PRIMARY;
 #endif
-       psw_kernel_bits = PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME |
-                         PSW_MASK_MCHECK | PSW_DEFAULT_KEY;
 
        if (MACHINE_HAS_MVCOS) {
                memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess));
@@ -325,7 +321,7 @@ early_param("user_mode", early_parse_user_mode);
 static void setup_addressing_mode(void)
 {
        if (user_mode == PRIMARY_SPACE_MODE) {
-               if (set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY))
+               if (set_amode_primary())
                        pr_info("Address spaces switched, "
                                "mvcos available\n");
                else
@@ -344,24 +340,25 @@ setup_lowcore(void)
         */
        BUILD_BUG_ON(sizeof(struct _lowcore) != LC_PAGES * 4096);
        lc = __alloc_bootmem_low(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0);
-       lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY;
+       lc->restart_psw.mask = psw_kernel_bits;
        lc->restart_psw.addr =
                PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler;
-       if (user_mode != HOME_SPACE_MODE)
-               lc->restart_psw.mask |= PSW_ASC_HOME;
-       lc->external_new_psw.mask = psw_kernel_bits;
+       lc->external_new_psw.mask = psw_kernel_bits |
+               PSW_MASK_DAT | PSW_MASK_MCHECK;
        lc->external_new_psw.addr =
                PSW_ADDR_AMODE | (unsigned long) ext_int_handler;
-       lc->svc_new_psw.mask = psw_kernel_bits | PSW_MASK_IO | PSW_MASK_EXT;
+       lc->svc_new_psw.mask = psw_kernel_bits |
+               PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK;
        lc->svc_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) system_call;
-       lc->program_new_psw.mask = psw_kernel_bits;
+       lc->program_new_psw.mask = psw_kernel_bits |
+               PSW_MASK_DAT | PSW_MASK_MCHECK;
        lc->program_new_psw.addr =
-               PSW_ADDR_AMODE | (unsigned long)pgm_check_handler;
-       lc->mcck_new_psw.mask =
-               psw_kernel_bits & ~PSW_MASK_MCHECK & ~PSW_MASK_DAT;
+               PSW_ADDR_AMODE | (unsigned long) pgm_check_handler;
+       lc->mcck_new_psw.mask = psw_kernel_bits;
        lc->mcck_new_psw.addr =
                PSW_ADDR_AMODE | (unsigned long) mcck_int_handler;
-       lc->io_new_psw.mask = psw_kernel_bits;
+       lc->io_new_psw.mask = psw_kernel_bits |
+               PSW_MASK_DAT | PSW_MASK_MCHECK;
        lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler;
        lc->clock_comparator = -1ULL;
        lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE;
@@ -435,10 +432,14 @@ static void __init setup_resources(void)
        for (i = 0; i < MEMORY_CHUNKS; i++) {
                if (!memory_chunk[i].size)