28 Jun, 2013

1 commit

  • Convert printks to pr_ (excludes printk(KERN_DEBUG...)
    to be more consistent throughout the xen subsystem.

    Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME
    Coalesce formats and add missing word spaces
    Add missing newlines
    Align arguments and reflow to 80 columns
    Remove DRV_NAME from formats as pr_fmt adds the same content

    This does change some of the prefixes of these messages
    but it also does make them more consistent.

    Signed-off-by: Joe Perches
    Signed-off-by: Konrad Rzeszutek Wilk

    Joe Perches
     

20 Jul, 2012

3 commits

  • If a driver leaves its poll method NULL, the device is assumed to
    be both readable and writable without blocking.

    This patch add .poll method to xen mcelog device driver, so that
    when mcelog use system calls like ppoll or select, it would be
    blocked when no data available, and avoid spinning at CPU.

    Reported-by: Konrad Rzeszutek Wilk
    Signed-off-by: Liu, Jinsong
    Signed-off-by: Konrad Rzeszutek Wilk

    Liu, Jinsong
     
  • copy_to_user might sleep and print a stack trace if it is executed
    in an atomic spinlock context. Like this:

    (XEN) CMCI: send CMCI to DOM0 through virq
    BUG: sleeping function called from invalid context at /home/konradinux/kernel.h:199
    in_atomic(): 1, irqs_disabled(): 0, pid: 4581, name: mcelog
    Pid: 4581, comm: mcelog Tainted: G O 3.5.0-rc1upstream-00003-g149000b-dirty #1
    [] __might_sleep+0xda/0x100
    [] xen_mce_chrdev_read+0xab/0x140
    [] vfs_read+0xc5/0x190
    [] sys_read+0x4c/0x90
    [] system_call_fastpath+0x16

    This patch schedule a workqueue for IRQ handler to poll the data,
    and use mutex instead of spinlock, so copy_to_user sleep in atomic
    context would not occur.

    Reported-by: Konrad Rzeszutek Wilk
    Suggested-by: Konrad Rzeszutek Wilk
    Signed-off-by: Liu, Jinsong
    Signed-off-by: Konrad Rzeszutek Wilk

    Liu, Jinsong
     
  • When MCA error occurs, it would be handled by Xen hypervisor first,
    and then the error information would be sent to initial domain for logging.

    This patch gets error information from Xen hypervisor and convert
    Xen format error into Linux format mcelog. This logic is basically
    self-contained, not touching other kernel components.

    By using tools like mcelog tool users could read specific error information,
    like what they did under native Linux.

    To test follow directions outlined in Documentation/acpi/apei/einj.txt

    Acked-and-tested-by: Borislav Petkov
    Signed-off-by: Ke, Liping
    Signed-off-by: Jiang, Yunhong
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Liu, Jinsong
    Signed-off-by: Konrad Rzeszutek Wilk

    Liu, Jinsong