id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
0576fc703a03a43e73a57450d5720b47ec7a03ba
Analyze and fix the following issue in the Linux kernel code: [S390] smp: use correct cpu address in print_cpu_info()
Problem Details: Up to now print_cpu_info() uses the cpu address stored in it's local lowcore to print a message to the console. The cpu address in the lowcore is (in this case) however not the physical cpu address of the local cpu. It's the address of the cpu that issued the sigp restart which started the local cpu. F...
```diff diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index ecb2d02b02e4..644548e615c6 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c @@ -42,7 +42,7 @@ void __cpuinit print_cpu_info(void) struct cpuid *id = &per_cpu(cpu_id, smp_processor_id()); pr_info("Pro...
baa071588c3ffcc1a8721faf9337140e85d34bf6
Analyze and fix the following issue in the Linux kernel code: [S390] cleanup system call parameter setup
Problem Details: Do the setup of the stack overflow argument for the sixth system call parameter right before the branch to the system call function. That simplifies the system call parameter access code. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h index 8429686951f9..5c0246b955d8 100644 --- a/arch/s390/include/asm/syscall.h +++ b/arch/s390/include/asm/syscall.h @@ -65,8 +65,6 @@ static inline void syscall_get_arguments(struct task_struct *task, if (test_tsk_thread_flag(task,...
84afdcee620b1640f2a145c07febae4ed68947f9
Analyze and fix the following issue in the Linux kernel code: [S390] pgtable: move pte_mkhuge() from hugetlb.h to pgtable.h
Problem Details: All architectures besides s390 have pte_mkhuge() defined in pgtable.h. So move the function to pgtable.h on s390 as well. Fixes a compile error introduced with "hugetlb: hugepage migration core" in linux-next which only happens on s390. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-...
```diff diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h index bb8343d157bc..b56403c2df28 100644 --- a/arch/s390/include/asm/hugetlb.h +++ b/arch/s390/include/asm/hugetlb.h @@ -37,32 +37,6 @@ static inline int prepare_hugepage_range(struct file *file, int arch_prepare_hugepage(struct page...
36bf96801e3a2c4efae0bb8c1897a530fc9ca13e
Analyze and fix the following issue in the Linux kernel code: [S390] fix SIGBUS handling
Problem Details: Raise SIGBUS with a siginfo structure. Deliver BUS_ADRERR as si_code and the address of the fault in the si_addr field. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index b49d12073f10..bae2c282221c 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -212,14 +212,21 @@ static noinline void do_sigbus(struct pt_regs *regs, long int_code, unsigned long trans_exc_code) { struct task_struct *tsk =...
34aec07c170b972a29c954b37047184bd0f9f294
Analyze and fix the following issue in the Linux kernel code: [S390] chsc: initialization fixes
Problem Details: This patch fixes: * kfree vs. free_page usage * structure definition for determine_css_characteristics * naming convention for the chsc init function * deregistration of crw handlers in the cleanup path Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <sch...
```diff diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 4cbb1a6ca33c..f26cc3e16181 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -2,7 +2,7 @@ * drivers/s390/cio/chsc.c * S/390 common I/O routines -- channel subsystem call * - * Copyright IBM Corp. 1999,2008 + * ...
74b6127e6c35abf06364468636dd261850639f8b
Analyze and fix the following issue in the Linux kernel code: [S390] cio: fix memleak in resume path
Problem Details: If a ccwdevice is lost during hibernation and a different ccwdevice is attached to the same subchannel, we will deregister the old ccw device and register the new one. Since deregistration is not allowed in this context, we handle this action later. However, some parts of the registration process for ...
```diff diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 51bd3687d163..07b1a074beaf 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1468,9 +1468,13 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process) goto out; break; case IO_SCH_UNREG_AT...
ed3640b285d831065eb0507cdca7d125f6f78e8d
Analyze and fix the following issue in the Linux kernel code: [S390] dasd fix dump_sense_dbf
Problem Details: The dasd_eckd_dump_sense_dbf function uses a macro for s390 debug feature that can handle up to 8 parameters (for the DASD device driver). Fix the function to use only the maximum number of parameters. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <sch...
```diff diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 59b4ecfb967b..ea0e565ebc9d 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -3093,16 +3093,20 @@ dasd_eckd_dump_sense_dbf(struct dasd_device *device, struct irb *irb, char *reason) { u64...
a8481c2afeed297426f67ce3fd4ad7eea6b7ddf5
Analyze and fix the following issue in the Linux kernel code: [S390] css: fix sparse warning
Problem Details: fix this sparse warning: drivers/s390/cio/css.c:580:6: warning: symbol 'css_schedule_eval_all_unreg' was not declared. Should it be static? Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
```diff diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index ca8e1c240c3c..064d3003ed20 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -577,7 +577,7 @@ static int __unset_registered(struct device *dev, void *data) return 0; } -void css_schedule_eval_all_unreg(void) +static void c...
a20852d2b7ca3c6e7b232eecf09631b66dde2a46
Analyze and fix the following issue in the Linux kernel code: [S390] cmm: fix crash on case conversion
Problem Details: When the cmm module is compiled into the kernel it will crash when writing to the R/O data section. Reason is the lower to upper case conversion of the "sender" module parameter which ignored the fact that the pointer is preinitialized. Introduced with 41b42876 "cmm, smsgiucv_app: convert sender to up...
```diff diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index a9550dca3e4b..c66ffd8dbbb7 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -23,7 +23,10 @@ #include <asm/pgalloc.h> #include <asm/diag.h> -static char *sender = "VMRMSVM"; +#ifdef CONFIG_CMM_IUCV +static char *cmm_default_sender = "VMRMS...
6931be0803ddae2791f3c646c8e1e0f82ca26013
Analyze and fix the following issue in the Linux kernel code: [S390] cpu hotplug/idle: move cpu_die call to enabled context
Problem Details: There is no difference if cpu_die is called from enabled or disabled context. Except that the fast_gup code might be called via cpu_die -> idle_task_exit -> __mm_drop -> crst_table_free. Which in turn grabs and releases a spinlock using the _bh ops, which is not allowed in irq disabled context, since s...
```diff diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index d3a2d1c6438e..ec2e03b22ead 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -76,17 +76,17 @@ unsigned long thread_saved_pc(struct task_struct *tsk) static void default_idle(void) { /* CPU is going idle. */ ...
05daf079259c7e5393f204503284ee90072cb348
Analyze and fix the following issue in the Linux kernel code: ARM: S5PC100: Fix Audio, Keypad and ADC clock sources
Problem Details: Audio, Keypad and ADC inherit PCLKD1 clock source. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> [kgene.kim@samsung.com: minor title fix] Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
```diff diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c index 9e192a0ad4f9..2d4a761a5163 100644 --- a/arch/arm/mach-s5pc100/clock.c +++ b/arch/arm/mach-s5pc100/clock.c @@ -676,55 +676,55 @@ static struct clk init_clocks_disable[] = { }, { .name = "iis", .id = 0, - .parent = &clk_d...
d2e7eca36dde5ee8979362bed5b27e47b37e94a0
Analyze and fix the following issue in the Linux kernel code: ARM: S5PV310: Add support GPIOlib
Problem Details: This patch adds GPIOlib support for S5PV310 and S5PC210. Signed-off-by: Jongpill Lee <boyko.lee@samsung.com> Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> [kgene.kim@samsung.com: Fix NR_IRQS] Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
```diff diff --git a/arch/arm/mach-s5pv310/Makefile b/arch/arm/mach-s5pv310/Makefile index 425cdd6f9660..ac3b4c125558 100644 --- a/arch/arm/mach-s5pv310/Makefile +++ b/arch/arm/mach-s5pv310/Makefile @@ -13,7 +13,7 @@ obj- := # Core support for S5PV310 system obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-...
42a6e20e4fd4755e6b4539891a4f20905af18dcd
Analyze and fix the following issue in the Linux kernel code: ARM: S5PV210: Fix wrong EPLL rate getting on setup clocks
Problem Details: This patch fix wrong EPLL getting on setup clocks on S5PV210. Signed-off-by: Seungwhan Youn <sw.youn@samsung.com> Acked-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
```diff diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c index b9c9f3bd2954..00a721771a43 100644 --- a/arch/arm/mach-s5pv210/clock.c +++ b/arch/arm/mach-s5pv210/clock.c @@ -1082,7 +1082,8 @@ void __init_or_cpufreq s5pv210_setup_clocks(void) apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL...
023c75c7c8fba0f603faf4458d955f61d213f0c7
Analyze and fix the following issue in the Linux kernel code: ARM: S5PV210: Fix wrong interrupt I2C2 and I2C3 number
Problem Details: The name of the I2C2 and I2C3 interrupt should be IIC2 and IIC3 instead of CAN0 and CAN1. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
```diff diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h index bb7f277c1fa3..119b95fdc3ce 100644 --- a/arch/arm/mach-s5pv210/include/mach/irqs.h +++ b/arch/arm/mach-s5pv210/include/mach/irqs.h @@ -55,8 +55,8 @@ #define IRQ_SPI1 S5P_IRQ_VIC1(16) #define IRQ_SPI2 S5P_...
3b7998f529a18696baafb8cca63a7720565ad77f
Analyze and fix the following issue in the Linux kernel code: ARM: S5PV310: I2C0/1 devices support on Universal board
Problem Details: Camera devices use the I2C0 and Gyro uese the I2C1 on universal board. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [kgene.kim@samsung.com: minor title fixes] Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
```diff diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig index 6b2b948c9ccd..f12f560894ad 100644 --- a/arch/arm/mach-s5pv310/Kconfig +++ b/arch/arm/mach-s5pv310/Kconfig @@ -57,6 +57,8 @@ config MACH_UNIVERSAL_C210 bool "Mobile UNIVERSAL_C210 Board" select CPU_S5PV310 select S5P_DEV_ONENA...
acf5eda92da23c904d1e37ba80c75572f3e2c860
Analyze and fix the following issue in the Linux kernel code: ARM: S5PV310: Universal OneNAND support
Problem Details: OneNAND device support for Universal board. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [kgene.kim@samsung.com: minor title fixes] Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
```diff diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig index 8cb3dc52b623..6b2b948c9ccd 100644 --- a/arch/arm/mach-s5pv310/Kconfig +++ b/arch/arm/mach-s5pv310/Kconfig @@ -56,6 +56,7 @@ config MACH_SMDKC210 config MACH_UNIVERSAL_C210 bool "Mobile UNIVERSAL_C210 Board" select CPU_S5PV310 ...
dc6c0ca39daad44f3169656296ef81d39a6dc7f5
Analyze and fix the following issue in the Linux kernel code: ARM: S5P: Fix missed IRQ_EINT_BIT()
Problem Details: When merged patches, missed IRQ_EINT_BIT() definition from commit ea31fd43 (ARM: S5PV210: Add Power Management Support). The IRQ_EINT_BIT() is used in the Power Management operation (plat-samsung/pm.c). Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
```diff diff --git a/arch/arm/plat-s5p/include/plat/irqs.h b/arch/arm/plat-s5p/include/plat/irqs.h index 7f653bce3c13..ba9121c60a2a 100644 --- a/arch/arm/plat-s5p/include/plat/irqs.h +++ b/arch/arm/plat-s5p/include/plat/irqs.h @@ -94,6 +94,8 @@ ((irq) - S5P_EINT_BASE1) : \ ((irq) + 16 - S5P_EINT_BASE2)) ...
2c78ffeca98fcd5a1dfd4a322438944506ed5e64
Analyze and fix the following issue in the Linux kernel code: x86/oprofile: Fix uninitialized variable use in debug printk
Problem Details: Stephen Rothwell reported this build warning: arch/x86/oprofile/op_model_amd.c: In function 'ibs_eilvt_valid': arch/x86/oprofile/op_model_amd.c:289: warning: 'offset' may be used uninitialized in this function And correctly observed that indeed the variable is used uninitialized in this function....
```diff diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c index 42fb46f83883..68759e716f0f 100644 --- a/arch/x86/oprofile/op_model_amd.c +++ b/arch/x86/oprofile/op_model_amd.c @@ -281,29 +281,25 @@ static inline int eilvt_is_available(int offset) static inline int ibs_eilvt_valid(void)...
c5fb514d2f0496ce58caed63bceb05fac40324b3
Analyze and fix the following issue in the Linux kernel code: Input: ab8500-ponkey - fix IRQ freeing in error path
Problem Details: Looks like an obvious typo to me. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
```diff diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index 98f8ede504b8..3d3288a78fdc 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c @@ -107,7 +107,7 @@ static int __devinit ab8500_ponkey_probe(struct platform_device *pdev) return 0; ...
d362edaf5386acedad4319a6721bb1540b74dcf7
Analyze and fix the following issue in the Linux kernel code: ACPI: Pre-map 'system event' related register blocks
Problem Details: During ACPI initialization, pre-map fixed hardware registers that are accessed during ACPI's 'system event' related IRQ handing. ACPI's 'system event' handing accesses specific fixed hardware registers; namely PM1a event, PM1b event, GPE0, and GPE1 register blocks which are declared within the FADT. ...
```diff diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index fc6c5d21c3eb..c63d4cb37dab 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -199,36 +199,6 @@ static int __init acpi_reserve_resources(void) } device_initcall(acpi_reserve_resources); -acpi_status __init acpi_os_initialize(void) -{ - retu...
b3ba1efec2a58f4dc0647f4c0099c27d6ab92595
Analyze and fix the following issue in the Linux kernel code: ACPI: Fix ioremap size for MMIO reads and writes
Problem Details: The size used for I/O remapping MMIO read and write accesses has not accounted for the basis of ACPI's Generic Address Structure (GAS) 'Register Bit Width' field which is bits, not bytes. This patch adjusts the ioremap() 'size' argument accordingly. ACPI "Generic Register" reference: ACPI Specifica...
```diff diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 65b25a303b86..58842fb9fd90 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -496,7 +496,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) u32 dummy; void __iomem *virt_addr; - virt_addr = ioremap(phys_add...
1804edd15c66a7af11f9e6194b4c783b37c5fe98
Analyze and fix the following issue in the Linux kernel code: i2c-nomadik: documentation fixes
Problem Details: This fixes some kerneldoc and assorted documenatation in the Nomadik I2C driver without semantic impact. Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Ben...
```diff diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 73de8ade10b1..a73c057f63fd 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 ST-Ericsson + * Copyright (C) 2009 ST-Ericsson SA * Copyright (C) 20...
a663bdd8c5d18d287f7468470816c9e0e66343c1
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix connection allocation in sequence()
Problem Details: We're doing an allocation under a spinlock, and ignoring the possibility of allocation failure. A better fix wouldn't require an unnecessary allocation in the common case, but we'll leave that for later. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index ce0412fd23eb..d4aa1b59d84b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1628,33 +1628,25 @@ out: return status; } -static struct nfsd4_conn *__nfsd4_find_conn(struct svc_rqst *r, struct nfsd4_session *s) +static struct nfsd4_con...
2316d3bc95ff65b7c0c40c70db83455912cf0328
Analyze and fix the following issue in the Linux kernel code: mtd: OneNAND: S5PC110: Fix double call suspend & resume function
Problem Details: The suspend & resume called from mtd core. So no need to call at driver. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index 214ed1e763b6..0de7a05e6de0 100644 --- a/drivers/mtd/onenand/samsung.c +++ b/drivers/mtd/onenand/samsung.c @@ -1098,7 +1098,7 @@ static int s3c_pm_ops_suspend(struct device *dev) struct onenand_chip *this = mtd->priv; this->wa...
cdcf12b211d45bd68acae9d8189275d29d500d12
Analyze and fix the following issue in the Linux kernel code: mtd: nand: fix MTD_MODE_RAW writes
Problem Details: RAW writes were broken by 782ce79a45b3b850b108896fcf7da26754061c8f which introduced a check of ops->ooboffs in nand_do_write_ops(). When writing in RAW mode this is called with an ops struct on the stack of mtdchar.c:mtd_write() which does not initialise ops->ooboffs, so it is garbage and fails this t...
```diff diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 53f4e41836f1..1f75a1b1f7c3 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2214,7 +2214,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to, memset(chip->oob_poi, 0xff, mtd->oobsize);...
12aebf3e1ad7dc8b076dd9674ca98f1aa6859fcd
Analyze and fix the following issue in the Linux kernel code: mtd: blktrans: fix a race vs kthread_stop
Problem Details: There is small race window that could make kthread_stop hang forever. I found that while hacking the IR subsystem. Signed-off-by: Maxim Levitsky <maximlevisky@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 040c2d923807..a919587ed481 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -133,6 +133,10 @@ static int mtd_blktrans_thread(void *arg) if (!req && !(req = blk_fetch_request(rq))) { set_current_state(TASK_...
6c0f6218ba04a5d6e61d0c55b68e6c4ef0736531
Analyze and fix the following issue in the Linux kernel code: [CIFS] Fix checkpatch warnings and bump cifs version number
Problem Details: Signed-off-by: Steve French <sfrench@us.ibm.com>
```diff diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index f35795a16b42..897b2b2b28b5 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h @@ -112,5 +112,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); extern const struct export_operations cifs_export_ops; #endif /* EXPERIMEN...
ebd71e3a4861849054751779ff5ccd3fb29a1e0a
Analyze and fix the following issue in the Linux kernel code: mtd: maps: gpio-addr-flash: fix warnings and make more portable
Problem Details: As reported on lkml, building this module for HIMEM systems spews warnings about mismatch in pointer types. Further, we need to use ioremap() in order to properly access the flash memory on most systems rather than just doing it directly. Reported-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Mi...
```diff diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c index 32e89d773b4e..af5707a80205 100644 --- a/drivers/mtd/maps/gpio-addr-flash.c +++ b/drivers/mtd/maps/gpio-addr-flash.c @@ -208,10 +208,14 @@ static int __devinit gpio_flash_probe(struct platform_device *pdev) if (!state) ...
5954c47c2194abcdeeae5f752e64b7c75770dbd3
Analyze and fix the following issue in the Linux kernel code: mtd: Blackfin NFC: fix badblock location with BootROM OOB
Problem Details: The bbt structure isn't actually used, just the badblockpos. This lets the driver correctly handle badblocks with the different OOB layout with certain sized flashes. Previously, the blocks would all be reported as bad and be completely unusable. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Sig...
```diff diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c index 6fbeefa3a766..79947bea4d57 100644 --- a/drivers/mtd/nand/bf5xx_nand.c +++ b/drivers/mtd/nand/bf5xx_nand.c @@ -110,15 +110,6 @@ static const unsigned short bfin_nfc_pin_req[] = 0}; #ifdef CONFIG_MTD_NAND_BF5XX_BOOTROM_ECC -sta...
edb44b9b9cbff71f6aa9bebc384ee1896c8bfc2c
Analyze and fix the following issue in the Linux kernel code: mtd: onenand: fix 4KiB page onenand chip recognition
Problem Details: For 4Gib non-DDP chip it does not follow that it is always 4KiB page chip. The number of data buffers is checked and if it is equal to 1 we suppose that it is 4KiB page onenand chip. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Sign...
```diff diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 33e0dbb0a96d..6b3a875647c9 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -3365,18 +3365,19 @@ static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, static ...
81cfc9f1f4ad8d335367bb393bd042cc45b00047
Analyze and fix the following issue in the Linux kernel code: jffs2: Fix serious write stall due to erase
Problem Details: Drop the alloc_sem before erasing flash in jffs2_garbage_collect_pass(). Otherwise writes are put on hold until the erase has finised. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Wood...
```diff diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index 846a79452497..31dce611337c 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c @@ -219,13 +219,14 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) if (!list_empty(&c->erase_complete_list) || !list_empty(&c->erase_pending_list)) { spin_unlock(&c->e...
733daa52b8d358e7c18be7fb9f82afc0619408f4
Analyze and fix the following issue in the Linux kernel code: mtd: omap2: fix static declaration warning
Problem Details: This patch fixes sparse warning for static declaration of variable "use_dma" drivers/mtd/nand/omap2.c:114:11: warning: symbol 'use_dma' was not declared. Should it be static? Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-...
```diff diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 133d51528f8d..439e80d78edd 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -111,11 +111,11 @@ static int use_dma = 1; module_param(use_dma, bool, 0); MODULE_PARM_DESC(use_dma, "enable/disable use of DMA"); #else -c...
766f271a63d1ee7caed8030736e6aed253d02073
Analyze and fix the following issue in the Linux kernel code: mtd: Fix endianness issues from device tree
Problem Details: This patch adds the appropriate conversions to correct the endianness issues in the MTD driver whenever it accesses the device tree (which is always big endian). Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse ...
```diff diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index fe63f6bd663c..ec4011c3d5f2 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -50,7 +50,7 @@ static int parse_obsolete_partitions(struct platform_device *dev, { int i, plen, nr_parts; const struc...
dcf08227e964a53a2cb39130b74842c7dcb6adde
Analyze and fix the following issue in the Linux kernel code: mtd: OneNAND: S5PC110: Fix wrong DMA handling when HIGHMEM
Problem Details: When use HIGHMEM, dma_map_single doesn't get the proper DMA address. So use the dma_map_page in this case. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index 285085a93c31..afdb4c544132 100644 --- a/drivers/mtd/onenand/samsung.c +++ b/drivers/mtd/onenand/samsung.c @@ -582,7 +582,8 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area, void __iomem *p; void *buf = (void ...
5c398dc8f5a58b5417d8ae0d474704feb6e12a12
Analyze and fix the following issue in the Linux kernel code: netlink: fix netlink_change_ngroups()
Problem Details: commit 6c04bb18ddd633 (netlink: use call_rcu for netlink_change_ngroups) used a somewhat convoluted and racy way to perform call_rcu(). The old block of memory is freed after a grace period, but the rcu_head used to track it is located in new block. This can clash if we call two times or more netlink...
```diff diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index cd96ed3ccee4..478181d53c55 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -83,9 +83,9 @@ struct netlink_sock { struct module *module; }; -struct listeners_rcu_head { - struct rcu_head rcu_head; - void *ptr; +st...
3866f673ebd86e5be2533923f5c0aed91fe1669f
Analyze and fix the following issue in the Linux kernel code: jffs2: use cond_resched() instead of yield()
Problem Details: yield() has different semantics meanwhile and even causes RT-kernels to BUG. Replace the only appearance left in jffs2. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index abac961f617b..e513f1913c15 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c @@ -151,7 +151,7 @@ int jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count) } /* Be nice */ - yield(); + cond_resched(); mutex_lock(&c->erase_free_sem); ...
0eecf4b20d63e0662d0a9732e9bd8a84bd3f872c
Analyze and fix the following issue in the Linux kernel code: mtd: fix the build warning for fsl_upm.c
Problem Details: Fix the build warning: drivers/mtd/nand/fsl_upm.c: In function 'fun_chip_init': drivers/mtd/nand/fsl_upm.c:190: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'resource_size_t' Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Signed-off-by: Artem Bityutskiy <Artem.Bityu...
```diff diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c index 4eff8b25e5af..c8ab15653e7c 100644 --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c @@ -186,7 +186,7 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun, if (!flash_np) return -ENODEV; - fun->mtd.name = ...
0561cf3dbff1f37c0d374fb1b824ef3a117c85e0
Analyze and fix the following issue in the Linux kernel code: vmxnet3: fix typo setting confPA
Problem Details: It's a le64, not a le32, typo in one place only. Noticed by sparse: drivers/net/vmxnet3/vmxnet3_drv.c:2668:52: warning: incorrect type in assignment (different base types) drivers/net/vmxnet3/vmxnet3_drv.c:2668:52: expected restricted __le64 [usertype] confPA drivers/net/vmxnet3/vmxnet3_drv.c:2668:...
```diff diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index 2ea4b818a07c..e3658e10db39 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -2665,7 +2665,7 @@ vmxnet3_resume(struct device *device) adapter->shared->devRead.pmConfDesc.confVer = c...
8f6d9f40476895571df039b6f1f5230ec7faebad
Analyze and fix the following issue in the Linux kernel code: cxgb4: fix crash due to manipulating queues before registration
Problem Details: Before commit "net: allocate tx queues in register_netdevice" netif_tx_stop_all_queues and related functions could be used between device allocation and registration but now only after registration. cxgb4 has such a call before registration and crashes now. Move it after register_netdev. Signed-off-b...
```diff diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c index 87054e0a5746..2a01a23ed409 100644 --- a/drivers/net/cxgb4/cxgb4_main.c +++ b/drivers/net/cxgb4/cxgb4_main.c @@ -3658,7 +3658,6 @@ static int __devinit init_one(struct pci_dev *pdev, pi->rx_offload = RX_CSO; pi->port_id = i;...
7351d3a5dbf42ba3299af71db3296be447bc1516
Analyze and fix the following issue in the Linux kernel code: mtd: fix almost all checkpatch warnings in nand_base.c
Problem Details: Only 3 warnings are left, one is off by one character, but splitting the line would reduce the readability. One is for a for loop statement, which would also not improve readability. The last one is a false positive on a test. Artem: it is much easier to verify patches against nand_base.c with ...
```diff diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 50c0d5f1c80a..922b890c8fcb 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -45,7 +45,7 @@ #include <linux/interrupt.h> #include <linux/bitops.h> #include <linux/leds.h> -#include <asm/io.h> +#includ...
f8ac04140e2215e1680440d5a8642553b0d2fa2d
Analyze and fix the following issue in the Linux kernel code: mtd: fix all checkpatch errors in nand_base.c
Problem Details: Artem: it is much easier to verify patches against nand_base.c with checkpatch.pl when nand_base.c itself does not have so many checkpatch.pl warnings. Signed-off-by: Florian Fainelli <ffainelli@freebox.fr> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David...
```diff diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 5b96f621f7c9..50c0d5f1c80a 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -59,7 +59,7 @@ static struct nand_ecclayout nand_oob_8 = { {.offset = 3, .length = 2}, {.offset = 6, - .length = 2...
2bdb053a8119355eada46dfab88782449a26b39d
Analyze and fix the following issue in the Linux kernel code: mtd: davinci: relax a timeout for ECC-initialization
Problem Details: Sudhakar found out that 100µs are enough. Sadly, his updated patch was overlooked and an older version still using 100ms was merged. Fix this. Reference: http://patchwork.ozlabs.org/patch/59180/ Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@noki...
```diff diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index e7129591c9c7..ad51f8ef0d4f 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -313,7 +313,7 @@ static int nand_davinci_correct_4bit(struct mtd_info *mtd, u32 syndrome[4]; u32 ecc_state; ...
eea116ed0497dc9c4a981b8c7017d758fc835ded
Analyze and fix the following issue in the Linux kernel code: mtd: davinci: fix comment to match the code
Problem Details: Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 70698e86e437..e7129591c9c7 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -369,8 +369,9 @@ compare: * after setting the 4BITECC_ADD_CALC_START bit. So if you immediately * begin tryi...
cf363518ca44d654c51497b3f73c69a34565155d
Analyze and fix the following issue in the Linux kernel code: mtd: mpc5121_nfc: fix memory leak on error path
Problem Details: Add a call to of_node_put in the error handling code following a call to of_find_compatible_node. Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@inte...
```diff diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c index df0c1da4ff49..f4610bc7ccd0 100644 --- a/drivers/mtd/nand/mpc5121_nfc.c +++ b/drivers/mtd/nand/mpc5121_nfc.c @@ -568,6 +568,7 @@ static int mpc5121_nfc_read_hw_config(struct mtd_info *mtd) uint rcw_width; uint rcwh; uint rom...
f4a2da0cd522a3b805ff2386c14912945bf990c7
Analyze and fix the following issue in the Linux kernel code: mtd: inftl.h: fix spacing errors
Problem Details: Replaced some spaces with tabs to fit CodingStyle guidelines Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h index 64ee53ce95a9..02cd5f9b79b8 100644 --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/inftl.h @@ -37,14 +37,14 @@ struct INFTLrecord { __u16 firstEUN; __u16 lastEUN; __u16 numfreeEUNs; - __u16 LastFreeEUN; /* To speed up findin...
12c8eb98de747ebc08404e3719c40abb405994e2
Analyze and fix the following issue in the Linux kernel code: mtd: fix callback return value check
Problem Details: Drivers may (and do) return negative errno values other than -1 from the ecc.correct callback. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index d551ddd9537a..0fd22cce0ecc 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -1223,7 +1223,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3 int stat; stat = c...
3388bff5cfe91589a912cdc7f00d3aae3aa18adc
Analyze and fix the following issue in the Linux kernel code: nfs: fix unchecked value
Problem Details: Return value of "decode_attr_bitmap()" was not checked; Signed-off-by: Roman Borisov <ext-roman.borisov@nokia.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 7131c761d85c..bd2101d918c8 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -2687,7 +2687,10 @@ out_overflow: static int decode_attr_supported(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *bitmask) { if (likely(bitmap[0] & FATTR4_WORD0_SUPP...
a9d992ecb36f8ed00130eaf41a406fda03433d23
Analyze and fix the following issue in the Linux kernel code: can: at91_can: fix section mismatch warning
Problem Details: ...by adding the correct annotation "__devinit" to the driver's probe function. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 1954ab003db7..61878135a9df 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -1027,7 +1027,7 @@ static const struct net_device_ops at91_netdev_ops = { .ndo_start_xmit = at91_start_xmit, }; -static int __ini...
b61f674051e58b394454602d492d5e3e3471facc
Analyze and fix the following issue in the Linux kernel code: can: at91_can: fix compiler warning in at91_irq_err_state
Problem Details: This patch fixes the following compiler warning: drivers/net/can/at91_can.c: In function 'at91_irq_err_state': drivers/net/can/at91_can.c:779: warning: 'reg_ier' may be used uninitialized in this function drivers/net/can/at91_can.c:779: warning: 'reg_idr' may be used uninitialized in this function Si...
```diff diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 2c17e7437c47..1954ab003db7 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -764,7 +764,7 @@ static void at91_irq_err_state(struct net_device *dev, struct can_frame *cf, enum can_state new_state) { struct...
759a6c768dcdbbb4d3f1fb965b674c15773e09ca
Analyze and fix the following issue in the Linux kernel code: can: at91_can: fix use after free of priv
Problem Details: The priv is part of the memory allocated by alloc_candev(). This patch moved the free it after last usage of priv. While there convert all free_netdev() to free_candev() (which is currently just a wrapper around free_netdev()) to be symetrically with the allocation via alloc_candev(). Signed-off-by: ...
```diff diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 3b66c6736832..2c17e7437c47 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -1101,7 +1101,7 @@ static int __init at91_can_probe(struct platform_device *pdev) return 0; exit_free: - free_netdev(dev); + fre...
8a0e0a49b0a917c8c8dce6f7121ec73a5c8e3932
Analyze and fix the following issue in the Linux kernel code: can: at91_can: fix reception of extended frames
Problem Details: The AT91_MID_MIDE bit must be set in order to receive extended frames. The reception of an extended frame sets this bit, while reception of standard frames resets it. This results in some lost extended frames in an extended ID only environment. But leads to unpredictable lost extended ID frames in a mi...
```diff diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index b2a4599eb1d7..3b66c6736832 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c @@ -243,6 +243,12 @@ static void at91_setup_mailboxes(struct net_device *dev) set_mb_mode(priv, i, AT91_MB_MODE_RX); set_mb_mode(pri...
118df3d17f11733b294ea2cd988d56ee376ef9fd
Analyze and fix the following issue in the Linux kernel code: SUNRPC: After calling xprt_release(), we must restart from call_reserve
Problem Details: Rob Leslie reports seeing the following Oops after his Kerberos session expired. BUG: unable to handle kernel NULL pointer dereference at 00000058 IP: [<e186ed94>] rpcauth_refreshcred+0x11/0x12c [sunrpc] *pde = 00000000 Oops: 0000 [#1] last sysfs file: /sys/devices/platform/pc87360.26144/temp3_input M...
```diff diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 2388d83b68ff..3d28ae8a888a 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1677,7 +1677,7 @@ rpc_verify_header(struct rpc_task *task) rpcauth_invalcred(task); /* Ensure we obtain a new XID! */ xprt_release(task); - task->tk_action...
f253b86b4ad1b3220544e75880510fd455ebd23f
Analyze and fix the following issue in the Linux kernel code: Revert "block: fix accounting bug on cross partition merges"
Problem Details: This reverts commit 7681bfeeccff5efa9eb29bf09249a3c400b15327. Conflicts: include/linux/genhd.h It has numerous issues with the cleanup path and non-elevator devices. Revert it for now so we can come up with a clean version without rushing things. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 51efd835d4cf..f8548876d7ea 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -64,15 +64,13 @@ static void drive_stat_acct(struct request *rq, int new_io) return; cpu = part_stat_lock(); + part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));...
641934069d29211baf82afb93622a426172b67b6
Analyze and fix the following issue in the Linux kernel code: drm/i915: Move gpu_write_list to per-ring
Problem Details: ... to prevent flush processing of an idle (or even absent) ring. This fixes a regression during suspend from 87acb0a5. Reported-and-tested-by: Alexey Fisher <bug-track@fisher-privat.net> Tested-by: Peter Clifton <pcjc2@cam.ac.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
```diff diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index cc9cb0dda6fc..2c2c19b6285e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -570,15 +570,6 @@ typedef struct drm_i915_private { */ struct list_head flushing_list; - /** - * List ...
6f7a35bd23bdbbb40c07ee1120ef047190e77d9b
Analyze and fix the following issue in the Linux kernel code: NFSv4: Fix up the 'dircount' hint in encode_readdir
Problem Details: Also ensure we only ask for either fileid or mounted_on_fileid in the readdirplus case too... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 4c43e4874c52..1e5d68e36e07 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -1386,6 +1386,7 @@ static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args, static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_read...
0a57274ea026c2b7670683947b6cc08b195148cf
Analyze and fix the following issue in the Linux kernel code: i2c: Fix Kconfig dependencies
Problem Details: drivers/i2c/algos/Kconfig makes all the algorithms dependent on !I2C_HELPER_AUTO, which triggers a Kconfig warning about broken dependencies when some driver selects one of the algorithms. Ideally we would make only the prompts dependent on !I2C_HELPER_AUTO, however Kconfig doesn't currently support th...
```diff diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 30f06e956bfb..b923074b2cbe 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -75,7 +75,8 @@ config I2C_HELPER_AUTO In doubt, say Y. config I2C_SMBUS - tristate "SMBus-specific protocols" if !I2C_HELPER_AUTO + tristate + prompt "SMBu...
3c52cc57ccd5c99441368d5e66be36681ce90e72
Analyze and fix the following issue in the Linux kernel code: i7core_edac: properly terminate pci_dev_table
Problem Details: At pci_xeon_fixup(), it waits for a null-terminated table, while at i7core_get_all_devices, it just do a for 0..ARRAY_SIZE. As other tables are zero-terminated, change it to be terminate with 0 as well, and fixes a bug where it may be running out of the table elements. Signed-off-by: Mauro Carvalho Ch...
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 71f4dc699abe..e3404b2bbaa2 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -353,6 +353,7 @@ static const struct pci_id_table pci_dev_table[] = { PCI_ID_TABLE_ENTRY(pci_dev_descr_i7core_nehalem), PCI_ID_TAB...
a3e1541637f2096ab31af311c53eaeb0853650d3
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Avoid PCI refcount to reach zero on successive load/reload
Problem Details: That's a nasty bug that took me a lot of time to track, and whose solution took just one line to solve. The best fragrances and the worse poisons are shipped on the smalest bottles. The drivers/pci/quick.c implements the pci_get_device function. The normal behavior is that you call it, the function re...
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 9868796f4871..71f4dc699abe 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1395,6 +1395,13 @@ static int i7core_get_onedevice(struct pci_dev **prev, dev_descr->func, PCI_VENDOR_ID_INTEL, dev_descr->dev_...
79daef2099a02fed35747c23bad22f30441133ea
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Fix refcount error at PCI devices
Problem Details: Probably due to a bug or some testing logic at PCI level, device refcount for <bus>:00.0 device is decremented at the end of the pci_get_device, made by i7core_get_all_devices(). The fact is that the first versions of the driver relied on those devices to probe for Nehalem, but the current versions don...
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index d55f74a6cd49..9868796f4871 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -281,7 +281,8 @@ static const struct pci_id_descr pci_dev_descr_i7core_nehalem[] = { /* Memory controller */ { PCI_DESCR(3, 0, PC...
6d37d240f2ff411c4d58bbbddefbda73a227d40c
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Fix an oops at i7core probe
Problem Details: changeset c91d57ba9ce5b5c93a7077e2f72510eb1f9131c4 moved the init of the priv pointer to the end of the probe routine. However, we need them before that, otherwise, we hit an OOPS: [ 67.743453] EDAC DEBUG: mci_bind_devs: Associated fn 0.0, dev = ffff88011b46e000, socket 0 [ 67.751861] BUG: unable ...
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 4a12961c5ef6..915835339d7c 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1968,6 +1968,10 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev) pvt = mci->pvt_info; memset(pvt, 0, sizeof(*pvt)...
1c6edbbe2529684859ff8e34a19e34fe9894a3b7
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Introduce i7core_unregister_mci
Problem Details: In i7core_probe, when setup of mci for 2nd or later socket failed, we should cleanup prepared mci for 1st socket or so before "put" of all devices. So let have i7core_unregister_mci that can be shared between here and i7core_remove. While here fix a typo "hanler". Signed-off-by: Hidetoshi Seto <seto...
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 7ee5034100b9..7164707ed99e 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1471,10 +1471,6 @@ static int mci_bind_devs(struct mem_ctl_info *mci, struct pci_dev *pdev; int i, func, slot; - /* Associates ...
628c5ddfb08094a5ef9186dc866d09bfcac105c9
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Fix error path of i7core_register_mci
Problem Details: Release resources properly. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 6bebf4d73f48..3542e8c0a63f 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1954,7 +1954,7 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, /* Store pci devices at mci for faster access */ ...
5939813b9c4270d0f46375c3cad64226bb1fcd62
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Fix order of lines in i7core_register_mci
Problem Details: The flag is_registered is not initialized until mci_bind_devs() is called. Refer it properly. The mci->dev and mci->edac_check is required in edac_mc_add_mc(), so prepare them just before the call. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Mauro Carvalho Chehab <mc...
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 19faeffac9dc..6bebf4d73f48 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1933,9 +1933,6 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p...
45b7c981aeeb456d4b0c04f15d551f3e515bf20e
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Fix the logic in i7core_remove()
Problem Details: commit 47251b4d960bdfa648b0d06dbc6d445f41cb3906 have changed the logic for unexplained reasons. It looks strange that it can release i7core_dev without calling i7core_put_devices() that releases i7core_dev->pdev. Fix the part. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-...
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index a76a4c067858..d64ac2ccc0bc 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -2095,9 +2095,9 @@ static void __devexit i7core_remove(struct pci_dev *pdev) /* Release PCI resources */ i7core_put_devices(...
accf74fff36315a31dc7319dae2927af06e9296f
Analyze and fix the following issue in the Linux kernel code: i7core_edac: don't use a freed mci struct
Problem Details: This is a nasty bug. Since kobject count will be reduced by zero by edac_mc_del_mc(), and this triggers the kobj release method, the mci memory will be freed automatically. So, all we have left is ctl_name, as shown by enabling debug: [ 80.822186] EDAC DEBUG: in drivers/edac/edac_mc_sysfs.c, line at...
```diff diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 889ce7566b56..ba6586a69ccc 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -238,6 +238,9 @@ void edac_mc_free(struct mem_ctl_info *mci) debugf1("%s()\n", __func__); edac_mc_unregister_sysfs_main_kobj(mci); + + /* free t...
bbc560ae677c0f4d7ff8404a21409c99f35b297b
Analyze and fix the following issue in the Linux kernel code: edac_core: Print debug messages at release calls
Problem Details: This is important to track a nasty bug at the free logic. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index b10b45cc7870..889ce7566b56 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -235,6 +235,8 @@ EXPORT_SYMBOL_GPL(edac_mc_alloc); */ void edac_mc_free(struct mem_ctl_info *mci) { + debugf1("%s()\n", __func__); + edac_mc_unr...
ac99768c534ebde637b506ce9a6f5638d2049a5d
Analyze and fix the following issue in the Linux kernel code: edac_core: Don't let free(mci) happen while using it
Problem Details: A very nasty bug were happening on edac core, due to the way mci objects are freed. mci memory is freed when kobject count reaches zero, by edac_mci_control_release(). However, from the logs, this is clearly happening before the final usage of mci struct: [15799.607454] EDAC DEBUG: in drivers/edac/eda...
```diff diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 5a5734c1f6a5..7024b873a3b9 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -759,8 +759,6 @@ static void edac_inst_grp_release(struct kobject *kobj) grp = container_of(kobj, struct mcidev_sysfs_grou...
41ba6c10586dfab632725cd532677ae5ae460e3e
Analyze and fix the following issue in the Linux kernel code: i7core_edac: MCE NMI handling should stop first
Problem Details: Otherwise, a NMI may happen causing a race condition and a panic. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index d2b2ed8915fd..e5aa06e6389e 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -2070,6 +2070,10 @@ static void __devexit i7core_remove(struct pci_dev *pdev) debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\...
3cfd01468b98360ede8cc8849d14e586253d290c
Analyze and fix the following issue in the Linux kernel code: i7core_edac: Improve debug to seek for register/remove errors
Problem Details: Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 36b4e1422838..a05f166d8917 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -1889,7 +1889,8 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev, if (unlikely(!mci)) return -ENOMEM; - debugf0(...
adac8d65f399b02e8a2222fc75c658e4b8d24f65
Analyze and fix the following issue in the Linux kernel code: viafb: fix hardware acceleration for suspend & resume
Problem Details: This patch splits the acceleration initialization in two parts: The first is only called during probe and is used to allocate resources. The second part is also called on resume to reinitalize the 2D engine. This should fix all acceleration issues after resume most notable an "invisible" cursor and as ...
```diff diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index c2f4e6e166f1..bc4905366726 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c @@ -315,13 +315,11 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height, return 0; } -int viafb_init_engine(stru...
7fb2b870d6a3b92f6750ac2b72858fd098dc9e3f
Analyze and fix the following issue in the Linux kernel code: x86: io_apic: Fix CONFIG_X86_IO_APIC=n breakage
Problem Details: Stupid me forgot to change the function name for the CONFIG_X86_IO_APIC=n case in commit 23f9b2671 (x86: apic: Move probe_nr_irqs_gsi() into ioapic_init_mappings()) Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 7e620baebf86..240a0a5e2b31 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h @@ -186,7 +186,7 @@ extern void __init pre_init_apic_IRQ0(void); #define io_apic_assign_pci_irqs 0 #define setup_ioapic...
d7a79b6c80fdbe4366484805ee07a4735fc427d8
Analyze and fix the following issue in the Linux kernel code: KVM: Fix signature of kvm_iommu_map_pages stub
Problem Details: Breaks otherwise if CONFIG_IOMMU_API is not set. KVM-Stable-Tag. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 0b89d008db65..866ed3084363 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -483,8 +483,7 @@ int kvm_deassign_device(struct kvm *kvm, struct kvm_assigned_dev_kernel *assigned_dev); #else /* CONFIG_IOMMU_API */ st...
9611c187774f0e20c258c23ced2599c44bd2fef4
Analyze and fix the following issue in the Linux kernel code: KVM: fix typo in copyright notice
Problem Details: Fix typo in copyright notice. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index d0df25d84acd..38b6e8dafaff 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -9,7 +9,7 @@ * privileged instructions: * * Copyright (C) 2006 Qumranet - * Copyright 2010 Red Hat, Inc. and/or its affilates. + * Copyright 201...
c42fffe3a3aa8c62b8028fff32d18156f5325c3b
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: audit: unregister audit tracepoints before module unloaded
Problem Details: fix: Call Trace: [<ffffffffa01e46ba>] ? kvm_mmu_pte_write+0x229/0x911 [kvm] [<ffffffffa01c6ba9>] ? gfn_to_memslot+0x39/0xa0 [kvm] [<ffffffffa01c6c26>] ? mark_page_dirty+0x16/0x2e [kvm] [<ffffffffa01c6d6f>] ? kvm_write_guest_page+0x67/0x7f [kvm] [<ffffffff81066fbd>] ? local_clock+0x2a/0x3b [<ffff...
```diff diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 88203fa4ef05..afde64ba118d 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3355,15 +3355,6 @@ int kvm_mmu_setup(struct kvm_vcpu *vcpu) return init_kvm_mmu(vcpu); } -void kvm_mmu_destroy(struct kvm_vcpu *vcpu) -{ - ASSERT(vcpu); - - des...
98224bf1d1783a25ccede29ab08309424ec8de25
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: audit: fix vcpu's spte walking
Problem Details: After nested nested paging, it may using long mode to shadow 32/PAE paging guest, so this patch fix it Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/mmu_audit.c b/arch/x86/kvm/mmu_audit.c index bd2b1be7066e..dcca3e7d7b4e 100644 --- a/arch/x86/kvm/mmu_audit.c +++ b/arch/x86/kvm/mmu_audit.c @@ -51,7 +51,7 @@ static void mmu_spte_walk(struct kvm_vcpu *vcpu, inspect_spte_fn fn) if (!VALID_PAGE(vcpu->arch.mmu.root_hpa)) return; -...
50933623e50d8730cc1a65853c153b3b4c93b629
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Fix constant type in kvm_get_time_scale
Problem Details: Older gcc versions complain about the improper type (for x86-32), 4.5 seems to fix this silently. However, we should better use the right type initially. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bfcf8fd5e080..ffcb90669ec5 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -930,14 +930,14 @@ static void kvm_get_time_scale(uint32_t scaled_khz, uint32_t base_khz, tps64 = base_khz * 1000LL; scaled64 = scaled_khz * 1000LL; - while (tp...
19b6a85b78a5d4b466c537bdbf0eaecae5e2c4e2
Analyze and fix the following issue in the Linux kernel code: KVM guest: Move a printk that's using the clock before it's ready
Problem Details: Fix a hang during SMP kernel boot on KVM that showed up after commit 489fb490dbf8dab0249ad82b56688ae3842a79e8 (2.6.35) and 59aab522154a2f17b25335b63c1cf68a51fb6ae0 (2.6.34.1). The problem only occurs when CONFIG_PRINTK_TIME is set. KVM-Stable-Tag. Signed-off-by: Arjan Koers <0h61vkll2ly8@xutrox.com> S...
```diff diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index eb9b76c716c2..ca43ce31a19c 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -128,13 +128,15 @@ static struct clocksource kvm_clock = { static int kvm_register_clock(char *txt) { int cpu = smp_processor_id()...
5f4e3f882731c65b5d64a2ff743fda96eaebb9ee
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Make math work for other scales
Problem Details: The math in kvm_get_time_scale relies on the fact that NSEC_PER_SEC < 2^32. To use the same function to compute arbitrary time scales, we must extend the first reduction step to shrink the base rate to a 32-bit value, and possibly reduce the scaled rate into a 32-bit as well. Note we must take care t...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7d2880500fa3..6666af840190 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -920,31 +920,35 @@ static uint32_t div_frac(uint32_t dividend, uint32_t divisor) return quotient; } -static void kvm_set_time_scale(uint32_t tsc_khz, struct pvcl...
cb16a7b3872e9a806f16b1f09b59103fafc7b796
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: fix counting of rmap entries in rmap_add()
Problem Details: It seems that rmap entries are under counted. Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 3ce56bfe056e..c94c43289f53 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -632,6 +632,7 @@ static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn) desc->sptes[0] = (u64 *)*rmapp; desc->sptes[1] = spte; *rmapp = (unsigned l...
8475f94abfa40d6975923ff022280cf7250fc5fb
Analyze and fix the following issue in the Linux kernel code: KVM: fix the description of kvm-amd.nested in documentation
Problem Details: The default state of 'kvm-amd.nested' is enabled now, so fix the documentation Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
```diff diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 6bd23751a2ce..3170edbf1924 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1127,7 +1127,7 @@ and is between 256 and 4096 characters. It is defined in the file Default i...
28e4639adf0c9f26f6bb56149b7ab547bf33bb95
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Fix kvmclock bug
Problem Details: If preempted after kvmclock values are updated, but before hardware virtualization is entered, the last tsc time as read by the guest is never set. It underflows the next time kvmclock is updated if there has not yet been a successful entry / exit into hardware virt. Fix this by simply setting last_t...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a51635ee85ec..0b021e16f9dd 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1095,6 +1095,7 @@ static int kvm_write_guest_time(struct kvm_vcpu *v) vcpu->hv_clock.tsc_timestamp = tsc_timestamp; vcpu->hv_clock.system_time = kernel_ns + v->k...
b0bc3ee2b54fcea0df42cc9aa05103b1ccd89db0
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: Fix regression with ept memory types merged into non-ept page tables
Problem Details: Commit "KVM: MMU: Make tdp_enabled a mmu-context parameter" made real-mode set ->direct_map, and changed the code that merges in the memory type depend on direct_map instead of tdp_enabled. However, in this case what really matters is tdp, not direct_map, since tdp changes the pte format regardless of...
```diff diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 6e248d80e350..3ce56bfe056e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -1980,7 +1980,7 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep, spte |= shadow_user_mask; if (level > PT_PAGE_TABLE_LEVEL) spte |= PT_PAGE_SIZE_MASK...
4c62a2dc92518c5adf434df8e5c2283c6762672a
Analyze and fix the following issue in the Linux kernel code: KVM: X86: Report SVM bit to userspace only when supported
Problem Details: This patch fixes a bug in KVM where it _always_ reports the support of the SVM feature to userspace. But KVM only supports SVM on AMD hardware and only when it is enabled in the kernel module. This patch fixes the wrong reporting. Cc: stable@kernel.org Signed-off-by: Joerg Roedel <joerg.roedel@amd.com...
```diff diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 36e6c88913dc..e0f4da07f987 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -3469,6 +3469,10 @@ static void svm_cpuid_update(struct kvm_vcpu *vcpu) static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry) { switch (fu...
651dd37a9ce6fdacdcd75da86619c62111efcbc2
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: Refactor mmu_alloc_roots function
Problem Details: This patch factors out the direct-mapping paths of the mmu_alloc_roots function into a seperate function. This makes it a lot easier to avoid all the unnecessary checks done in the shadow path which may break when running direct. In fact, this patch already fixes a problem when running PAE guests on a ...
```diff diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index a25173a0d8b9..9cd5a717ede5 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2357,42 +2357,77 @@ static int mmu_check_root(struct kvm_vcpu *vcpu, gfn_t root_gfn) return ret; } -static int mmu_alloc_roots(struct kvm_vcpu *vcpu) +static in...
cda0008299a06f0d7218c6037c3c02d7a865e954
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Restore correct registers after sel_cr0 intercept emulation
Problem Details: This patch implements restoring of the correct rip, rsp, and rax after the svm emulation in KVM injected a selective_cr0 write intercept into the guest hypervisor. The problem was that the vmexit is emulated in the instruction emulation which later commits the registers right after the write-cr0 instru...
```diff diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index a1a83b955ed7..07655345f50b 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -88,6 +88,14 @@ struct nested_state { /* A VMEXIT is required but not yet emulated */ bool exit_required; + /* + * If we vmexit during an instruction emulation...
f87f928882d080eaec8b0d76aecff003d664697d
Analyze and fix the following issue in the Linux kernel code: KVM: MMU: Fix 32 bit legacy paging with NPT
Problem Details: This patch fixes 32 bit legacy paging with NPT enabled. The mmu_check_root call on the top-level of the loop causes root_gfn to take values (in the tdp_enabled path) which are outside of guest memory. So the mmu_check_root call fails at some point in the loop interation causing the guest to tiple-fault...
```diff diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d2dad65a45f8..b2136f921d7e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2387,6 +2387,10 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu) return 0; } direct = !is_paging(vcpu); + + if (mmu_check_root(vcpu, root_gfn)) + return ...
26e673c3003bc8f24bdbbdcb8bc91a78556f579a
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Move of include to __KERNEL__ section
Problem Details: We have to protect the include for linux/of.h by __KERNEL__ so it doesn't accidently get referenced outside. This patch fixes this and makes the tree compile again. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h index d79fd0910964..50533f9adf40 100644 --- a/arch/powerpc/include/asm/kvm_para.h +++ b/arch/powerpc/include/asm/kvm_para.h @@ -21,7 +21,6 @@ #define __POWERPC_KVM_PARA_H__ #include <linux/types.h> -#include <linux/of.h> ...
344941beb9926418663e171a347d1a31d727fe45
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Fix compile error in e500_tlb.c
Problem Details: The e500_tlb.c file didn't compile for me due to the following error: arch/powerpc/kvm/e500_tlb.c: In function ‘kvmppc_e500_shadow_map’: arch/powerpc/kvm/e500_tlb.c:300: error: format ‘%lx’ expects type ‘long unsigned int’, but argument 2 has type ‘gfn_t’ So let's explicitly cast the argument to make...
```diff diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c index a413883cf948..d6d6d47a75a9 100644 --- a/arch/powerpc/kvm/e500_tlb.c +++ b/arch/powerpc/kvm/e500_tlb.c @@ -297,7 +297,8 @@ static inline void kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, /* Get reference to new page. */ ...
21e537ba149be99c4d31a04949ca6e0770379662
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: e500_tlb: Fix a minor copy-paste tracing bug
Problem Details: The kvmppc_e500_stlbe_invalidate() function was trying to pass too many parameters to trace_kvm_stlb_inval(). This appears to be a bad copy-paste from a call to trace_kvm_stlb_write(). Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com> Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c index 092a390876f3..a413883cf948 100644 --- a/arch/powerpc/kvm/e500_tlb.c +++ b/arch/powerpc/kvm/e500_tlb.c @@ -226,8 +226,7 @@ static void kvmppc_e500_stlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500, kvmppc_e500_shadow_release(vcpu_...
0b3bafc8e5867039e265869749abbb7ea6dd2c8b
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: fix compilation of "dump tlbs" debug function
Problem Details: Missing local variable. Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com> Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c index 9f71b8d6eb0d..5f3cff83e089 100644 --- a/arch/powerpc/kvm/44x_tlb.c +++ b/arch/powerpc/kvm/44x_tlb.c @@ -47,6 +47,7 @@ #ifdef DEBUG void kvmppc_dump_tlbs(struct kvm_vcpu *vcpu) { + struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu); str...
e7c1d14e3bf40b87e6a3f68964b36dbb2c875c0f
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Make invalidation code more reliable
Problem Details: There is a race condition in the pte invalidation code path where we can't be sure if a pte was invalidated already. So let's move the spin lock around to get rid of the race. Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/kvm/book3s_mmu_hpte.c b/arch/powerpc/kvm/book3s_mmu_hpte.c index bd6a7676d0c8..79751d8dd131 100644 --- a/arch/powerpc/kvm/book3s_mmu_hpte.c +++ b/arch/powerpc/kvm/book3s_mmu_hpte.c @@ -92,10 +92,6 @@ static void free_pte_rcu(struct rcu_head *head) static void invalidate_pte(struct k...
c60b4cf70127941e2f944a7971a7f6b3ecb367ac
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Add tracepoints for generic spte flushes
Problem Details: The different ways of flusing shadow ptes have their own debug prints which use stupid old printk. Let's move them to tracepoints, making them easier available, faster and possible to activate on demand Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/kvm/book3s_mmu_hpte.c b/arch/powerpc/kvm/book3s_mmu_hpte.c index 3397152a2b26..bd6a7676d0c8 100644 --- a/arch/powerpc/kvm/book3s_mmu_hpte.c +++ b/arch/powerpc/kvm/book3s_mmu_hpte.c @@ -31,14 +31,6 @@ #define PTE_SIZE 12 -/* #define DEBUG_MMU */ - -#ifdef DEBUG_MMU -#define dprintk...
c22c31963b4b0c23250e8f520a76427b3986b73b
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Fix sid map search after flush
Problem Details: After a flush the sid map contained lots of entries with 0 for their gvsid and hvsid value. Unfortunately, 0 can be a real value the guest searches for when looking up a vsid so it would incorrectly find the host's 0 hvsid mapping which doesn't belong to our sid space. So let's also check for the vali...
```diff diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index aa516ad81de7..ebb1b5ddabfb 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_host.c +++ b/arch/powerpc/kvm/book3s_64_mmu_host.c @@ -65,14 +65,14 @@ static struct kvmppc_sid_map *find_sid_vsid(struct kvm_vcpu *vcpu, u64 gv...
8696ee431233171b3c1cc82bae0193efc4fef2ac
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Move pte invalidate debug code to tracepoint
Problem Details: This patch moves the SPTE flush debug printk over to tracepoints. Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/kvm/book3s_mmu_hpte.c b/arch/powerpc/kvm/book3s_mmu_hpte.c index ac94bd992564..3397152a2b26 100644 --- a/arch/powerpc/kvm/book3s_mmu_hpte.c +++ b/arch/powerpc/kvm/book3s_mmu_hpte.c @@ -104,8 +104,7 @@ static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte) if (hlist...
82fdee7bce546c3ce38dcf0db6096eea73dbe7bd
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Move book3s_64 mmu map debug print to trace point
Problem Details: This patch moves Book3s MMU debugging over to tracepoints. Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index 672b1495f265..aa516ad81de7 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_host.c +++ b/arch/powerpc/kvm/book3s_64_mmu_host.c @@ -28,19 +28,13 @@ #include <asm/machdep.h> #include <asm/mmu_context.h> #include <asm/hw...
bed1ed9860d3744cc6488831fa5672d5c7aff4be
Analyze and fix the following issue in the Linux kernel code: KVM: PPC: Move EXIT_DEBUG partially to tracepoints
Problem Details: We have a debug printk on every exit that is usually #ifdef'ed out. Using tracepoints makes a lot more sense here though, as they can be dynamically enabled. This patch converts the most commonly used debug printks of EXIT_DEBUG to tracepoints. Signed-off-by: Alexander Graf <agraf@suse.de>
```diff diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 7656b6df0d8b..37db61d37041 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c @@ -17,6 +17,7 @@ #include <linux/kvm_host.h> #include <linux/err.h> #include <linux/slab.h> +#include "trace.h" #include <asm/reg.h> ...
55438cc751c32cfafac52938403a86069e25b1bf
Analyze and fix the following issue in the Linux kernel code: KVM: ia64: define kvm_lapic_enabled() to fix a compile error
Problem Details: The following patch commit 57ce1659316f4ca298919649f9b1b55862ac3826 KVM: x86: In DM_LOWEST, only deliver interrupts to vcpus with enabled LAPIC's ignored the fact that kvm_irq_delivery_to_apic() was also used by ia64. We define kvm_lapic_enabled() to fix a compile error caused by this. This will...
```diff diff --git a/arch/ia64/kvm/lapic.h b/arch/ia64/kvm/lapic.h index ee541cebcd78..c5f92a926a9a 100644 --- a/arch/ia64/kvm/lapic.h +++ b/arch/ia64/kvm/lapic.h @@ -25,5 +25,6 @@ int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source, int kvm_apic_compare_prio(struct kvm_vcpu *vcpu1, struct kvm_vcpu...
84e0cefa8ddd5d5018d3b582e1e90585ed551757
Analyze and fix the following issue in the Linux kernel code: KVM: Fix guest kernel crash on MSR_K7_CLK_CTL
Problem Details: MSR_K7_CLK_CTL is a no longer documented MSR, which is only relevant on said old AMD CPU models. This change returns the expected value, which the Linux kernel is expecting to avoid writing back the MSR, plus it ignores all writes to the MSR. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signe...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 1c972382e5d4..f47db2588a41 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1449,6 +1449,16 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) pr_unimpl(vcpu, "unimplemented perfctr wrmsr: " "0x%x data 0x%llx\n", msr,...
a4d4a7c1880db98a521bc27c15348185fa30c256
Analyze and fix the following issue in the Linux kernel code: KVM: x86 emulator: fix group 11 decoding for reg != 0
Problem Details: These are all undefined. Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c0715ae05a54..9940d1661544 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2449,6 +2449,10 @@ static struct group_dual group9 = { { N, N, N, N, N, N, N, N, } }; +static struct opcode group11[] = { + I(DstMem | SrcImm | ...
eaa48512ba9df32aab8be5fceec10f3f80369379
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: init_vmcb should reset vcpu->efer
Problem Details: Otherwise EFER_LMA bit is retained across a SIPI reset. Fixes guest cpu onlining. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
```diff diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 60bc1e53d237..a1a83b955ed7 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -816,7 +816,7 @@ static void init_vmcb(struct vcpu_svm *svm) init_sys_seg(&save->ldtr, SEG_TYPE_LDT); init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16); - save->efer...