diff options
63 files changed, 2666 insertions, 9347 deletions
diff --git a/freed-ora/current/master/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch b/freed-ora/current/master/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch deleted file mode 100644 index c42c8c4f1..000000000 --- a/freed-ora/current/master/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch +++ /dev/null @@ -1,162 +0,0 @@ -From ce10d1b72b4da3c98bbbcb1b945687d964c31923 Mon Sep 17 00:00:00 2001 -From: Josh Boyer <jwboyer@redhat.com> -Date: Tue, 9 Apr 2013 11:08:13 -0400 -Subject: [PATCH] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg - -The dmesg_restrict sysctl currently covers the syslog method for access -dmesg, however /dev/kmsg isn't covered by the same protections. Most -people haven't noticed because util-linux dmesg(1) defaults to using the -syslog method for access in older versions. With util-linux dmesg(1) -defaults to reading directly from /dev/kmsg. - -Fix this by reworking all of the access methods to use the -check_syslog_permissions function and adding checks to devkmsg_open and -devkmsg_read. - -This fixes https://bugzilla.redhat.com/show_bug.cgi?id=903192 - -Reported-by: Christian Kujau <lists@nerdbynature.de> -CC: stable@vger.kernel.org -Signed-off-by: Eric Paris <eparis@redhat.com> -Signed-off-by: Josh Boyer <jwboyer@redhat.com> ---- - kernel/printk.c | 91 +++++++++++++++++++++++++++++---------------------------- - 1 file changed, 47 insertions(+), 44 deletions(-) - -diff --git a/kernel/printk.c b/kernel/printk.c -index abbdd9e..5541095 100644 ---- a/kernel/printk.c -+++ b/kernel/printk.c -@@ -368,6 +368,46 @@ static void log_store(int facility, int level, - log_next_seq++; - } - -+#ifdef CONFIG_SECURITY_DMESG_RESTRICT -+int dmesg_restrict = 1; -+#else -+int dmesg_restrict; -+#endif -+ -+static int syslog_action_restricted(int type) -+{ -+ if (dmesg_restrict) -+ return 1; -+ /* Unless restricted, we allow "read all" and "get buffer size" for everybody */ -+ return type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER; -+} -+ -+static int check_syslog_permissions(int type, bool from_file) -+{ -+ /* -+ * If this is from /proc/kmsg and we've already opened it, then we've -+ * already done the capabilities checks at open time. -+ */ -+ if (from_file && type != SYSLOG_ACTION_OPEN) -+ goto ok; -+ -+ if (syslog_action_restricted(type)) { -+ if (capable(CAP_SYSLOG)) -+ goto ok; -+ /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */ -+ if (capable(CAP_SYS_ADMIN)) { -+ printk_once(KERN_WARNING "%s (%d): " -+ "Attempt to access syslog with CAP_SYS_ADMIN " -+ "but no CAP_SYSLOG (deprecated).\n", -+ current->comm, task_pid_nr(current)); -+ goto ok; -+ } -+ return -EPERM; -+ } -+ok: -+ return security_syslog(type); -+} -+ - /* /dev/kmsg - userspace message inject/listen interface */ - struct devkmsg_user { - u64 seq; -@@ -443,10 +483,16 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf, - char cont = '-'; - size_t len; - ssize_t ret; -+ int err; - - if (!user) - return -EBADF; - -+ err = check_syslog_permissions(SYSLOG_ACTION_READ_ALL, -+ SYSLOG_FROM_FILE); -+ if (err) -+ return err; -+ - ret = mutex_lock_interruptible(&user->lock); - if (ret) - return ret; -@@ -624,7 +670,7 @@ static int devkmsg_open(struct inode *inode, struct file *file) - if ((file->f_flags & O_ACCMODE) == O_WRONLY) - return 0; - -- err = security_syslog(SYSLOG_ACTION_READ_ALL); -+ err = check_syslog_permissions(SYSLOG_ACTION_OPEN, SYSLOG_FROM_FILE); - if (err) - return err; - -@@ -817,45 +863,6 @@ static inline void boot_delay_msec(int level) - } - #endif - --#ifdef CONFIG_SECURITY_DMESG_RESTRICT --int dmesg_restrict = 1; --#else --int dmesg_restrict; --#endif -- --static int syslog_action_restricted(int type) --{ -- if (dmesg_restrict) -- return 1; -- /* Unless restricted, we allow "read all" and "get buffer size" for everybody */ -- return type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER; --} -- --static int check_syslog_permissions(int type, bool from_file) --{ -- /* -- * If this is from /proc/kmsg and we've already opened it, then we've -- * already done the capabilities checks at open time. -- */ -- if (from_file && type != SYSLOG_ACTION_OPEN) -- return 0; -- -- if (syslog_action_restricted(type)) { -- if (capable(CAP_SYSLOG)) -- return 0; -- /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */ -- if (capable(CAP_SYS_ADMIN)) { -- printk_once(KERN_WARNING "%s (%d): " -- "Attempt to access syslog with CAP_SYS_ADMIN " -- "but no CAP_SYSLOG (deprecated).\n", -- current->comm, task_pid_nr(current)); -- return 0; -- } -- return -EPERM; -- } -- return 0; --} -- - #if defined(CONFIG_PRINTK_TIME) - static bool printk_time = 1; - #else -@@ -1131,10 +1138,6 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) - if (error) - goto out; - -- error = security_syslog(type); -- if (error) -- return error; -- - switch (type) { - case SYSLOG_ACTION_CLOSE: /* Close log */ - break; --- -1.8.1.4 - diff --git a/freed-ora/current/master/HID-input-return-ENODATA-if-reading-battery-attrs-fails.patch b/freed-ora/current/master/HID-input-return-ENODATA-if-reading-battery-attrs-fails.patch new file mode 100644 index 000000000..acdd66d48 --- /dev/null +++ b/freed-ora/current/master/HID-input-return-ENODATA-if-reading-battery-attrs-fails.patch @@ -0,0 +1,55 @@ +From d0a934b764c67b4bf626f5b7cf725a6e3066afd2 Mon Sep 17 00:00:00 2001 +From: David Herrmann <dh.herrmann@gmail.com> +Date: Mon, 13 May 2013 15:01:30 +0000 +Subject: HID: input: return ENODATA if reading battery attrs fails + +power_supply core has the bad habit of calling our battery callbacks +from within power_supply_register(). Furthermore, if the callbacks +fail with an unhandled error code, it will skip any uevent that it +might currently process. +So if HID-core registers battery devices, an "add" uevent is generated +and the battery callbacks are called. These will gracefully fail due +to timeouts as they might still hold locks on event processing. One +could argue that this should be fixed in power_supply core, but the +least we can do is to signal ENODATA so power_supply core will just +skip the property and continue with the uevent. + +This fixes a bug where "add" and "remove" uevents are skipped for +battery devices. upower is unable to track these devices and currently +needs to ignore them. + +This patch also overwrites any other error code. I cannot see any reason +why we should forward protocol- or I/O-errors to the power_supply core. +We handle these errors in hid_ll_driver later, anyway, so just skip +them. power_supply core cannot do anything useful with them, anyway, +and we avoid skipping important uevents and confusing user-space. + +Thanks a lot to Daniel Nicoletti for pushing and investigating +on this. + +Cc: Jiri Kosina <jkosina@suse.cz> +Cc: Anton Vorontsov <cbou@mail.ru> +Cc: David Woodhouse <dwmw2@infradead.org> +Reported-by: Daniel Nicoletti <dantti12@gmail.com> +Signed-off-by: David Herrmann <dh.herrmann@gmail.com> +Signed-off-by: Jiri Kosina <jkosina@suse.cz> +--- +diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c +index 945b815..c526a3c 100644 +--- a/drivers/hid/hid-input.c ++++ b/drivers/hid/hid-input.c +@@ -354,10 +354,10 @@ static int hidinput_get_battery_property(struct power_supply *psy, + dev->battery_report_type); + + if (ret != 2) { +- if (ret >= 0) +- ret = -EINVAL; ++ ret = -ENODATA; + break; + } ++ ret = 0; + + if (dev->battery_min < dev->battery_max && + buf[1] >= dev->battery_min && +-- +cgit v0.9.2 diff --git a/freed-ora/current/master/KVM-x86-handle-idiv-overflow-at-kvm_write_tsc.patch b/freed-ora/current/master/KVM-x86-handle-idiv-overflow-at-kvm_write_tsc.patch new file mode 100644 index 000000000..678e82953 --- /dev/null +++ b/freed-ora/current/master/KVM-x86-handle-idiv-overflow-at-kvm_write_tsc.patch @@ -0,0 +1,45 @@ +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c +index 094b5d9..64a4b03 100644 +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -1194,20 +1194,37 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr) + elapsed = ns - kvm->arch.last_tsc_nsec; + + if (vcpu->arch.virtual_tsc_khz) { ++ int faulted = 0; ++ + /* n.b - signed multiplication and division required */ + usdiff = data - kvm->arch.last_tsc_write; + #ifdef CONFIG_X86_64 + usdiff = (usdiff * 1000) / vcpu->arch.virtual_tsc_khz; + #else + /* do_div() only does unsigned */ +- asm("idivl %2; xor %%edx, %%edx" +- : "=A"(usdiff) +- : "A"(usdiff * 1000), "rm"(vcpu->arch.virtual_tsc_khz)); ++ asm("1: idivl %[divisor]\n" ++ "2: xor %%edx, %%edx\n" ++ " movl $0, %[faulted]\n" ++ "3:\n" ++ ".section .fixup,\"ax\"\n" ++ "4: movl $1, %[faulted]\n" ++ " jmp 3b\n" ++ ".previous\n" ++ ++ _ASM_EXTABLE(1b, 4b) ++ ++ : "=A"(usdiff), [faulted] "=r" (faulted) ++ : "A"(usdiff * 1000), [divisor] "rm"(vcpu->arch.virtual_tsc_khz)); ++ + #endif + do_div(elapsed, 1000); + usdiff -= elapsed; + if (usdiff < 0) + usdiff = -usdiff; ++ ++ /* idivl overflow => difference is larger than USEC_PER_SEC */ ++ if (faulted) ++ usdiff = USEC_PER_SEC; + } else + usdiff = USEC_PER_SEC; /* disable TSC match window below */ + diff --git a/freed-ora/current/master/Makefile.config b/freed-ora/current/master/Makefile.config index 69b12baa4..cfaf67476 100644 --- a/freed-ora/current/master/Makefile.config +++ b/freed-ora/current/master/Makefile.config @@ -9,12 +9,12 @@ CONFIGFILES = \ $(CFG)-i686-PAE.config $(CFG)-i686-PAEdebug.config \ $(CFG)-x86_64.config $(CFG)-x86_64-debug.config \ $(CFG)-s390x.config \ - $(CFG)-armv7hl.config $(CFG)-armv7hl-lpae.config\ - $(CFG)-armv7hl-tegra.config \ + $(CFG)-armv7hl.config $(CFG)-armv7hl-lpae.config \ + $(CFG)-aarch64.config \ $(CFG)-ppc.config $(CFG)-ppc-smp.config \ $(CFG)-ppc64.config $(CFG)-ppc64p7.config $(CFG)-ppc64-debug.config -PLATFORMS = x86 x86_64 powerpc powerpc32 powerpc64 s390x arm +PLATFORMS = x86 x86_64 powerpc powerpc32 powerpc64 s390x arm arm64 TEMPFILES = $(addprefix temp-, $(addsuffix -generic, $(PLATFORMS))) configs: $(CONFIGFILES) @@ -32,7 +32,10 @@ temp-generic: config-generic temp-debug-generic: config-generic cat config-generic config-debug > temp-debug-generic -temp-armv7-generic: config-armv7-generic temp-generic +temp-arm-generic: config-arm-generic temp-generic + perl merge.pl $^ > $@ + +temp-armv7-generic: config-armv7-generic temp-arm-generic perl merge.pl $^ > $@ temp-armv7: config-armv7 temp-armv7-generic @@ -41,8 +44,14 @@ temp-armv7: config-armv7 temp-armv7-generic temp-armv7-lpae: config-armv7-lpae temp-armv7-generic perl merge.pl $^ > $@ -temp-armv7-tegra: config-armv7-tegra temp-armv7-generic - perl merge.pl $^ > $@ +temp-arm-debug-generic: temp-arm-generic temp-debug-generic + perl merge.pl $^ > $@ + +temp-arm64: config-arm64 temp-arm-generic + perl merge.pl $^ > $@ + +temp-arm64-debug: config-arm64 temp-arm-debug-generic + perl merge.pl $^ > $@ temp-x86-32: config-x86-32-generic config-x86-generic perl merge.pl $^ > $@ @@ -77,47 +86,47 @@ temp-powerpc64-generic: config-powerpc64 temp-powerpc-generic temp-s390-generic: config-s390x temp-generic perl merge.pl $^ > $@ -kernel-$(VERSION)-i686-PAE.config: config-i686-PAE temp-x86-32-generic +$(CFG)-i686-PAE.config: config-i686-PAE temp-x86-32-generic perl merge.pl $^ i386 > $@ -kernel-$(VERSION)-i686-PAEdebug.config: config-i686-PAE temp-x86-debug-generic +$(CFG)-i686-PAEdebug.config: config-i686-PAE temp-x86-debug-generic perl merge.pl $^ i386 > $@ -kernel-$(VERSION)-i686.config: /dev/null temp-x86-32-generic +$(CFG)-i686.config: /dev/null temp-x86-32-generic perl merge.pl $^ i386 > $@ -kernel-$(VERSION)-i686-debug.config: /dev/null temp-x86-debug-generic +$(CFG)-i686-debug.config: /dev/null temp-x86-debug-generic perl merge.pl $^ i386 > $@ -kernel-$(VERSION)-x86_64.config: /dev/null temp-x86_64-generic +$(CFG)-x86_64.config: /dev/null temp-x86_64-generic perl merge.pl $^ x86_64 > $@ -kernel-$(VERSION)-x86_64-debug.config: /dev/null temp-x86_64-debug-generic +$(CFG)-x86_64-debug.config: /dev/null temp-x86_64-debug-generic perl merge.pl $^ x86_64 > $@ -kernel-$(VERSION)-ppc64.config: /dev/null temp-powerpc64-generic +$(CFG)-ppc64.config: /dev/null temp-powerpc64-generic perl merge.pl $^ powerpc > $@ -kernel-$(VERSION)-ppc64-debug.config: temp-powerpc64-generic temp-powerpc-debug-generic +$(CFG)-ppc64-debug.config: temp-powerpc64-generic temp-powerpc-debug-generic perl merge.pl $^ powerpc > $@ -kernel-$(VERSION)-ppc64p7.config: config-powerpc64p7 temp-powerpc64-generic +$(CFG)-ppc64p7.config: config-powerpc64p7 temp-powerpc64-generic perl merge.pl $^ powerpc > $@ -kernel-$(VERSION)-s390x.config: config-s390x temp-s390-generic +$(CFG)-s390x.config: config-s390x temp-s390-generic perl merge.pl $^ s390 > $@ -kernel-$(VERSION)-armv7hl.config: /dev/null temp-armv7 +$(CFG)-armv7hl.config: /dev/null temp-armv7 perl merge.pl $^ arm > $@ -kernel-$(VERSION)-armv7hl-lpae.config: /dev/null temp-armv7-lpae +$(CFG)-armv7hl-lpae.config: /dev/null temp-armv7-lpae perl merge.pl $^ arm > $@ -kernel-$(VERSION)-armv7hl-tegra.config: /dev/null temp-armv7-tegra - perl merge.pl $^ arm > $@ +$(CFG)-aarch64.config: /dev/null temp-arm64 + perl merge.pl $^ arm64 > $@ -kernel-$(VERSION)-ppc.config: /dev/null temp-powerpc32-generic +$(CFG)-ppc.config: /dev/null temp-powerpc32-generic perl merge.pl $^ powerpc > $@ -kernel-$(VERSION)-ppc-smp.config: config-powerpc32-smp temp-powerpc32-generic +$(CFG)-ppc-smp.config: config-powerpc32-smp temp-powerpc32-generic perl merge.pl $^ powerpc > $@ diff --git a/freed-ora/current/master/Makefile.release b/freed-ora/current/master/Makefile.release index ee811bac2..3eba9dbac 100644 --- a/freed-ora/current/master/Makefile.release +++ b/freed-ora/current/master/Makefile.release @@ -64,11 +64,15 @@ config-release: @perl -pi -e 's/CONFIG_CPU_NOTIFIER_ERROR_INJECT=m/# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_PER_CPU_MAPS=y/# CONFIG_DEBUG_PER_CPU_MAPS is not set/' config-nodebug @perl -pi -e 's/CONFIG_TEST_LIST_SORT=y/# CONFIG_TEST_LIST_SORT is not set/' config-nodebug + @perl -pi -e 's/CONFIG_TEST_STRING_HELPERS=m/# CONFIG_TEST_STRING_HELPERS is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_ATOMIC_SLEEP=y/# CONFIG_DEBUG_ATOMIC_SLEEP is not set/' config-nodebug @perl -pi -e 's/CONFIG_DETECT_HUNG_TASK=y/# CONFIG_DETECT_HUNG_TASK is not set/' config-nodebug @perl -pi -e 's/CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y/# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set/' config-nodebug @perl -pi -e 's/CONFIG_DEBUG_KMEMLEAK=y/# CONFIG_DEBUG_KMEMLEAK is not set/' config-nodebug @perl -pi -e 's/CONFIG_MAC80211_MESSAGE_TRACING=y/# CONFIG_MAC80211_MESSAGE_TRACING is not set/' config-nodebug + @perl -pi -e 's/CONFIG_XFS_WARN=y/# CONFIG_XFS_WARN is not set/' config-nodebug + @perl -pi -e 's/CONFIG_EDAC_DEBUG=y/# CONFIG_EDAC_DEBUG is not set/' config-nodebug + @perl -pi -e 's/CONFIG_RTLWIFI_DEBUG=y/# CONFIG_RTLWIFI_DEBUG is not set/' config-nodebug @# Undo anything that make extremedebug might have set @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-debug diff --git a/freed-ora/current/master/VMX-x86-handle-host-TSC-calibration-failure.patch b/freed-ora/current/master/VMX-x86-handle-host-TSC-calibration-failure.patch deleted file mode 100644 index 6b6ddd2d2..000000000 --- a/freed-ora/current/master/VMX-x86-handle-host-TSC-calibration-failure.patch +++ /dev/null @@ -1,58 +0,0 @@ -@@ -, +, @@ - VMX: x86: handle host TSC calibration failure - - If the host TSC calibration fails, tsc_khz is zero (see tsc_init.c). - Handle such case properly in KVM (instead of dividing by zero). - - https://bugzilla.redhat.com/show_bug.cgi?id=859282 - - Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> - Signed-off-by: Gleb Natapov <gleb@redhat.com> ---- a/arch/x86/kvm/x86.c -+++ a/arch/x86/kvm/x86.c -@@ -1079,6 +1079,10 @@ static void kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 this_tsc_khz) - u32 thresh_lo, thresh_hi; - int use_scaling = 0; - -+ /* tsc_khz can be zero if TSC calibration fails */ -+ if (this_tsc_khz == 0) -+ return; -+ - /* Compute a scale to convert nanoseconds in TSC cycles */ - kvm_get_time_scale(this_tsc_khz, NSEC_PER_SEC / 1000, - &vcpu->arch.virtual_tsc_shift, -@@ -1156,20 +1160,23 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr) - ns = get_kernel_ns(); - elapsed = ns - kvm->arch.last_tsc_nsec; - -- /* n.b - signed multiplication and division required */ -- usdiff = data - kvm->arch.last_tsc_write; -+ if (vcpu->arch.virtual_tsc_khz) { -+ /* n.b - signed multiplication and division required */ -+ usdiff = data - kvm->arch.last_tsc_write; - #ifdef CONFIG_X86_64 -- usdiff = (usdiff * 1000) / vcpu->arch.virtual_tsc_khz; -+ usdiff = (usdiff * 1000) / vcpu->arch.virtual_tsc_khz; - #else -- /* do_div() only does unsigned */ -- asm("idivl %2; xor %%edx, %%edx" -- : "=A"(usdiff) -- : "A"(usdiff * 1000), "rm"(vcpu->arch.virtual_tsc_khz)); -+ /* do_div() only does unsigned */ -+ asm("idivl %2; xor %%edx, %%edx" -+ : "=A"(usdiff) -+ : "A"(usdiff * 1000), "rm"(vcpu->arch.virtual_tsc_khz)); - #endif -- do_div(elapsed, 1000); -- usdiff -= elapsed; -- if (usdiff < 0) -- usdiff = -usdiff; -+ do_div(elapsed, 1000); -+ usdiff -= elapsed; -+ if (usdiff < 0) -+ usdiff = -usdiff; -+ } else -+ usdiff = USEC_PER_SEC; /* disable TSC match window below */ - - /* - * Special case: TSC write with a small delta (1 second) of virtual diff --git a/freed-ora/current/master/arm-export-read_current_timer.patch b/freed-ora/current/master/arm-export-read_current_timer.patch deleted file mode 100644 index 5059d6862..000000000 --- a/freed-ora/current/master/arm-export-read_current_timer.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- linux-3.7.0-0.rc2.git1.2.fc19.x86_64/arch/arm/kernel/armksyms.c.orig 2012-10-01 00:47:46.000000000 +0100 -+++ linux-3.7.0-0.rc2.git1.2.fc19.x86_64/arch/arm/kernel/armksyms.c 2012-10-24 09:06:46.570452677 +0100 -@@ -50,6 +50,7 @@ - - /* platform dependent support */ - EXPORT_SYMBOL(arm_delay_ops); -+EXPORT_SYMBOL(read_current_timer); - - /* networking */ - EXPORT_SYMBOL(csum_partial); diff --git a/freed-ora/current/master/arm-of-dma.patch b/freed-ora/current/master/arm-of-dma.patch deleted file mode 100644 index c3223a4e6..000000000 --- a/freed-ora/current/master/arm-of-dma.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 7362f04c2888b14c20f8aaa02e1a897025261768 Mon Sep 17 00:00:00 2001 -From: Viresh Kumar <viresh.kumar@linaro.org> -Date: Fri, 15 Mar 2013 08:48:20 +0000 -Subject: DMA: OF: Check properties value before running be32_to_cpup() on it - -In of_dma_controller_register() routine we are calling of_get_property() as an -parameter to be32_to_cpup(). In case the property doesn't exist we will get a -crash. - -This patch changes this code to check if we got a valid property first and then -runs be32_to_cpup() on it. - -Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> -Signed-off-by: Vinod Koul <vinod.koul@intel.com> ---- -diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c -index 6036cd0..00db454 100644 ---- a/drivers/dma/of-dma.c -+++ b/drivers/dma/of-dma.c -@@ -93,6 +93,7 @@ int of_dma_controller_register(struct device_node *np, - { - struct of_dma *ofdma; - int nbcells; -+ const __be32 *prop; - - if (!np || !of_dma_xlate) { - pr_err("%s: not enough information provided\n", __func__); -@@ -103,8 +104,11 @@ int of_dma_controller_register(struct device_node *np, - if (!ofdma) - return -ENOMEM; - -- nbcells = be32_to_cpup(of_get_property(np, "#dma-cells", NULL)); -- if (!nbcells) { -+ prop = of_get_property(np, "#dma-cells", NULL); -+ if (prop) -+ nbcells = be32_to_cpup(prop); -+ -+ if (!prop || !nbcells) { - pr_err("%s: #dma-cells property is missing or invalid\n", - __func__); - kfree(ofdma); --- -cgit v0.9.1 diff --git a/freed-ora/current/master/arm-omap-ehci-fix.patch b/freed-ora/current/master/arm-omap-ehci-fix.patch deleted file mode 100644 index f6fc0a934..000000000 --- a/freed-ora/current/master/arm-omap-ehci-fix.patch +++ /dev/null @@ -1,190 +0,0 @@ -From 54a419668b0f27b7982807fb2376d237e0a0ce05 Mon Sep 17 00:00:00 2001 -From: Alan Stern <stern@rowland.harvard.edu> -Date: Tue, 12 Mar 2013 10:44:39 +0000 -Subject: USB: EHCI: split ehci-omap out to a separate driver - -This patch (as1645) converts ehci-omap over to the new "ehci-hcd is a -library" approach, so that it can coexist peacefully with other EHCI -platform drivers and can make use of the private area allocated at -the end of struct ehci_hcd. - -Signed-off-by: Alan Stern <stern@rowland.harvard.edu> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index c59a112..62f4e9a 100644 ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -155,7 +155,7 @@ config USB_EHCI_MXC - Variation of ARC USB block used in some Freescale chips. - - config USB_EHCI_HCD_OMAP -- bool "EHCI support for OMAP3 and later chips" -+ tristate "EHCI support for OMAP3 and later chips" - depends on USB_EHCI_HCD && ARCH_OMAP - default y - ---help--- -diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile -index 001fbff..56de410 100644 ---- a/drivers/usb/host/Makefile -+++ b/drivers/usb/host/Makefile -@@ -27,6 +27,7 @@ obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o - obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o - obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o - obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o -+obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o - - obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o - obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o -diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c -index b416a3f..303b022 100644 ---- a/drivers/usb/host/ehci-hcd.c -+++ b/drivers/usb/host/ehci-hcd.c -@@ -1252,11 +1252,6 @@ MODULE_LICENSE ("GPL"); - #define PLATFORM_DRIVER ehci_hcd_sh_driver - #endif - --#ifdef CONFIG_USB_EHCI_HCD_OMAP --#include "ehci-omap.c" --#define PLATFORM_DRIVER ehci_hcd_omap_driver --#endif -- - #ifdef CONFIG_PPC_PS3 - #include "ehci-ps3.c" - #define PS3_SYSTEM_BUS_DRIVER ps3_ehci_driver -@@ -1346,6 +1341,7 @@ MODULE_LICENSE ("GPL"); - !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \ - !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \ - !IS_ENABLED(CONFIG_USB_EHCI_MXC) && \ -+ !IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \ - !defined(PLATFORM_DRIVER) && \ - !defined(PS3_SYSTEM_BUS_DRIVER) && \ - !defined(OF_PLATFORM_DRIVER) && \ -diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c -index 0555ee4..fa66757 100644 ---- a/drivers/usb/host/ehci-omap.c -+++ b/drivers/usb/host/ehci-omap.c -@@ -36,6 +36,9 @@ - * - convert to use hwmod and runtime PM - */ - -+#include <linux/kernel.h> -+#include <linux/module.h> -+#include <linux/io.h> - #include <linux/platform_device.h> - #include <linux/slab.h> - #include <linux/usb/ulpi.h> -@@ -43,6 +46,10 @@ - #include <linux/pm_runtime.h> - #include <linux/gpio.h> - #include <linux/clk.h> -+#include <linux/usb.h> -+#include <linux/usb/hcd.h> -+ -+#include "ehci.h" - - #include <linux/platform_data/usb-omap.h> - -@@ -57,9 +64,11 @@ - #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 - #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0 - --/*-------------------------------------------------------------------------*/ -+#define DRIVER_DESC "OMAP-EHCI Host Controller driver" - --static const struct hc_driver ehci_omap_hc_driver; -+static const char hcd_name[] = "ehci-omap"; -+ -+/*-------------------------------------------------------------------------*/ - - - static inline void ehci_write(void __iomem *base, u32 reg, u32 val) -@@ -166,6 +175,12 @@ static void disable_put_regulator( - /* configure so an HC device and id are always provided */ - /* always called with process context; sleeping is OK */ - -+static struct hc_driver __read_mostly ehci_omap_hc_driver; -+ -+static const struct ehci_driver_overrides ehci_omap_overrides __initdata = { -+ .reset = omap_ehci_init, -+}; -+ - /** - * ehci_hcd_omap_probe - initialize TI-based HCDs - * -@@ -315,56 +330,33 @@ static struct platform_driver ehci_hcd_omap_driver = { - /*.suspend = ehci_hcd_omap_suspend, */ - /*.resume = ehci_hcd_omap_resume, */ - .driver = { -- .name = "ehci-omap", -+ .name = hcd_name, - } - }; - - /*-------------------------------------------------------------------------*/ - --static const struct hc_driver ehci_omap_hc_driver = { -- .description = hcd_name, -- .product_desc = "OMAP-EHCI Host Controller", -- .hcd_priv_size = sizeof(struct ehci_hcd), -- -- /* -- * generic hardware linkage -- */ -- .irq = ehci_irq, -- .flags = HCD_MEMORY | HCD_USB2, -- -- /* -- * basic lifecycle operations -- */ -- .reset = omap_ehci_init, -- .start = ehci_run, -- .stop = ehci_stop, -- .shutdown = ehci_shutdown, -- -- /* -- * managing i/o requests and associated device resources -- */ -- .urb_enqueue = ehci_urb_enqueue, -- .urb_dequeue = ehci_urb_dequeue, -- .endpoint_disable = ehci_endpoint_disable, -- .endpoint_reset = ehci_endpoint_reset, -+static int __init ehci_omap_init(void) -+{ -+ if (usb_disabled()) -+ return -ENODEV; - -- /* -- * scheduling support -- */ -- .get_frame_number = ehci_get_frame, -+ pr_info("%s: " DRIVER_DESC "\n", hcd_name); - -- /* -- * root hub support -- */ -- .hub_status_data = ehci_hub_status_data, -- .hub_control = ehci_hub_control, -- .bus_suspend = ehci_bus_suspend, -- .bus_resume = ehci_bus_resume, -+ ehci_init_driver(&ehci_omap_hc_driver, &ehci_omap_overrides); -+ return platform_driver_register(&ehci_hcd_omap_driver); -+} -+module_init(ehci_omap_init); - -- .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, --}; -+static void __exit ehci_omap_cleanup(void) -+{ -+ platform_driver_unregister(&ehci_hcd_omap_driver); -+} -+module_exit(ehci_omap_cleanup); - - MODULE_ALIAS("platform:ehci-omap"); - MODULE_AUTHOR("Texas Instruments, Inc."); - MODULE_AUTHOR("Felipe Balbi <felipe.balbi@nokia.com>"); - -+MODULE_DESCRIPTION(DRIVER_DESC); -+MODULE_LICENSE("GPL"); --- -cgit v0.9.1 diff --git a/freed-ora/current/master/arm-omap-load-tfp410.patch b/freed-ora/current/master/arm-omap-load-tfp410.patch new file mode 100644 index 000000000..0f2ba5457 --- /dev/null +++ b/freed-ora/current/master/arm-omap-load-tfp410.patch @@ -0,0 +1,14 @@ +diff -urNp linux-3.9.4-300.fc19.armv7hl_orig/drivers/video/omap2/dss/core.c linux-3.9.4-300.fc19.armv7hl/drivers/video/omap2/dss/core.c
+--- linux-3.9.4-300.fc19.armv7hl_orig/drivers/video/omap2/dss/core.c 2013-04-28 20:36:01.000000000 -0400
++++ linux-3.9.4-300.fc19.armv7hl/drivers/video/omap2/dss/core.c 2013-05-31 12:24:07.711334359 -0400
+@@ -596,6 +596,9 @@ static int __init omap_dss_init(void)
+ {
+ int r;
+
++ /* hack to load panel-tfp410 driver */
++ request_module("panel-tfp410");
++
+ r = omap_dss_bus_register();
+ if (r)
+ return r;
+Binary files linux-3.9.4-300.fc19.armv7hl_orig/drivers/video/omap2/dss/.Makefile.swp and linux-3.9.4-300.fc19.armv7hl/drivers/video/omap2/dss/.Makefile.swp differ
diff --git a/freed-ora/current/master/arm-tegra-fixclk.patch b/freed-ora/current/master/arm-tegra-fixclk.patch deleted file mode 100644 index df0991293..000000000 --- a/freed-ora/current/master/arm-tegra-fixclk.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c -index 788486e..2f4d0e3 100644 ---- a/drivers/clk/tegra/clk-periph.c -+++ b/drivers/clk/tegra/clk-periph.c -@@ -18,6 +18,7 @@ - #include <linux/clk-provider.h> - #include <linux/slab.h> - #include <linux/err.h> -+#include <linux/export.h> - - #include "clk.h" - -@@ -128,6 +129,7 @@ void tegra_periph_reset_deassert(struct clk *c) - - tegra_periph_reset(gate, 0); - } -+EXPORT_SYMBOL_GPL(tegra_periph_reset_deassert); - - void tegra_periph_reset_assert(struct clk *c) - { -@@ -147,6 +149,7 @@ void tegra_periph_reset_assert(struct clk *c) - - tegra_periph_reset(gate, 1); - } -+EXPORT_SYMBOL_GPL(tegra_periph_reset_assert); - - const struct clk_ops tegra_clk_periph_ops = { - .get_parent = clk_periph_get_parent, diff --git a/freed-ora/current/master/arm-tegra-sdhci-module-fix.patch b/freed-ora/current/master/arm-tegra-sdhci-module-fix.patch deleted file mode 100644 index 24ba278ed..000000000 --- a/freed-ora/current/master/arm-tegra-sdhci-module-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- linux-3.5.0-0.rc0.git3.1.fc18.armv7hl/drivers/mmc/host/sdhci-tegra.c.orig 2012-05-23 06:59:19.797302757 -0500 -+++ linux-3.5.0-0.rc0.git3.1.fc18.armv7hl/drivers/mmc/host/sdhci-tegra.c 2012-05-22 15:26:07.154823359 -0500 -@@ -190,7 +190,7 @@ - #endif - {} - }; --MODULE_DEVICE_TABLE(of, sdhci_dt_ids); -+MODULE_DEVICE_TABLE(of, sdhci_tegra_dt_match); - - static struct tegra_sdhci_platform_data * __devinit sdhci_tegra_dt_parse_pdata( - struct platform_device *pdev) diff --git a/freed-ora/current/master/arm64-makefile-vdso_install.patch b/freed-ora/current/master/arm64-makefile-vdso_install.patch new file mode 100644 index 000000000..f7b4d122b --- /dev/null +++ b/freed-ora/current/master/arm64-makefile-vdso_install.patch @@ -0,0 +1,15 @@ +diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile +index c95c5cb..b6ccf8a 100644 +--- a/arch/arm64/Makefile ++++ b/arch/arm64/Makefile +@@ -60,6 +60,10 @@ zinstall install: vmlinux + dtbs: scripts + $(Q)$(MAKE) $(build)=$(boot)/dts dtbs + ++PHONY += vdso_install ++vdso_install: ++ $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@ ++ + # We use MRPROPER_FILES and CLEAN_FILES now + archclean: + $(Q)$(MAKE) $(clean)=$(boot) diff --git a/freed-ora/current/master/ath3k-dont-use-stack-memory-for-DMA.patch b/freed-ora/current/master/ath3k-dont-use-stack-memory-for-DMA.patch new file mode 100644 index 000000000..610a00067 --- /dev/null +++ b/freed-ora/current/master/ath3k-dont-use-stack-memory-for-DMA.patch @@ -0,0 +1,72 @@ +Memory allocated by vmalloc (including stack) can not be used for DMA, +i.e. data pointer on usb_control_msg() should not point to stack memory. + +Resolves: +https://bugzilla.redhat.com/show_bug.cgi?id=977558 + +Reported-and-tested-by: Andy Lawrence <dr.diesel@gmail.com> +Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> +--- + drivers/bluetooth/ath3k.c | 38 +++++++++++++++++++++++++++++--------- + 1 file changed, 29 insertions(+), 9 deletions(-) + +diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c +index 11f467c..81b636c 100644 +--- a/drivers/bluetooth/ath3k.c ++++ b/drivers/bluetooth/ath3k.c +@@ -193,24 +193,44 @@ error: + + static int ath3k_get_state(struct usb_device *udev, unsigned char *state) + { +- int pipe = 0; ++ int ret, pipe = 0; ++ char *buf; ++ ++ buf = kmalloc(1, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; + + pipe = usb_rcvctrlpipe(udev, 0); +- return usb_control_msg(udev, pipe, ATH3K_GETSTATE, +- USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, +- state, 0x01, USB_CTRL_SET_TIMEOUT); ++ ret = usb_control_msg(udev, pipe, ATH3K_GETSTATE, ++ USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, ++ buf, 1, USB_CTRL_SET_TIMEOUT); ++ ++ *state = *buf; ++ kfree(buf); ++ ++ return ret; + } + + static int ath3k_get_version(struct usb_device *udev, + struct ath3k_version *version) + { +- int pipe = 0; ++ int ret, pipe = 0; ++ char *buf; ++ const int size = sizeof(struct ath3k_version); ++ ++ buf = kmalloc(size, GFP_KERNEL); ++ if (!buf) ++ return -ENOMEM; + + pipe = usb_rcvctrlpipe(udev, 0); +- return usb_control_msg(udev, pipe, ATH3K_GETVERSION, +- USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, version, +- sizeof(struct ath3k_version), +- USB_CTRL_SET_TIMEOUT); ++ ret = usb_control_msg(udev, pipe, ATH3K_GETVERSION, ++ USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, ++ buf, size, USB_CTRL_SET_TIMEOUT); ++ ++ memcpy(version, buf, size); ++ kfree(buf); ++ ++ return ret; + } + + static int ath3k_load_fwfile(struct usb_device *udev, +-- +1.7.11.7 diff --git a/freed-ora/current/master/blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch b/freed-ora/current/master/blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch deleted file mode 100644 index 615d7555b..000000000 --- a/freed-ora/current/master/blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch +++ /dev/null @@ -1,79 +0,0 @@ -From e5072664f8237cf53b0bd68a51aa1a7bc69061c5 Mon Sep 17 00:00:00 2001 -From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> -Date: Tue, 09 Apr 2013 13:01:21 +0000 -Subject: blkcg: fix "scheduling while atomic" in blk_queue_bypass_start - -Since 749fefe677 in v3.7 ("block: lift the initial queue bypass mode -on blk_register_queue() instead of blk_init_allocated_queue()"), -the following warning appears when multipath is used with CONFIG_PREEMPT=y. - -This patch moves blk_queue_bypass_start() before radix_tree_preload() -to avoid the sleeping call while preemption is disabled. - - BUG: scheduling while atomic: multipath/2460/0x00000002 - 1 lock held by multipath/2460: - #0: (&md->type_lock){......}, at: [<ffffffffa019fb05>] dm_lock_md_type+0x17/0x19 [dm_mod] - Modules linked in: ... - Pid: 2460, comm: multipath Tainted: G W 3.7.0-rc2 #1 - Call Trace: - [<ffffffff810723ae>] __schedule_bug+0x6a/0x78 - [<ffffffff81428ba2>] __schedule+0xb4/0x5e0 - [<ffffffff814291e6>] schedule+0x64/0x66 - [<ffffffff8142773a>] schedule_timeout+0x39/0xf8 - [<ffffffff8108ad5f>] ? put_lock_stats+0xe/0x29 - [<ffffffff8108ae30>] ? lock_release_holdtime+0xb6/0xbb - [<ffffffff814289e3>] wait_for_common+0x9d/0xee - [<ffffffff8107526c>] ? try_to_wake_up+0x206/0x206 - [<ffffffff810c0eb8>] ? kfree_call_rcu+0x1c/0x1c - [<ffffffff81428aec>] wait_for_completion+0x1d/0x1f - [<ffffffff810611f9>] wait_rcu_gp+0x5d/0x7a - [<ffffffff81061216>] ? wait_rcu_gp+0x7a/0x7a - [<ffffffff8106fb18>] ? complete+0x21/0x53 - [<ffffffff810c0556>] synchronize_rcu+0x1e/0x20 - [<ffffffff811dd903>] blk_queue_bypass_start+0x5d/0x62 - [<ffffffff811ee109>] blkcg_activate_policy+0x73/0x270 - [<ffffffff81130521>] ? kmem_cache_alloc_node_trace+0xc7/0x108 - [<ffffffff811f04b3>] cfq_init_queue+0x80/0x28e - [<ffffffffa01a1600>] ? dm_blk_ioctl+0xa7/0xa7 [dm_mod] - [<ffffffff811d8c41>] elevator_init+0xe1/0x115 - [<ffffffff811e229f>] ? blk_queue_make_request+0x54/0x59 - [<ffffffff811dd743>] blk_init_allocated_queue+0x8c/0x9e - [<ffffffffa019ffcd>] dm_setup_md_queue+0x36/0xaa [dm_mod] - [<ffffffffa01a60e6>] table_load+0x1bd/0x2c8 [dm_mod] - [<ffffffffa01a7026>] ctl_ioctl+0x1d6/0x236 [dm_mod] - [<ffffffffa01a5f29>] ? table_clear+0xaa/0xaa [dm_mod] - [<ffffffffa01a7099>] dm_ctl_ioctl+0x13/0x17 [dm_mod] - [<ffffffff811479fc>] do_vfs_ioctl+0x3fb/0x441 - [<ffffffff811b643c>] ? file_has_perm+0x8a/0x99 - [<ffffffff81147aa0>] sys_ioctl+0x5e/0x82 - [<ffffffff812010be>] ? trace_hardirqs_on_thunk+0x3a/0x3f - [<ffffffff814310d9>] system_call_fastpath+0x16/0x1b - -Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> -Acked-by: Vivek Goyal <vgoyal@redhat.com> -Acked-by: Tejun Heo <tj@kernel.org> -Cc: Alasdair G Kergon <agk@redhat.com> -Cc: stable@kernel.org -Signed-off-by: Jens Axboe <axboe@kernel.dk> ---- -(limited to 'block/blk-cgroup.c') - -diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c -index b2b9837..e8918ff 100644 ---- a/block/blk-cgroup.c -+++ b/block/blk-cgroup.c -@@ -972,10 +972,10 @@ int blkcg_activate_policy(struct request_queue *q, - if (!new_blkg) - return -ENOMEM; - -- preloaded = !radix_tree_preload(GFP_KERNEL); -- - blk_queue_bypass_start(q); - -+ preloaded = !radix_tree_preload(GFP_KERNEL); -+ - /* - * Make sure the root blkg exists and count the existing blkgs. As - * @q is bypassing at this point, blkg_lookup_create() can't be --- -cgit v0.9.1 diff --git a/freed-ora/current/master/block-do-not-pass-disk-names-as-format-strings.patch b/freed-ora/current/master/block-do-not-pass-disk-names-as-format-strings.patch new file mode 100644 index 000000000..496111dcd --- /dev/null +++ b/freed-ora/current/master/block-do-not-pass-disk-names-as-format-strings.patch @@ -0,0 +1,64 @@ +Disk names may contain arbitrary strings, so they must not be interpreted +as format strings. It seems that only md allows arbitrary strings to be +used for disk names, but this could allow for a local memory corruption +from uid 0 into ring 0. + +CVE-2013-2851 + +Signed-off-by: Kees Cook <keescook@chromium.org> +Cc: stable@vger.kernel.org +Cc: Jens Axboe <axboe@kernel.dk> +--- + block/genhd.c | 2 +- + drivers/block/nbd.c | 3 ++- + drivers/scsi/osd/osd_uld.c | 2 +- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/block/genhd.c b/block/genhd.c +index 20625ee..cdeb527 100644 +--- a/block/genhd.c ++++ b/block/genhd.c +@@ -512,7 +512,7 @@ static void register_disk(struct gendisk *disk) + + ddev->parent = disk->driverfs_dev; + +- dev_set_name(ddev, disk->disk_name); ++ dev_set_name(ddev, "%s", disk->disk_name); + + /* delay uevents, until we scanned partition table */ + dev_set_uevent_suppress(ddev, 1); +diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c +index 037288e..46b35f7 100644 +--- a/drivers/block/nbd.c ++++ b/drivers/block/nbd.c +@@ -714,7 +714,8 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, + else + blk_queue_flush(nbd->disk->queue, 0); + +- thread = kthread_create(nbd_thread, nbd, nbd->disk->disk_name); ++ thread = kthread_create(nbd_thread, nbd, "%s", ++ nbd->disk->disk_name); + if (IS_ERR(thread)) { + mutex_lock(&nbd->tx_lock); + return PTR_ERR(thread); +diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c +index 0fab6b5..9d86947 100644 +--- a/drivers/scsi/osd/osd_uld.c ++++ b/drivers/scsi/osd/osd_uld.c +@@ -485,7 +485,7 @@ static int osd_probe(struct device *dev) + oud->class_dev.class = &osd_uld_class; + oud->class_dev.parent = dev; + oud->class_dev.release = __remove; +- error = dev_set_name(&oud->class_dev, disk->disk_name); ++ error = dev_set_name(&oud->class_dev, "%s", disk->disk_name); + if (error) { + OSD_ERR("dev_set_name failed => %d\n", error); + goto err_put_cdev; +-- +1.7.9.5 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html +Please read the FAQ at http://www.tux.org/lkml/
\ No newline at end of file diff --git a/freed-ora/current/master/bridge-only-expire-the-mdb-entry-when-query-is-received.patch b/freed-ora/current/master/bridge-only-expire-the-mdb-entry-when-query-is-received.patch new file mode 100644 index 000000000..b58b57083 --- /dev/null +++ b/freed-ora/current/master/bridge-only-expire-the-mdb-entry-when-query-is-received.patch @@ -0,0 +1,159 @@ +From 9f00b2e7cf241fa389733d41b615efdaa2cb0f5b Mon Sep 17 00:00:00 2001 +From: Cong Wang <amwang@redhat.com> +Date: Tue, 21 May 2013 21:52:55 +0000 +Subject: bridge: only expire the mdb entry when query is received + +Currently we arm the expire timer when the mdb entry is added, +however, this causes problem when there is no querier sent +out after that. + +So we should only arm the timer when a corresponding query is +received, as suggested by Herbert. + +And he also mentioned "if there is no querier then group +subscriptions shouldn't expire. There has to be at least one querier +in the network for this thing to work. Otherwise it just degenerates +into a non-snooping switch, which is OK." + +Cc: Herbert Xu <herbert@gondor.apana.org.au> +Cc: Stephen Hemminger <stephen@networkplumber.org> +Cc: "David S. Miller" <davem@davemloft.net> +Cc: Adam Baker <linux@baker-net.org.uk> +Signed-off-by: Cong Wang <amwang@redhat.com> +Acked-by: Herbert Xu <herbert@gondor.apana.org.au> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- +(limited to 'net/bridge') + +diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c +index 2475147..40bda80 100644 +--- a/net/bridge/br_multicast.c ++++ b/net/bridge/br_multicast.c +@@ -617,8 +617,6 @@ rehash: + + mp->br = br; + mp->addr = *group; +- setup_timer(&mp->timer, br_multicast_group_expired, +- (unsigned long)mp); + + hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]); + mdb->size++; +@@ -656,7 +654,6 @@ static int br_multicast_add_group(struct net_bridge *br, + struct net_bridge_mdb_entry *mp; + struct net_bridge_port_group *p; + struct net_bridge_port_group __rcu **pp; +- unsigned long now = jiffies; + int err; + + spin_lock(&br->multicast_lock); +@@ -671,7 +668,6 @@ static int br_multicast_add_group(struct net_bridge *br, + + if (!port) { + mp->mglist = true; +- mod_timer(&mp->timer, now + br->multicast_membership_interval); + goto out; + } + +@@ -679,7 +675,7 @@ static int br_multicast_add_group(struct net_bridge *br, + (p = mlock_dereference(*pp, br)) != NULL; + pp = &p->next) { + if (p->port == port) +- goto found; ++ goto out; + if ((unsigned long)p->port < (unsigned long)port) + break; + } +@@ -690,8 +686,6 @@ static int br_multicast_add_group(struct net_bridge *br, + rcu_assign_pointer(*pp, p); + br_mdb_notify(br->dev, port, group, RTM_NEWMDB); + +-found: +- mod_timer(&p->timer, now + br->multicast_membership_interval); + out: + err = 0; + +@@ -1131,6 +1125,10 @@ static int br_ip4_multicast_query(struct net_bridge *br, + if (!mp) + goto out; + ++ setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); ++ mod_timer(&mp->timer, now + br->multicast_membership_interval); ++ mp->timer_armed = true; ++ + max_delay *= br->multicast_last_member_count; + + if (mp->mglist && +@@ -1205,6 +1203,10 @@ static int br_ip6_multicast_query(struct net_bridge *br, + if (!mp) + goto out; + ++ setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); ++ mod_timer(&mp->timer, now + br->multicast_membership_interval); ++ mp->timer_armed = true; ++ + max_delay *= br->multicast_last_member_count; + if (mp->mglist && + (timer_pending(&mp->timer) ? +@@ -1263,7 +1265,7 @@ static void br_multicast_leave_group(struct net_bridge *br, + call_rcu_bh(&p->rcu, br_multicast_free_pg); + br_mdb_notify(br->dev, port, group, RTM_DELMDB); + +- if (!mp->ports && !mp->mglist && ++ if (!mp->ports && !mp->mglist && mp->timer_armed && + netif_running(br->dev)) + mod_timer(&mp->timer, jiffies); + } +@@ -1275,30 +1277,12 @@ static void br_multicast_leave_group(struct net_bridge *br, + br->multicast_last_member_interval; + + if (!port) { +- if (mp->mglist && ++ if (mp->mglist && mp->timer_armed && + (timer_pending(&mp->timer) ? + time_after(mp->timer.expires, time) : + try_to_del_timer_sync(&mp->timer) >= 0)) { + mod_timer(&mp->timer, time); + } +- +- goto out; +- } +- +- for (p = mlock_dereference(mp->ports, br); +- p != NULL; +- p = mlock_dereference(p->next, br)) { +- if (p->port != port) +- continue; +- +- if (!hlist_unhashed(&p->mglist) && +- (timer_pending(&p->timer) ? +- time_after(p->timer.expires, time) : +- try_to_del_timer_sync(&p->timer) >= 0)) { +- mod_timer(&p->timer, time); +- } +- +- break; + } + + out: +@@ -1674,6 +1658,7 @@ void br_multicast_stop(struct net_bridge *br) + hlist_for_each_entry_safe(mp, n, &mdb->mhash[i], + hlist[ver]) { + del_timer(&mp->timer); ++ mp->timer_armed = false; + call_rcu_bh(&mp->rcu, br_multicast_free_group); + } + } +diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h +index e260710..1b0ac95 100644 +--- a/net/bridge/br_private.h ++++ b/net/bridge/br_private.h +@@ -112,6 +112,7 @@ struct net_bridge_mdb_entry + struct timer_list timer; + struct br_ip addr; + bool mglist; ++ bool timer_armed; + }; + + struct net_bridge_mdb_htable +-- +cgit v0.9.2 diff --git a/freed-ora/current/master/bridge-send-query-as-soon-as-leave-is-received.patch b/freed-ora/current/master/bridge-send-query-as-soon-as-leave-is-received.patch new file mode 100644 index 000000000..8b6652e7e --- /dev/null +++ b/freed-ora/current/master/bridge-send-query-as-soon-as-leave-is-received.patch @@ -0,0 +1,57 @@ +From 6b7df111ece130fa979a0c4f58e53674c1e47d3e Mon Sep 17 00:00:00 2001 +From: Cong Wang <amwang@redhat.com> +Date: Tue, 21 May 2013 21:52:56 +0000 +Subject: bridge: send query as soon as leave is received + +Continue sending queries when leave is received if the user marks +it as a querier. + +Cc: Herbert Xu <herbert@gondor.apana.org.au> +Cc: Stephen Hemminger <stephen@networkplumber.org> +Cc: "David S. Miller" <davem@davemloft.net> +Cc: Adam Baker <linux@baker-net.org.uk> +Signed-off-by: Cong Wang <amwang@redhat.com> +Acked-by: Herbert Xu <herbert@gondor.apana.org.au> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- +(limited to 'net/bridge') + +diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c +index 40bda80..37a4676 100644 +--- a/net/bridge/br_multicast.c ++++ b/net/bridge/br_multicast.c +@@ -1250,6 +1250,32 @@ static void br_multicast_leave_group(struct net_bridge *br, + if (!mp) + goto out; + ++ if (br->multicast_querier && ++ !timer_pending(&br->multicast_querier_timer)) { ++ __br_multicast_send_query(br, port, &mp->addr); ++ ++ time = jiffies + br->multicast_last_member_count * ++ br->multicast_last_member_interval; ++ mod_timer(port ? &port->multicast_query_timer : ++ &br->multicast_query_timer, time); ++ ++ for (p = mlock_dereference(mp->ports, br); ++ p != NULL; ++ p = mlock_dereference(p->next, br)) { ++ if (p->port != port) ++ continue; ++ ++ if (!hlist_unhashed(&p->mglist) && ++ (timer_pending(&p->timer) ? ++ time_after(p->timer.expires, time) : ++ try_to_del_timer_sync(&p->timer) >= 0)) { ++ mod_timer(&p->timer, time); ++ } ++ ++ break; ++ } ++ } ++ + if (port && (port->flags & BR_MULTICAST_FAST_LEAVE)) { + struct net_bridge_port_group __rcu **pp; + +-- +cgit v0.9.2 diff --git a/freed-ora/current/master/cdrom-use-kzalloc-for-failing-hardware.patch b/freed-ora/current/master/cdrom-use-kzalloc-for-failing-hardware.patch new file mode 100644 index 000000000..6afb6c4d8 --- /dev/null +++ b/freed-ora/current/master/cdrom-use-kzalloc-for-failing-hardware.patch @@ -0,0 +1,45 @@ +From 050e4b8fb7cdd7096c987a9cd556029c622c7fe2 Mon Sep 17 00:00:00 2001 +From: Jonathan Salwan <jonathan.salwan@gmail.com> +Date: Thu, 06 Jun 2013 00:39:39 +0000 +Subject: drivers/cdrom/cdrom.c: use kzalloc() for failing hardware + +In drivers/cdrom/cdrom.c mmc_ioctl_cdrom_read_data() allocates a memory +area with kmalloc in line 2885. + +2885 cgc->buffer = kmalloc(blocksize, GFP_KERNEL); +2886 if (cgc->buffer == NULL) +2887 return -ENOMEM; + +In line 2908 we can find the copy_to_user function: + +2908 if (!ret && copy_to_user(arg, cgc->buffer, blocksize)) + +The cgc->buffer is never cleaned and initialized before this function. If +ret = 0 with the previous basic block, it's possible to display some +memory bytes in kernel space from userspace. + +When we read a block from the disk it normally fills the ->buffer but if +the drive is malfunctioning there is a chance that it would only be +partially filled. The result is an leak information to userspace. + +Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> +Cc: Jens Axboe <axboe@kernel.dk> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +--- +(limited to 'drivers/cdrom/cdrom.c') + +diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c +index d620b44..8a3aff7 100644 +--- a/drivers/cdrom/cdrom.c ++++ b/drivers/cdrom/cdrom.c +@@ -2882,7 +2882,7 @@ static noinline int mmc_ioctl_cdrom_read_data(struct cdrom_device_info *cdi, + if (lba < 0) + return -EINVAL; + +- cgc->buffer = kmalloc(blocksize, GFP_KERNEL); ++ cgc->buffer = kzalloc(blocksize, GFP_KERNEL); + if (cgc->buffer == NULL) + return -ENOMEM; + +-- +cgit v0.9.2 diff --git a/freed-ora/current/master/cfg80211-mac80211-disconnect-on-suspend.patch b/freed-ora/current/master/cfg80211-mac80211-disconnect-on-suspend.patch deleted file mode 100644 index b3180fb54..000000000 --- a/freed-ora/current/master/cfg80211-mac80211-disconnect-on-suspend.patch +++ /dev/null @@ -1,219 +0,0 @@ -From 8125696991194aacb1173b6e8196d19098b44e17 Mon Sep 17 00:00:00 2001 -From: Stanislaw Gruszka <sgruszka@redhat.com> -Date: Thu, 28 Feb 2013 09:55:25 +0000 -Subject: cfg80211/mac80211: disconnect on suspend - -If possible that after suspend, cfg80211 will receive request to -disconnect what require action on interface that was removed during -suspend. - -Problem can manifest itself by various warnings similar to below one: - -WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]() -wlan0: Failed check-sdata-in-driver check, flags: 0x4 -Call Trace: - [<c043e0b3>] warn_slowpath_fmt+0x33/0x40 - [<f83707c9>] ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211] - [<f83a660a>] ieee80211_recalc_ps_vif+0x2a/0x30 [mac80211] - [<f83a6706>] ieee80211_set_disassoc+0xf6/0x500 [mac80211] - [<f83a9441>] ieee80211_mgd_deauth+0x1f1/0x280 [mac80211] - [<f8381b36>] ieee80211_deauth+0x16/0x20 [mac80211] - [<f8261e70>] cfg80211_mlme_down+0x70/0xc0 [cfg80211] - [<f8264de1>] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211] - -To fix the problem disconnect from any associated network before -suspend. User space is responsible to establish connection again -after resume. This basically need to be done by user space anyway, -because associated stations can go away during suspend (for example -NetworkManager disconnects on suspend and connect on resume by default). - -Patch also handle situation when driver refuse to suspend with wowlan -configured and try to suspend again without it. - -Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> -Signed-off-by: Johannes Berg <johannes.berg@intel.com> ---- -diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c -index d0275f3..4d105c7 100644 ---- a/net/mac80211/pm.c -+++ b/net/mac80211/pm.c -@@ -93,7 +93,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) - return err; - } else if (err > 0) { - WARN_ON(err != 1); -- local->wowlan = false; -+ return err; - } else { - list_for_each_entry(sdata, &local->interfaces, list) - if (ieee80211_sdata_running(sdata)) -diff --git a/net/wireless/core.c b/net/wireless/core.c -index ea4155f..f382cae 100644 ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -814,6 +814,46 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, - rdev->num_running_monitor_ifaces += num; - } - -+void cfg80211_leave(struct cfg80211_registered_device *rdev, -+ struct wireless_dev *wdev) -+{ -+ struct net_device *dev = wdev->netdev; -+ -+ switch (wdev->iftype) { -+ case NL80211_IFTYPE_ADHOC: -+ cfg80211_leave_ibss(rdev, dev, true); -+ break; -+ case NL80211_IFTYPE_P2P_CLIENT: -+ case NL80211_IFTYPE_STATION: -+ mutex_lock(&rdev->sched_scan_mtx); -+ __cfg80211_stop_sched_scan(rdev, false); -+ mutex_unlock(&rdev->sched_scan_mtx); -+ -+ wdev_lock(wdev); -+#ifdef CONFIG_CFG80211_WEXT -+ kfree(wdev->wext.ie); -+ wdev->wext.ie = NULL; -+ wdev->wext.ie_len = 0; -+ wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; -+#endif -+ __cfg80211_disconnect(rdev, dev, -+ WLAN_REASON_DEAUTH_LEAVING, true); -+ cfg80211_mlme_down(rdev, dev); -+ wdev_unlock(wdev); -+ break; -+ case NL80211_IFTYPE_MESH_POINT: -+ cfg80211_leave_mesh(rdev, dev); -+ break; -+ case NL80211_IFTYPE_AP: -+ cfg80211_stop_ap(rdev, dev); -+ break; -+ default: -+ break; -+ } -+ -+ wdev->beacon_interval = 0; -+} -+ - static int cfg80211_netdev_notifier_call(struct notifier_block *nb, - unsigned long state, - void *ndev) -@@ -882,38 +922,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, - dev->priv_flags |= IFF_DONT_BRIDGE; - break; - case NETDEV_GOING_DOWN: -- switch (wdev->iftype) { -- case NL80211_IFTYPE_ADHOC: -- cfg80211_leave_ibss(rdev, dev, true); -- break; -- case NL80211_IFTYPE_P2P_CLIENT: -- case NL80211_IFTYPE_STATION: -- mutex_lock(&rdev->sched_scan_mtx); -- __cfg80211_stop_sched_scan(rdev, false); -- mutex_unlock(&rdev->sched_scan_mtx); -- -- wdev_lock(wdev); --#ifdef CONFIG_CFG80211_WEXT -- kfree(wdev->wext.ie); -- wdev->wext.ie = NULL; -- wdev->wext.ie_len = 0; -- wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC; --#endif -- __cfg80211_disconnect(rdev, dev, -- WLAN_REASON_DEAUTH_LEAVING, true); -- cfg80211_mlme_down(rdev, dev); -- wdev_unlock(wdev); -- break; -- case NL80211_IFTYPE_MESH_POINT: -- cfg80211_leave_mesh(rdev, dev); -- break; -- case NL80211_IFTYPE_AP: -- cfg80211_stop_ap(rdev, dev); -- break; -- default: -- break; -- } -- wdev->beacon_interval = 0; -+ cfg80211_leave(rdev, wdev); - break; - case NETDEV_DOWN: - cfg80211_update_iface_num(rdev, wdev->iftype, -1); -diff --git a/net/wireless/core.h b/net/wireless/core.h -index 9a2be8d..d5d06fd 100644 ---- a/net/wireless/core.h -+++ b/net/wireless/core.h -@@ -503,6 +503,9 @@ int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, - void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev, - enum nl80211_iftype iftype, int num); - -+void cfg80211_leave(struct cfg80211_registered_device *rdev, -+ struct wireless_dev *wdev); -+ - void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev, - struct wireless_dev *wdev); - -diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h -index 8c8b26f..d77e1c1 100644 ---- a/net/wireless/rdev-ops.h -+++ b/net/wireless/rdev-ops.h -@@ -6,11 +6,12 @@ - #include "core.h" - #include "trace.h" - --static inline int rdev_suspend(struct cfg80211_registered_device *rdev) -+static inline int rdev_suspend(struct cfg80211_registered_device *rdev, -+ struct cfg80211_wowlan *wowlan) - { - int ret; -- trace_rdev_suspend(&rdev->wiphy, rdev->wowlan); -- ret = rdev->ops->suspend(&rdev->wiphy, rdev->wowlan); -+ trace_rdev_suspend(&rdev->wiphy, wowlan); -+ ret = rdev->ops->suspend(&rdev->wiphy, wowlan); - trace_rdev_return_int(&rdev->wiphy, ret); - return ret; - } -diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c -index 238ee49..8f28b9f 100644 ---- a/net/wireless/sysfs.c -+++ b/net/wireless/sysfs.c -@@ -83,6 +83,14 @@ static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env) - return 0; - } - -+static void cfg80211_leave_all(struct cfg80211_registered_device *rdev) -+{ -+ struct wireless_dev *wdev; -+ -+ list_for_each_entry(wdev, &rdev->wdev_list, list) -+ cfg80211_leave(rdev, wdev); -+} -+ - static int wiphy_suspend(struct device *dev, pm_message_t state) - { - struct cfg80211_registered_device *rdev = dev_to_rdev(dev); -@@ -90,12 +98,19 @@ static int wiphy_suspend(struct device *dev, pm_message_t state) - - rdev->suspend_at = get_seconds(); - -- if (rdev->ops->suspend) { -- rtnl_lock(); -- if (rdev->wiphy.registered) -- ret = rdev_suspend(rdev); -- rtnl_unlock(); -+ rtnl_lock(); -+ if (rdev->wiphy.registered) { -+ if (!rdev->wowlan) -+ cfg80211_leave_all(rdev); -+ if (rdev->ops->suspend) -+ ret = rdev_suspend(rdev, rdev->wowlan); -+ if (ret == 1) { -+ /* Driver refuse to configure wowlan */ -+ cfg80211_leave_all(rdev); -+ ret = rdev_suspend(rdev, NULL); -+ } - } -+ rtnl_unlock(); - - return ret; - } --- -cgit v0.9.1 diff --git a/freed-ora/current/master/config-arm-generic b/freed-ora/current/master/config-arm-generic new file mode 100644 index 000000000..efce65434 --- /dev/null +++ b/freed-ora/current/master/config-arm-generic @@ -0,0 +1,43 @@ +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +# CONFIG_ARM_DT_BL_CPUFREQ is not set +CONFIG_ARM_GIC=y +# CONFIG_ASYMMETRIC_KEY_TYPE is not set +CONFIG_BACKLIGHT_PWM=m +# CONFIG_COMMON_CLK_DEBUG is not set +CONFIG_COMMON_CLK=y +CONFIG_DMA_OF=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_ETHERNET=y +CONFIG_FB_SSD1307=m +CONFIG_GENERIC_GPIO=y +CONFIG_GPIOLIB=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_HW_PERF_EVENTS=y +# CONFIG_I2C_NOMADIK is not set +CONFIG_INPUT_PWM_BEEPER=m +# CONFIG_IRQ_DOMAIN_DEBUG is not set +# CONFIG_LEDS_RENESAS_TPU is not set +CONFIG_MMC_ARMMMCI=y +# CONFIG_MMC_SDHCI_PXAV2 is not set +# CONFIG_MMC_SDHCI_PXAV3 is not set +CONFIG_MMC=y +CONFIG_NFS_FS=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NO_HZ=y +CONFIG_OF_DEVICE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +# CONFIG_OF_SELFTEST is not set +CONFIG_OF=y +CONFIG_PERF_EVENTS=y +# CONFIG_PID_IN_CONTEXTIDR is not set +CONFIG_PWM=y +CONFIG_RCU_FANOUT_LEAF=16 +# CONFIG_RTC_DRV_SNVS is not set +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_AMBA_PL011=y + +# CONFIG_CRYPTO_TEST is not set diff --git a/freed-ora/current/master/config-arm-omap b/freed-ora/current/master/config-arm-omap deleted file mode 100644 index 877f7c16b..000000000 --- a/freed-ora/current/master/config-arm-omap +++ /dev/null @@ -1,79 +0,0 @@ -CONFIG_OMAP_PACKAGE_CBB=y -CONFIG_OMAP_PACKAGE_CBL=y -CONFIG_OMAP_PACKAGE_CBS=y - -# -# OMAP Board Type -# -CONFIG_MACH_CM_T35=y -CONFIG_MACH_CM_T3517=y -CONFIG_MACH_CRANEBOARD=y -CONFIG_MACH_DEVKIT8000=y -CONFIG_MACH_IGEP0020=y -CONFIG_MACH_IGEP0030=y -CONFIG_MACH_OMAP_GENERIC=y -CONFIG_MACH_OMAP_LDP=y -CONFIG_MACH_OMAP_ZOOM2=y -CONFIG_MACH_OMAP_ZOOM3=y -CONFIG_MACH_OMAP_3430SDP=y -CONFIG_MACH_OMAP_3630SDP=y -CONFIG_MACH_OMAP_4430SDP=y -CONFIG_MACH_OMAP3_BEAGLE=y -CONFIG_MACH_OMAP3_PANDORA=y -CONFIG_MACH_OMAP3_TOUCHBOOK=y -CONFIG_MACH_OMAP3_TORPEDO=y -CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL=y -CONFIG_MACH_OMAP3EVM=y -CONFIG_MACH_OMAP3517EVM=y -CONFIG_MACH_OMAP3530_LV_SOM=y -CONFIG_MACH_OMAP4_PANDA=y -CONFIG_MACH_OVERO=y -CONFIG_MACH_SBC3530=y -CONFIG_MACH_TI8148EVM=y -CONFIG_MACH_TI8168EVM=y -CONFIG_MACH_TOUCHBOOK=y -# CONFIG_MACH_NOKIA_RM680 is not set -# CONFIG_MACH_NOKIA_RX51 is not set - - -# CONFIG_OMAP3_SDRC_AC_TIMING is not set - - -# System MMU -CONFIG_SWP_EMULATE=y -# CONFIG_CPU_BPREDICT_DISABLE is not set -# CONFIG_THUMB2_KERNEL is not set -CONFIG_ZBOOT_ROM_TEXT=0x0 -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_BINFMT_MISC=m -CONFIG_CAN_PM_TRACE=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_ARCH_HAS_OPP=y -CONFIG_PM_OPP=y - -# -# OMAP Hardware -# - -CONFIG_LEDS_PWM=m -CONFIG_LEDS_LP8788=m -CONFIG_MTD_ONENAND_OMAP2=y -CONFIG_MFD_LP8788=y -CONFIG_MFD_TPS65910=y -CONFIG_GPIO_TPS65910=y -CONFIG_REGULATOR_LP8788=y -CONFIG_REGULATOR_TPS65217=y -CONFIG_REGULATOR_TPS65910=y - -CONFIG_LCD_CLASS_DEVICE=m -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_CLASS_DEVICE=m -CONFIG_BACKLIGHT_LP8788=m -CONFIG_BACKLIGHT_PWM=m -CONFIG_BACKLIGHT_PANDORA=m - -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set - -# CONFIG_USB_GADGET_OMAP is not set -# CONFIG_ISP1301_OMAP is not set diff --git a/freed-ora/current/master/config-arm64 b/freed-ora/current/master/config-arm64 new file mode 100644 index 000000000..8bac90936 --- /dev/null +++ b/freed-ora/current/master/config-arm64 @@ -0,0 +1,495 @@ +CONFIG_64BIT=y +CONFIG_AIO=y +# CONFIG_ALWAYS_USE_PERSISTENT_CLOCK is not set +# CONFIG_AMBA_PL08X is not set +CONFIG_ANON_INODES=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y +CONFIG_ARCH_PHYS_ADDR_T_64BIT=y +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_VEXPRESS=y +CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_FRAME_POINTERS=y +CONFIG_ARM64_64K_PAGES=y +CONFIG_ARM64=y +# CONFIG_ARM_DT_BL_CPUFREQ is not set +CONFIG_ASYNC_CORE=m +CONFIG_ASYNC_MEMCPY=m +CONFIG_ASYNC_PQ=m +CONFIG_ASYNC_RAID6_RECOV=m +CONFIG_ASYNC_XOR=m +# CONFIG_ATA_NONSTANDARD is not set +CONFIG_ATH9K_COMMON=m +CONFIG_ATH9K_HW=m +# CONFIG_ATH_DEBUG is not set +CONFIG_AUDIT_GENERIC=y +CONFIG_AVERAGE=y +CONFIG_B43_LEDS=y +CONFIG_B43LEGACY_LEDS=y +CONFIG_B43_PIO=y +CONFIG_B43_SSB=y +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +CONFIG_BCMA_POSSIBLE=y +# CONFIG_BINARY_PRINTF is not set +CONFIG_BITREVERSE=y +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLOCK=y +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 +CONFIG_BQL=y +CONFIG_BRCMUTIL=m +CONFIG_BUG=y +# CONFIG_CEPH_LIB_PRETTYDEBUG is not set +# CONFIG_CFG80211_INTERNAL_REGDB is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="console=ttyAMA0" +# CONFIG_CMDLINE_FORCE is not set +CONFIG_COMMON_CLK_SI5351=y +CONFIG_COMMON_CLK_VERSATILE=y +CONFIG_CONSOLE_TRANSLATIONS=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_COREDUMP=y +CONFIG_CPU_RMAP=y +# CONFIG_CRC32_BIT is not set +# CONFIG_CRC32_SARWATE is not set +# CONFIG_CRC32_SLICEBY4 is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CRC32=y +CONFIG_CRC_T10DIF=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_BLKCIPHER2=y +CONFIG_CRYPTO_BLOWFISH_COMMON=m +CONFIG_CRYPTO_CAST_COMMON=m +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_PCOMP2=y +CONFIG_CRYPTO_PCOMP=m +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_TWOFISH_COMMON=m +CONFIG_CRYPTO_USER_API=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CUSE=y +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_BLK_CGROUP is not set +CONFIG_DEBUG_BUGVERBOSE=y +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_WRITECOUNT is not set +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DECOMPRESS_LZO=y +CONFIG_DECOMPRESS_XZ=y +CONFIG_DEFAULT_CUBIC=y +CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_IOSCHED="cfq" +# CONFIG_DEFAULT_NOOP is not set +# CONFIG_DEFAULT_RENO is not set +# CONFIG_DEFAULT_SECURITY_DAC is not set +CONFIG_DEFAULT_SECURITY="selinux" +CONFIG_DEFAULT_SECURITY_SELINUX=y +CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_DMADEVICES_DEBUG is not set +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DM_BIO_PRISON=m +CONFIG_DM_BUFIO=m +CONFIG_DM_PERSISTENT_DATA=m +CONFIG_DNS_RESOLVER=y +CONFIG_DQL=y +# CONFIG_DRBD_FAULT_INJECTION is not set +# CONFIG_DVB_DUMMY_FE is not set +CONFIG_ELF_CORE=y +CONFIG_EVENTFD=y +# CONFIG_EXT4_DEBUG is not set +CONFIG_FAT_FS=y +# CONFIG_FAULT_INJECTION is not set +CONFIG_FB_ARMCLCD=y +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_DDC is not set +CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_SVGALIB is not set +CONFIG_FB_SYS_COPYAREA=m +CONFIG_FB_SYS_FILLRECT=m +CONFIG_FB_SYS_FOPS=m +CONFIG_FB_SYS_IMAGEBLIT=m +# CONFIG_FB_WMT_GE_ROPS is not set +CONFIG_FIB_RULES=y +CONFIG_FILE_LOCKING=y +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +CONFIG_FREEZER=y +CONFIG_FS_POSIX_ACL=y +# CONFIG_FTRACE is not set +CONFIG_FUSE_FS=y +CONFIG_GARP=m +CONFIG_GENERIC_ACL=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_GENERIC_CLOCKEVENTS=y +# CONFIG_GENERIC_CPU_DEVICES is not set +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +# CONFIG_GIGASET_DUMMYLL is not set +# CONFIG_GIGASET_I4L is not set +# CONFIG_GPIO_ADNP is not set +CONFIG_GPIO_DEVRES=y +# CONFIG_GPIO_GENERIC_PLATFORM is not set +# CONFIG_GPIO_MCP23S08 is not set +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y +# CONFIG_HAVE_AOUT is not set +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_DEBUG_BUGVERBOSE=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_GENERIC_HARDIRQS=y +CONFIG_HAVE_HW_BREAKPOINT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HDMI=y +CONFIG_HID_APPLE=m +CONFIG_HID_MAGICMOUSE=m +# CONFIG_HUGETLB_PAGE is not set +CONFIG_HVC_DRIVER=y +# CONFIG_HWMON is not set +# CONFIG_HW_RANDOM is not set +CONFIG_HZ=100 +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_PXA_PCI is not set +CONFIG_I2C_SI4713=m +CONFIG_I2C_SMBUS=m +# CONFIG_I2C_VERSATILE is not set +CONFIG_IKCONFIG_PROC=y +CONFIG_IKCONFIG=y +CONFIG_INET6_TUNNEL=m +CONFIG_INET6_XFRM_TUNNEL=m +CONFIG_INET_DCCP_DIAG=m +CONFIG_INET_TCP_DIAG=m +CONFIG_INET_XFRM_TUNNEL=m +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_INLINE_READ_UNLOCK_IRQ=y +CONFIG_INLINE_READ_UNLOCK=y +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +CONFIG_INLINE_WRITE_UNLOCK=y +CONFIG_IOMMU_HELPER=y +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_IOSCHED_DEADLINE is not set +CONFIG_IP_DCCP_TFRC_LIB=y +CONFIG_IP_ROUTE_CLASSID=y +CONFIG_IPV6_NDISC_NODETYPE=y +CONFIG_IP_VS_NFCT=y +CONFIG_IP_VS_PROTO_AH_ESP=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_WORK=y +# CONFIG_JBD2_DEBUG is not set +CONFIG_LEDS_LP55XX_COMMON=m +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_LOCKD=y +# CONFIG_LOCK_STAT is not set +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_LRU_CACHE=m +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MAC80211_HAS_RC=y +# CONFIG_MAC80211_MESSAGE_TRACING is not set +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +CONFIG_MAC80211_RC_MINSTREL_HT=y +# CONFIG_MDIO_BUS_MUX_GPIO is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set +CONFIG_MEDIA_COMMON_OPTIONS=y +CONFIG_MEDIA_TUNER=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_XC5000=m +# CONFIG_MEMCG_SWAP_ENABLED is not set +CONFIG_MFD_CORE=m +# CONFIG_MFD_TMIO is not set +CONFIG_MFD_WL1273_CORE=m +CONFIG_MII=y +# CONFIG_MISC_FILESYSTEMS is not set +CONFIG_MM_OWNER=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_CYPRESS=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +CONFIG_MRP=m +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_OF_PARTS=m +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_SG_DMA_LENGTH=y +# CONFIG_NET_CADENCE is not set +CONFIG_NET_CORE=y +CONFIG_NET_DSA_MV88E6XXX=m +CONFIG_NET_DSA_MV88E6XXX_NEED_PPU=y +CONFIG_NET_DSA_TAG_DSA=y +CONFIG_NET_DSA_TAG_EDSA=y +CONFIG_NET_DSA_TAG_TRAILER=y +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m +CONFIG_NETFILTER_XT_MATCH_STATE=m +CONFIG_NETFILTER_XT_TARGET_HL=m +CONFIG_NETFILTER_XT_TARGET_NETMAP=m +CONFIG_NETFILTER_XT_TARGET_REDIRECT=m +CONFIG_NETPOLL=y +CONFIG_NET_SCH_FIFO=y +CONFIG_NET_VENDOR_BROADCOM=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NF_CONNTRACK_BROADCAST=m +CONFIG_NF_CONNTRACK_IPV4=m +CONFIG_NF_CONNTRACK_IPV6=m +CONFIG_NF_CONNTRACK_LABELS=y +CONFIG_NF_CT_PROTO_GRE=m +CONFIG_NF_DEFRAG_IPV4=m +CONFIG_NF_DEFRAG_IPV6=m +CONFIG_NF_NAT_AMANDA=m +CONFIG_NF_NAT_FTP=m +CONFIG_NF_NAT_H323=m +CONFIG_NF_NAT_IRC=m +CONFIG_NF_NAT_NEEDED=y +CONFIG_NF_NAT_PPTP=m +CONFIG_NF_NAT_PROTO_DCCP=m +CONFIG_NF_NAT_PROTO_GRE=m +CONFIG_NF_NAT_PROTO_SCTP=m +CONFIG_NF_NAT_PROTO_UDPLITE=m +CONFIG_NF_NAT_SIP=m +CONFIG_NF_NAT_TFTP=m +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_NFS_DEBUG=y +# CONFIG_NFSD_FAULT_INJECTION is not set +CONFIG_NFSD_V2_ACL=y +CONFIG_NFS_USE_KERNEL_DNS=y +CONFIG_NLATTR=y +CONFIG_NO_BOOTMEM=y +CONFIG_NO_IOPORT=y +CONFIG_NR_CPUS=4 +CONFIG_OF_ADDRESS=y +# CONFIG_OF_DISPLAY_TIMING is not set +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_I2C=m +CONFIG_OF_MDIO=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +# CONFIG_OF_VIDEOMODE is not set +CONFIG_ORE=m +CONFIG_P54_LEDS=y +CONFIG_PADATA=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_PANIC_ON_OOPS_VALUE=0 +# CONFIG_PARPORT is not set +# CONFIG_PARPORT_GSC is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PHYS_ADDR_T_64BIT=y +# CONFIG_PL330_DMA is not set +CONFIG_PNFS_FILE_LAYOUT=m +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_POWER_RESET_GPIO is not set +CONFIG_POWER_RESET_VEXPRESS=y +CONFIG_PPP_BSDCOMP=m +# CONFIG_PREEMPT_RCU is not set +CONFIG_PRINTK=y +# CONFIG_PROC_DEVICETREE is not set +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROVE_LOCKING is not set +# CONFIG_QUOTA_DEBUG is not set +CONFIG_QUOTA_TREE=y +CONFIG_RAID6_PQ=m +CONFIG_RCU_FANOUT=64 +CONFIG_RCU_STALL_COMMON=y +CONFIG_RD_BZIP2=y +CONFIG_RD_GZIP=y +CONFIG_RD_LZMA=y +CONFIG_RD_LZO=y +CONFIG_RD_XZ=y +CONFIG_REGMAP_I2C=m +CONFIG_REGMAP=y +# CONFIG_RFKILL_GPIO is not set +CONFIG_RFKILL_LEDS=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +# CONFIG_RTC_DRV_PL030 is not set +# CONFIG_RTC_DRV_PL031 is not set +CONFIG_RTC_LIB=y +# CONFIG_RTLWIFI_DEBUG is not set +CONFIG_RT_MUTEXES=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_SCHED_DEBUG is not set +CONFIG_SCSI_DMA=y +CONFIG_SCSI_MOD=y +CONFIG_SCSI_NETLINK=y +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SERIAL_8250_DMA=y +# CONFIG_SERIAL_AMBA_PL010 is not set +CONFIG_SERIAL_OF_PLATFORM=m +CONFIG_SERIO_AMBAKMI=y +# CONFIG_SERIO_I8042 is not set +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_SERPORT is not set +CONFIG_SHMEM=y +CONFIG_SIGNALFD=y +CONFIG_SLABINFO=y +# CONFIG_SLAB is not set +CONFIG_SLHC=m +# CONFIG_SLUB_DEBUG_ON is not set +CONFIG_SLUB_DEBUG=y +CONFIG_SMC91X=y +CONFIG_SND_DEBUG=y +# CONFIG_SND_EMU10K1_SEQ is not set +CONFIG_SND_HRTIMER=m +CONFIG_SND=m +CONFIG_SND_MIXER_OSS=m +CONFIG_SND_MPU401_UART=m +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +CONFIG_SND_PCM=m +CONFIG_SND_PCM_OSS=m +CONFIG_SND_PCM_XRUN_DEBUG=y +CONFIG_SND_RAWMIDI=m +CONFIG_SND_RAWMIDI_SEQ=m +# CONFIG_SND_SBAWE_SEQ is not set +CONFIG_SND_SEQUENCER=m +CONFIG_SND_TIMER=m +CONFIG_SND_VERBOSE_PRINTK=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_SSB_BLOCKIO=y +CONFIG_SSB_POSSIBLE=y +CONFIG_SSB_SDIOHOST_POSSIBLE=y +CONFIG_STACKTRACE_SUPPORT=y +# CONFIG_STMMAC_CHAINED is not set +CONFIG_STMMAC_RING=y +CONFIG_STOP_MACHINE=y +CONFIG_STP=m +CONFIG_SUNRPC_BACKCHANNEL=y +CONFIG_SUNRPC_GSS=y +CONFIG_SUNRPC=y +CONFIG_SWIOTLB=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +# CONFIG_SYSCTL_SYSCALL is not set +CONFIG_SYSFS=y +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_TEST_LIST_SORT is not set +CONFIG_TEXTSEARCH_BM=m +CONFIG_TEXTSEARCH_FSM=m +CONFIG_TEXTSEARCH_KMP=m +CONFIG_TEXTSEARCH=y +# CONFIG_THERMAL is not set +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TICK_ONESHOT=y +CONFIG_TIMERFD=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_TREE_RCU_TRACE is not set +CONFIG_TREE_RCU=y +# CONFIG_TTPCI_EEPROM is not set +CONFIG_TTY=y +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_USB_ARCH_HAS_EHCI is not set +# CONFIG_USB_ARCH_HAS_HCD is not set +# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_USB_ARCH_HAS_XHCI is not set +CONFIG_USE_GENERIC_SMP_HELPERS=y +CONFIG_VEXPRESS_CONFIG=y +CONFIG_VFAT_FS=y +# CONFIG_VGA_CONSOLE is not set +# CONFIG_VGASTATE is not set +CONFIG_VIDEO_IR_I2C=m +CONFIG_VIDEO_V4L2=m +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_SPY=y +CONFIG_WIZNET_BUS_ANY=y +# CONFIG_WIZNET_BUS_DIRECT is not set +# CONFIG_WIZNET_BUS_INDIRECT is not set +CONFIG_XFRM_ALGO=y +CONFIG_XFRM_IPCOMP=m +CONFIG_XOR_BLOCKS=m +CONFIG_XPS=y +# CONFIG_XZ_DEC_BCJ is not set +CONFIG_ZONE_DMA32=y +CONFIG_ZONE_DMA_FLAG=0 diff --git a/freed-ora/current/master/config-armv7 b/freed-ora/current/master/config-armv7 index 4f27e5c06..1bbb3d524 100644 --- a/freed-ora/current/master/config-armv7 +++ b/freed-ora/current/master/config-armv7 @@ -1,22 +1,20 @@ # ARM unified arch kernel -CONFIG_CPU_V7=y -# CONFIG_ARCH_MULTI_V4 is not set -# CONFIG_ARCH_MULTI_V4T is not set -# CONFIG_ARCH_MULTI_V6 is not set -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -# This is V6 so we'll eventually support it in v5 unified kernels + # CONFIG_ARCH_BCM is not set CONFIG_ARCH_HIGHBANK=y CONFIG_ARCH_MVEBU=y -# CONFIG_ARCH_MXC is not set +CONFIG_ARCH_MXC=y CONFIG_ARCH_OMAP2PLUS=y CONFIG_ARCH_PICOXCELL=y +# CONFIG_ARCH_SIRF is not set CONFIG_ARCH_SOCFPGA=y +# CONFIG_PLAT_SPEAR is not set CONFIG_ARCH_SUNXI=y +CONFIG_ARCH_TEGRA=y +# CONFIG_ARCH_U8500 is not set CONFIG_ARCH_VEXPRESS_CA9X4=y -CONFIG_ARCH_VEXPRESS_DT=y -CONFIG_ARCH_VIRT=y +CONFIG_ARCH_VEXPRESS=y +# CONFIG_ARCH_VIRT is not set # CONFIG_ARCH_WM8850 is not set CONFIG_ARCH_ZYNQ=y @@ -26,6 +24,9 @@ CONFIG_ARCH_ZYNQ=y # CONFIG_VIRTIO_CONSOLE is not set # CONFIG_ARM_VIRT_EXT is not set +# Generic +CONFIG_REMOTEPROC=m + # highbank # 2013/04/19 - stability issues # CONFIG_CPU_IDLE_CALXEDA is not set @@ -71,13 +72,15 @@ CONFIG_MVEBU_CLK_GATING=y CONFIG_MMC_MVSDIO=m CONFIG_SPI_ORION=m CONFIG_USB_MV_UDC=m +CONFIG_MVEBU_MBUS=y +CONFIG_ARMADA_THERMAL=m # omap CONFIG_ARCH_OMAP2PLUS_TYPICAL=y # CONFIG_ARCH_OMAP2 is not set CONFIG_ARCH_OMAP3=y CONFIG_ARCH_OMAP4=y -# CONFIG_SOC_OMAP5 is not set +CONFIG_SOC_OMAP5=y # CONFIG_SOC_OMAP2420 is not set # CONFIG_SOC_OMAP2430 is not set CONFIG_SOC_OMAP3430=y @@ -111,6 +114,7 @@ CONFIG_MACH_TI8148EVM=y CONFIG_MACH_OMAP_4430SDP=y CONFIG_MACH_OMAP4_PANDA=y +CONFIG_SOC_HAS_REALTIME_COUNTER=y CONFIG_OMAP_RESET_CLOCKS=y CONFIG_OMAP_MUX=y CONFIG_OMAP_MUX_WARNINGS=y @@ -137,6 +141,9 @@ CONFIG_TI_DAVINCI_CPDMA=m CONFIG_TI_CPSW=m CONFIG_TI_CPTS=y CONFIG_TI_EMIF=m +CONFIG_MFD_TPS65217=m +CONFIG_REGULATOR_TPS65217=m +CONFIG_BACKLIGHT_TPS65217=m CONFIG_SERIAL_OMAP=y CONFIG_SERIAL_OMAP_CONSOLE=y @@ -203,7 +210,7 @@ CONFIG_MTD_NAND_OMAP2=y CONFIG_MTD_NAND_OMAP_PREFETCH=y CONFIG_MTD_NAND_OMAP_PREFETCH_DMA=y CONFIG_SPI_DAVINCI=m -CONFIG_SPI_OMAP24XX=y +CONFIG_SPI_OMAP24XX=m CONFIG_MFD_TI_SSP=m CONFIG_SPI_TI_SSP=m @@ -235,7 +242,7 @@ CONFIG_CRYPTO_DEV_OMAP_SHAM=m CONFIG_CRYPTO_DEV_OMAP_AES=m CONFIG_HW_RANDOM_OMAP=m -# CONFIG_DRM_TILCDC is not set +CONFIG_DRM_TILCDC=m CONFIG_DRM_OMAP=m CONFIG_DRM_OMAP_NUM_CRTCS=2 CONFIG_OMAP2_VRAM=y @@ -315,7 +322,7 @@ CONFIG_SND_SOC_TWL4030=m CONFIG_SND_SOC_TWL6040=m CONFIG_RADIO_WL128X=m -# CONFIG_OMAP_REMOTEPROC is not set +CONFIG_OMAP_REMOTEPROC=m # CONFIG_TIDSPBRIDGE is not set # CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000 @@ -370,13 +377,48 @@ CONFIG_PINCTRL_SUNXI=y # CONFIG_RTC_DRV_SUN4I=y # imx -# CONFIG_BACKLIGHT_PWM is not set -# CONFIG_DRM_IMX is not set -# CONFIG_DRM_IMX_FB_HELPER=m -# CONFIG_DRM_IMX_PARALLEL_DISPLAY=m -# CONFIG_DRM_IMX_IPUV3_CORE=m -# CONFIG_DRM_IMX_IPUV3=m -# CONFIG_VIDEO_CODA is not set +CONFIG_MXC_IRQ_PRIOR=y +# CONFIG_MXC_DEBUG_BOARD is not set +CONFIG_MACH_IMX51_DT=y +# CONFIG_MACH_MX51_BABBAGE is not set +# CONFIG_MACH_EUKREA_CPUIMX51SD is not set +CONFIG_SOC_IMX53=y +CONFIG_SOC_IMX6Q=y +CONFIG_PATA_IMX=m +CONFIG_NET_VENDOR_FREESCALE=y +CONFIG_FEC=m +CONFIG_KEYBOARD_IMX=m +CONFIG_SERIAL_IMX=y +CONFIG_SERIAL_IMX_CONSOLE=y +CONFIG_I2C_IMX=m +CONFIG_SPI_IMX=m +CONFIG_W1_MASTER_MXC=m +CONFIG_IMX2_WDT=m +# CONFIG_FB_MX3 is not set +CONFIG_SND_IMX_SOC=m +CONFIG_SND_SOC_IMX_SGTL5000=m +CONFIG_USB_EHCI_MXC=m +CONFIG_USB_IMX21_HCD=m +CONFIG_USB_MXS_PHY=m +CONFIG_MMC_SDHCI_ESDHC_IMX=m +CONFIG_MMC_MXC=m +CONFIG_SPI_MXS=m +CONFIG_RTC_DRV_IMXDI=m +CONFIG_RTC_DRV_MXC=m +# CONFIG_MX3_IPU is not set +# CONFIG_MX3_IPU_IRQS is not set +CONFIG_IMX_SDMA=m +CONFIG_IMX_DMA=m +# CONFIG_MXS_DMA is not set +CONFIG_PWM_IMX=m +CONFIG_BACKLIGHT_PWM=m +CONFIG_DRM_IMX=m +CONFIG_DRM_IMX_FB_HELPER=m +CONFIG_DRM_IMX_PARALLEL_DISPLAY=m +CONFIG_DRM_IMX_IPUV3_CORE=m +CONFIG_DRM_IMX_IPUV3=m +CONFIG_DRM_IMX_TVE=m +CONFIG_VIDEO_CODA=m CONFIG_INPUT_PWM_BEEPER=m CONFIG_INPUT_88PM80X_ONKEY=m @@ -391,8 +433,106 @@ CONFIG_CRYPTO_DEV_PICOXCELL=m CONFIG_HW_RANDOM_PICOXCELL=m # ST Ericsson -# CONFIG_I2C_NOMADIK is not set -# CONFIG_SENSORS_LIS3_I2C is not set +CONFIG_MACH_HREFV60=y +CONFIG_MACH_SNOWBALL=y +CONFIG_MACH_UX500_DT=y + +CONFIG_ABX500_CORE=y +CONFIG_UX500_DEBUG_UART=2 +CONFIG_AB8500_CORE=y +CONFIG_STE_DMA40=y +CONFIG_HSEM_U8500=m +CONFIG_PINCTRL_ABX500=y +CONFIG_PINCTRL_AB8500=y +CONFIG_I2C_NOMADIK=m +CONFIG_KEYBOARD_NOMADIK=m +CONFIG_DB8500_CPUFREQ_COOLING=m +CONFIG_DB8500_THERMAL=y +CONFIG_UX500_WATCHDOG=m +CONFIG_INPUT_AB8500_PONKEY=m +CONFIG_REGULATOR_AB8500=y +CONFIG_AB8500_USB=m +CONFIG_RTC_DRV_AB8500=m +CONFIG_PWM_AB8500=m +CONFIG_SND_SOC_UX500=m +CONFIG_SND_SOC_UX500_PLAT_DMA=m +CONFIG_SND_SOC_UX500_MACH_MOP500=m +CONFIG_CLKSRC_DBX500_PRCMU=y +CONFIG_CLKSRC_DBX500_PRCMU_SCHED_CLOCK=y +CONFIG_CRYPTO_DEV_UX500=m +CONFIG_CRYPTO_DEV_UX500_CRYP=m +CONFIG_CRYPTO_DEV_UX500_HASH=m +CONFIG_SENSORS_LIS3_I2C=m +CONFIG_AB8500_BM=y +CONFIG_AB8500_GPADC=y +CONFIG_SENSORS_AB8500=m +CONFIG_STE_MODEM_RPROC=m + +# tegra +CONFIG_ARCH_TEGRA_2x_SOC=y +CONFIG_ARCH_TEGRA_3x_SOC=y +# CONFIG_ARCH_TEGRA_114_SOC is not set + +CONFIG_SERIAL_TEGRA=y + +CONFIG_TEGRA_PCI=y +CONFIG_TEGRA_IOMMU_GART=y +CONFIG_TEGRA_IOMMU_SMMU=y +CONFIG_MMC_SDHCI_TEGRA=m + +CONFIG_I2C_TEGRA=m + +CONFIG_TEGRA_SYSTEM_DMA=y +CONFIG_TEGRA_EMC_SCALING_ENABLE=y +CONFIG_TEGRA_AHB=y +CONFIG_TEGRA20_APB_DMA=y +# CONFIG_SPI_TEGRA114 is not set +CONFIG_SPI_TEGRA20_SFLASH=m +CONFIG_SPI_TEGRA20_SLINK=m + +CONFIG_KEYBOARD_TEGRA=m +CONFIG_PINCTRL_TEGRA=y +CONFIG_PINCTRL_TEGRA20=y +CONFIG_PINCTRL_TEGRA30=y +CONFIG_USB_EHCI_TEGRA=y +CONFIG_RTC_DRV_TEGRA=y + +CONFIG_SND_SOC_TEGRA=m +CONFIG_SND_SOC_TEGRA_ALC5632=m +CONFIG_SND_SOC_TEGRA_WM8753=m +CONFIG_SND_SOC_TEGRA_WM8903=m +CONFIG_SND_SOC_TEGRA_WM9712=m +CONFIG_SND_SOC_TEGRA_TRIMSLICE=m +CONFIG_SND_SOC_TEGRA30_AHUB=m +CONFIG_SND_SOC_TEGRA30_I2S=m +CONFIG_SND_SOC_TEGRA20_AC97=m + +# AC100 (PAZ00) +CONFIG_MFD_NVEC=y +CONFIG_MFD_TPS80031=y +CONFIG_KEYBOARD_NVEC=y +CONFIG_SERIO_NVEC_PS2=y +CONFIG_NVEC_POWER=y +CONFIG_POWER_SUPPLY=y +CONFIG_NVEC_LEDS=y +CONFIG_NVEC_PAZ00=y +CONFIG_MFD_TPS6586X=y +CONFIG_GPIO_TPS6586X=y +CONFIG_REGULATOR_TPS6586X=m +CONFIG_RTC_DRV_TPS6586X=m + +CONFIG_PWM_TEGRA=m + +CONFIG_TEGRA_HOST1X=m +CONFIG_TEGRA_HOST1X_FIREWALL=y + +CONFIG_DRM_TEGRA=y +# CONFIG_DRM_TEGRA_STAGING is not set +# CONFIG_DRM_TEGRA_DEBUG is not set + +CONFIG_CRYPTO_DEV_TEGRA_AES=m + +CONFIG_LEDS_RENESAS_TPU=y # ZYNQ CONFIG_LATTICE_ECP3_CONFIG=m @@ -416,8 +556,6 @@ CONFIG_REGULATOR_FAN53555=m # CONFIG_REGULATOR_DUMMY is not set # CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set -CONFIG_RFKILL_REGULATOR=m -CONFIG_REGULATOR_GPIO=m CONFIG_REGULATOR_AD5398=m CONFIG_REGULATOR_ISL6271A=m CONFIG_REGULATOR_MAX1586=m @@ -496,3 +634,6 @@ CONFIG_REGULATOR_LP8755=m # CONFIG_POWER_RESET_QNAP is not set # CONFIG_POWER_RESET_RESTART is not set # CONFIG_OMAP2_DSS_DEBUG is not set +# CONFIG_DRM_TEGRA_DEBUG is not set +# CONFIG_CRYPTO_DEV_UX500_DEBUG is not set +# CONFIG_AB8500_DEBUG is not set diff --git a/freed-ora/current/master/config-armv7-generic b/freed-ora/current/master/config-armv7-generic index 4105483df..897a7e3ee 100644 --- a/freed-ora/current/master/config-armv7-generic +++ b/freed-ora/current/master/config-armv7-generic @@ -2,6 +2,11 @@ # Generic ARM config options CONFIG_ARM=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +# CONFIG_ARCH_MULTI_V6 is not set +CONFIG_ARCH_MULTI_V7=y + CONFIG_CMDLINE="" CONFIG_HAVE_ARM_ARCH_TIMER=y CONFIG_HAVE_ARM_TWD=y @@ -9,10 +14,10 @@ CONFIG_AEABI=y CONFIG_VFP=y CONFIG_VFPv3=y CONFIG_NEON=y + CONFIG_ARM_UNWIND=y CONFIG_ARM_THUMB=y CONFIG_ARM_THUMBEE=y -CONFIG_ARM_GIC=y CONFIG_ARM_ASM_UNIFIED=y CONFIG_ARM_CPU_TOPOLOGY=y CONFIG_ARM_DMA_MEM_BUFFERABLE=y @@ -21,20 +26,16 @@ CONFIG_CACHE_L2X0=y CONFIG_CACHE_PL310=y CONFIG_HIGHPTE=y CONFIG_AUTO_ZRELADDR=y -CONFIG_EARLY_PRINTK=y CONFIG_ATAGS=y CONFIG_ATAGS_PROC=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 - CONFIG_XZ_DEC_ARMTHUMB=y -CONFIG_ARM_ARCH_TIMER=y CONFIG_ARCH_HAS_TICK_BROADCAST=y CONFIG_ALWAYS_USE_PERSISTENT_CLOCK=y +# CONFIG_MCPM is not set # CONFIG_OABI_COMPAT is not set -# CONFIG_FPE_NWFPE is not set -# CONFIG_FPE_FASTFPE is not set # CONFIG_APM_EMULATION is not set # CONFIG_CPU_ICACHE_DISABLE is not set # CONFIG_CPU_DCACHE_DISABLE is not set @@ -50,10 +51,12 @@ CONFIG_ALWAYS_USE_PERSISTENT_CLOCK=y # CONFIG_ARM_ERRATA_326103 is not set # CONFIG_ARM_ERRATA_411920 is not set # Cortex-A8 -# CONFIG_ARM_ERRATA_430973 is not set +CONFIG_ARM_ERRATA_430973=y +# The following two don't work with MP # CONFIG_ARM_ERRATA_458693 is not set # CONFIG_ARM_ERRATA_460075 is not set # Cortex-A9 +CONFIG_ARM_ERRATA_643719=y CONFIG_ARM_ERRATA_720789=y CONFIG_ARM_ERRATA_742230=y CONFIG_ARM_ERRATA_742231=y @@ -68,8 +71,9 @@ CONFIG_ARM_ERRATA_775420=y # CONFIG_PL310_ERRATA_727915 is not set CONFIG_PL310_ERRATA_753970=y CONFIG_PL310_ERRATA_769419=y +CONFIG_PJ4B_ERRATA_4742=y # Cortex-A15 -CONFIG_ARM_ERRATA_798181=y +# CONFIG_ARM_ERRATA_798181 is not set # generic that deviates from or should be merged into config-generic CONFIG_SMP=y @@ -82,7 +86,6 @@ CONFIG_SCHED_MC=y CONFIG_SCHED_SMT=y CONFIG_RCU_FANOUT=32 -CONFIG_RCU_FANOUT_LEAF=16 # 2013/04/19 - disable due to stability issues in 3.9 for the moment # CONFIG_CPU_IDLE is not set @@ -90,12 +93,11 @@ CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_CPU_IDLE_GOV_MENU is not set # CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set +# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set + CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 CONFIG_LSM_MMAP_MIN_ADDR=32768 -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y - CONFIG_SECCOMP=y CONFIG_STRICT_DEVMEM=y @@ -108,7 +110,6 @@ CONFIG_SUSPEND=y CONFIG_ARM_CPU_SUSPEND=y CONFIG_LOCAL_TIMERS=y -CONFIG_HW_PERF_EVENTS=y CONFIG_UACCESS_WITH_MEMCPY=y CONFIG_CC_STACKPROTECTOR=y @@ -117,30 +118,19 @@ CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y # Root as NFS, different from mainline -CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y CONFIG_LBDAF=y -CONFIG_COMMON_CLK=y - # Device tree -CONFIG_DTC=y -CONFIG_OF=y CONFIG_USE_OF=y -CONFIG_OF_DEVICE=y -CONFIG_OF_IRQ=y -CONFIG_DMA_OF=y CONFIG_ARM_ATAG_DTB_COMPAT=y CONFIG_ARM_APPENDED_DTB=y CONFIG_PROC_DEVICETREE=y -# CONFIG_OF_SELFTEST is not set CONFIG_SERIAL_OF_PLATFORM=y CONFIG_OF_PCI=y CONFIG_OF_PCI_IRQ=y -CONFIG_OF_GPIO=y CONFIG_I2C_MUX_PINCTRL=m CONFIG_OF_MDIO=m @@ -148,14 +138,13 @@ CONFIG_OF_DISPLAY_TIMING=y CONFIG_OF_VIDEOMODE=y # General vexpress ARM drivers -CONFIG_ARM_AMBA=y CONFIG_ARM_TIMER_SP804=y CONFIG_SERIO_AMBAKMI=m CONFIG_SERIAL_AMBA_PL010=y CONFIG_SERIAL_AMBA_PL010_CONSOLE=y -CONFIG_SERIAL_AMBA_PL011=y -CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_MRST_MAX3110=m CONFIG_RTC_DRV_PL030=y CONFIG_RTC_DRV_PL031=y @@ -180,6 +169,7 @@ CONFIG_SMC91X=m CONFIG_SMC911X=m CONFIG_SMSC911X=m CONFIG_USB_ISP1760_HCD=m +# CONFIG_USB_EHCI_HCD_ORION is not set # Multifunction Devices CONFIG_MFD_SYSCON=y @@ -200,8 +190,6 @@ CONFIG_PINCTRL_SINGLE=m # GPIO CONFIG_GPIO_GENERIC_PLATFORM=m CONFIG_EXTCON_GPIO=m -CONFIG_GENERIC_GPIO=y -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y # CONFIG_GPIO_EM is not set CONFIG_GPIO_ADNP=m CONFIG_GPIO_MCP23S08=m @@ -212,15 +200,16 @@ CONFIG_INPUT_GPIO_TILT_POLLED=m CONFIG_MDIO_BUS_MUX_GPIO=m CONFIG_MDIO_BUS_MUX_MMIOREG=m CONFIG_LEDS_GPIO=m -CONFIG_GPIOLIB=y CONFIG_GPIO_MAX7301=m CONFIG_GPIO_MC33880=m CONFIG_GPIO_74X164=m CONFIG_GPIO_TPS65912=m +# CONFIG_GPIO_RCAR is not set CONFIG_W1_MASTER_GPIO=m CONFIG_CHARGER_GPIO=m CONFIG_SPI=y +CONFIG_SPI_MASTER=y CONFIG_SPI_GPIO=m CONFIG_SPI_BITBANG=m CONFIG_SPI_PL022=m @@ -235,6 +224,7 @@ CONFIG_SPI_XCOMM=m CONFIG_SPI_XILINX=m CONFIG_SPI_DESIGNWARE=m CONFIG_SPI_TLE62X0=m +# CONFIG_SPI_FSL_SPI is not set # HW crypto and rng CONFIG_CRYPTO_SHA1_ARM=m @@ -265,14 +255,12 @@ CONFIG_EEPROM_AT25=m CONFIG_EEPROM_93XX46=m # MMC/SD -CONFIG_MMC=y -CONFIG_MMC_ARMMMCI=y -CONFIG_MMC_SDHCI_PLTFM=m CONFIG_MMC_SPI=m CONFIG_MMC_DW=m CONFIG_MMC_DW_PLTFM=m CONFIG_MMC_DW_PCI=m CONFIG_SPI_DW_MMIO=m +CONFIG_SPI_DW_PCI=m # CONFIG_MMC_DW_EXYNOS is not set # CONFIG_MMC_DW_IDMAC is not set @@ -285,14 +273,11 @@ CONFIG_SND_DESIGNWARE_I2S=m CONFIG_SND_SIMPLE_CARD=m CONFIG_SND_SOC_CACHE_LZO=y CONFIG_SND_SOC_ALL_CODECS=m +CONFIG_SND_SOC_DMAENGINE_PCM=y +CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y # CONFIG_SND_ATMEL_SOC is not set # Displays -CONFIG_FB_SSD1307=m - -# PWM -CONFIG_PWM=y -CONFIG_BACKLIGHT_PWM=m # RTC CONFIG_RTC_DRV_M41T93=m @@ -345,6 +330,7 @@ CONFIG_SENSORS_GPIO_FAN=m CONFIG_LCD_L4F00242T03=m CONFIG_LCD_LMS283GF05=m CONFIG_LCD_LTV350QV=m +CONFIG_LCD_ILI922X=m CONFIG_LCD_ILI9320=m CONFIG_LCD_TDO24M=m CONFIG_LCD_VGG2432A4=m @@ -354,12 +340,11 @@ CONFIG_LCD_AMS369FG06=m CONFIG_LCD_LMS501KF03=m CONFIG_LCD_HX8357=m -CONFIG_INPUT_PWM_BEEPER=m +# Input CONFIG_INPUT_GP2A=m CONFIG_INPUT_ARIZONA_HAPTICS=m CONFIG_INPUT_MC13783_PWRBUTTON=m - CONFIG_TOUCHSCREEN_ADS7846=m CONFIG_TOUCHSCREEN_AD7877=m CONFIG_TOUCHSCREEN_MC13783=m @@ -369,6 +354,18 @@ CONFIG_LEDS_DAC124S085=m CONFIG_LEDS_PWM=m CONFIG_BMP085_SPI=m +# Display + +CONFIG_CMA=y +# CONFIG_CMA_DEBUG is not set +CONFIG_CMA_SIZE_MBYTES=16 +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 + # Ethernet CONFIG_KS8851=m CONFIG_ENC28J60=m @@ -403,27 +400,20 @@ CONFIG_UBIFS_FS_ZLIB=y # CONFIG_UBIFS_FS_DEBUG is not set # Should be in generic -CONFIG_ETHERNET=y CONFIG_BPF_JIT=y # CONFIG_NET_VENDOR_BROADCOM is not set # CONFIG_NET_VENDOR_CIRRUS is not set # CONFIG_NET_VENDOR_MICROCHIP is not set # CONFIG_PATA_PLATFORM is not set -CONFIG_PERF_EVENTS=y -# CONFIG_RTC_DRV_SNVS is not set # CONFIG_DRM_EXYNOS is not set # CONFIG_DRM_TILCDC is not set # CONFIG_DRM_IMX is not set -# CONFIG_MMC_SDHCI_PXAV3 is not set -# CONFIG_MMC_SDHCI_PXAV2 is not set # CONFIG_CS89x0 is not set # CONFIG_DM9000 is not set # CONFIG_HW_RANDOM_ATMEL is not set # CONFIG_HW_RANDOM_EXYNOS is not set -# CONFIG_I2C_NOMADIK is not set -# CONFIG_LEDS_RENESAS_TPU is not set # CONFIG_MFD_T7L66XB is not set # CONFIG_MFD_TC6387XB is not set # CONFIG_TI_DAC7512 is not set @@ -433,14 +423,16 @@ CONFIG_PERF_EVENTS=y # CONFIG_ARM_CHARLCD is not set # CONFIG_MTD_AFS_PARTS is not set # CONFIG_IP_PNP_RARP is not set -# CONFIG_ASYMMETRIC_KEY_TYPE is not set -# CONFIG_PID_IN_CONTEXTIDR is not set # CONFIG_DEPRECATED_PARAM_STRUCT is not set # CONFIG_LATTICE_ECP3_CONFIG is not set # CONFIG_M25PXX_USE_FAST_READ is not set # CONFIG_SERIAL_MAX3100 is not set # CONFIG_SERIAL_MAX310X is not set # CONFIG_SERIAL_IFX6X60 is not set +# CONFIG_COMMON_CLK_SI5351 is not set +# CONFIG_COMMON_CLK_AXI_CLKGEN is not set +# CONFIG_SPI_TOPCLIFF_PCH is not set +# CONFIG_SPI_PXA2XX is not set # these modules all fail with missing __bad_udelay # http://www.spinics.net/lists/arm/msg15615.html provides some background @@ -459,8 +451,7 @@ CONFIG_PERF_EVENTS=y # CONFIG_MLX4_EN is not set # Debug options. We need to deal with them at some point like x86 -# CONFIG_COMMON_CLK_DEBUG is not set # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_LL is not set -# CONFIG_IRQ_DOMAIN_DEBUG is not set # CONFIG_DEBUG_PINCTRL is not set +# CONFIG_ARM_DT_BL_CPUFREQ is not set diff --git a/freed-ora/current/master/config-armv7-lpae b/freed-ora/current/master/config-armv7-lpae index 15b0d53cd..f17b8616a 100644 --- a/freed-ora/current/master/config-armv7-lpae +++ b/freed-ora/current/master/config-armv7-lpae @@ -1,16 +1,20 @@ # ARM unified arch kernel -CONFIG_CPU_V7=y CONFIG_ARCH_EXYNOS=y CONFIG_ARCH_VIRT=y # CONFIG_ARCH_EXYNOS4 is not set CONFIG_ARCH_EXYNOS5=y +# CONFIG_EXYNOS_ATAGS is not set + CONFIG_ARM_LPAE=y CONFIG_VIRTIO_CONSOLE=m CONFIG_ARM_VIRT_EXT=y CONFIG_VIRTUALIZATION=y +# Cortex-A15 +CONFIG_ARM_ERRATA_798181=y + CONFIG_KVM=y CONFIG_KVM_ARM_HOST=y CONFIG_KVM_ARM_MAX_VCPUS=8 @@ -35,6 +39,10 @@ CONFIG_XEN_GNTDEV=y CONFIG_XEN_GRANT_DEV_ALLOC=m CONFIG_XEN_WDT=m +CONFIG_MACH_EXYNOS5_DT=y +CONFIG_SERIAL_SAMSUNG=y +CONFIG_SERIAL_SAMSUNG_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y CONFIG_S3C_BOOT_ERROR_RESET=y CONFIG_S3C_BOOT_UART_FORCE_FIFO=y CONFIG_S3C_LOWLEVEL_UART_PORT=0 @@ -45,9 +53,11 @@ CONFIG_S3C24XX_PWM=y # CONFIG_SAMSUNG_PM_CHECK is not set CONFIG_SOC_EXYNOS5250=y CONFIG_SOC_EXYNOS5440=y -CONFIG_MACH_EXYNOS5_DT=y CONFIG_ARM_EXYNOS_CPUFREQ=y -CONFIG_SERIAL_SAMSUNG=y +# CONFIG_GENERIC_CPUFREQ_CPU0 is not set +CONFIG_EXYNOS_THERMAL=m + +CONFIG_TCG_TIS_I2C_INFINEON=m CONFIG_I2C_S3C2410=m CONFIG_PINCTRL_EXYNOS=y CONFIG_PINCTRL_EXYNOS5440=y @@ -60,7 +70,7 @@ CONFIG_EXYNOS_VIDEO=y CONFIG_EXYNOS_MIPI_DSI=y CONFIG_EXYNOS_DP=y # CONFIG_EXYNOS_LCD_S6E8AX0 is not set -# CONFIG_DRM_EXYNOS is not set +CONFIG_DRM_EXYNOS=m CONFIG_DRM_EXYNOS_IOMMU=y CONFIG_DRM_EXYNOS_DMABUF=y CONFIG_DRM_EXYNOS_FIMD=y @@ -73,8 +83,12 @@ CONFIG_DRM_EXYNOS_ROTATOR=y CONFIG_DRM_EXYNOS_GSC=y # CONFIG_FB_S3C is not set CONFIG_SND_SOC_SAMSUNG=m -CONFIG_USB_EHCI_S5P=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_S5P=m CONFIG_USB_OHCI_EXYNOS=y +CONFIG_USB_DWC3=m +# CONFIG_USB_DWC3_DEBUG is not set +CONFIG_S3C_DEV_HSMMC=y CONFIG_MMC_SDHCI_S3C=m CONFIG_MMC_SDHCI_S3C_DMA=y CONFIG_RTC_DRV_S3C=m @@ -88,8 +102,26 @@ CONFIG_SENSORS_S3C_RAW=y CONFIG_FB_S3C_DEBUG_REGWRITE=y CONFIG_SND_SOC_SAMSUNG_SMDK_SPDIF=m CONFIG_USB_EHCI_S5P=y -CONFIG_SAMSUNG_USBPHY=y -CONFIG_MMC_DW=y -CONFIG_MMC_DW_PLTFM=y -CONFIG_MMC_DW_PCI=y -CONFIG_MMC_DW_EXYNOS=y +CONFIG_SAMSUNG_USBPHY=m +CONFIG_SAMSUNG_USB2PHY=m +CONFIG_SAMSUNG_USB3PHY=m +CONFIG_MMC_DW=m +CONFIG_MMC_DW_PLTFM=m +CONFIG_MMC_DW_PCI=m +CONFIG_MMC_DW_EXYNOS=m + +# Chromebook +CONFIG_MFD_CROS_EC=m +CONFIG_MFD_CROS_EC_I2C=m +CONFIG_MFD_CROS_EC_SPI=m +CONFIG_KEYBOARD_CROS_EC=m + +# Arndale/Origen +CONFIG_MFD_MAX8997=y +CONFIG_MFD_SEC_CORE=y +CONFIG_REGULATOR_MAX8997=m +CONFIG_REGULATOR_S5M8767=m +CONFIG_COMMON_CLK_MAX77686=m + +# CONFIG_EXYNOS4_SDHCI_CH0_8BIT is not set +# CONFIG_EXYNOS4_SDHCI_CH2_8BIT is not set diff --git a/freed-ora/current/master/config-armv7-tegra b/freed-ora/current/master/config-armv7-tegra deleted file mode 100644 index 20cda8a7b..000000000 --- a/freed-ora/current/master/config-armv7-tegra +++ /dev/null @@ -1,108 +0,0 @@ -CONFIG_ARCH_TEGRA=y - -CONFIG_ARCH_TEGRA_2x_SOC=y -# CONFIG_ARCH_TEGRA_3x_SOC is not set -# CONFIG_ARCH_TEGRA_114_SOC is not set - -# CONFIG_NEON is not set -# These are supported in the LPAE kernel -# CONFIG_ARM_LPAE is not set -# CONFIG_XEN is not set -# CONFIG_VIRTIO_CONSOLE is not set -# CONFIG_ARM_VIRT_EXT is not set -# CONFIG_VIRTUALIZATION is not set - -# CONFIG_MACH_HARMONY is not set -CONFIG_MACH_KAEN=y -CONFIG_MACH_PAZ00=y -CONFIG_MACH_SEABOARD=y -CONFIG_MACH_TEGRA_DT=y -CONFIG_MACH_TRIMSLICE=y -CONFIG_MACH_WARIO=y -CONFIG_MACH_VENTANA=y - -CONFIG_TEGRA_PCI=y -CONFIG_TEGRA_IOMMU_GART=y -CONFIG_TEGRA_IOMMU_SMMU=y - -CONFIG_I2C_TEGRA=m - -# This block is temporary until we work out why the MMC modules don't work as modules -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MMC_SDHCI_OF=y -CONFIG_MMC_SDHCI_TEGRA=y - -CONFIG_TEGRA_SYSTEM_DMA=y -CONFIG_TEGRA_EMC_SCALING_ENABLE=y -CONFIG_TEGRA_AHB=y -CONFIG_TEGRA20_APB_DMA=y -CONFIG_SPI_TEGRA20_SFLASH=m -CONFIG_SPI_TEGRA20_SLINK=m - -CONFIG_KEYBOARD_TEGRA=m -CONFIG_PINCTRL_TEGRA=y -CONFIG_PINCTRL_TEGRA20=y -CONFIG_PINCTRL_TEGRA30=y -CONFIG_USB_EHCI_TEGRA=y -CONFIG_RTC_DRV_TEGRA=y - -CONFIG_SND_SOC_TEGRA=m -CONFIG_SND_SOC_TEGRA_ALC5632=m -CONFIG_SND_SOC_TEGRA_WM8753=m -CONFIG_SND_SOC_TEGRA_WM8903=m -CONFIG_SND_SOC_TEGRA_WM9712=m -CONFIG_SND_SOC_TEGRA_TRIMSLICE=m -CONFIG_SND_SOC_TEGRA30_AHUB=m -CONFIG_SND_SOC_TEGRA30_I2S=m -CONFIG_SND_SOC_TEGRA20_AC97=m - -# AC100 (PAZ00) -CONFIG_MFD_NVEC=y -CONFIG_MFD_TPS80031=y -CONFIG_KEYBOARD_NVEC=y -CONFIG_SERIO_NVEC_PS2=y -CONFIG_NVEC_POWER=y -CONFIG_POWER_SUPPLY=y -CONFIG_NVEC_LEDS=y -CONFIG_NVEC_PAZ00=y - -# CONFIG_MFD_TPS6586X is not set -# CONFIG_RTC_DRV_TPS6586X is not set - -CONFIG_PWM_TEGRA=m - -CONFIG_CMA=y -# CONFIG_CMA_DEBUG is not set -CONFIG_CMA_SIZE_MBYTES=16 -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 - -CONFIG_DRM_TEGRA=m - -CONFIG_CRYPTO_DEV_TEGRA_AES=m - -CONFIG_LEDS_RENESAS_TPU=y - -CONFIG_OF=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIAL_TEGRA=y -CONFIG_OF_GPIO=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y - -# CONFIG_DRM_TEGRA_DEBUG is not set -# CONFIG_TI_DAC7512 is not set -# CONFIG_SPI_TOPCLIFF_PCH is not set -# CONFIG_SPI_DW_PCI is not set -# CONFIG_SPI_PXA2XX is not set -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_PINCTRL_EXYNOS is not set -# CONFIG_PINCTRL_EXYNOS5440 is not set diff --git a/freed-ora/current/master/config-debug b/freed-ora/current/master/config-debug index 43655a1a1..5df2cd620 100644 --- a/freed-ora/current/master/config-debug +++ b/freed-ora/current/master/config-debug @@ -64,6 +64,8 @@ CONFIG_DEBUG_CREDENTIALS=y CONFIG_EXT4_DEBUG=y +CONFIG_XFS_WARN=y + CONFIG_DEBUG_PERF_USE_VMALLOC=y # off in both production debug and nodebug builds, @@ -82,6 +84,8 @@ CONFIG_ATH_DEBUG=y CONFIG_CARL9170_DEBUGFS=y CONFIG_IWLWIFI_DEVICE_TRACING=y +CONFIG_RTLWIFI_DEBUG=y + CONFIG_DEBUG_OBJECTS_WORK=y CONFIG_DMADEVICES_DEBUG=y @@ -100,6 +104,7 @@ CONFIG_KDB_CONTINUE_CATASTROPHIC=0 CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y CONFIG_TEST_LIST_SORT=y +CONFIG_TEST_STRING_HELPERS=m CONFIG_DETECT_HUNG_TASK=y CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 diff --git a/freed-ora/current/master/config-generic b/freed-ora/current/master/config-generic index df7d399a4..4f518a574 100644 --- a/freed-ora/current/master/config-generic +++ b/freed-ora/current/master/config-generic @@ -156,6 +156,7 @@ CONFIG_INFINIBAND_USER_MAD=m CONFIG_INFINIBAND_USER_ACCESS=m CONFIG_INFINIBAND_IPATH=m CONFIG_INFINIBAND_ISER=m +CONFIG_INFINIBAND_ISERT=m CONFIG_INFINIBAND_AMSO1100=m # CONFIG_INFINIBAND_AMSO1100_DEBUG is not set CONFIG_INFINIBAND_CXGB3=m @@ -175,6 +176,7 @@ CONFIG_INFINIBAND_QIB=m CONFIG_BINFMT_ELF=y CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y # CONFIG_BINFMT_AOUT is not set +CONFIG_BINFMT_SCRIPT=y CONFIG_BINFMT_MISC=m # @@ -300,9 +302,10 @@ CONFIG_CISS_SCSI_TAPE=y CONFIG_BLK_DEV_DAC960=m CONFIG_BLK_DEV_DRBD=m CONFIG_BLK_DEV_UMEM=m -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -CONFIG_BLK_DEV_CRYPTOLOOP=m +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_LOOP_MIN_COUNT=0 +# Fedora 18 util-linux is the last release that supports cryptoloop devices +# CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_NVME=m CONFIG_BLK_DEV_OSD=m @@ -337,6 +340,7 @@ CONFIG_HW_RANDOM_VIRTIO=m CONFIG_VIRTIO_CONSOLE=y CONFIG_VHOST_NET=m CONFIG_TCM_VHOST=m +CONFIG_VHOST_SCSI=m # # SCSI device support @@ -434,6 +438,7 @@ CONFIG_SCSI_MPT3SAS_LOGGING=y CONFIG_SCSI_UFSHCD=m CONFIG_SCSI_UFSHCD_PCI=m +# CONFIG_SCSI_UFSHCD_PLATFORM is not set CONFIG_SCSI_MVUMI=m @@ -585,6 +590,12 @@ CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID456=m + +CONFIG_BCACHE=m +# CONFIG_BCACHE_DEBUG is not set +# CONFIG_BCACHE_EDEBUG is not set +# CONFIG_BCACHE_CLOSURES_DEBUG is not set + # CONFIG_MULTICORE_RAID456 is not set CONFIG_ASYNC_RAID6_TEST=m CONFIG_BLK_DEV_DM=y @@ -595,7 +606,7 @@ CONFIG_DM_MIRROR=y CONFIG_DM_MULTIPATH=m CONFIG_DM_SNAPSHOT=y CONFIG_DM_THIN_PROVISIONING=m -CONFIG_DM_CACHE=m +CONFIG_DM_CACHE=m CONFIG_DM_CACHE_MQ=m CONFIG_DM_CACHE_CLEANER=m # CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set @@ -654,6 +665,9 @@ CONFIG_NET=y CONFIG_NET_DMA=y +CONFIG_NETLINK_MMAP=y +CONFIG_NETLINK_DIAG=m + CONFIG_TCP_CONG_ADVANCED=y CONFIG_TCP_CONG_BIC=m CONFIG_TCP_CONG_CUBIC=y @@ -674,7 +688,7 @@ CONFIG_TCP_MD5SIG=y # Networking options # CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set +CONFIG_PACKET_DIAG=m CONFIG_UNIX=y CONFIG_UNIX_DIAG=m CONFIG_NET_KEY=m @@ -1039,6 +1053,7 @@ CONFIG_IP_DCCP_CCID3=y # CONFIG_TIPC=m CONFIG_TIPC_PORTS=8192 +# CONFIG_TIPC_MEDIA_IB is not set # CONFIG_TIPC_ADVANCED is not set # CONFIG_TIPC_DEBUG is not set @@ -1109,6 +1124,8 @@ CONFIG_DNS_RESOLVER=m CONFIG_BATMAN_ADV=m CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_DAT=y +CONFIG_BATMAN_ADV_NC=y + # CONFIG_BATMAN_ADV_DEBUG is not set CONFIG_OPENVSWITCH=m CONFIG_VSOCKETS=m @@ -1135,6 +1152,7 @@ CONFIG_NET_TEAM_MODE_ROUNDROBIN=m CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m CONFIG_NET_TEAM_MODE_LOADBALANCE=m CONFIG_NET_TEAM_MODE_BROADCAST=m +CONFIG_NET_TEAM_MODE_RANDOM=m CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_MACVLAN=m @@ -1216,6 +1234,7 @@ CONFIG_AMD8111_ETH=m CONFIG_PCMCIA_NMCLAN=m CONFIG_NET_VENDOR_ATHEROS=y +CONFIG_ALX=m CONFIG_ATL2=m CONFIG_ATL1=m CONFIG_ATL1C=m @@ -1334,6 +1353,7 @@ CONFIG_YELLOWFIN=m CONFIG_NET_VENDOR_QLOGIC=y CONFIG_QLA3XXX=m CONFIG_QLCNIC=m +CONFIG_QLCNIC_SRIOV=y CONFIG_QLGE=m CONFIG_NETXEN_NIC=m @@ -1524,6 +1544,7 @@ CONFIG_ATH6KL=m CONFIG_ATH6KL_DEBUG=y CONFIG_ATH6KL_SDIO=m CONFIG_ATH6KL_USB=m +# CONFIG_ATH6KL_TRACING is not set CONFIG_AR5523=m CONFIG_ATH9K=m CONFIG_ATH9K_PCI=y @@ -1534,7 +1555,7 @@ CONFIG_ATH9K_DEBUGFS=y CONFIG_ATH9K_HTC=m CONFIG_ATH9K_BTCOEX_SUPPORT=y # CONFIG_ATH9K_HTC_DEBUGFS is not set -CONFIG_ATH9K_RATE_CONTROL=y +# CONFIG_ATH9K_LEGACY_RATE_CONTROL is not set CONFIG_WIL6210=m CONFIG_WIL6210_ISR_COR=y CONFIG_CARL9170=m @@ -1628,6 +1649,7 @@ CONFIG_RT2800USB=m CONFIG_RT2800USB_RT33XX=y CONFIG_RT2800USB_RT35XX=y CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_RT55XX=y CONFIG_RT2800USB_UNKNOWN=y CONFIG_RT2800PCI=m CONFIG_RT2800PCI_RT3290=y @@ -1658,12 +1680,12 @@ CONFIG_WL1251_SPI=m CONFIG_WL1251_SDIO=m CONFIG_RTLWIFI=m -# CONFIG_RTLWIFI_DEBUG is not set CONFIG_RTL8192CE=m CONFIG_RTL8192SE=m CONFIG_RTL8192CU=m CONFIG_RTL8192DE=m CONFIG_RTL8723AE=m +CONFIG_RTL8188EE=m CONFIG_MWIFIEX=m CONFIG_MWIFIEX_SDIO=m @@ -1959,6 +1981,7 @@ CONFIG_INPUT_POLLDEV=m CONFIG_INPUT_SPARSEKMAP=m # CONFIG_INPUT_ADXL34X is not set # CONFIG_INPUT_BMA150 is not set +# CONFIG_INPUT_IMS_PCU is not set CONFIG_INPUT_CMA3000=m CONFIG_INPUT_CMA3000_I2C=m @@ -1977,6 +2000,7 @@ CONFIG_SERIO_RAW=m CONFIG_SERIO_ALTERA_PS2=m # CONFIG_SERIO_PS2MULT is not set CONFIG_SERIO_ARC_PS2=m +# CONFIG_SERIO_APBPS2 is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set @@ -2130,6 +2154,7 @@ CONFIG_N_HDLC=m CONFIG_N_GSM=m # CONFIG_TRACE_SINK is not set # CONFIG_STALDRV is not set +# CONFIG_DUMMY_IRQ is not set # CONFIG_IBM_ASM is not set CONFIG_TIFM_CORE=m CONFIG_TIFM_7XX1=m @@ -2264,6 +2289,7 @@ CONFIG_SENSORS_ADM1026=m CONFIG_SENSORS_ADM1029=m CONFIG_SENSORS_ADM1031=m CONFIG_SENSORS_ADM9240=m +CONFIG_SENSORS_ADT7310=m CONFIG_SENSORS_ADT7410=m CONFIG_SENSORS_ADS7828=m CONFIG_SENSORS_ADT7462=m @@ -2305,11 +2331,13 @@ CONFIG_SENSORS_LM87=m CONFIG_SENSORS_LM90=m CONFIG_SENSORS_LM92=m CONFIG_SENSORS_LM93=m +CONFIG_SENSORS_LM95234=m CONFIG_SENSORS_LTC4245=m CONFIG_SENSORS_MAX1619=m CONFIG_SENSORS_MAX6650=m CONFIG_SENSORS_MAX6697=m CONFIG_SENSORS_MCP3021=m +CONFIG_SENSORS_NCT6775=m CONFIG_SENSORS_NTC_THERMISTOR=m CONFIG_SENSORS_PC87360=m CONFIG_SENSORS_PC87427=m @@ -2394,6 +2422,7 @@ CONFIG_SENSORS_MAX197=m # CONFIG_PCH_PHUB is not set # CONFIG_SERIAL_PCH_UART is not set # CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_SRAM is not set CONFIG_SERIAL_ARC=m CONFIG_SERIAL_ARC_NR_PORTS=1 # CONFIG_SERIAL_RP2 is not set @@ -2408,6 +2437,7 @@ CONFIG_W1_MASTER_DS1WM=m CONFIG_W1_SLAVE_THERM=m CONFIG_W1_SLAVE_SMEM=m CONFIG_W1_SLAVE_DS2408=m +# CONFIG_W1_SLAVE_DS2408_READBACK is not set CONFIG_W1_SLAVE_DS2413=m CONFIG_W1_SLAVE_DS2423=m CONFIG_W1_SLAVE_DS2431=m @@ -2742,6 +2772,7 @@ CONFIG_DVB_BUDGET_CORE=m CONFIG_DVB_PLUTO2=m CONFIG_SMS_SIANO_MDTV=m CONFIG_SMS_SIANO_RC=y +# CONFIG_SMS_SIANO_DEBUGFS is not set CONFIG_MEDIA_SUBDRV_AUTOSELECT=y CONFIG_SMS_USB_DRV=m CONFIG_SMS_SDIO_DRV=m @@ -2918,6 +2949,7 @@ CONFIG_FB_I810_I2C=y # CONFIG_FB_S1D13XXX is not set # CONFIG_FB_S3 is not set # CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIMPLE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_SM501 is not set # CONFIG_FB_SMSCUFX is not set @@ -3144,6 +3176,7 @@ CONFIG_USB_SUPPORT=y # Deprecated. # CONFIG_USB_DEVICEFS is not set +CONFIG_USB_DEFAULT_PERSIST=y # CONFIG_USB_DYNAMIC_MINORS is not set CONFIG_USB_SUSPEND=y @@ -3282,6 +3315,7 @@ CONFIG_HID_SAITEK=m CONFIG_HID_TIVO=m CONFIG_HID_GENERIC=y CONFIG_HID_AUREAL=m +CONFIG_HID_APPLEIR=m # @@ -3359,6 +3393,7 @@ CONFIG_USB_HSO=m CONFIG_USB_KAWETH=m CONFIG_USB_PEGASUS=m CONFIG_USB_RTL8150=m +CONFIG_USB_RTL8152=m CONFIG_USB_USBNET=m CONFIG_USB_SPEEDTOUCH=m CONFIG_USB_NET_AX8817X=m @@ -3451,6 +3486,7 @@ CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_MOS7720=m CONFIG_USB_SERIAL_MOS7715_PARPORT=y # CONFIG_USB_SERIAL_ZIO is not set +# CONFIG_USB_SERIAL_WISHBONE is not set # CONFIG_USB_SERIAL_ZTE is not set CONFIG_USB_SERIAL_MOS7840=m CONFIG_USB_SERIAL_MOTOROLA=m @@ -3493,9 +3529,16 @@ CONFIG_USB_ADUTUX=m CONFIG_USB_SEVSEG=m CONFIG_USB_ALI_M5632=y CONFIG_USB_APPLEDISPLAY=m + +# Physical Layer USB driver +CONFIG_USB_PHY=y + # CONFIG_OMAP_USB2 is not set # CONFIG_OMAP_USB3 is not set # CONFIG_OMAP_CONTROL_USB is not set +# CONFIG_SAMSUNG_USBPHY is not set +# CONFIG_SAMSUNG_USB2PHY is not set +# CONFIG_SAMSUNG_USB3PHY is not set CONFIG_USB_RCAR_PHY=m CONFIG_USB_ATM=m CONFIG_USB_CXACRU=m @@ -3543,6 +3586,8 @@ CONFIG_USB_UEAGLEATM=m CONFIG_USB_XUSBATM=m CONFIG_USB_ZERO=m +# CONFIG_USB_DWC2 is not set + CONFIG_USB_ANNOUNCE_NEW_DEVICES=y # CONFIG_USB_ISP1301 is not set @@ -3608,6 +3653,10 @@ CONFIG_MFD_VIPERBOARD=m # CONFIG_MFD_MC13XXX_I2C is not set # CONFIG_MFD_ARIZONA is not set # CONFIG_MFD_ARIZONA_I2C is not set +# CONFIG_MFD_CROS_EC is not set +# CONFIG_MFD_SI476X_CORE is not set +# CONFIG_MFD_TPS65912 is not set +# CONFIG_MFD_SYSCON is not set # # File systems @@ -3807,6 +3856,8 @@ CONFIG_BTRFS_FS=m CONFIG_BTRFS_FS_POSIX_ACL=y # Maybe see if we want this on for debug kernels? # CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set +# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set +# CONFIG_BTRFS_DEBUG is not set CONFIG_CONFIGFS_FS=y @@ -4004,6 +4055,8 @@ CONFIG_AUDITSYSCALL=y # http://lists.fedoraproject.org/pipermail/kernel/2013-February/004125.html CONFIG_AUDIT_LOGINUID_IMMUTABLE=y +# CONFIG_SSBI is not set + # # Cryptographic options # @@ -4037,6 +4090,7 @@ CONFIG_CRYPTO_ECB=y CONFIG_CRYPTO_FCRYPT=m CONFIG_CRYPTO_GCM=m CONFIG_CRYPTO_GF128MUL=m +CONFIG_CRYPTO_CMAC=m CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_KHAZAD=m CONFIG_CRYPTO_LRW=m @@ -4145,8 +4199,8 @@ CONFIG_CGROUP_DEVICE=y CONFIG_CGROUP_FREEZER=y CONFIG_CGROUP_SCHED=y CONFIG_MEMCG=y -CONFIG_MEMCG_SWAP=y # XXX disabled by default, pass 'swapaccount' -# CONFIG_MEMCG_SWAP_ENABLED is not set +CONFIG_MEMCG_SWAP=y +CONFIG_MEMCG_SWAP_ENABLED=y CONFIG_MEMCG_KMEM=y # CONFIG_CGROUP_HUGETLB is not set CONFIG_CGROUP_PERF=y @@ -4251,6 +4305,7 @@ CONFIG_SND_INDIGODJX=m CONFIG_BALLOON_COMPACTION=y CONFIG_COMPACTION=y CONFIG_MIGRATION=y +CONFIG_BOUNCE=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y # CONFIG_LEDS_AMS_DELTA is not set @@ -4276,6 +4331,7 @@ CONFIG_LEDS_TRIGGER_BACKLIGHT=m # CONFIG_LEDS_TRIGGER_CPU is not set CONFIG_LEDS_TRIGGER_DEFAULT_ON=m CONFIG_LEDS_TRIGGER_TRANSIENT=m +CONFIG_LEDS_TRIGGER_CAMERA=m CONFIG_LEDS_ALIX2=m CONFIG_LEDS_CLEVO_MAIL=m CONFIG_LEDS_INTEL_SS4200=m @@ -4286,6 +4342,7 @@ CONFIG_LEDS_BLINKM=m CONFIG_LEDS_LP3944=m CONFIG_LEDS_LP5521=m CONFIG_LEDS_LP5523=m +CONFIG_LEDS_LP5562=m CONFIG_LEDS_LT3593=m CONFIG_LEDS_REGULATOR=m CONFIG_LEDS_TRIGGER_GPIO=m @@ -4310,12 +4367,14 @@ CONFIG_DYNAMIC_FTRACE=y CONFIG_SCHED_TRACER=y CONFIG_CONTEXT_SWITCH_TRACER=y CONFIG_TRACER_SNAPSHOT=y +# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set CONFIG_FTRACE_SYSCALLS=y CONFIG_FTRACE_MCOUNT_RECORD=y # CONFIG_FTRACE_STARTUP_TEST is not set # CONFIG_TRACE_BRANCH_PROFILING is not set CONFIG_FUNCTION_PROFILER=y CONFIG_RING_BUFFER_BENCHMARK=m +# CONFIG_RING_BUFFER_STARTUP_TEST is not set # CONFIG_RBTREE_TEST is not set # CONFIG_INTERVAL_TREE_TEST is not set CONFIG_FUNCTION_TRACER=y @@ -4583,6 +4642,7 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_RCU_TRACE is not set # CONFIG_RCU_CPU_STALL_INFO is not set +# CONFIG_RCU_USER_QS is not set CONFIG_SPARSE_RCU_POINTER=y CONFIG_KSM=y @@ -4652,6 +4712,7 @@ CONFIG_GPIO_VIPERBOARD=m # CONFIG_GPIO_AMD8111 is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_SX150X is not set +# CONFIG_GPIO_GRGPIO is not set # FIXME: Why? CONFIG_EVENT_POWER_TRACING_DEPRECATED=y @@ -4706,6 +4767,8 @@ CONFIG_IOMMU_SUPPORT=y # CONFIG_MAILBOX is not set +# CONFIG_RESET_CONTROLLER is not set + # CONFIG_HSI is not set # CONFIG_PM_DEVFREQ is not set diff --git a/freed-ora/current/master/config-nodebug b/freed-ora/current/master/config-nodebug index aa7568c82..80c8a5f02 100644 --- a/freed-ora/current/master/config-nodebug +++ b/freed-ora/current/master/config-nodebug @@ -68,6 +68,8 @@ CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1 # CONFIG_EXT4_DEBUG is not set +# CONFIG_XFS_WARN is not set + # CONFIG_DEBUG_PERF_USE_VMALLOC is not set # CONFIG_JBD2_DEBUG is not set @@ -82,6 +84,8 @@ CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1 # CONFIG_CARL9170_DEBUGFS is not set # CONFIG_IWLWIFI_DEVICE_TRACING is not set +# CONFIG_RTLWIFI_DEBUG is not set + # CONFIG_DEBUG_OBJECTS_WORK is not set # CONFIG_DMADEVICES_DEBUG is not set @@ -100,6 +104,7 @@ CONFIG_KDB_CONTINUE_CATASTROPHIC=0 # CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set # CONFIG_TEST_LIST_SORT is not set +# CONFIG_TEST_STRING_HELPERS is not set # CONFIG_DETECT_HUNG_TASK is not set CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 diff --git a/freed-ora/current/master/config-powerpc-generic b/freed-ora/current/master/config-powerpc-generic index b6df88ea8..2dcab485d 100644 --- a/freed-ora/current/master/config-powerpc-generic +++ b/freed-ora/current/master/config-powerpc-generic @@ -385,6 +385,8 @@ CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_OF_DISPLAY_TIMING is not set # CONFIG_OF_VIDEOMODE is not set +# CONFIG_POWERNV_MSI is not set + CONFIG_POWER_RESET_GPIO=y CONFIG_FB_SSD1307=m CONFIG_INPUT_PWM_BEEPER=m diff --git a/freed-ora/current/master/config-powerpc64 b/freed-ora/current/master/config-powerpc64 index d0e0aab5b..34297ec97 100644 --- a/freed-ora/current/master/config-powerpc64 +++ b/freed-ora/current/master/config-powerpc64 @@ -12,6 +12,7 @@ CONFIG_PPC_MAPLE=y CONFIG_PPC_PSERIES=y CONFIG_PPC_PMAC=y CONFIG_PPC_POWERNV=y +CONFIG_POWERNV_MSI=y CONFIG_PPC_POWERNV_RTAS=y # CONFIG_PPC_PASEMI is not set # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set @@ -144,6 +145,7 @@ CONFIG_EVENT_PROFILE=y CONFIG_KVM_BOOK3S_64=m CONFIG_KVM_BOOK3S_64_HV=y # CONFIG_KVM_EXIT_TIMING is not set +CONFIG_KVM_XICS=y #-- bz#607175 #-- active memory sharing diff --git a/freed-ora/current/master/config-powerpc64p7 b/freed-ora/current/master/config-powerpc64p7 index 285d9fff9..d22fbbf02 100644 --- a/freed-ora/current/master/config-powerpc64p7 +++ b/freed-ora/current/master/config-powerpc64p7 @@ -8,6 +8,7 @@ CONFIG_POWER7_CPU=y CONFIG_PPC_PSERIES=y # CONFIG_PPC_PMAC is not set CONFIG_PPC_POWERNV=y +CONFIG_POWERNV_MSI=y CONFIG_PPC_POWERNV_RTAS=y # CONFIG_PPC_PASEMI is not set # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set @@ -135,6 +136,7 @@ CONFIG_EVENT_PROFILE=y CONFIG_KVM_BOOK3S_64=m CONFIG_KVM_BOOK3S_64_HV=y # CONFIG_KVM_EXIT_TIMING is not set +CONFIG_KVM_XICS=y #-- bz#607175 #-- active memory sharing diff --git a/freed-ora/current/master/config-x86-32-generic b/freed-ora/current/master/config-x86-32-generic index 6b6c60d30..1ee7325d8 100644 --- a/freed-ora/current/master/config-x86-32-generic +++ b/freed-ora/current/master/config-x86-32-generic @@ -1,6 +1,6 @@ # CONFIG_64BIT is not set -CONFIG_X86_32_NON_STANDARD=y +# CONFIG_X86_32_NON_STANDARD is not set # CONFIG_X86_ELAN is not set # CONFIG_X86_GOLDFISH is not set diff --git a/freed-ora/current/master/config-x86-generic b/freed-ora/current/master/config-x86-generic index 7820755c7..42c0d09fe 100644 --- a/freed-ora/current/master/config-x86-generic +++ b/freed-ora/current/master/config-x86-generic @@ -29,7 +29,7 @@ CONFIG_PNP=y CONFIG_MTRR=y CONFIG_MTRR_SANITIZER=y -CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1 +CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0 CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1 CONFIG_X86_PAT=y CONFIG_X86_PM_TIMER=y @@ -37,6 +37,7 @@ CONFIG_X86_PM_TIMER=y CONFIG_EFI=y CONFIG_EFI_STUB=y CONFIG_EFI_VARS=y +CONFIG_EFIVAR_FS=y CONFIG_EFI_VARS_PSTORE=y CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE=y CONFIG_EFI_PCDP=y @@ -102,6 +103,7 @@ CONFIG_X86_ACPI_CPUFREQ=m CONFIG_X86_ACPI_CPUFREQ_CPB=y CONFIG_X86_PCC_CPUFREQ=m CONFIG_X86_POWERNOW_K8=m +CONFIG_X86_AMD_FREQ_SENSITIVITY=m CONFIG_X86_P4_CLOCKMOD=m # CONFIG_X86_SPEEDSTEP_CENTRINO is not set @@ -242,10 +244,11 @@ CONFIG_VIRTUALIZATION=y CONFIG_KVM=m CONFIG_KVM_INTEL=m CONFIG_KVM_AMD=m +CONFIG_KVM_DEVICE_ASSIGNMENT=y CONFIG_LGUEST=m CONFIG_LGUEST_GUEST=y -CONFIG_PARAVIRT_GUEST=y +CONFIG_HYPERVISOR_GUEST=y CONFIG_PARAVIRT=y CONFIG_PARAVIRT_TIME_ACCOUNTING=y # CONFIG_PARAVIRT_DEBUG is not set @@ -420,6 +423,7 @@ CONFIG_HID_HYPERV_MOUSE=m CONFIG_HYPERV_NET=m CONFIG_HYPERV_STORAGE=m CONFIG_HYPERV_BALLOON=m +CONFIG_FB_HYPERV=m # Depends on HOTPLUG_PCI_PCIE CONFIG_BLK_DEV_PCIESSD_MTIP32XX=m @@ -433,6 +437,10 @@ CONFIG_RCU_FANOUT_LEAF=16 CONFIG_INTEL_MEI=m CONFIG_INTEL_MEI_ME=y +CONFIG_NFC_MEI_PHY=m +CONFIG_NFC_PN544_MEI=m +CONFIG_NFC_MICROREAD_MEI=m + # Maybe enable in debug kernels? # CONFIG_DEBUG_NMI_SELFTEST is not set @@ -459,3 +467,4 @@ CONFIG_MODULE_SIG_UEFI=y CONFIG_VMXNET3=m CONFIG_VFIO_PCI_VGA=y +CONFIG_PVPANIC=m diff --git a/freed-ora/current/master/config-x86_64-generic b/freed-ora/current/master/config-x86_64-generic index 92f283073..5b6b32b47 100644 --- a/freed-ora/current/master/config-x86_64-generic +++ b/freed-ora/current/master/config-x86_64-generic @@ -34,7 +34,7 @@ CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_KEXEC_JUMP=y CONFIG_ACPI_BLACKLIST_YEAR=0 -CONFIG_ACPI_HOTPLUG_MEMORY=m +CONFIG_ACPI_HOTPLUG_MEMORY=y # CONFIG_INTEL_SCU_IPC is not set @@ -47,14 +47,20 @@ CONFIG_CRYPTO_TWOFISH_X86_64=m CONFIG_CRYPTO_SALSA20_X86_64=m CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m CONFIG_CRYPTO_SHA1_SSSE3=m +CONFIG_CRYPTO_SHA256_SSSE3=m +CONFIG_CRYPTO_SHA512_SSSE3=m CONFIG_CRYPTO_BLOWFISH_X86_64=m +CONFIG_CRYPTO_BLOWFISH_AVX2_X86_64=m CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m CONFIG_CRYPTO_CAMELLIA_X86_64=m +CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=m +CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=m CONFIG_CRYPTO_CAST5_AVX_X86_64=m CONFIG_CRYPTO_CAST6_AVX_X86_64=m CONFIG_CRYPTO_SERPENT_AVX_X86_64=m +CONFIG_CRYPTO_SERPENT_AVX2_X86_64=m CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m -CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=m +CONFIG_CRYPTO_TWOFISH_AVX2_X86_64=m # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set diff --git a/freed-ora/current/master/cve-2013-2147-ciss-info-leak.patch b/freed-ora/current/master/cve-2013-2147-ciss-info-leak.patch new file mode 100644 index 000000000..ee49d3bfb --- /dev/null +++ b/freed-ora/current/master/cve-2013-2147-ciss-info-leak.patch @@ -0,0 +1,27 @@ +diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c +index 639d26b..2b94403 100644 +--- a/drivers/block/cpqarray.c ++++ b/drivers/block/cpqarray.c +@@ -1193,6 +1193,7 @@ out_passthru: + ida_pci_info_struct pciinfo; + + if (!arg) return -EINVAL; ++ memset(&pciinfo, 0, sizeof(pciinfo)); + pciinfo.bus = host->pci_dev->bus->number; + pciinfo.dev_fn = host->pci_dev->devfn; + pciinfo.board_id = host->board_id; + + diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c +index 6374dc1..34971aa 100644 +--- a/drivers/block/cciss.c ++++ b/drivers/block/cciss.c +@@ -1201,6 +1201,7 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode, + int err; + u32 cp; + ++ memset(&arg64, 0, sizeof(arg64)); + err = 0; + err |= + copy_from_user(&arg64.LUN_info, &arg32->LUN_info, + +
\ No newline at end of file diff --git a/freed-ora/current/master/deblob-3.9 b/freed-ora/current/master/deblob-3.10 index 684190ae7..21f528ef3 100755 --- a/freed-ora/current/master/deblob-3.9 +++ b/freed-ora/current/master/deblob-3.10 @@ -48,7 +48,7 @@ # For each kver release, start extra with an empty string, then count # from 1 if changes are needed that require rebuilding the tarball. -kver=3.9 extra= +kver=3.10 extra= case $1 in --force) @@ -598,6 +598,8 @@ reject_firmware drivers/gpu/drm/radeon/ni.c clean_blob drivers/gpu/drm/radeon/ni.c reject_firmware drivers/gpu/drm/radeon/si.c clean_blob drivers/gpu/drm/radeon/si.c +reject_firmware drivers/gpu/drm/radeon/radeon_uvd.c +clean_blob drivers/gpu/drm/radeon/radeon_uvd.c clean_kconfig drivers/gpu/drm/Kconfig 'DRM_RADEON' clean_mk CONFIG_DRM_RADEON drivers/gpu/drm/Makefile @@ -966,7 +968,7 @@ reject_firmware drivers/media/pci/pluto2/pluto2.c announce SMS_SIANO_MDTV - "Siano SMS1xxx based MDTV receiver" reject_firmware drivers/media/common/siano/smscoreapi.c clean_blob drivers/media/common/siano/smscoreapi.c -clean_blob drivers/media/common/siano/sms-cards.c +clean_blob drivers/media/common/siano/smscoreapi.h clean_kconfig drivers/media/common/siano/Kconfig 'SMS_SIANO_MDTV' clean_mk CONFIG_SMS_SIANO_MDTV drivers/media/common/siano/Makefile @@ -1054,6 +1056,12 @@ clean_blob drivers/media/usb/em28xx/em28xx-dvb.c clean_kconfig drivers/media/usb/em28xx/Kconfig 'VIDEO_EM28XX_DVB' clean_mk CONFIG_VIDEO_EM28XX_DVB drivers/media/usb/em28xx/Makefile +announce VIDEO_EXYNOS4_FIMC_IS - "EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver" +reject_firmware drivers/media/platform/exynos4-is/fimc-is.c +clean_blob drivers/media/platform/exynos4-is/fimc-is.h +clean_kconfig drivers/media/platform/exynos4-is/Kconfig 'VIDEO_EXYNOS4_FIMC_IS' +clean_mk CONFIG_VIDEO_EXYNOS4_FIMC_IS drivers/media/platform/exynos4-is/Makefile + announce VIDEO_IVTV - "Conexant cx23416/cx23415 MPEG encoder/decoder support" reject_firmware drivers/media/pci/ivtv/ivtv-firmware.c clean_blob drivers/media/pci/ivtv/ivtv-firmware.c @@ -1073,14 +1081,14 @@ announce VIDEO_GO7007 - "Go 7007 support" reject_firmware drivers/staging/media/go7007/go7007-driver.c clean_blob drivers/staging/media/go7007/go7007-driver.c reject_firmware drivers/staging/media/go7007/go7007-fw.c -clean_blob drivers/staging/media/go7007/go7007-usb.c +clean_blob drivers/staging/media/go7007/go7007-fw.c clean_blob drivers/staging/media/go7007/saa7134-go7007.c clean_kconfig drivers/staging/media/go7007/Kconfig 'VIDEO_GO7007' clean_mk CONFIG_VIDEO_GO7007 drivers/staging/media/go7007/Makefile announce VIDEO_GO7007_USB_S2250_BOARD - "Sensoray 2250/2251 support" -reject_firmware drivers/staging/media/go7007/s2250-loader.c -clean_blob drivers/staging/media/go7007/s2250-loader.c +reject_firmware drivers/staging/media/go7007/go7007-loader.c +clean_blob drivers/staging/media/go7007/go7007-loader.c clean_kconfig drivers/staging/media/go7007/Kconfig 'VIDEO_GO7007_USB_S2250_BOARD' clean_mk CONFIG_VIDEO_GO7007_USB_S2250_BOARD drivers/staging/media/go7007/Makefile @@ -1580,11 +1588,11 @@ clean_mk CONFIG_IWL3945 drivers/net/wireless/iwlegacy/Makefile announce IWLWIFI - "Intel Wireless WiFi Next Gen AGN" reject_firmware drivers/net/wireless/iwlwifi/iwl-drv.c clean_blob drivers/net/wireless/iwlwifi/iwl-drv.c -clean_blob drivers/net/wireless/iwlwifi/pcie/5000.c -clean_blob drivers/net/wireless/iwlwifi/pcie/6000.c -clean_blob drivers/net/wireless/iwlwifi/pcie/7000.c -clean_blob drivers/net/wireless/iwlwifi/pcie/1000.c -clean_blob drivers/net/wireless/iwlwifi/pcie/2000.c +clean_blob drivers/net/wireless/iwlwifi/iwl-5000.c +clean_blob drivers/net/wireless/iwlwifi/iwl-6000.c +clean_blob drivers/net/wireless/iwlwifi/iwl-7000.c +clean_blob drivers/net/wireless/iwlwifi/iwl-1000.c +clean_blob drivers/net/wireless/iwlwifi/iwl-2000.c clean_kconfig drivers/net/wireless/iwlwifi/Kconfig 'IWLWIFI' clean_mk CONFIG_IWLWIFI drivers/net/wireless/iwlwifi/Makefile @@ -1745,6 +1753,12 @@ clean_blob drivers/net/wireless/rt2x00/rt2800usb.c clean_kconfig drivers/net/wireless/rt2x00/Kconfig RT2800USB clean_mk CONFIG_RT2800USB drivers/net/wireless/rt2x00/Makefile +announce RTL8188EE - "Realtek RTL8188EE Wireless Network Adapter" +reject_firmware drivers/net/wireless/rtlwifi/rtl8188ee/sw.c +clean_blob drivers/net/wireless/rtlwifi/rtl8188ee/sw.c +clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8188EE +clean_mk CONFIG_RTL8188EE drivers/net/wireless/rtlwifi/rtl8188ee/Makefile + announce RTL8192CE - "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" reject_firmware drivers/net/wireless/rtlwifi/rtl8192ce/sw.c clean_blob drivers/net/wireless/rtlwifi/rtl8192ce/sw.c @@ -1865,6 +1879,12 @@ clean_blob drivers/bluetooth/bt3c_cs.c clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBT3C' clean_mk CONFIG_BT_HCIBT3C drivers/bluetooth/Makefile +announce BT_HCIBTUSB - "HCI USB driver" +reject_firmware drivers/bluetooth/btusb.c +clean_blob drivers/bluetooth/btusb.c +clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBTUSB' +clean_mk CONFIG_BT_HCIBTUSB drivers/bluetooth/Makefile + announce BT_MRVL_SDIO - "Marvell BT-over-SDIO driver" reject_firmware drivers/bluetooth/btmrvl_sdio.c clean_blob drivers/bluetooth/btmrvl_sdio.c @@ -2030,6 +2050,12 @@ clean_blob drivers/staging/media/lirc/lirc_zilog.c clean_kconfig drivers/staging/media/lirc/Kconfig 'LIRC_ZILOG' clean_mk CONFIG_LIRC_ZILOG drivers/staging/media/lirc/Makefile +announce INPUT_IMS_PCU - "IMS Passenger Control Unit driver" +reject_firmware drivers/input/misc/ims-pcu.c +clean_blob drivers/input/misc/ims-pcu.c +clean_kconfig drivers/input/misc/Kconfig 'INPUT_IMS_PCU' +clean_mk CONFIG_INPUT_IMS_PCU drivers/input/misc/Makefile + #################### # Data acquisition # #################### @@ -2139,7 +2165,7 @@ clean_mk CONFIG_SCSI_BFA_FC drivers/scsi/bfa/Makefile announce SCSI_CHELSIO_FCOE - "Chelsio Communications FCoE support" reject_firmware drivers/scsi/csiostor/csio_hw.c -clean_blob drivers/scsi/csiostor/csio_hw.h +clean_blob drivers/scsi/csiostor/csio_hw_chip.h clean_blob drivers/scsi/csiostor/csio_init.c clean_kconfig drivers/scsi/csiostor/Kconfig 'SCSI_CHELSIO_FCOE' clean_mk CONFIG_SCSI_CHELSIO_FCOE drivers/scsi/csiostor/Makefile diff --git a/freed-ora/current/master/deblob-check b/freed-ora/current/master/deblob-check index ce469b9cb..06f7f9749 100755 --- a/freed-ora/current/master/deblob-check +++ b/freed-ora/current/master/deblob-check @@ -1,6 +1,6 @@ #! /bin/sh -# deblob-check version 2013-04-28 +# deblob-check version 2013-07-01 # Inspired in gNewSense's find-firmware script. # Written by Alexandre Oliva <lxoliva@fsfla.org> @@ -891,7 +891,7 @@ set_except () { blobna 'DEFAULT_FIRMWARE' blobna '\([.]\|->\)firmware[ \n]*=[^=]' blobna 'mod_firmware_load' # sound/ - blobname '[.]\(fw\|bin[0-9]*\|hex\|frm\|co[dx]\|dat\|elf\|xlx\|rfb\|ucode\|img\|sbcf\|ctx\(prog\|vals\)\|z77\|wfw\)["]' + blobname '[.]\(fw\|bin[0-9]*\|hex\|frm\|co[dx]\|dat\|elf\|xlx\|rfb\|ucode\|img\|sbcf\|ctx\(prog\|vals\)\|z77\|wfw\|inp\)["]' # Ideally we'd whitelist URLs that don't recommend non-Free # Software, but there are just too many URLs in Linux, and most are # fine, so we just blacklist when we find undesirable URLs. @@ -3104,7 +3104,7 @@ set_except () { accept '[ ][ ]\.download_firmware[ ]=[ ]af9035_download_firmware\(_it9135\)\?[,][\n][ ][ ]\.firmware[ ]=[ ]' drivers/media/dvb/dvb-usb/af9035.c blobname 'rtl_nic[/]rtl8402-1\.fw' drivers/net/ethernet/realtek/r8169.c blobname 'rtl_nic[/]rtl8411-1\.fw' drivers/net/ethernet/realtek/r8169.c - blobname 'bdata\(\.SD31\|\.DB132\)\?\.bin' drivers/net/wireless/ath/ath6kl/core.h + blobname 'bdata\(\.\(SD3[12]\|WB31\|CUSTOM\|DB132\)\)\?\.bin' drivers/net/wireless/ath/ath6kl/core.h blobname 'mrvl[/]sd8786_uapsta\.bin' 'drivers/net/wireless/mwifiex/sdio\.[ch]' accept '[ ][ ][*][ ]the[ ]isl3886[+]net2280' drivers/net/wireless/p54/p54usb.c @@ -3263,6 +3263,15 @@ set_except () { accept '[ ]ret[ ]=[ ]request_firmware_nowait[(]THIS_MODULE[,][ ]true[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[,][ ]GFP_KERNEL[,][\n][ ]*hif_dev[,][ ]ath9k_hif_usb_firmware_cb[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c accept '[ ]ret[ ]=[ ]request_firmware[(][&]hif_dev->firmware[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c accept '[ ][ ]ret[ ]=[ ]request_firmware[(][&]fw[,][ ]hif_dev->fw_name[,][\n][ ]*[&]hif_dev->udev->dev[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c + # as in 2.6.39 + accept '[#]define[ ]FIRMWARE_AR7010[ ]*["]ar7010\.fw["]' drivers/net/wireless/ath/ath9k/hif_usb.c + accept '[#]define[ ]FIRMWARE_AR7010_1_1[ ]*["]ar7010_1_1\.fw["]' drivers/net/wireless/ath/ath9k/hif_usb.c + accept '[#]define[ ]FIRMWARE_AR9271[ ]*["]ar9271\.fw["]' drivers/net/wireless/ath/ath9k/hif_usb.c + accept 'MODULE_FIRMWARE[(]FIRMWARE_AR7010[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c + # as in 2.6.35 + accept '[ ]ATH9K_FW_USB_DEV[(]0x\(9271\|1006\)[,][ ]["]ar9271\.fw["][)][,]' drivers/net/wireless/ath/ath9k/hif_usb.c + accept '[ ]dev_info[(][&]hif_dev->udev->dev[,][ ]["]ath9k_htc:[^\n"]*["][,][\n][ ]*["]ar9271\.fw["][,]' drivers/net/wireless/ath/ath9k/hif_usb.c + accept '[ ]ret[ ]=[ ]request_firmware[(][&]hif_dev->firmware[,][ ]fw_name[,][ ][&]hif_dev->udev->dev[)][;]' drivers/net/wireless/ath/ath9k/hif_usb.c # New in 3.9 blobname 'imx[/]sdma[/]sdma-imx6q\.bin' arch/arm/boot/dts/imx6qdl.dtsi @@ -3315,12 +3324,85 @@ set_except () { defsnc 'static[ ]unsigned[ ]int[ ]\(voice_focus\|mic_svm\|equalizer\)_vals_lookup\[\][ ]=' sound/pci/hda/patch_ca0132.c defsnc 'static[ ]struct[ ]hda_verb[ ]ca0132_init_verbs0\[\][ ]=' sound/pci/hda/patch_ca0132.c defsnc 'static[ ]const[ ]int[ ]dmic_comp\[6\]\[6\][ ]=' sound/soc/codecs/max98090.c + + # New in 3.10 + accept '[ \t]*edid[ ]=[ ]\[00[ ]FF[ 0-9A-F\n\t]*\]' arch/powerpc/boot/dts/ac14xx.dts + accept 'K256:[\n][\t]\.long[ ]0x428a2f98[,][0-9a-f0x,]*\([\n][\t]\.long[ ][0-9a-f0x,]*\)*' arch/x86/crypto/sha256-avx-asm.S + accept 'K256:[\n][\t]\.long[\t]0x428a2f98[,][0-9a-f0x,]*\([\n][\t]\.long[\t][0-9a-f0x,]*\)*' arch/x86/crypto/sha256-avx2-asm.S + accept 'K256:[\n][ ]*\.long[ ]0x428a2f98[,][0-9a-f0x,]*\([\n][ ]*\.long[ ][0-9a-f0x,]*\)*' arch/x86/crypto/sha256-ssse3-asm.S + accept 'K512:[\n][\t]\.quad[ ]0x428a2f98d728ae22[,][0-9a-f0x,]*\([\n][\t]\.quad[ ][0-9a-f0x,]*\)*' 'arch/x86/crypto/sha512-\(avx\|ssse3\)-asm\.S' + accept 'K512:[\n][\t]\.quad[\t]0x428a2f98d728ae22[,][0-9a-f0x,]*\([\n][\t]\.quad[\t][0-9a-f0x,]*\)*' 'arch/x86/crypto/sha512-avx2-asm.S' + defsnc 'static[ ]const[ ]uint32_t[ ]axi_clkgen_lock_table\[\][ ]=' drivers/clk/clk-axi-clkgen.c + defsnc 'static[ ]const[ ]int[ ]arizona_micd_levels\[\][ ]=' drivers/extcon/extcon-arizona.c + defsnc 'static[ ]const[ ]struct[ ]hdmiphy_config[ ]hdmiphy_v13_configs\[\][ ]=' drivers/gpu/drm/exynos/exynos_hdmi.c + defsnc '[ ][}][ ]common_modes\[\][ ]=' drivers/gpu/drm/qxl/qxl_display.c + defsnc 'static[ ]const[ ]u32[ ]\(evergreen\|cedar\|supersumo\|wrestler\|barts\|turks\|caicos\)_golden_registers2\?\[\][ ]=' drivers/gpu/drm/radeon/evergreen.c + defsnc 'static[ ]const[ ]u32[ ]\(cypress\|redwood\|cedar\|juniper\)_mgcg_init\[\][ ]=' drivers/gpu/drm/radeon/evergreen.c + defsnc 'static[ ]const[ ]u32[ ]\(cayman\|dvst\|scrapper\)_golden_registers2\?\[\][ ]=' drivers/gpu/drm/radeon/ni.c + defsnc 'static[ ]const[ ]u32[ ]cayman_io_mc_regs\[BTC_IO_MC_REGS_SIZE\]\[2\][ ]=' drivers/gpu/drm/radeon/si.c + defsnc 'static[ ]const[ ]u32[ ]\(r7xx\|rv7[1347]0\)_\(golden_registers\|mgcg_init\)\[\][ ]=' drivers/gpu/drm/radeon/rv770.c + defsnc 'static[ ]const[ ]u32[ ]\(tahiti\|pitcairn\|verde\|oland\|hainan\)_\(golden_registers\|mgcg_cgcg_init\)\[\][ ]=' drivers/gpu/drm/radeon/si.c + defsnc 'static[ ]\(const[ ]\)\?u32[ ]verde_pg_init\[\][ ]=' drivers/gpu/drm/radeon/si.c + defsnc 'static[ ]const[ ]u32[ ]hainan_io_mc_regs\[TAHITI_IO_MC_REGS_SIZE\]\[2\][ ]=' drivers/gpu/drm/radeon/si.c + defsnc 'static[ ]const[ ]s16[ ]temp_lut\[\][ ]=' drivers/hwmon/via686a.c + defsnc 'static[ ]const[ ]u8[ ]via_lut\[\][ ]=' drivers/hwmon/via686a.c + defsnc 'static[ ]const[ ]uint64_t[ ]crc_table\[256\][ ]=' drivers/md/bcache/util.c + defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]ofsm_init_it9135_v[12]\[\][ ]=' drivers/media/dvb-frontends/af9033_priv.h + defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]tuner_init_it9135_\(38\|51\|52\|60\|61\|62\)\[\][ ]=' drivers/media/dvb-frontends/af9033_priv.h + defsc 'static[ ]struct[ ]regdata[ ]mb86a20s_init2\[\][ ]=' drivers/media/dvb-frontends/mb86a20s.c + defsnc 'static[ ]const[ ]u8[ ]channel_registers\[\][ ]=' drivers/media/i2c/tw2804.c + defsnc '[\t]static[ ]const[ ]struct[ ]si476x_property_range[ ]valid_ranges\[\][ ]=' drivers/mfd/si476x-prop.c + defsnc '[\t]static[ ]const[ ]unsigned[ ]int[ ]t[45]_reg_ranges\[\][ ]=' drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c + defsnc 'static[ ]const[ ]u16[ ]b43_ntab_antswctl_r3\[4\]\[32\][ ]=' drivers/net/wireless/b43/tables_nphy.c + defsnc 'static[ ]struct[ ]nphy_gain_ctl_workaround_entry[ ]nphy_gain_ctl_wa_phy6_radio11_ghz2[ ]=' drivers/net/wireless/b43/tables_nphy.c + defsc 'static[ ]struct[ ]nphy_gain_ctl_workaround_entry[ ]nphy_gain_ctl_workaround\[2\]\[4\][ ]=' drivers/net/wireless/b43/tables_nphy.c + defsnc 'static[ ]const[ ]u16[ ]b43_lcntab_sw_ctl_4313_epa_rev0\[\][ ]=' drivers/net/wireless/b43/tables_phy_lcn.c + defsc 'static[ ]const[ ]struct[ ]rf_channel[ ]rf_vals_5592_xtal[24]0\[\][ ]=' drivers/net/wireless/rt2x00/rt2800lib.c + defsnc 'u32[ ]RTL8188EEPHY_REG_\(1TARRAY\|ARRAY_PG\)\[\][ ]=' drivers/net/wireless/rtlwifi/rtl8188ee/table.c + defsnc 'u32[ ]RTL8188EE_RADIOA_1TARRAY\[\][ ]=' drivers/net/wireless/rtlwifi/rtl8188ee/table.c + defsnc 'u32[ ]RTL8188EEMAC_1T_ARRAY\[\][ ]=' drivers/net/wireless/rtlwifi/rtl8188ee/table.c + defsnc 'u32[ ]RTL8188EEAGCTAB_1TARRAY\[\][ ]=' drivers/net/wireless/rtlwifi/rtl8188ee/table.c + defsc 'static[ ]const[ ]struct[ ]pinmux_cfg_reg[ ]pinmux_config_regs\[\][ ]=' 'drivers/pinctrl/sh-pfc/pfc-\(r8a77\(40\|79\)\|sh72\(03\|69\)\)\.c' + defsnc 'static[ ]const[ ]struct[ ]abx500_v_to_cap[ ]cap_tbl\(_[ab]_thermistor\)\?\[\][ ]=' drivers/power/ab8500_bmdata.c + defsnc 'static[ ]int[ ]ab8540_charge_\(output\|input\)_curr_map\[\][ ]=' drivers/power/ab8500_bmdata.c + defsnc 'static[ ]const[ ]unsigned[ ]int[ ]ldo_vaux56_ab8540_voltages\[\][ ]=' drivers/regulator/ab8500.c + accept '[\t]rproc->firmware[ ]=[ ]p[;]' drivers/remoteproc/remoteproc_core.c + defsnc 'static[ ]const[ ]unsigned[ ]char[ ]jpeg_header\[\][ ]=' drivers/staging/media/solo6x10/solo6x10-jpeg.h + defsnc 'const[ ]unsigned[ ]char[ ]jpeg_dqt\[4\]\[DQT_LEN\][ ]=' drivers/staging/media/solo6x10/solo6x10-jpeg.h + defsnc 'static[ ]unsigned[ ]char[ ]vop_6010_\(ntsc\|pal\)_\(d1\|cif\)\[\][ ]=' drivers/staging/media/solo6x10/solo6x10-v4l2-enc.c + defsnc 'u8[ ]\(sbox\|dot[23]\)_table\[256\][ ]=' drivers/staging/vt6656/aes_ccmp.c + defsnc 'static[ ]const[ ]u32[ ]s_adwCrc32Table\[256\][ ]=' drivers/staging/vt6656/tcrc.c + defsnc 'const[ ]u8[ ]TKIP_Sbox_\(Lower\|Upper\)\[256\][ ]=' drivers/staging/vt6656/tkip.c + defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]tas5086_reg_defaults\[\][ ]=' sound/soc/codecs/tas5086.c + accept '[\t]\.firmware[\t]=[ ]' drivers/bluetooth/btmrvl_sdio.c + blobname 'mrvl[/]sd8688\(_helper\)\?\.bin' drivers/bluetooth/btmrvl_sdio.c + blobname 'mrvl[/]sd8897_uapsta\.bin' drivers/bluetooth/btmrvl_sdio.c + blobname '\(\(atsc\|tdmb\)_denver\|cmmb_\(ming_app\|venice_12mhz\)\|dvbh\?_rio\|fm_radio\(_rio\)\?\|isdbt_\(pele\|rio\)\)\.inp' drivers/media/common/siano/smscoreapi.h + blobname 'tigon[/]tg357766\.bin' drivers/net/ethernet/broadcom/tg3.c + blobname 'cxgb4[/]t5fw\.bin' drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c + blobname 'rtl_nic[/]rtl8106e-2\.fw' drivers/net/ethernet/realtek/r8169.c + blobname 'rtl_nic[/]rtl8168g-[23]\.fw' drivers/net/ethernet/realtek/r8169.c + blobname 'mwl8k[/]fmimage_8764_ap-["][ ][#]api[ ]["]\.fw' drivers/net/wireless/mwl8k.c + blobname 'go7007[/]go7007fw\.bin' drivers/staging/media/go7007/go7007-driver.c + blobname 'go7007[/]go7007tv\.bin' drivers/staging/media/go7007/go7007-fw.c + blobname 'go7007[/]\(s2250-[12]\|px-\(m\|tv\)402u\|lr192\|wis-startrek\)\.fw' drivers/staging/media/go7007/go7007-loader.c + blobname 'intel[/]ibt-hw-%x\.%x\(\.%x-fw-%x\.%x\.%x\.%x\.%x\)\?\.bseq' drivers/bluetooth/btusb.c + blobname 'radeon[/]\(RV710\|CYPRESS\|SUMO\|TAHITI\)_uvd\.bin' drivers/gpu/drm/radeon/radeon_uvd.c + blobname 'imspcu\.fw' drivers/input/misc/ims-pcu.c + blobname 'fimc_is_fw\.bin' drivers/media/platform/exynos4-is/fimc-is.h + blobname 'setfile\.bin' drivers/media/platform/exynos4-is/fimc-is.h + blobname 'rtlwifi[/]rtl8188efw\.bin' drivers/net/wireless/rtlwifi/rtl8188ee/sw.c ;; */*freedo*.patch | */*logo*.patch) accept 'P[13]\([\n]#[^\n]*\)*[\n]*\([\n][0-9 ]*\)\+' drivers/video/logo/logo_libre_clut224.ppm ;; + */patch-3.9*) + initnc '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?static[ ]const[ ]u32[ ]ar9485_1_1_baseband_pos\([*][/][;]\)\?' drivers/net/wireless/ath/ath9k/ar9485_initvals.h + accept '\([;][/][*]@@[ ]-[0-9]*,[0-9]*[ ][+][0-9]*,[0-9]*[ ]@@[ ]\)\?static[ ]int[ ]_request_firmware_load\(struct[*][/][;]\)\?' drivers/base/firmware_class.c + ;; + */patch-3.8*) # Present in 3.8 but patched in stable releases. defsnc '\(static[ ]\)\?const[ ]u16[ ]dot11lcn_sw_ctrl_tbl_\(4313_\)\?\(bt_\)\?\(epa_\)\?\(p250_\)\?rev0\(_combo\)\?\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_lcn\.c\|brcmsmac/phy/phytbl_lcn\.c\)' diff --git a/freed-ora/current/master/debug-bad-pte-modules.patch b/freed-ora/current/master/debug-bad-pte-modules.patch index 047231087..8dbf6db40 100644 --- a/freed-ora/current/master/debug-bad-pte-modules.patch +++ b/freed-ora/current/master/debug-bad-pte-modules.patch @@ -1,11 +1,18 @@ -When we encounter a bad PTE, print out what modules were loaded, -so we can see if there is a common driver potentially at fault. +From 3cd4fefa1d614debf75f059def34ac1aaaf96501 Mon Sep 17 00:00:00 2001 +From: Josh Boyer <jwboyer@redhat.com> +Date: Tue, 30 Apr 2013 14:01:57 -0400 +Subject: [PATCH] When we encounter a bad PTE, print out what modules were + loaded, so we can see if there is a common driver potentially at fault. Signed-off-by: Dave Jones <davej@redhat.com> +--- + mm/memory.c | 2 ++ + 1 file changed, 2 insertions(+) -diff -durpN '--exclude-from=/home/davej/.exclude' /home/davej/src/kernel/git-trees/linux/mm/memory.c linux-dj/mm/memory.c ---- /home/davej/src/kernel/git-trees/linux/mm/memory.c 2013-02-26 14:41:18.591116577 -0500 -+++ linux-dj/mm/memory.c 2013-02-28 20:04:37.678304092 -0500 +diff --git a/mm/memory.c b/mm/memory.c +index 6dc1882..99564df 100644 +--- a/mm/memory.c ++++ b/mm/memory.c @@ -57,6 +57,7 @@ #include <linux/swapops.h> #include <linux/elf.h> @@ -14,12 +21,14 @@ diff -durpN '--exclude-from=/home/davej/.exclude' /home/davej/src/kernel/git-tre #include <linux/migrate.h> #include <linux/string.h> -@@ -719,6 +722,7 @@ static void print_bad_pte(struct vm_area +@@ -720,6 +721,7 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr, if (vma->vm_file && vma->vm_file->f_op) - print_symbol(KERN_ALERT "vma->vm_file->f_op->mmap: %s\n", - (unsigned long)vma->vm_file->f_op->mmap); + printk(KERN_ALERT "vma->vm_file->f_op->mmap: %pSR\n", + vma->vm_file->f_op->mmap); + print_modules(); dump_stack(); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); } +-- +1.8.1.4 diff --git a/freed-ora/current/master/devel-pekey-secure-boot-20130306.patch b/freed-ora/current/master/devel-pekey-secure-boot-20130502.patch index 85bcec738..703bbf5ad 100644 --- a/freed-ora/current/master/devel-pekey-secure-boot-20130306.patch +++ b/freed-ora/current/master/devel-pekey-secure-boot-20130502.patch @@ -1,7 +1,7 @@ -From 1693ee9461cddd18c607f7126ac3d300915dbc05 Mon Sep 17 00:00:00 2001 +From 888c361d20210d39863ba6f2b71adb84e0a926a7 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Fri, 18 Jan 2013 13:53:35 +0000 -Subject: [PATCH 02/48] KEYS: Load *.x509 files into kernel keyring +Subject: [PATCH 01/47] KEYS: Load *.x509 files into kernel keyring Load all the files matching the pattern "*.x509" that are to be found in kernel base source dir and base build dir into the module signing keyring. @@ -15,10 +15,10 @@ Signed-off-by: David Howells <dhowells@redhat.com> 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile -index bbde5f1..6cb07a0 100644 +index d1574d4..64c97da 100644 --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -140,17 +140,40 @@ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE +@@ -141,17 +141,40 @@ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE $(call if_changed,bc) ifeq ($(CONFIG_MODULE_SIG),y) @@ -78,13 +78,13 @@ index 246b4c6..0a60203 100644 + .incbin "kernel/x509_certificate_list" GLOBAL(modsign_certificate_list_end) -- -1.8.1.2 +1.8.1.4 -From 80e06b81dec8a01819170c4d102a05d98df4c6f7 Mon Sep 17 00:00:00 2001 +From 26a6bf8ffbe82d706c6de06746d760d9bc425ee5 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 18:39:54 +0000 -Subject: [PATCH 03/48] KEYS: Separate the kernel signature checking keyring +Subject: [PATCH 02/47] KEYS: Separate the kernel signature checking keyring from module signing Separate the kernel signature checking keyring from module signing so that it @@ -136,10 +136,10 @@ index 0000000..8dabc39 + +#endif /* _KEYS_SYSTEM_KEYRING_H */ diff --git a/init/Kconfig b/init/Kconfig -index 22616cd..e988655 100644 +index a76d131..b9d8870 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1575,6 +1575,18 @@ config BASE_SMALL +@@ -1615,6 +1615,18 @@ config BASE_SMALL default 0 if BASE_FULL default 1 if !BASE_FULL @@ -158,7 +158,7 @@ index 22616cd..e988655 100644 menuconfig MODULES bool "Enable loadable module support" help -@@ -1647,6 +1659,7 @@ config MODULE_SRCVERSION_ALL +@@ -1687,6 +1699,7 @@ config MODULE_SRCVERSION_ALL config MODULE_SIG bool "Module signature verification" depends on MODULES @@ -167,10 +167,10 @@ index 22616cd..e988655 100644 select CRYPTO select ASYMMETRIC_KEY_TYPE diff --git a/kernel/Makefile b/kernel/Makefile -index 6cb07a0..a9ecd52 100644 +index 64c97da..ecff938 100644 --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -51,8 +51,9 @@ obj-$(CONFIG_SMP) += spinlock.o +@@ -52,8 +52,9 @@ obj-$(CONFIG_SMP) += spinlock.o obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o obj-$(CONFIG_PROVE_LOCKING) += spinlock.o obj-$(CONFIG_UID16) += uid16.o @@ -181,7 +181,7 @@ index 6cb07a0..a9ecd52 100644 obj-$(CONFIG_KALLSYMS) += kallsyms.o obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o obj-$(CONFIG_KEXEC) += kexec.o -@@ -139,13 +140,14 @@ targets += timeconst.h +@@ -140,13 +141,14 @@ targets += timeconst.h $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE $(call if_changed,bc) @@ -199,7 +199,7 @@ index 6cb07a0..a9ecd52 100644 X509_CERTIFICATES-y := $(wildcard *.x509) $(wildcard $(srctree)/*.x509) X509_CERTIFICATES-$(CONFIG_MODULE_SIG) += signing_key.x509 X509_CERTIFICATES := $(sort $(X509_CERTIFICATES-y)) -@@ -161,10 +163,11 @@ $(shell rm $(obj)/.x509.list) +@@ -162,10 +164,11 @@ $(shell rm $(obj)/.x509.list) endif endif @@ -213,7 +213,7 @@ index 6cb07a0..a9ecd52 100644 targets += $(obj)/x509_certificate_list $(obj)/x509_certificate_list: $(X509_CERTIFICATES) $(obj)/.x509.list $(call if_changed,x509certs) -@@ -174,7 +177,9 @@ $(obj)/.x509.list: +@@ -175,7 +178,9 @@ $(obj)/.x509.list: @echo $(X509_CERTIFICATES) >$@ clean-files := x509_certificate_list .x509.list @@ -497,13 +497,13 @@ index 0000000..a3ca76f +} +late_initcall(load_system_certificate_list); -- -1.8.1.2 +1.8.1.4 -From a2512743c97ac3c236eaf9ce6b2879cb0ff61dd5 Mon Sep 17 00:00:00 2001 +From 4e2b0f425d73360fc40b8719b36e6e3ca94d458e Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Thu, 17 Jan 2013 16:25:00 +0000 -Subject: [PATCH 04/48] KEYS: Add a 'trusted' flag and a 'trusted only' flag +Subject: [PATCH 03/47] KEYS: Add a 'trusted' flag and a 'trusted only' flag Add KEY_FLAG_TRUSTED to indicate that a key either comes from a trusted source or had a cryptographic signature chain that led back to a trusted key the @@ -626,13 +626,13 @@ index 6ece7f2..f18d7ff 100644 if (ret == 0) { ret = __key_link_check_live_key(keyring, key); -- -1.8.1.2 +1.8.1.4 -From a466fb7f25a238e646970d1dbdbb5143f9b3b066 Mon Sep 17 00:00:00 2001 +From 3deae827abdd3de9b7976b423279812d7559e580 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:32 +0000 -Subject: [PATCH 05/48] KEYS: Rename public key parameter name arrays +Subject: [PATCH 04/47] KEYS: Rename public key parameter name arrays Rename the arrays of public key parameters (public key algorithm names, hash algorithm names and ID type names) so that the array name ends in "_name". @@ -781,13 +781,13 @@ index 0034e36..0b6b870 100644 key = request_asymmetric_key(sig, ms.signer_len, -- -1.8.1.2 +1.8.1.4 -From bb9a97b29085a9dfbda5b32a6dbdfaec5612e46b Mon Sep 17 00:00:00 2001 +From 2acf1a703de1213ad85515a71873f57535dc057d Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:33 +0000 -Subject: [PATCH 06/48] KEYS: Move the algorithm pointer array from x509 to +Subject: [PATCH 05/47] KEYS: Move the algorithm pointer array from x509 to public_key.c Move the public-key algorithm pointer array from x509_public_key.c to @@ -863,13 +863,13 @@ index 619d570..46bde25 100644 enum pkey_hash_algo { PKEY_HASH_MD4, -- -1.8.1.2 +1.8.1.4 -From 35da3ee1a151d44c8e0b38422584918f39d66298 Mon Sep 17 00:00:00 2001 +From 3cc2c6f01277dfa00106c3e4f3f3ab8184025b90 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:33 +0000 -Subject: [PATCH 07/48] KEYS: Store public key algo ID in public_key struct +Subject: [PATCH 06/47] KEYS: Store public key algo ID in public_key struct Store public key algo ID in public_key struct for reference purposes. This allows it to be removed from the x509_certificate struct and used to find a @@ -948,13 +948,13 @@ index 46bde25..05778df 100644 union { MPI mpi[5]; -- -1.8.1.2 +1.8.1.4 -From a837dc33a6ca6a4c11d7485ac51951992e7ccf53 Mon Sep 17 00:00:00 2001 +From 7dcc63793a873198d3b3c4299f896e2896292d84 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:34 +0000 -Subject: [PATCH 08/48] KEYS: Split public_key_verify_signature() and make +Subject: [PATCH 07/47] KEYS: Split public_key_verify_signature() and make available Modify public_key_verify_signature() so that it now takes a public_key struct @@ -1064,13 +1064,13 @@ index fac574c..8cb2f70 100644 pr_debug("Cert Verification: %d\n", ret); -- -1.8.1.2 +1.8.1.4 -From def87e748398cfd083e79ae48556aa2144873fc4 Mon Sep 17 00:00:00 2001 +From da18477d1a1987dce0f3c5f78b62e5b223e2bf90 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:35 +0000 -Subject: [PATCH 09/48] KEYS: Store public key algo ID in public_key_signature +Subject: [PATCH 08/47] KEYS: Store public key algo ID in public_key_signature struct Store public key algorithm ID in public_key_signature struct for reference @@ -1097,13 +1097,13 @@ index 05778df..b34fda4 100644 union { MPI mpi[2]; -- -1.8.1.2 +1.8.1.4 -From 87230ff62f9901069b350c57aaa996dabe191165 Mon Sep 17 00:00:00 2001 +From 29d80acc90a95ef5614cf36d4e30835bcc014cc4 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:35 +0000 -Subject: [PATCH 10/48] X.509: struct x509_certificate needs struct tm +Subject: [PATCH 09/47] X.509: struct x509_certificate needs struct tm declaring struct x509_certificate needs struct tm declaring by #inclusion of linux/time.h @@ -1129,13 +1129,13 @@ index e583ad0..2d01182 100644 struct x509_certificate { -- -1.8.1.2 +1.8.1.4 -From 82c121f975c92d34202a9248f94de9c9ada4f9a2 Mon Sep 17 00:00:00 2001 +From ba3ba9e41abb17a7632075668e4f0a30edb59896 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:35 +0000 -Subject: [PATCH 11/48] X.509: Add bits needed for PKCS#7 +Subject: [PATCH 10/47] X.509: Add bits needed for PKCS#7 PKCS#7 validation requires access to the serial number and the raw names in an X.509 certificate. @@ -1227,13 +1227,13 @@ index 2d01182..a6ce46f 100644 /* -- -1.8.1.2 +1.8.1.4 -From 57fb22f1b578187da39d5edfdcaf22daea5fddcb Mon Sep 17 00:00:00 2001 +From 4d2f837ab3629d5b4b3bac2bbdbdf2d0060e74a8 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:36 +0000 -Subject: [PATCH 12/48] X.509: Embed public_key_signature struct and create +Subject: [PATCH 11/47] X.509: Embed public_key_signature struct and create filler function Embed a public_key_signature struct in struct x509_certificate, eliminating @@ -1495,13 +1495,13 @@ index 8cb2f70..b7c81d8 100644 if (!cert->fingerprint || !cert->authority) { pr_warn("Cert for '%s' must have SubjKeyId and AuthKeyId extensions\n", -- -1.8.1.2 +1.8.1.4 -From c882d17501c48b2ea515b2c6cba21d91ad3ce4c4 Mon Sep 17 00:00:00 2001 +From 822175026ad1d4640240d1fdd77b1f45ddd9e7a9 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:36 +0000 -Subject: [PATCH 13/48] X.509: Check the algorithm IDs obtained from parsing an +Subject: [PATCH 12/47] X.509: Check the algorithm IDs obtained from parsing an X.509 certificate Check that the algorithm IDs obtained from the ASN.1 parse by OID lookup @@ -1536,13 +1536,13 @@ index b7c81d8..eb368d4 100644 pr_devel("Cert Valid From: %04ld-%02d-%02d %02d:%02d:%02d\n", cert->valid_from.tm_year + 1900, cert->valid_from.tm_mon + 1, -- -1.8.1.2 +1.8.1.4 -From a5e4fc67608e4f63189263c9840eab47569ab78b Mon Sep 17 00:00:00 2001 +From 4a1a540f79d36d8b0b8970ea638648cef080057b Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:37 +0000 -Subject: [PATCH 14/48] X.509: Handle certificates that lack an +Subject: [PATCH 13/47] X.509: Handle certificates that lack an authorityKeyIdentifier field Handle certificates that lack an authorityKeyIdentifier field by assuming @@ -1583,13 +1583,13 @@ index eb368d4..0f55e3b 100644 if (ret < 0) goto error_free_cert; -- -1.8.1.2 +1.8.1.4 -From 91fc935afe02fedb2cbf4e77994d226f0fbd25eb Mon Sep 17 00:00:00 2001 +From f5e443e719cfb7cae2aea764ad3c9ec9ffba4f60 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:37 +0000 -Subject: [PATCH 15/48] X.509: Export certificate parse and free functions +Subject: [PATCH 14/47] X.509: Export certificate parse and free functions Export certificate parse and free functions for use by modules. @@ -1629,13 +1629,13 @@ index 931f069..9cf0e16 100644 /* * Note an OID when we find one for later processing when we know how -- -1.8.1.2 +1.8.1.4 -From 14b152615af5ca6b274714b1e515d7dcf142a55b Mon Sep 17 00:00:00 2001 +From 792a56d205765cf4ece16868929ad5fbe6b89df4 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:38 +0000 -Subject: [PATCH 16/48] PKCS#7: Implement a parser [RFC 2315] +Subject: [PATCH 15/47] PKCS#7: Implement a parser [RFC 2315] Implement a parser for a PKCS#7 signed-data message as described in part of RFC 2315. @@ -2242,13 +2242,13 @@ index 6926db7..edeff85 100644 /* Distinguished Name attribute IDs [RFC 2256] */ OID_commonName, /* 2.5.4.3 */ -- -1.8.1.2 +1.8.1.4 -From ec62dd1e7576f4b83d6374cd900049c7c555a7d0 Mon Sep 17 00:00:00 2001 +From 3b4b82eecde52c1bd75ab11ef7f8a5c13ec73c40 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:38 +0000 -Subject: [PATCH 17/48] PKCS#7: Digest the data in a signed-data message +Subject: [PATCH 16/47] PKCS#7: Digest the data in a signed-data message Digest the data in a PKCS#7 signed-data message and attach to the public_key_signature struct contained in the pkcs7_message struct. @@ -2416,13 +2416,13 @@ index 0000000..2f9f26c +} +EXPORT_SYMBOL_GPL(pkcs7_verify); -- -1.8.1.2 +1.8.1.4 -From e90ddcd9bc29ed13b4b2808029c6580f3444c5b3 Mon Sep 17 00:00:00 2001 +From e67fed4626a30dd11967abad9187013ff4185991 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:39 +0000 -Subject: [PATCH 18/48] PKCS#7: Find the right key in the PKCS#7 key list and +Subject: [PATCH 17/47] PKCS#7: Find the right key in the PKCS#7 key list and verify the signature Find the appropriate key in the PKCS#7 key list and verify the signature with @@ -2515,13 +2515,13 @@ index 2f9f26c..3f6f0e2 100644 } EXPORT_SYMBOL_GPL(pkcs7_verify); -- -1.8.1.2 +1.8.1.4 -From 8e22cd5881575b9dcdd45b29671935fce505d056 Mon Sep 17 00:00:00 2001 +From 87ec8d783c887617ee6e85f66a9ce1a03c627e87 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:39 +0000 -Subject: [PATCH 19/48] PKCS#7: Verify internal certificate chain +Subject: [PATCH 18/47] PKCS#7: Verify internal certificate chain Verify certificate chain in the X.509 certificates contained within the PKCS#7 message as far as possible. If any signature that we should be able to verify @@ -2631,13 +2631,13 @@ index 6b1d877..5e35fba 100644 char *issuer; /* Name of certificate issuer */ char *subject; /* Name of certificate subject */ -- -1.8.1.2 +1.8.1.4 -From 185c80f1aa2a59a7494db7f57eba30f54a46152a Mon Sep 17 00:00:00 2001 +From cc6c40318a05330e4bb201b35378d7c0a0278aaa Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:42 +0000 -Subject: [PATCH 20/48] PKCS#7: Find intersection between PKCS#7 message and +Subject: [PATCH 19/47] PKCS#7: Find intersection between PKCS#7 message and known, trusted keys Find the intersection between the X.509 certificate chain contained in a PKCS#7 @@ -2838,13 +2838,13 @@ index 0000000..cc226f5 +} +EXPORT_SYMBOL_GPL(pkcs7_validate_trust); -- -1.8.1.2 +1.8.1.4 -From 5b9065e00fb0d0b5fd87f41d8e4c19522a624d6f Mon Sep 17 00:00:00 2001 +From f20b0d77771133bd0d7e89932fef494f00687607 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:39 +0000 -Subject: [PATCH 21/48] Provide PE binary definitions +Subject: [PATCH 20/47] Provide PE binary definitions Provide some PE binary structural and constant definitions as taken from the pesign package sources. @@ -3311,13 +3311,13 @@ index 0000000..9234aef + +#endif /* __LINUX_PE_H */ -- -1.8.1.2 +1.8.1.4 -From 0514d1400ccf6602fa4f4a45d54e82c0386788fb Mon Sep 17 00:00:00 2001 +From d329754b0c2881b6331aacafab74a26b2d9262b3 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:40 +0000 -Subject: [PATCH 22/48] pefile: Parse a PE binary to find a key and a signature +Subject: [PATCH 21/47] pefile: Parse a PE binary to find a key and a signature contained therein Parse a PE binary to find a key and a signature contained therein. Later @@ -3605,13 +3605,13 @@ index 0000000..82bcaf6 + enum pkey_hash_algo digest_algo; /* Digest algorithm */ +}; -- -1.8.1.2 +1.8.1.4 -From 84598b0ba0da9e914fe13cd8e73b4d77a77f8a8e Mon Sep 17 00:00:00 2001 +From 3794d7963e17fc0b0c2f62164306b9a45cb2254e Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:40 +0000 -Subject: [PATCH 23/48] pefile: Strip the wrapper off of the cert data block +Subject: [PATCH 22/47] pefile: Strip the wrapper off of the cert data block The certificate data block in a PE binary has a wrapper around the PKCS#7 signature we actually want to get at. Strip this off and check that we've got @@ -3709,13 +3709,13 @@ index fb80cf0..f2d4df0 100644 } -- -1.8.1.2 +1.8.1.4 -From 6c9fdc4a6bb91f67ba83a164bed515f86b487804 Mon Sep 17 00:00:00 2001 +From f23895761a15e08959140091dc17004e7e6e2035 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:40 +0000 -Subject: [PATCH 24/48] pefile: Parse the presumed PKCS#7 content of the +Subject: [PATCH 23/47] pefile: Parse the presumed PKCS#7 content of the certificate blob Parse the content of the certificate blob, presuming it to be PKCS#7 format. @@ -3763,13 +3763,13 @@ index f2d4df0..056500f 100644 static struct asymmetric_key_parser pefile_key_parser = { -- -1.8.1.2 +1.8.1.4 -From 7816d32941300ae8ed25cc98baf13064854e6cb9 Mon Sep 17 00:00:00 2001 +From fcdb91196beb6235eed676c368a662cbdf92b804 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:41 +0000 -Subject: [PATCH 25/48] pefile: Parse the "Microsoft individual code signing" +Subject: [PATCH 24/47] pefile: Parse the "Microsoft individual code signing" data blob The PKCS#7 certificate should contain a "Microsoft individual code signing" @@ -4006,13 +4006,13 @@ index edeff85..332dcf5 100644 OID_sha256, /* 2.16.840.1.101.3.4.2.1 */ -- -1.8.1.2 +1.8.1.4 -From 9e97d5c51460969ff04d3027e734a69437518cfd Mon Sep 17 00:00:00 2001 +From 63204898d9491f8ba1b90dea8660e8ff778db993 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:41 +0000 -Subject: [PATCH 26/48] pefile: Digest the PE binary and compare to the PKCS#7 +Subject: [PATCH 25/47] pefile: Digest the PE binary and compare to the PKCS#7 data Digest the signed parts of the PE binary, canonicalising the section table @@ -4242,13 +4242,13 @@ index f1c8cc1..dfdb85e 100644 error: -- -1.8.1.2 +1.8.1.4 -From 2b5752323fc40cd9145150158f32b088fb0d4fa2 Mon Sep 17 00:00:00 2001 +From 17ed825e5f3f595665abd3fc11a6c180e6762b87 Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Fri, 18 Jan 2013 13:58:35 +0000 -Subject: [PATCH 27/48] PEFILE: Validate PKCS#7 trust chain +Subject: [PATCH 26/47] PEFILE: Validate PKCS#7 trust chain Validate the PKCS#7 trust chain against the contents of the system keyring. @@ -4294,13 +4294,13 @@ index dfdb85e..edad948 100644 error: -- -1.8.1.2 +1.8.1.4 -From 1d94bb9d91322f250d870a1df94e24f9717a1660 Mon Sep 17 00:00:00 2001 +From ce9ca4236f691264a94bcbe10beda9ec5a035baf Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@redhat.com> Date: Tue, 15 Jan 2013 15:33:42 +0000 -Subject: [PATCH 28/48] PEFILE: Load the contained key if we consider the +Subject: [PATCH 27/47] PEFILE: Load the contained key if we consider the container to be validly signed Load the key contained in the PE binary if the signature on the container can @@ -4385,13 +4385,13 @@ index 0f55e3b..c3e5a6d 100644 static struct asymmetric_key_parser x509_key_parser = { .owner = THIS_MODULE, -- -1.8.1.2 +1.8.1.4 -From ef929c440551421ba319fe2305a063706ce7c8a6 Mon Sep 17 00:00:00 2001 +From 395cc1b55a0645ced39f92b31ba3bcc141e59383 Mon Sep 17 00:00:00 2001 From: Chun-Yi Lee <joeyli.kernel@gmail.com> Date: Thu, 21 Feb 2013 19:23:49 +0800 -Subject: [PATCH 29/48] MODSIGN: Fix including certificate twice when the +Subject: [PATCH 28/47] MODSIGN: Fix including certificate twice when the signing_key.x509 already exists This issue was found in devel-pekey branch on linux-modsign.git tree. The @@ -4424,10 +4424,10 @@ Signed-off-by: David Howells <dhowells@redhat.com> 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/Makefile b/kernel/Makefile -index a9ecd52..c94d081 100644 +index ecff938..52f3426 100644 --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -148,7 +148,10 @@ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE +@@ -149,7 +149,10 @@ $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE # ############################################################################### ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y) @@ -4440,13 +4440,13 @@ index a9ecd52..c94d081 100644 X509_CERTIFICATES := $(sort $(X509_CERTIFICATES-y)) -- -1.8.1.2 +1.8.1.4 -From 614232115eed153b4f56f37319114a18d590daaa Mon Sep 17 00:00:00 2001 +From 0ef575739cff3fda47dd2a9415f066ab44dcc922 Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Thu, 20 Sep 2012 10:40:56 -0400 -Subject: [PATCH 30/48] Secure boot: Add new capability +Subject: [PATCH 29/47] Secure boot: Add new capability Secure boot adds certain policy requirements, including that root must not be able to do anything that could cause the kernel to execute arbitrary code. @@ -4477,13 +4477,13 @@ index ba478fa..7109e65 100644 #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) -- -1.8.1.2 +1.8.1.4 -From 5c31721c6ec69d901a3f81a1cfa1518ca138ab75 Mon Sep 17 00:00:00 2001 +From 7312bed4fb9125d4880f11a64521b110079a3c0a Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Thu, 20 Sep 2012 10:41:05 -0400 -Subject: [PATCH 31/48] SELinux: define mapping for new Secure Boot capability +Subject: [PATCH 30/47] SELinux: define mapping for new Secure Boot capability Add the name of the new Secure Boot capability. This allows SELinux policies to properly map CAP_COMPROMISE_KERNEL to the appropriate @@ -4510,13 +4510,13 @@ index 14d04e6..ed99a2d 100644 { "tun_socket", { COMMON_SOCK_PERMS, "attach_queue", NULL } }, -- -1.8.1.2 +1.8.1.4 -From b7c947a5862f33eb44bc33211a89ac1d8fd32475 Mon Sep 17 00:00:00 2001 +From e99e1273b0a50d874d2a53461e95f74460e1b812 Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Thu, 20 Sep 2012 10:41:02 -0400 -Subject: [PATCH 32/48] Secure boot: Add a dummy kernel parameter that will +Subject: [PATCH 31/47] Secure boot: Add a dummy kernel parameter that will switch on Secure Boot mode This forcibly drops CAP_COMPROMISE_KERNEL from both cap_permitted and cap_bset @@ -4530,10 +4530,10 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com> 2 files changed, 24 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 4609e81..7c0b137 100644 +index 8c01a02..ee6c1ca 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt -@@ -2683,6 +2683,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. +@@ -2744,6 +2744,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted. Note: increases power consumption, thus should only be enabled if running jitter sensitive (HPC/RT) workloads. @@ -4576,13 +4576,13 @@ index e0573a4..c3f4e3e 100644 * prepare_kernel_cred - Prepare a set of credentials for a kernel service * @daemon: A userspace daemon to be used as a reference -- -1.8.1.2 +1.8.1.4 -From b218aab3dcc56d27324b2fc170d620e98c726603 Mon Sep 17 00:00:00 2001 +From eeac2b5391d834eefebfae49a100244fdccc82e5 Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Thu, 20 Sep 2012 10:41:03 -0400 -Subject: [PATCH 33/48] efi: Enable secure boot lockdown automatically when +Subject: [PATCH 32/47] efi: Enable secure boot lockdown automatically when enabled in firmware The firmware has a set of flags that indicate whether secure boot is enabled @@ -4616,10 +4616,10 @@ index 199f453..ff651d3 100644 290/040 ALL edd_mbr_sig_buffer EDD MBR signatures 2D0/A00 ALL e820_map E820 memory map table diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c -index c205035..96d859d 100644 +index 35ee62f..0998ec7 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c -@@ -861,6 +861,36 @@ fail: +@@ -906,6 +906,36 @@ fail: return status; } @@ -4656,7 +4656,7 @@ index c205035..96d859d 100644 /* * Because the x86 boot code expects to be passed a boot_params we * need to create one ourselves (usually the bootloader would create -@@ -1155,6 +1185,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, +@@ -1200,6 +1230,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) goto fail; @@ -4664,12 +4664,12 @@ index c205035..96d859d 100644 + setup_graphics(boot_params); - setup_efi_pci(boot_params); + setup_efi_vars(boot_params); diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h -index ae93f72..05ecc52 100644 +index 653668d..69a6c08 100644 --- a/arch/x86/include/asm/bootparam_utils.h +++ b/arch/x86/include/asm/bootparam_utils.h -@@ -22,9 +22,13 @@ static void sanitize_boot_params(struct boot_params *boot_params) +@@ -38,9 +38,13 @@ static void sanitize_boot_params(struct boot_params *boot_params) memset(&boot_params->olpc_ofw_header, 0, (char *)&boot_params->efi_info - (char *)&boot_params->olpc_ofw_header); @@ -4686,10 +4686,10 @@ index ae93f72..05ecc52 100644 (char *)&boot_params->edd_mbr_sig_buffer[0] - (char *)&boot_params->_pad7[0]); diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h -index c15ddaf..85d7685 100644 +index 0874424..56b7d39 100644 --- a/arch/x86/include/uapi/asm/bootparam.h +++ b/arch/x86/include/uapi/asm/bootparam.h -@@ -131,7 +131,8 @@ struct boot_params { +@@ -132,7 +132,8 @@ struct boot_params { __u8 eddbuf_entries; /* 0x1e9 */ __u8 edd_mbr_sig_buf_entries; /* 0x1ea */ __u8 kbd_status; /* 0x1eb */ @@ -4700,10 +4700,10 @@ index c15ddaf..85d7685 100644 * The sentinel is set to a nonzero value (0xff) in header.S. * diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 84d3285..2485897 100644 +index 56f7fcf..3af6cf8 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c -@@ -1098,6 +1098,13 @@ void __init setup_arch(char **cmdline_p) +@@ -1131,6 +1131,13 @@ void __init setup_arch(char **cmdline_p) io_delay_init(); @@ -4731,10 +4731,10 @@ index 04421e8..9e69542 100644 * check for validity of credentials */ diff --git a/include/linux/efi.h b/include/linux/efi.h -index 9bf2f1f..1bf382b 100644 +index 2bc0ad7..10b167a 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -627,6 +627,7 @@ extern int __init efi_setup_pcdp_console(char *); +@@ -634,6 +634,7 @@ extern int __init efi_setup_pcdp_console(char *); #define EFI_RUNTIME_SERVICES 3 /* Can we use runtime services? */ #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ #define EFI_64BIT 5 /* Is the firmware 64-bit? */ @@ -4743,13 +4743,13 @@ index 9bf2f1f..1bf382b 100644 #ifdef CONFIG_EFI # ifdef CONFIG_X86 -- -1.8.1.2 +1.8.1.4 -From c2a1ee697d989d5d5ba7c5d7c20abf6d320afe74 Mon Sep 17 00:00:00 2001 +From a1ac3b80b7a85d4fce665047b9701713fcfc1ea0 Mon Sep 17 00:00:00 2001 From: Dave Howells <dhowells@redhat.com> Date: Tue, 23 Oct 2012 09:30:54 -0400 -Subject: [PATCH 34/48] Add EFI signature data types +Subject: [PATCH 33/47] Add EFI signature data types Add the data types that are used for containing hashes, keys and certificates for cryptographic verification. @@ -4760,10 +4760,10 @@ Signed-off-by: David Howells <dhowells@redhat.com> 1 file changed, 20 insertions(+) diff --git a/include/linux/efi.h b/include/linux/efi.h -index 1bf382b..8902faf 100644 +index 10b167a..d3ef7c6 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -388,6 +388,12 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, +@@ -389,6 +389,12 @@ typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long si #define EFI_FILE_SYSTEM_GUID \ EFI_GUID( 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) @@ -4776,7 +4776,7 @@ index 1bf382b..8902faf 100644 typedef struct { efi_guid_t guid; u64 table; -@@ -523,6 +529,20 @@ typedef struct { +@@ -524,6 +530,20 @@ typedef struct { #define EFI_INVALID_TABLE_ADDR (~0UL) @@ -4798,13 +4798,13 @@ index 1bf382b..8902faf 100644 * All runtime access to EFI goes through this structure: */ -- -1.8.1.2 +1.8.1.4 -From 03401c77362c324756e7f4ce3b0e72f06e79e0d7 Mon Sep 17 00:00:00 2001 +From fac308c18ba449322666325f37f6a08ad818cf9f Mon Sep 17 00:00:00 2001 From: Dave Howells <dhowells@redhat.com> Date: Tue, 23 Oct 2012 09:36:28 -0400 -Subject: [PATCH 35/48] Add an EFI signature blob parser and key loader. +Subject: [PATCH 34/47] Add an EFI signature blob parser and key loader. X.509 certificates are loaded into the specified keyring as asymmetric type keys. @@ -4963,10 +4963,10 @@ index 0000000..424896a + return 0; +} diff --git a/include/linux/efi.h b/include/linux/efi.h -index 8902faf..ff3c599 100644 +index d3ef7c6..4f0fbb7 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -612,6 +612,10 @@ extern int efi_set_rtc_mmss(unsigned long nowtime); +@@ -619,6 +619,10 @@ extern int efi_set_rtc_mmss(unsigned long nowtime); extern void efi_reserve_boot_services(void); extern struct efi_memory_map memmap; @@ -4978,13 +4978,13 @@ index 8902faf..ff3c599 100644 * efi_range_is_wc - check the WC bit on an address range * @start: starting kvirt address -- -1.8.1.2 +1.8.1.4 -From 5f7f02ad9d46cf93090a0aed55530c44ce96cb96 Mon Sep 17 00:00:00 2001 +From 75560e565cb8a4e853a3b6f6c65ed70c1ba29039 Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Fri, 26 Oct 2012 12:36:24 -0400 -Subject: [PATCH 36/48] KEYS: Add a system blacklist keyring +Subject: [PATCH 35/47] KEYS: Add a system blacklist keyring This adds an additional keyring that is used to store certificates that are blacklisted. This keyring is searched first when loading signed modules @@ -5015,10 +5015,10 @@ index 8dabc39..e466de1 100644 #endif /* _KEYS_SYSTEM_KEYRING_H */ diff --git a/init/Kconfig b/init/Kconfig -index e988655..3cac597 100644 +index b9d8870..4f9771f 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1587,6 +1587,15 @@ config SYSTEM_TRUSTED_KEYRING +@@ -1627,6 +1627,15 @@ config SYSTEM_TRUSTED_KEYRING Keys in this keyring are used by module signature checking. @@ -5093,13 +5093,13 @@ index dae8778..2913c70 100644 } -- -1.8.1.2 +1.8.1.4 -From 4fa15a799f5955b7f82b83953fc6726f9113e385 Mon Sep 17 00:00:00 2001 +From e46bf80471882ce1ab0b75dc954b2b59deec6fbb Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Fri, 26 Oct 2012 12:42:16 -0400 -Subject: [PATCH 37/48] MODSIGN: Import certificates from UEFI Secure Boot +Subject: [PATCH 36/47] MODSIGN: Import certificates from UEFI Secure Boot Secure Boot stores a list of allowed certificates in the 'db' variable. This imports those certificates into the system trusted keyring. This @@ -5119,15 +5119,15 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com> include/linux/efi.h | 6 ++++ init/Kconfig | 9 +++++ kernel/Makefile | 3 ++ - kernel/modsign_uefi.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 109 insertions(+) + kernel/modsign_uefi.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 110 insertions(+) create mode 100644 kernel/modsign_uefi.c diff --git a/include/linux/efi.h b/include/linux/efi.h -index ff3c599..8400949 100644 +index 4f0fbb7..7ac7a17 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h -@@ -394,6 +394,12 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, +@@ -395,6 +395,12 @@ typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long si #define EFI_CERT_X509_GUID \ EFI_GUID( 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 ) @@ -5141,10 +5141,10 @@ index ff3c599..8400949 100644 efi_guid_t guid; u64 table; diff --git a/init/Kconfig b/init/Kconfig -index 3cac597..e7e0216 100644 +index 4f9771f..da92f1c 100644 --- a/init/Kconfig +++ b/init/Kconfig -@@ -1705,6 +1705,15 @@ config MODULE_SIG_ALL +@@ -1745,6 +1745,15 @@ config MODULE_SIG_ALL comment "Do not forget to sign required modules with scripts/sign-file" depends on MODULE_SIG_FORCE && !MODULE_SIG_ALL @@ -5161,10 +5161,10 @@ index 3cac597..e7e0216 100644 prompt "Which hash algorithm should modules be signed with?" depends on MODULE_SIG diff --git a/kernel/Makefile b/kernel/Makefile -index c94d081..94be1fc 100644 +index 52f3426..e2a616f 100644 --- a/kernel/Makefile +++ b/kernel/Makefile -@@ -54,6 +54,7 @@ obj-$(CONFIG_UID16) += uid16.o +@@ -55,6 +55,7 @@ obj-$(CONFIG_UID16) += uid16.o obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o obj-$(CONFIG_MODULES) += module.o obj-$(CONFIG_MODULE_SIG) += module_signing.o @@ -5172,7 +5172,7 @@ index c94d081..94be1fc 100644 obj-$(CONFIG_KALLSYMS) += kallsyms.o obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o obj-$(CONFIG_KEXEC) += kexec.o -@@ -113,6 +114,8 @@ obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o +@@ -114,6 +115,8 @@ obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o $(obj)/configs.o: $(obj)/config_data.h @@ -5183,15 +5183,16 @@ index c94d081..94be1fc 100644 targets += config_data.gz diff --git a/kernel/modsign_uefi.c b/kernel/modsign_uefi.c new file mode 100644 -index 0000000..df831ff +index 0000000..94b0eb3 --- /dev/null +++ b/kernel/modsign_uefi.c -@@ -0,0 +1,91 @@ +@@ -0,0 +1,92 @@ +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/cred.h> +#include <linux/err.h> +#include <linux/efi.h> ++#include <linux/slab.h> +#include <keys/asymmetric-type.h> +#include <keys/system_keyring.h> +#include "module-internal.h" @@ -5279,13 +5280,13 @@ index 0000000..df831ff +} +late_initcall(load_uefi_certs); -- -1.8.1.2 +1.8.1.4 -From 439626853a29ad3a731d5563a0ee82645eb4f012 Mon Sep 17 00:00:00 2001 +From 8724600edad99706cce510645eff15f28787561a Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Thu, 20 Sep 2012 10:40:57 -0400 -Subject: [PATCH 38/48] PCI: Lock down BAR access in secure boot environments +Subject: [PATCH 37/47] PCI: Lock down BAR access in secure boot environments Any hardware that can potentially generate DMA has to be locked down from userspace in order to avoid it being possible for an attacker to cause @@ -5300,7 +5301,7 @@ Signed-off-by: Matthew Garrett <mjg@redhat.com> 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c -index 9c6e9bb..b966089 100644 +index 5b4a9d9..db2ff9e 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -622,6 +622,9 @@ pci_write_config(struct file* filp, struct kobject *kobj, @@ -5334,11 +5335,11 @@ index 9c6e9bb..b966089 100644 } diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c -index 0b00947..7639f68 100644 +index 0812608..544132d 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c -@@ -139,6 +139,9 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof - int size = dp->size; +@@ -136,6 +136,9 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof + int size = dev->cfg_size; int cnt; + if (!capable(CAP_COMPROMISE_KERNEL)) @@ -5347,7 +5348,7 @@ index 0b00947..7639f68 100644 if (pos >= size) return 0; if (nbytes >= size) -@@ -219,6 +222,9 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, +@@ -215,6 +218,9 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, #endif /* HAVE_PCI_MMAP */ int ret = 0; @@ -5357,7 +5358,7 @@ index 0b00947..7639f68 100644 switch (cmd) { case PCIIOC_CONTROLLER: ret = pci_domain_nr(dev->bus); -@@ -259,7 +265,7 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) +@@ -253,7 +259,7 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) struct pci_filp_private *fpriv = file->private_data; int i, ret; @@ -5380,13 +5381,13 @@ index e1c1ec5..97e785f 100644 dev = pci_get_bus_and_slot(bus, dfn); -- -1.8.1.2 +1.8.1.4 -From 55d73bfee2d162dadf4f697cfeb1235a68c90aa8 Mon Sep 17 00:00:00 2001 +From 2361c561632c00e3974a092454ecc7daafb7cdf6 Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Thu, 20 Sep 2012 10:40:58 -0400 -Subject: [PATCH 39/48] x86: Lock down IO port access in secure boot +Subject: [PATCH 38/47] x86: Lock down IO port access in secure boot environments IO port access would permit users to gain access to PCI configuration @@ -5437,13 +5438,13 @@ index 2c644af..7eee4d8 100644 return -EFAULT; while (count-- > 0 && i < 65536) { -- -1.8.1.2 +1.8.1.4 -From 985b096320b1689dbe91a97e999d0607f5461068 Mon Sep 17 00:00:00 2001 +From e97f4dd5b1baaae0854e8a5c87aa4be4d03d1854 Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Thu, 20 Sep 2012 10:40:59 -0400 -Subject: [PATCH 40/48] ACPI: Limit access to custom_method +Subject: [PATCH 39/47] ACPI: Limit access to custom_method It must be impossible for even root to get code executed in kernel context under a secure boot environment. custom_method effectively allows arbitrary @@ -5469,13 +5470,13 @@ index 12b62f2..edf0710 100644 /* parse the table header to get the table length */ if (count <= sizeof(struct acpi_table_header)) -- -1.8.1.2 +1.8.1.4 -From 6fe8ea348f67771efa9738b4484e658521f42d1e Mon Sep 17 00:00:00 2001 +From f0389c3a6d823e2386ab4e21d9e012c4ebd310ac Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Thu, 20 Sep 2012 10:41:00 -0400 -Subject: [PATCH 41/48] asus-wmi: Restrict debugfs interface +Subject: [PATCH 40/47] asus-wmi: Restrict debugfs interface We have no way of validating what all of the Asus WMI methods do on a given machine, and there's a risk that some will allow hardware state to @@ -5522,13 +5523,13 @@ index c11b242..6d5f88f 100644 1, asus->debug.method_id, &input, &output); -- -1.8.1.2 +1.8.1.4 -From ddaafd6f64c317ad0fc33d06449e01632883b4b3 Mon Sep 17 00:00:00 2001 +From 2e507337fc23547c7a15e5a102647becf20dba77 Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Thu, 20 Sep 2012 10:41:01 -0400 -Subject: [PATCH 42/48] Restrict /dev/mem and /dev/kmem in secure boot setups +Subject: [PATCH 41/47] Restrict /dev/mem and /dev/kmem in secure boot setups Allowing users to write to address space makes it possible for the kernel to be subverted. Restrict this when we need to protect the kernel. @@ -5563,13 +5564,13 @@ index 7eee4d8..772ee2b 100644 unsigned long to_write = min_t(unsigned long, count, (unsigned long)high_memory - p); -- -1.8.1.2 +1.8.1.4 -From acb828bd8b69f66957865a66420e543bf0666b21 Mon Sep 17 00:00:00 2001 +From ff22d9716846844f8c249dbc965684a8014efed0 Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Thu, 20 Sep 2012 10:41:04 -0400 -Subject: [PATCH 43/48] acpi: Ignore acpi_rsdp kernel parameter in a secure +Subject: [PATCH 42/47] acpi: Ignore acpi_rsdp kernel parameter in a secure boot environment This option allows userspace to pass the RSDP address to the kernel. This @@ -5585,7 +5586,7 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c -index 586e7e9..8950454 100644 +index e721863..ed82da7 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -245,7 +245,7 @@ early_param("acpi_rsdp", setup_acpi_rsdp); @@ -5598,13 +5599,13 @@ index 586e7e9..8950454 100644 #endif -- -1.8.1.2 +1.8.1.4 -From 0d76357d15402c418cf3345239462e30062a3245 Mon Sep 17 00:00:00 2001 +From b08ac626fbcf917bc219133d49c347d7d58eaae1 Mon Sep 17 00:00:00 2001 From: Matthew Garrett <mjg@redhat.com> Date: Tue, 4 Sep 2012 11:55:13 -0400 -Subject: [PATCH 44/48] kexec: Disable in a secure boot environment +Subject: [PATCH 43/47] kexec: Disable in a secure boot environment kexec could be used as a vector for a malicious user to use a signed kernel to circumvent the secure boot trust model. In the long run we'll want to @@ -5617,10 +5618,10 @@ Signed-off-by: Matthew Garrett <mjg@redhat.com> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kexec.c b/kernel/kexec.c -index bddd3d7..cbdb930 100644 +index 59f7b55..8bf1336 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c -@@ -946,7 +946,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, +@@ -939,7 +939,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, int result; /* We only trust the superuser with rebooting the system. */ @@ -5630,13 +5631,13 @@ index bddd3d7..cbdb930 100644 /* -- -1.8.1.2 +1.8.1.4 -From 8ef1f60c8c529785450ee97365714c940d4f2d8e Mon Sep 17 00:00:00 2001 +From f0d9c2906c1145585882fb7eb167e47e998c2e24 Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Fri, 5 Oct 2012 10:12:48 -0400 -Subject: [PATCH 45/48] MODSIGN: Always enforce module signing in a Secure Boot +Subject: [PATCH 44/47] MODSIGN: Always enforce module signing in a Secure Boot environment If a machine is booted into a Secure Boot environment, we need to @@ -5692,13 +5693,13 @@ index 0925c9a..af4a476 100644 static int param_set_bool_enable_only(const char *val, const struct kernel_param *kp) -- -1.8.1.2 +1.8.1.4 -From b1e2ed158dd5ba3e18a9542802bdeb9d762f0656 Mon Sep 17 00:00:00 2001 +From 1c6bfec7db39e46eeb456fb84e3153281690bbe0 Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Fri, 26 Oct 2012 14:02:09 -0400 -Subject: [PATCH 46/48] hibernate: Disable in a Secure Boot environment +Subject: [PATCH 45/47] hibernate: Disable in a Secure Boot environment There is currently no way to verify the resume image when returning from hibernate. This might compromise the secure boot trust model, @@ -5806,13 +5807,13 @@ index 4ed81e7..b11a0f4 100644 if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { -- -1.8.1.2 +1.8.1.4 -From 4c086b0bca62d3028dfd4faf6e6852ce59788333 Mon Sep 17 00:00:00 2001 +From 07cda990d2f18774522889ece30bddf67c703157 Mon Sep 17 00:00:00 2001 From: Josh Boyer <jwboyer@redhat.com> Date: Tue, 5 Feb 2013 19:25:05 -0500 -Subject: [PATCH 47/48] efi: Disable secure boot if shim is in insecure mode +Subject: [PATCH 46/47] efi: Disable secure boot if shim is in insecure mode A user can manually tell the shim boot loader to disable validation of images it loads. When a user does this, it creates a UEFI variable called @@ -5826,10 +5827,10 @@ Signed-off-by: Josh Boyer <jwboyer@redhat.com> 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c -index 96d859d..c9ffd2f 100644 +index 0998ec7..4945ee5 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c -@@ -863,8 +863,9 @@ fail: +@@ -908,8 +908,9 @@ fail: static int get_secure_boot(efi_system_table_t *_table) { @@ -5840,7 +5841,7 @@ index 96d859d..c9ffd2f 100644 efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; efi_status_t status; -@@ -888,6 +889,23 @@ static int get_secure_boot(efi_system_table_t *_table) +@@ -933,6 +934,23 @@ static int get_secure_boot(efi_system_table_t *_table) if (setup == 1) return 0; @@ -5865,13 +5866,13 @@ index 96d859d..c9ffd2f 100644 } -- -1.8.1.2 +1.8.1.4 -From 8225ade084c6137223579c69f17677fdd994940c Mon Sep 17 00:00:00 2001 +From e61066577405c37c2758f9b7fb2694967bdbe921 Mon Sep 17 00:00:00 2001 From: Kees Cook <keescook@chromium.org> Date: Fri, 8 Feb 2013 11:12:13 -0800 -Subject: [PATCH 48/48] x86: Lock down MSR writing in secure boot +Subject: [PATCH 47/47] x86: Lock down MSR writing in secure boot Writing to MSRs should not be allowed unless CAP_COMPROMISE_KERNEL is set since it could lead to execution of arbitrary code in kernel mode. @@ -5907,5 +5908,5 @@ index ce13049..fa4dc6c 100644 err = -EFAULT; break; -- -1.8.1.2 +1.8.1.4 diff --git a/freed-ora/current/master/drm-exynos-fix-multiple-definition-build-error.patch b/freed-ora/current/master/drm-exynos-fix-multiple-definition-build-error.patch new file mode 100644 index 000000000..8242f20fd --- /dev/null +++ b/freed-ora/current/master/drm-exynos-fix-multiple-definition-build-error.patch @@ -0,0 +1,53 @@ +From patchwork Fri Apr 26 05:03:10 2013 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: drm/exynos: fix multiple definition build error +Date: Fri, 26 Apr 2013 05:03:10 -0000 +From: Inki Dae <inki.dae@samsung.com> +X-Patchwork-Id: 2490831 +Message-Id: <1366952590-11652-1-git-send-email-inki.dae@samsung.com> +To: airlied@linux.ie, dri-devel@lists.freedesktop.org +Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com + +This patch fixes multiple definition error like below when building it +as moudle with device tree support. + +drivers/gpu/drm/exynos/exynos_drm_g2d.o: In function `.LANCHOR1': +exynos_drm_g2d.c:(.rodata+0x6c): multiple definition of `__mod_of_device_table' +drivers/gpu/drm/exynos/exynos_drm_fimd.o:exynos_drm_fimd.c:(.rodata+0x144): first defined here + +Signed-off-by: Inki Dae <inki.dae@samsung.com> +Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> + +--- +drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- + drivers/gpu/drm/exynos/exynos_drm_g2d.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c +index 746b282..1e02d13 100644 +--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c ++++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c +@@ -117,7 +117,7 @@ static const struct of_device_id fimd_driver_dt_match[] = { + .data = &exynos5_fimd_driver_data }, + {}, + }; +-MODULE_DEVICE_TABLE(of, fimd_driver_dt_match); ++MODULE_DEVICE_TABLE(of_fimd, fimd_driver_dt_match); + #endif + + static inline struct fimd_driver_data *drm_fimd_get_driver_data( +diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c +index 47a493c..6a01ff1 100644 +--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c ++++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c +@@ -1525,7 +1525,7 @@ static const struct of_device_id exynos_g2d_match[] = { + { .compatible = "samsung,exynos5250-g2d" }, + {}, + }; +-MODULE_DEVICE_TABLE(of, exynos_g2d_match); ++MODULE_DEVICE_TABLE(of_g2d, exynos_g2d_match); + #endif + + struct platform_driver g2d_driver = { diff --git a/freed-ora/current/master/drm-i915-dp-stfu.patch b/freed-ora/current/master/drm-i915-dp-stfu.patch index 78fb5fe60..fb2e58ee9 100644 --- a/freed-ora/current/master/drm-i915-dp-stfu.patch +++ b/freed-ora/current/master/drm-i915-dp-stfu.patch @@ -1,17 +1,17 @@ diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c -index f61cb79..64a24c0 100644 +index fb2fbc1..0aaf67d 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c -@@ -315,7 +315,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp) - if (!is_edp(intel_dp)) - return; +@@ -283,7 +283,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp) + pp_ctrl_reg = IS_VALLEYVIEW(dev) ? PIPEA_PP_CONTROL : PCH_PP_CONTROL; + if (!ironlake_edp_have_panel_power(intel_dp) && !ironlake_edp_have_panel_vdd(intel_dp)) { - WARN(1, "eDP powered off while attempting aux channel communication.\n"); + DRM_ERROR("eDP powered off while attempting aux channel communication.\n"); DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n", - I915_READ(PCH_PP_STATUS), - I915_READ(PCH_PP_CONTROL)); -@@ -446,7 +446,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, + I915_READ(pp_stat_reg), + I915_READ(pp_ctrl_reg)); +@@ -376,7 +376,7 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, } if (try == 3) { @@ -20,7 +20,7 @@ index f61cb79..64a24c0 100644 I915_READ(ch_ctl)); ret = -EBUSY; goto out; -@@ -1083,8 +1083,8 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp) +@@ -995,8 +995,8 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp) return; DRM_DEBUG_KMS("Turn eDP VDD on\n"); @@ -31,7 +31,7 @@ index f61cb79..64a24c0 100644 intel_dp->want_panel_vdd = true; -@@ -1151,7 +1151,8 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync) +@@ -1070,7 +1070,8 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync) return; DRM_DEBUG_KMS("Turn eDP VDD off %d\n", intel_dp->want_panel_vdd); @@ -41,7 +41,7 @@ index f61cb79..64a24c0 100644 intel_dp->want_panel_vdd = false; -@@ -1221,7 +1222,8 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp) +@@ -1144,7 +1145,8 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp) DRM_DEBUG_KMS("Turn eDP power off\n"); @@ -49,5 +49,5 @@ index f61cb79..64a24c0 100644 + if (!intel_dp->want_panel_vdd) + DRM_ERROR("Need VDD to turn off panel\n"); - pp = ironlake_get_pp_control(dev_priv); + pp = ironlake_get_pp_control(intel_dp); /* We need to switch off panel power _and_ force vdd, for otherwise some diff --git a/freed-ora/current/master/drm-qxl-driver.patch b/freed-ora/current/master/drm-qxl-driver.patch deleted file mode 100644 index 6a6bf111d..000000000 --- a/freed-ora/current/master/drm-qxl-driver.patch +++ /dev/null @@ -1,7444 +0,0 @@ -From 1a401a749cb1f06e637ef0e91fb8c120963aa356 Mon Sep 17 00:00:00 2001 -From: Dave Airlie <airlied@gmail.com> -Date: Mon, 25 Feb 2013 14:47:55 +1000 -Subject: [PATCH 2/2] drm: add new QXL driver. (v1.3) - -QXL is a paravirtual graphics device used by the Spice virtual desktop -interface. - -The drivers uses GEM and TTM to manage memory, the qxl hw fencing however -is quite different than normal TTM expects, we have to keep track of a number -of non-linear fence ids per bo that we need to have released by the hardware. - -The releases are freed from a workqueue that wakes up and processes the -release ring. - -releases are suballocated from a BO, there are 3 release categories, drawables, -surfaces and cursor cmds. The hw also has 3 rings for commands, cursor and release handling. - -The hardware also have a surface id tracking mechnaism and the driver encapsulates it completely inside the kernel, userspace never sees the actual hw surface -ids. - -This requires a newer version of the QXL userspace driver, so shouldn't be -enabled until that has been placed into your distro of choice. - -Authors: Dave Airlie, Alon Levy - -v1.1: fixup some issues in the ioctl interface with padding -v1.2: add module device table -v1.3: fix nomodeset, fbcon leak, dumb bo create, release ring irq, - don't try flush release ring (broken hw), fix -modesetting. - -Signed-off-by: Alon Levy <alevy@redhat.com> -Signed-off-by: Dave Airlie <airlied@redhat.com> ---- - drivers/gpu/drm/Kconfig | 2 + - drivers/gpu/drm/Makefile | 1 + - drivers/gpu/drm/qxl/Kconfig | 10 + - drivers/gpu/drm/qxl/Makefile | 9 + - drivers/gpu/drm/qxl/qxl_cmd.c | 707 +++++++++++++++++++++++++++ - drivers/gpu/drm/qxl/qxl_debugfs.c | 135 ++++++ - drivers/gpu/drm/qxl/qxl_dev.h | 879 ++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/qxl/qxl_display.c | 981 ++++++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/qxl/qxl_draw.c | 384 +++++++++++++++ - drivers/gpu/drm/qxl/qxl_drv.c | 145 ++++++ - drivers/gpu/drm/qxl/qxl_drv.h | 566 ++++++++++++++++++++++ - drivers/gpu/drm/qxl/qxl_dumb.c | 93 ++++ - drivers/gpu/drm/qxl/qxl_fb.c | 567 ++++++++++++++++++++++ - drivers/gpu/drm/qxl/qxl_fence.c | 97 ++++ - drivers/gpu/drm/qxl/qxl_gem.c | 178 +++++++ - drivers/gpu/drm/qxl/qxl_image.c | 120 +++++ - drivers/gpu/drm/qxl/qxl_ioctl.c | 411 ++++++++++++++++ - drivers/gpu/drm/qxl/qxl_irq.c | 97 ++++ - drivers/gpu/drm/qxl/qxl_kms.c | 302 ++++++++++++ - drivers/gpu/drm/qxl/qxl_object.c | 365 ++++++++++++++ - drivers/gpu/drm/qxl/qxl_object.h | 112 +++++ - drivers/gpu/drm/qxl/qxl_release.c | 307 ++++++++++++ - drivers/gpu/drm/qxl/qxl_ttm.c | 577 ++++++++++++++++++++++ - include/uapi/drm/Kbuild | 1 + - include/uapi/drm/qxl_drm.h | 152 ++++++ - 25 files changed, 7198 insertions(+) - create mode 100644 drivers/gpu/drm/qxl/Kconfig - create mode 100644 drivers/gpu/drm/qxl/Makefile - create mode 100644 drivers/gpu/drm/qxl/qxl_cmd.c - create mode 100644 drivers/gpu/drm/qxl/qxl_debugfs.c - create mode 100644 drivers/gpu/drm/qxl/qxl_dev.h - create mode 100644 drivers/gpu/drm/qxl/qxl_display.c - create mode 100644 drivers/gpu/drm/qxl/qxl_draw.c - create mode 100644 drivers/gpu/drm/qxl/qxl_drv.c - create mode 100644 drivers/gpu/drm/qxl/qxl_drv.h - create mode 100644 drivers/gpu/drm/qxl/qxl_dumb.c - create mode 100644 drivers/gpu/drm/qxl/qxl_fb.c - create mode 100644 drivers/gpu/drm/qxl/qxl_fence.c - create mode 100644 drivers/gpu/drm/qxl/qxl_gem.c - create mode 100644 drivers/gpu/drm/qxl/qxl_image.c - create mode 100644 drivers/gpu/drm/qxl/qxl_ioctl.c - create mode 100644 drivers/gpu/drm/qxl/qxl_irq.c - create mode 100644 drivers/gpu/drm/qxl/qxl_kms.c - create mode 100644 drivers/gpu/drm/qxl/qxl_object.c - create mode 100644 drivers/gpu/drm/qxl/qxl_object.h - create mode 100644 drivers/gpu/drm/qxl/qxl_release.c - create mode 100644 drivers/gpu/drm/qxl/qxl_ttm.c - create mode 100644 include/uapi/drm/qxl_drm.h - -diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig -index 1e82882..19b8e0d 100644 ---- a/drivers/gpu/drm/Kconfig -+++ b/drivers/gpu/drm/Kconfig -@@ -220,3 +220,5 @@ source "drivers/gpu/drm/tegra/Kconfig" - source "drivers/gpu/drm/omapdrm/Kconfig" - - source "drivers/gpu/drm/tilcdc/Kconfig" -+ -+source "drivers/gpu/drm/qxl/Kconfig" -diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile -index 0d59b24..6a42115 100644 ---- a/drivers/gpu/drm/Makefile -+++ b/drivers/gpu/drm/Makefile -@@ -52,4 +52,5 @@ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/ - obj-$(CONFIG_DRM_TEGRA) += tegra/ - obj-$(CONFIG_DRM_OMAP) += omapdrm/ - obj-$(CONFIG_DRM_TILCDC) += tilcdc/ -+obj-$(CONFIG_DRM_QXL) += qxl/ - obj-y += i2c/ -diff --git a/drivers/gpu/drm/qxl/Kconfig b/drivers/gpu/drm/qxl/Kconfig -new file mode 100644 -index 0000000..2f1a57e ---- /dev/null -+++ b/drivers/gpu/drm/qxl/Kconfig -@@ -0,0 +1,10 @@ -+config DRM_QXL -+ tristate "QXL virtual GPU" -+ depends on DRM && PCI -+ select FB_SYS_FILLRECT -+ select FB_SYS_COPYAREA -+ select FB_SYS_IMAGEBLIT -+ select DRM_KMS_HELPER -+ select DRM_TTM -+ help -+ QXL virtual GPU for Spice virtualization desktop integration. Do not enable this driver unless your distro ships a corresponding X.org QXL driver that can handle kernel modesetting. -diff --git a/drivers/gpu/drm/qxl/Makefile b/drivers/gpu/drm/qxl/Makefile -new file mode 100644 -index 0000000..ea046ba ---- /dev/null -+++ b/drivers/gpu/drm/qxl/Makefile -@@ -0,0 +1,9 @@ -+# -+# Makefile for the drm device driver. This driver provides support for the -+# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. -+ -+ccflags-y := -Iinclude/drm -+ -+qxl-y := qxl_drv.o qxl_kms.o qxl_display.o qxl_ttm.o qxl_fb.o qxl_object.o qxl_gem.o qxl_cmd.o qxl_image.o qxl_draw.o qxl_debugfs.o qxl_irq.o qxl_dumb.o qxl_ioctl.o qxl_fence.o qxl_release.o -+ -+obj-$(CONFIG_DRM_QXL)+= qxl.o -diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c -new file mode 100644 -index 0000000..804b411 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_cmd.c -@@ -0,0 +1,707 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+/* QXL cmd/ring handling */ -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+static int qxl_reap_surface_id(struct qxl_device *qdev, int max_to_reap); -+ -+struct ring { -+ struct qxl_ring_header header; -+ uint8_t elements[0]; -+}; -+ -+struct qxl_ring { -+ struct ring *ring; -+ int element_size; -+ int n_elements; -+ int prod_notify; -+ wait_queue_head_t *push_event; -+ spinlock_t lock; -+}; -+ -+void qxl_ring_free(struct qxl_ring *ring) -+{ -+ kfree(ring); -+} -+ -+struct qxl_ring * -+qxl_ring_create(struct qxl_ring_header *header, -+ int element_size, -+ int n_elements, -+ int prod_notify, -+ bool set_prod_notify, -+ wait_queue_head_t *push_event) -+{ -+ struct qxl_ring *ring; -+ -+ ring = kmalloc(sizeof(*ring), GFP_KERNEL); -+ if (!ring) -+ return NULL; -+ -+ ring->ring = (struct ring *)header; -+ ring->element_size = element_size; -+ ring->n_elements = n_elements; -+ ring->prod_notify = prod_notify; -+ ring->push_event = push_event; -+ if (set_prod_notify) -+ header->notify_on_prod = ring->n_elements; -+ spin_lock_init(&ring->lock); -+ return ring; -+} -+ -+static int qxl_check_header(struct qxl_ring *ring) -+{ -+ int ret; -+ struct qxl_ring_header *header = &(ring->ring->header); -+ unsigned long flags; -+ spin_lock_irqsave(&ring->lock, flags); -+ ret = header->prod - header->cons < header->num_items; -+ if (ret == 0) -+ header->notify_on_cons = header->cons + 1; -+ spin_unlock_irqrestore(&ring->lock, flags); -+ return ret; -+} -+ -+static int qxl_check_idle(struct qxl_ring *ring) -+{ -+ int ret; -+ struct qxl_ring_header *header = &(ring->ring->header); -+ unsigned long flags; -+ spin_lock_irqsave(&ring->lock, flags); -+ ret = header->prod == header->cons; -+ spin_unlock_irqrestore(&ring->lock, flags); -+ return ret; -+} -+ -+int qxl_ring_push(struct qxl_ring *ring, -+ const void *new_elt, bool interruptible) -+{ -+ struct qxl_ring_header *header = &(ring->ring->header); -+ uint8_t *elt; -+ int idx, ret; -+ unsigned long flags; -+ spin_lock_irqsave(&ring->lock, flags); -+ if (header->prod - header->cons == header->num_items) { -+ header->notify_on_cons = header->cons + 1; -+ mb(); -+ spin_unlock_irqrestore(&ring->lock, flags); -+ if (!drm_can_sleep()) { -+ while (!qxl_check_header(ring)) -+ udelay(1); -+ } else { -+ if (interruptible) { -+ ret = wait_event_interruptible(*ring->push_event, -+ qxl_check_header(ring)); -+ if (ret) -+ return ret; -+ } else { -+ wait_event(*ring->push_event, -+ qxl_check_header(ring)); -+ } -+ -+ } -+ spin_lock_irqsave(&ring->lock, flags); -+ } -+ -+ idx = header->prod & (ring->n_elements - 1); -+ elt = ring->ring->elements + idx * ring->element_size; -+ -+ memcpy((void *)elt, new_elt, ring->element_size); -+ -+ header->prod++; -+ -+ mb(); -+ -+ if (header->prod == header->notify_on_prod) -+ outb(0, ring->prod_notify); -+ -+ spin_unlock_irqrestore(&ring->lock, flags); -+ return 0; -+} -+ -+bool qxl_ring_pop(struct qxl_ring *ring, -+ void *element) -+{ -+ volatile struct qxl_ring_header *header = &(ring->ring->header); -+ volatile uint8_t *ring_elt; -+ int idx; -+ unsigned long flags; -+ spin_lock_irqsave(&ring->lock, flags); -+ if (header->cons == header->prod) { -+ header->notify_on_prod = header->cons + 1; -+ spin_unlock_irqrestore(&ring->lock, flags); -+ return false; -+ } -+ -+ idx = header->cons & (ring->n_elements - 1); -+ ring_elt = ring->ring->elements + idx * ring->element_size; -+ -+ memcpy(element, (void *)ring_elt, ring->element_size); -+ -+ header->cons++; -+ -+ spin_unlock_irqrestore(&ring->lock, flags); -+ return true; -+} -+ -+void qxl_ring_wait_idle(struct qxl_ring *ring) -+{ -+ struct qxl_ring_header *header = &(ring->ring->header); -+ unsigned long flags; -+ -+ spin_lock_irqsave(&ring->lock, flags); -+ if (ring->ring->header.cons < ring->ring->header.prod) { -+ header->notify_on_cons = header->prod; -+ mb(); -+ spin_unlock_irqrestore(&ring->lock, flags); -+ wait_event_interruptible(*ring->push_event, -+ qxl_check_idle(ring)); -+ spin_lock_irqsave(&ring->lock, flags); -+ } -+ spin_unlock_irqrestore(&ring->lock, flags); -+} -+ -+int -+qxl_push_command_ring_release(struct qxl_device *qdev, struct qxl_release *release, -+ uint32_t type, bool interruptible) -+{ -+ struct qxl_command cmd; -+ -+ cmd.type = type; -+ cmd.data = qxl_bo_physical_address(qdev, release->bos[0], release->release_offset); -+ -+ return qxl_ring_push(qdev->command_ring, &cmd, interruptible); -+} -+ -+int -+qxl_push_cursor_ring_release(struct qxl_device *qdev, struct qxl_release *release, -+ uint32_t type, bool interruptible) -+{ -+ struct qxl_command cmd; -+ -+ cmd.type = type; -+ cmd.data = qxl_bo_physical_address(qdev, release->bos[0], release->release_offset); -+ -+ return qxl_ring_push(qdev->cursor_ring, &cmd, interruptible); -+} -+ -+bool qxl_queue_garbage_collect(struct qxl_device *qdev, bool flush) -+{ -+ if (!qxl_check_idle(qdev->release_ring)) { -+ queue_work(qdev->gc_queue, &qdev->gc_work); -+ if (flush) -+ flush_work(&qdev->gc_work); -+ return true; -+ } -+ return false; -+} -+ -+int qxl_garbage_collect(struct qxl_device *qdev) -+{ -+ struct qxl_release *release; -+ uint64_t id, next_id; -+ int i = 0; -+ int ret; -+ union qxl_release_info *info; -+ -+ while (qxl_ring_pop(qdev->release_ring, &id)) { -+ QXL_INFO(qdev, "popped %lld\n", id); -+ while (id) { -+ release = qxl_release_from_id_locked(qdev, id); -+ if (release == NULL) -+ break; -+ -+ ret = qxl_release_reserve(qdev, release, false); -+ if (ret) { -+ qxl_io_log(qdev, "failed to reserve release on garbage collect %lld\n", id); -+ DRM_ERROR("failed to reserve release %lld\n", id); -+ } -+ -+ info = qxl_release_map(qdev, release); -+ next_id = info->next; -+ qxl_release_unmap(qdev, release, info); -+ -+ qxl_release_unreserve(qdev, release); -+ QXL_INFO(qdev, "popped %lld, next %lld\n", id, -+ next_id); -+ -+ switch (release->type) { -+ case QXL_RELEASE_DRAWABLE: -+ case QXL_RELEASE_SURFACE_CMD: -+ case QXL_RELEASE_CURSOR_CMD: -+ break; -+ default: -+ DRM_ERROR("unexpected release type\n"); -+ break; -+ } -+ id = next_id; -+ -+ qxl_release_free(qdev, release); -+ ++i; -+ } -+ } -+ -+ QXL_INFO(qdev, "%s: %lld\n", __func__, i); -+ -+ return i; -+} -+ -+int qxl_alloc_bo_reserved(struct qxl_device *qdev, unsigned long size, -+ struct qxl_bo **_bo) -+{ -+ struct qxl_bo *bo; -+ int ret; -+ -+ ret = qxl_bo_create(qdev, size, false /* not kernel - device */, -+ QXL_GEM_DOMAIN_VRAM, NULL, &bo); -+ if (ret) { -+ DRM_ERROR("failed to allocate VRAM BO\n"); -+ return ret; -+ } -+ ret = qxl_bo_reserve(bo, false); -+ if (unlikely(ret != 0)) -+ goto out_unref; -+ -+ *_bo = bo; -+ return 0; -+out_unref: -+ qxl_bo_unref(&bo); -+ return 0; -+} -+ -+static int wait_for_io_cmd_user(struct qxl_device *qdev, uint8_t val, long port) -+{ -+ int irq_num; -+ long addr = qdev->io_base + port; -+ int ret; -+ -+ mutex_lock(&qdev->async_io_mutex); -+ irq_num = atomic_read(&qdev->irq_received_io_cmd); -+ -+ -+ if (qdev->last_sent_io_cmd > irq_num) { -+ ret = wait_event_interruptible(qdev->io_cmd_event, -+ atomic_read(&qdev->irq_received_io_cmd) > irq_num); -+ if (ret) -+ goto out; -+ irq_num = atomic_read(&qdev->irq_received_io_cmd); -+ } -+ outb(val, addr); -+ qdev->last_sent_io_cmd = irq_num + 1; -+ ret = wait_event_interruptible(qdev->io_cmd_event, -+ atomic_read(&qdev->irq_received_io_cmd) > irq_num); -+out: -+ mutex_unlock(&qdev->async_io_mutex); -+ return ret; -+} -+ -+static void wait_for_io_cmd(struct qxl_device *qdev, uint8_t val, long port) -+{ -+ int ret; -+ -+restart: -+ ret = wait_for_io_cmd_user(qdev, val, port); -+ if (ret == -ERESTARTSYS) -+ goto restart; -+} -+ -+int qxl_io_update_area(struct qxl_device *qdev, struct qxl_bo *surf, -+ const struct qxl_rect *area) -+{ -+ int surface_id; -+ uint32_t surface_width, surface_height; -+ int ret; -+ -+ if (!surf->hw_surf_alloc) -+ DRM_ERROR("got io update area with no hw surface\n"); -+ -+ if (surf->is_primary) -+ surface_id = 0; -+ else -+ surface_id = surf->surface_id; -+ surface_width = surf->surf.width; -+ surface_height = surf->surf.height; -+ -+ if (area->left < 0 || area->top < 0 || -+ area->right > surface_width || area->bottom > surface_height) { -+ qxl_io_log(qdev, "%s: not doing area update for " -+ "%d, (%d,%d,%d,%d) (%d,%d)\n", __func__, surface_id, area->left, -+ area->top, area->right, area->bottom, surface_width, surface_height); -+ return -EINVAL; -+ } -+ mutex_lock(&qdev->update_area_mutex); -+ qdev->ram_header->update_area = *area; -+ qdev->ram_header->update_surface = surface_id; -+ ret = wait_for_io_cmd_user(qdev, 0, QXL_IO_UPDATE_AREA_ASYNC); -+ mutex_unlock(&qdev->update_area_mutex); -+ return ret; -+} -+ -+void qxl_io_notify_oom(struct qxl_device *qdev) -+{ -+ outb(0, qdev->io_base + QXL_IO_NOTIFY_OOM); -+} -+ -+void qxl_io_flush_release(struct qxl_device *qdev) -+{ -+ outb(0, qdev->io_base + QXL_IO_FLUSH_RELEASE); -+} -+ -+void qxl_io_flush_surfaces(struct qxl_device *qdev) -+{ -+ wait_for_io_cmd(qdev, 0, QXL_IO_FLUSH_SURFACES_ASYNC); -+} -+ -+ -+void qxl_io_destroy_primary(struct qxl_device *qdev) -+{ -+ wait_for_io_cmd(qdev, 0, QXL_IO_DESTROY_PRIMARY_ASYNC); -+} -+ -+void qxl_io_create_primary(struct qxl_device *qdev, unsigned width, -+ unsigned height, unsigned offset, struct qxl_bo *bo) -+{ -+ struct qxl_surface_create *create; -+ -+ QXL_INFO(qdev, "%s: qdev %p, ram_header %p\n", __func__, qdev, -+ qdev->ram_header); -+ create = &qdev->ram_header->create_surface; -+ create->format = bo->surf.format; -+ create->width = width; -+ create->height = height; -+ create->stride = bo->surf.stride; -+ create->mem = qxl_bo_physical_address(qdev, bo, offset); -+ -+ QXL_INFO(qdev, "%s: mem = %llx, from %p\n", __func__, create->mem, -+ bo->kptr); -+ -+ create->flags = QXL_SURF_FLAG_KEEP_DATA; -+ create->type = QXL_SURF_TYPE_PRIMARY; -+ -+ wait_for_io_cmd(qdev, 0, QXL_IO_CREATE_PRIMARY_ASYNC); -+} -+ -+void qxl_io_memslot_add(struct qxl_device *qdev, uint8_t id) -+{ -+ QXL_INFO(qdev, "qxl_memslot_add %d\n", id); -+ wait_for_io_cmd(qdev, id, QXL_IO_MEMSLOT_ADD_ASYNC); -+} -+ -+void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...) -+{ -+ va_list args; -+ -+ va_start(args, fmt); -+ vsnprintf(qdev->ram_header->log_buf, QXL_LOG_BUF_SIZE, fmt, args); -+ va_end(args); -+ /* -+ * DO not do a DRM output here - this will call printk, which will -+ * call back into qxl for rendering (qxl_fb) -+ */ -+ outb(0, qdev->io_base + QXL_IO_LOG); -+} -+ -+void qxl_io_reset(struct qxl_device *qdev) -+{ -+ outb(0, qdev->io_base + QXL_IO_RESET); -+} -+ -+void qxl_io_monitors_config(struct qxl_device *qdev) -+{ -+ qxl_io_log(qdev, "%s: %d [%dx%d+%d+%d]\n", __func__, -+ qdev->monitors_config ? -+ qdev->monitors_config->count : -1, -+ qdev->monitors_config && qdev->monitors_config->count ? -+ qdev->monitors_config->heads[0].width : -1, -+ qdev->monitors_config && qdev->monitors_config->count ? -+ qdev->monitors_config->heads[0].height : -1, -+ qdev->monitors_config && qdev->monitors_config->count ? -+ qdev->monitors_config->heads[0].x : -1, -+ qdev->monitors_config && qdev->monitors_config->count ? -+ qdev->monitors_config->heads[0].y : -1 -+ ); -+ -+ wait_for_io_cmd(qdev, 0, QXL_IO_MONITORS_CONFIG_ASYNC); -+} -+ -+int qxl_surface_id_alloc(struct qxl_device *qdev, -+ struct qxl_bo *surf) -+{ -+ uint32_t handle = -ENOMEM; -+ int idr_ret; -+ int count = 0; -+again: -+ if (idr_pre_get(&qdev->surf_id_idr, GFP_ATOMIC) == 0) { -+ DRM_ERROR("Out of memory for surf idr\n"); -+ kfree(surf); -+ goto alloc_fail; -+ } -+ -+ spin_lock(&qdev->surf_id_idr_lock); -+ idr_ret = idr_get_new_above(&qdev->surf_id_idr, NULL, 1, &handle); -+ spin_unlock(&qdev->surf_id_idr_lock); -+ -+ if (idr_ret == -EAGAIN) -+ goto again; -+ -+ if (handle >= qdev->rom->n_surfaces) { -+ count++; -+ spin_lock(&qdev->surf_id_idr_lock); -+ idr_remove(&qdev->surf_id_idr, handle); -+ spin_unlock(&qdev->surf_id_idr_lock); -+ qxl_reap_surface_id(qdev, 2); -+ goto again; -+ } -+ surf->surface_id = handle; -+ -+ spin_lock(&qdev->surf_id_idr_lock); -+ qdev->last_alloced_surf_id = handle; -+ spin_unlock(&qdev->surf_id_idr_lock); -+ alloc_fail: -+ return 0; -+} -+ -+void qxl_surface_id_dealloc(struct qxl_device *qdev, -+ uint32_t surface_id) -+{ -+ spin_lock(&qdev->surf_id_idr_lock); -+ idr_remove(&qdev->surf_id_idr, surface_id); -+ spin_unlock(&qdev->surf_id_idr_lock); -+} -+ -+int qxl_hw_surface_alloc(struct qxl_device *qdev, -+ struct qxl_bo *surf, -+ struct ttm_mem_reg *new_mem) -+{ -+ struct qxl_surface_cmd *cmd; -+ struct qxl_release *release; -+ int ret; -+ -+ if (surf->hw_surf_alloc) -+ return 0; -+ -+ ret = qxl_alloc_surface_release_reserved(qdev, QXL_SURFACE_CMD_CREATE, -+ NULL, -+ &release); -+ if (ret) -+ return ret; -+ -+ cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release); -+ cmd->type = QXL_SURFACE_CMD_CREATE; -+ cmd->u.surface_create.format = surf->surf.format; -+ cmd->u.surface_create.width = surf->surf.width; -+ cmd->u.surface_create.height = surf->surf.height; -+ cmd->u.surface_create.stride = surf->surf.stride; -+ if (new_mem) { -+ int slot_id = surf->type == QXL_GEM_DOMAIN_VRAM ? qdev->main_mem_slot : qdev->surfaces_mem_slot; -+ struct qxl_memslot *slot = &(qdev->mem_slots[slot_id]); -+ -+ /* TODO - need to hold one of the locks to read tbo.offset */ -+ cmd->u.surface_create.data = slot->high_bits; -+ -+ cmd->u.surface_create.data |= (new_mem->start << PAGE_SHIFT) + surf->tbo.bdev->man[new_mem->mem_type].gpu_offset; -+ } else -+ cmd->u.surface_create.data = qxl_bo_physical_address(qdev, surf, 0); -+ cmd->surface_id = surf->surface_id; -+ qxl_release_unmap(qdev, release, &cmd->release_info); -+ -+ surf->surf_create = release; -+ -+ /* no need to add a release to the fence for this bo, -+ since it is only released when we ask to destroy the surface -+ and it would never signal otherwise */ -+ qxl_fence_releaseable(qdev, release); -+ -+ qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false); -+ -+ qxl_release_unreserve(qdev, release); -+ -+ surf->hw_surf_alloc = true; -+ spin_lock(&qdev->surf_id_idr_lock); -+ idr_replace(&qdev->surf_id_idr, surf, surf->surface_id); -+ spin_unlock(&qdev->surf_id_idr_lock); -+ return 0; -+} -+ -+int qxl_hw_surface_dealloc(struct qxl_device *qdev, -+ struct qxl_bo *surf) -+{ -+ struct qxl_surface_cmd *cmd; -+ struct qxl_release *release; -+ int ret; -+ int id; -+ -+ if (!surf->hw_surf_alloc) -+ return 0; -+ -+ ret = qxl_alloc_surface_release_reserved(qdev, QXL_SURFACE_CMD_DESTROY, -+ surf->surf_create, -+ &release); -+ if (ret) -+ return ret; -+ -+ surf->surf_create = NULL; -+ /* remove the surface from the idr, but not the surface id yet */ -+ spin_lock(&qdev->surf_id_idr_lock); -+ idr_replace(&qdev->surf_id_idr, NULL, surf->surface_id); -+ spin_unlock(&qdev->surf_id_idr_lock); -+ surf->hw_surf_alloc = false; -+ -+ id = surf->surface_id; -+ surf->surface_id = 0; -+ -+ release->surface_release_id = id; -+ cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release); -+ cmd->type = QXL_SURFACE_CMD_DESTROY; -+ cmd->surface_id = id; -+ qxl_release_unmap(qdev, release, &cmd->release_info); -+ -+ qxl_fence_releaseable(qdev, release); -+ -+ qxl_push_command_ring_release(qdev, release, QXL_CMD_SURFACE, false); -+ -+ qxl_release_unreserve(qdev, release); -+ -+ -+ return 0; -+} -+ -+int qxl_update_surface(struct qxl_device *qdev, struct qxl_bo *surf) -+{ -+ struct qxl_rect rect; -+ int ret; -+ -+ /* if we are evicting, we need to make sure the surface is up -+ to date */ -+ rect.left = 0; -+ rect.right = surf->surf.width; -+ rect.top = 0; -+ rect.bottom = surf->surf.height; -+retry: -+ ret = qxl_io_update_area(qdev, surf, &rect); -+ if (ret == -ERESTARTSYS) -+ goto retry; -+ return ret; -+} -+ -+void qxl_surface_evict_locked(struct qxl_device *qdev, struct qxl_bo *surf, bool do_update_area) -+{ -+ /* no need to update area if we are just freeing the surface normally */ -+ if (do_update_area) -+ qxl_update_surface(qdev, surf); -+ -+ /* nuke the surface id at the hw */ -+ qxl_hw_surface_dealloc(qdev, surf); -+} -+ -+void qxl_surface_evict(struct qxl_device *qdev, struct qxl_bo *surf, bool do_update_area) -+{ -+ mutex_lock(&qdev->surf_evict_mutex); -+ qxl_surface_evict_locked(qdev, surf, do_update_area); -+ mutex_unlock(&qdev->surf_evict_mutex); -+} -+ -+static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stall) -+{ -+ int ret; -+ -+ ret = qxl_bo_reserve(surf, false); -+ if (ret == -EBUSY) -+ return -EBUSY; -+ -+ if (surf->fence.num_active_releases > 0 && stall == false) { -+ qxl_bo_unreserve(surf); -+ return -EBUSY; -+ } -+ -+ if (stall) -+ mutex_unlock(&qdev->surf_evict_mutex); -+ -+ spin_lock(&surf->tbo.bdev->fence_lock); -+ ret = ttm_bo_wait(&surf->tbo, true, true, !stall); -+ spin_unlock(&surf->tbo.bdev->fence_lock); -+ -+ if (stall) -+ mutex_lock(&qdev->surf_evict_mutex); -+ if (ret == -EBUSY) { -+ qxl_bo_unreserve(surf); -+ return -EBUSY; -+ } -+ -+ qxl_surface_evict_locked(qdev, surf, true); -+ qxl_bo_unreserve(surf); -+ return 0; -+} -+ -+static int qxl_reap_surface_id(struct qxl_device *qdev, int max_to_reap) -+{ -+ int num_reaped = 0; -+ int i, ret; -+ bool stall = false; -+ int start = 0; -+ -+ mutex_lock(&qdev->surf_evict_mutex); -+again: -+ -+ spin_lock(&qdev->surf_id_idr_lock); -+ start = qdev->last_alloced_surf_id + 1; -+ spin_unlock(&qdev->surf_id_idr_lock); -+ -+ for (i = start; i < start + qdev->rom->n_surfaces; i++) { -+ void *objptr; -+ int surfid = i % qdev->rom->n_surfaces; -+ -+ /* this avoids the case where the objects is in the -+ idr but has been evicted half way - its makes -+ the idr lookup atomic with the eviction */ -+ spin_lock(&qdev->surf_id_idr_lock); -+ objptr = idr_find(&qdev->surf_id_idr, surfid); -+ spin_unlock(&qdev->surf_id_idr_lock); -+ -+ if (!objptr) -+ continue; -+ -+ ret = qxl_reap_surf(qdev, objptr, stall); -+ if (ret == 0) -+ num_reaped++; -+ if (num_reaped >= max_to_reap) -+ break; -+ } -+ if (num_reaped == 0 && stall == false) { -+ stall = true; -+ goto again; -+ } -+ -+ mutex_unlock(&qdev->surf_evict_mutex); -+ if (num_reaped) { -+ usleep_range(500, 1000); -+ qxl_queue_garbage_collect(qdev, true); -+ } -+ -+ return 0; -+} -diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c -new file mode 100644 -index 0000000..c630152 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_debugfs.c -@@ -0,0 +1,135 @@ -+/* -+ * Copyright (C) 2009 Red Hat <bskeggs@redhat.com> -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ * -+ */ -+ -+/* -+ * Authors: -+ * Alon Levy <alevy@redhat.com> -+ */ -+ -+#include <linux/debugfs.h> -+ -+#include "drmP.h" -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+ -+static int -+qxl_debugfs_irq_received(struct seq_file *m, void *data) -+{ -+ struct drm_info_node *node = (struct drm_info_node *) m->private; -+ struct qxl_device *qdev = node->minor->dev->dev_private; -+ -+ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received)); -+ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_display)); -+ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_cursor)); -+ seq_printf(m, "%d\n", atomic_read(&qdev->irq_received_io_cmd)); -+ seq_printf(m, "%d\n", qdev->irq_received_error); -+ return 0; -+} -+ -+static int -+qxl_debugfs_buffers_info(struct seq_file *m, void *data) -+{ -+ struct drm_info_node *node = (struct drm_info_node *) m->private; -+ struct qxl_device *qdev = node->minor->dev->dev_private; -+ struct qxl_bo *bo; -+ -+ list_for_each_entry(bo, &qdev->gem.objects, list) { -+ seq_printf(m, "size %ld, pc %d, sync obj %p, num releases %d\n", -+ (unsigned long)bo->gem_base.size, bo->pin_count, -+ bo->tbo.sync_obj, bo->fence.num_active_releases); -+ } -+ return 0; -+} -+ -+static struct drm_info_list qxl_debugfs_list[] = { -+ { "irq_received", qxl_debugfs_irq_received, 0, NULL }, -+ { "qxl_buffers", qxl_debugfs_buffers_info, 0, NULL }, -+}; -+#define QXL_DEBUGFS_ENTRIES ARRAY_SIZE(qxl_debugfs_list) -+ -+int -+qxl_debugfs_init(struct drm_minor *minor) -+{ -+ drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES, -+ minor->debugfs_root, minor); -+ return 0; -+} -+ -+void -+qxl_debugfs_takedown(struct drm_minor *minor) -+{ -+ drm_debugfs_remove_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES, -+ minor); -+} -+ -+int qxl_debugfs_add_files(struct qxl_device *qdev, -+ struct drm_info_list *files, -+ unsigned nfiles) -+{ -+ unsigned i; -+ -+ for (i = 0; i < qdev->debugfs_count; i++) { -+ if (qdev->debugfs[i].files == files) { -+ /* Already registered */ -+ return 0; -+ } -+ } -+ -+ i = qdev->debugfs_count + 1; -+ if (i > QXL_DEBUGFS_MAX_COMPONENTS) { -+ DRM_ERROR("Reached maximum number of debugfs components.\n"); -+ DRM_ERROR("Report so we increase QXL_DEBUGFS_MAX_COMPONENTS.\n"); -+ return -EINVAL; -+ } -+ qdev->debugfs[qdev->debugfs_count].files = files; -+ qdev->debugfs[qdev->debugfs_count].num_files = nfiles; -+ qdev->debugfs_count = i; -+#if defined(CONFIG_DEBUG_FS) -+ drm_debugfs_create_files(files, nfiles, -+ qdev->ddev->control->debugfs_root, -+ qdev->ddev->control); -+ drm_debugfs_create_files(files, nfiles, -+ qdev->ddev->primary->debugfs_root, -+ qdev->ddev->primary); -+#endif -+ return 0; -+} -+ -+void qxl_debugfs_remove_files(struct qxl_device *qdev) -+{ -+#if defined(CONFIG_DEBUG_FS) -+ unsigned i; -+ -+ for (i = 0; i < qdev->debugfs_count; i++) { -+ drm_debugfs_remove_files(qdev->debugfs[i].files, -+ qdev->debugfs[i].num_files, -+ qdev->ddev->control); -+ drm_debugfs_remove_files(qdev->debugfs[i].files, -+ qdev->debugfs[i].num_files, -+ qdev->ddev->primary); -+ } -+#endif -+} -diff --git a/drivers/gpu/drm/qxl/qxl_dev.h b/drivers/gpu/drm/qxl/qxl_dev.h -new file mode 100644 -index 0000000..94c5aec ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_dev.h -@@ -0,0 +1,879 @@ -+/* -+ Copyright (C) 2009 Red Hat, Inc. -+ -+ Redistribution and use in source and binary forms, with or without -+ modification, are permitted provided that the following conditions are -+ met: -+ -+ * Redistributions of source code must retain the above copyright -+ notice, this list of conditions and the following disclaimer. -+ * Redistributions in binary form must reproduce the above copyright -+ notice, this list of conditions and the following disclaimer in -+ the documentation and/or other materials provided with the -+ distribution. -+ * Neither the name of the copyright holder nor the names of its -+ contributors may be used to endorse or promote products derived -+ from this software without specific prior written permission. -+ -+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS -+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+*/ -+ -+ -+#ifndef H_QXL_DEV -+#define H_QXL_DEV -+ -+#include <linux/types.h> -+ -+/* -+ * from spice-protocol -+ * Release 0.10.0 -+ */ -+ -+/* enums.h */ -+ -+enum SpiceImageType { -+ SPICE_IMAGE_TYPE_BITMAP, -+ SPICE_IMAGE_TYPE_QUIC, -+ SPICE_IMAGE_TYPE_RESERVED, -+ SPICE_IMAGE_TYPE_LZ_PLT = 100, -+ SPICE_IMAGE_TYPE_LZ_RGB, -+ SPICE_IMAGE_TYPE_GLZ_RGB, -+ SPICE_IMAGE_TYPE_FROM_CACHE, -+ SPICE_IMAGE_TYPE_SURFACE, -+ SPICE_IMAGE_TYPE_JPEG, -+ SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS, -+ SPICE_IMAGE_TYPE_ZLIB_GLZ_RGB, -+ SPICE_IMAGE_TYPE_JPEG_ALPHA, -+ -+ SPICE_IMAGE_TYPE_ENUM_END -+}; -+ -+enum SpiceBitmapFmt { -+ SPICE_BITMAP_FMT_INVALID, -+ SPICE_BITMAP_FMT_1BIT_LE, -+ SPICE_BITMAP_FMT_1BIT_BE, -+ SPICE_BITMAP_FMT_4BIT_LE, -+ SPICE_BITMAP_FMT_4BIT_BE, -+ SPICE_BITMAP_FMT_8BIT, -+ SPICE_BITMAP_FMT_16BIT, -+ SPICE_BITMAP_FMT_24BIT, -+ SPICE_BITMAP_FMT_32BIT, -+ SPICE_BITMAP_FMT_RGBA, -+ -+ SPICE_BITMAP_FMT_ENUM_END -+}; -+ -+enum SpiceSurfaceFmt { -+ SPICE_SURFACE_FMT_INVALID, -+ SPICE_SURFACE_FMT_1_A, -+ SPICE_SURFACE_FMT_8_A = 8, -+ SPICE_SURFACE_FMT_16_555 = 16, -+ SPICE_SURFACE_FMT_32_xRGB = 32, -+ SPICE_SURFACE_FMT_16_565 = 80, -+ SPICE_SURFACE_FMT_32_ARGB = 96, -+ -+ SPICE_SURFACE_FMT_ENUM_END -+}; -+ -+enum SpiceClipType { -+ SPICE_CLIP_TYPE_NONE, -+ SPICE_CLIP_TYPE_RECTS, -+ -+ SPICE_CLIP_TYPE_ENUM_END -+}; -+ -+enum SpiceRopd { -+ SPICE_ROPD_INVERS_SRC = (1 << 0), -+ SPICE_ROPD_INVERS_BRUSH = (1 << 1), -+ SPICE_ROPD_INVERS_DEST = (1 << 2), -+ SPICE_ROPD_OP_PUT = (1 << 3), -+ SPICE_ROPD_OP_OR = (1 << 4), -+ SPICE_ROPD_OP_AND = (1 << 5), -+ SPICE_ROPD_OP_XOR = (1 << 6), -+ SPICE_ROPD_OP_BLACKNESS = (1 << 7), -+ SPICE_ROPD_OP_WHITENESS = (1 << 8), -+ SPICE_ROPD_OP_INVERS = (1 << 9), -+ SPICE_ROPD_INVERS_RES = (1 << 10), -+ -+ SPICE_ROPD_MASK = 0x7ff -+}; -+ -+enum SpiceBrushType { -+ SPICE_BRUSH_TYPE_NONE, -+ SPICE_BRUSH_TYPE_SOLID, -+ SPICE_BRUSH_TYPE_PATTERN, -+ -+ SPICE_BRUSH_TYPE_ENUM_END -+}; -+ -+enum SpiceCursorType { -+ SPICE_CURSOR_TYPE_ALPHA, -+ SPICE_CURSOR_TYPE_MONO, -+ SPICE_CURSOR_TYPE_COLOR4, -+ SPICE_CURSOR_TYPE_COLOR8, -+ SPICE_CURSOR_TYPE_COLOR16, -+ SPICE_CURSOR_TYPE_COLOR24, -+ SPICE_CURSOR_TYPE_COLOR32, -+ -+ SPICE_CURSOR_TYPE_ENUM_END -+}; -+ -+/* qxl_dev.h */ -+ -+#pragma pack(push, 1) -+ -+#define REDHAT_PCI_VENDOR_ID 0x1b36 -+ -+/* 0x100-0x11f reserved for spice, 0x1ff used for unstable work */ -+#define QXL_DEVICE_ID_STABLE 0x0100 -+ -+enum { -+ QXL_REVISION_STABLE_V04 = 0x01, -+ QXL_REVISION_STABLE_V06 = 0x02, -+ QXL_REVISION_STABLE_V10 = 0x03, -+ QXL_REVISION_STABLE_V12 = 0x04, -+}; -+ -+#define QXL_DEVICE_ID_DEVEL 0x01ff -+#define QXL_REVISION_DEVEL 0x01 -+ -+#define QXL_ROM_MAGIC (*(uint32_t *)"QXRO") -+#define QXL_RAM_MAGIC (*(uint32_t *)"QXRA") -+ -+enum { -+ QXL_RAM_RANGE_INDEX, -+ QXL_VRAM_RANGE_INDEX, -+ QXL_ROM_RANGE_INDEX, -+ QXL_IO_RANGE_INDEX, -+ -+ QXL_PCI_RANGES -+}; -+ -+/* qxl-1 compat: append only */ -+enum { -+ QXL_IO_NOTIFY_CMD, -+ QXL_IO_NOTIFY_CURSOR, -+ QXL_IO_UPDATE_AREA, -+ QXL_IO_UPDATE_IRQ, -+ QXL_IO_NOTIFY_OOM, -+ QXL_IO_RESET, -+ QXL_IO_SET_MODE, /* qxl-1 */ -+ QXL_IO_LOG, -+ /* appended for qxl-2 */ -+ QXL_IO_MEMSLOT_ADD, -+ QXL_IO_MEMSLOT_DEL, -+ QXL_IO_DETACH_PRIMARY, -+ QXL_IO_ATTACH_PRIMARY, -+ QXL_IO_CREATE_PRIMARY, -+ QXL_IO_DESTROY_PRIMARY, -+ QXL_IO_DESTROY_SURFACE_WAIT, -+ QXL_IO_DESTROY_ALL_SURFACES, -+ /* appended for qxl-3 */ -+ QXL_IO_UPDATE_AREA_ASYNC, -+ QXL_IO_MEMSLOT_ADD_ASYNC, -+ QXL_IO_CREATE_PRIMARY_ASYNC, -+ QXL_IO_DESTROY_PRIMARY_ASYNC, -+ QXL_IO_DESTROY_SURFACE_ASYNC, -+ QXL_IO_DESTROY_ALL_SURFACES_ASYNC, -+ QXL_IO_FLUSH_SURFACES_ASYNC, -+ QXL_IO_FLUSH_RELEASE, -+ /* appended for qxl-4 */ -+ QXL_IO_MONITORS_CONFIG_ASYNC, -+ -+ QXL_IO_RANGE_SIZE -+}; -+ -+typedef uint64_t QXLPHYSICAL; -+typedef int32_t QXLFIXED; /* fixed 28.4 */ -+ -+struct qxl_point_fix { -+ QXLFIXED x; -+ QXLFIXED y; -+}; -+ -+struct qxl_point { -+ int32_t x; -+ int32_t y; -+}; -+ -+struct qxl_point_1_6 { -+ int16_t x; -+ int16_t y; -+}; -+ -+struct qxl_rect { -+ int32_t top; -+ int32_t left; -+ int32_t bottom; -+ int32_t right; -+}; -+ -+struct qxl_urect { -+ uint32_t top; -+ uint32_t left; -+ uint32_t bottom; -+ uint32_t right; -+}; -+ -+/* qxl-1 compat: append only */ -+struct qxl_rom { -+ uint32_t magic; -+ uint32_t id; -+ uint32_t update_id; -+ uint32_t compression_level; -+ uint32_t log_level; -+ uint32_t mode; /* qxl-1 */ -+ uint32_t modes_offset; -+ uint32_t num_io_pages; -+ uint32_t pages_offset; /* qxl-1 */ -+ uint32_t draw_area_offset; /* qxl-1 */ -+ uint32_t surface0_area_size; /* qxl-1 name: draw_area_size */ -+ uint32_t ram_header_offset; -+ uint32_t mm_clock; -+ /* appended for qxl-2 */ -+ uint32_t n_surfaces; -+ uint64_t flags; -+ uint8_t slots_start; -+ uint8_t slots_end; -+ uint8_t slot_gen_bits; -+ uint8_t slot_id_bits; -+ uint8_t slot_generation; -+ /* appended for qxl-4 */ -+ uint8_t client_present; -+ uint8_t client_capabilities[58]; -+ uint32_t client_monitors_config_crc; -+ struct { -+ uint16_t count; -+ uint16_t padding; -+ struct qxl_urect heads[64]; -+ } client_monitors_config; -+}; -+ -+/* qxl-1 compat: fixed */ -+struct qxl_mode { -+ uint32_t id; -+ uint32_t x_res; -+ uint32_t y_res; -+ uint32_t bits; -+ uint32_t stride; -+ uint32_t x_mili; -+ uint32_t y_mili; -+ uint32_t orientation; -+}; -+ -+/* qxl-1 compat: fixed */ -+struct qxl_modes { -+ uint32_t n_modes; -+ struct qxl_mode modes[0]; -+}; -+ -+/* qxl-1 compat: append only */ -+enum qxl_cmd_type { -+ QXL_CMD_NOP, -+ QXL_CMD_DRAW, -+ QXL_CMD_UPDATE, -+ QXL_CMD_CURSOR, -+ QXL_CMD_MESSAGE, -+ QXL_CMD_SURFACE, -+}; -+ -+/* qxl-1 compat: fixed */ -+struct qxl_command { -+ QXLPHYSICAL data; -+ uint32_t type; -+ uint32_t padding; -+}; -+ -+#define QXL_COMMAND_FLAG_COMPAT (1<<0) -+#define QXL_COMMAND_FLAG_COMPAT_16BPP (2<<0) -+ -+struct qxl_command_ext { -+ struct qxl_command cmd; -+ uint32_t group_id; -+ uint32_t flags; -+}; -+ -+struct qxl_mem_slot { -+ uint64_t mem_start; -+ uint64_t mem_end; -+}; -+ -+#define QXL_SURF_TYPE_PRIMARY 0 -+ -+#define QXL_SURF_FLAG_KEEP_DATA (1 << 0) -+ -+struct qxl_surface_create { -+ uint32_t width; -+ uint32_t height; -+ int32_t stride; -+ uint32_t format; -+ uint32_t position; -+ uint32_t mouse_mode; -+ uint32_t flags; -+ uint32_t type; -+ QXLPHYSICAL mem; -+}; -+ -+#define QXL_COMMAND_RING_SIZE 32 -+#define QXL_CURSOR_RING_SIZE 32 -+#define QXL_RELEASE_RING_SIZE 8 -+ -+#define QXL_LOG_BUF_SIZE 4096 -+ -+#define QXL_INTERRUPT_DISPLAY (1 << 0) -+#define QXL_INTERRUPT_CURSOR (1 << 1) -+#define QXL_INTERRUPT_IO_CMD (1 << 2) -+#define QXL_INTERRUPT_ERROR (1 << 3) -+#define QXL_INTERRUPT_CLIENT (1 << 4) -+#define QXL_INTERRUPT_CLIENT_MONITORS_CONFIG (1 << 5) -+ -+struct qxl_ring_header { -+ uint32_t num_items; -+ uint32_t prod; -+ uint32_t notify_on_prod; -+ uint32_t cons; -+ uint32_t notify_on_cons; -+}; -+ -+/* qxl-1 compat: append only */ -+struct qxl_ram_header { -+ uint32_t magic; -+ uint32_t int_pending; -+ uint32_t int_mask; -+ uint8_t log_buf[QXL_LOG_BUF_SIZE]; -+ struct qxl_ring_header cmd_ring_hdr; -+ struct qxl_command cmd_ring[QXL_COMMAND_RING_SIZE]; -+ struct qxl_ring_header cursor_ring_hdr; -+ struct qxl_command cursor_ring[QXL_CURSOR_RING_SIZE]; -+ struct qxl_ring_header release_ring_hdr; -+ uint64_t release_ring[QXL_RELEASE_RING_SIZE]; -+ struct qxl_rect update_area; -+ /* appended for qxl-2 */ -+ uint32_t update_surface; -+ struct qxl_mem_slot mem_slot; -+ struct qxl_surface_create create_surface; -+ uint64_t flags; -+ -+ /* appended for qxl-4 */ -+ -+ /* used by QXL_IO_MONITORS_CONFIG_ASYNC */ -+ QXLPHYSICAL monitors_config; -+ uint8_t guest_capabilities[64]; -+}; -+ -+union qxl_release_info { -+ uint64_t id; /* in */ -+ uint64_t next; /* out */ -+}; -+ -+struct qxl_release_info_ext { -+ union qxl_release_info *info; -+ uint32_t group_id; -+}; -+ -+struct qxl_data_chunk { -+ uint32_t data_size; -+ QXLPHYSICAL prev_chunk; -+ QXLPHYSICAL next_chunk; -+ uint8_t data[0]; -+}; -+ -+struct qxl_message { -+ union qxl_release_info release_info; -+ uint8_t data[0]; -+}; -+ -+struct qxl_compat_update_cmd { -+ union qxl_release_info release_info; -+ struct qxl_rect area; -+ uint32_t update_id; -+}; -+ -+struct qxl_update_cmd { -+ union qxl_release_info release_info; -+ struct qxl_rect area; -+ uint32_t update_id; -+ uint32_t surface_id; -+}; -+ -+struct qxl_cursor_header { -+ uint64_t unique; -+ uint16_t type; -+ uint16_t width; -+ uint16_t height; -+ uint16_t hot_spot_x; -+ uint16_t hot_spot_y; -+}; -+ -+struct qxl_cursor { -+ struct qxl_cursor_header header; -+ uint32_t data_size; -+ struct qxl_data_chunk chunk; -+}; -+ -+enum { -+ QXL_CURSOR_SET, -+ QXL_CURSOR_MOVE, -+ QXL_CURSOR_HIDE, -+ QXL_CURSOR_TRAIL, -+}; -+ -+#define QXL_CURSOR_DEVICE_DATA_SIZE 128 -+ -+struct qxl_cursor_cmd { -+ union qxl_release_info release_info; -+ uint8_t type; -+ union { -+ struct { -+ struct qxl_point_1_6 position; -+ uint8_t visible; -+ QXLPHYSICAL shape; -+ } set; -+ struct { -+ uint16_t length; -+ uint16_t frequency; -+ } trail; -+ struct qxl_point_1_6 position; -+ } u; -+ /* todo: dynamic size from rom */ -+ uint8_t device_data[QXL_CURSOR_DEVICE_DATA_SIZE]; -+}; -+ -+enum { -+ QXL_DRAW_NOP, -+ QXL_DRAW_FILL, -+ QXL_DRAW_OPAQUE, -+ QXL_DRAW_COPY, -+ QXL_COPY_BITS, -+ QXL_DRAW_BLEND, -+ QXL_DRAW_BLACKNESS, -+ QXL_DRAW_WHITENESS, -+ QXL_DRAW_INVERS, -+ QXL_DRAW_ROP3, -+ QXL_DRAW_STROKE, -+ QXL_DRAW_TEXT, -+ QXL_DRAW_TRANSPARENT, -+ QXL_DRAW_ALPHA_BLEND, -+ QXL_DRAW_COMPOSITE -+}; -+ -+struct qxl_raster_glyph { -+ struct qxl_point render_pos; -+ struct qxl_point glyph_origin; -+ uint16_t width; -+ uint16_t height; -+ uint8_t data[0]; -+}; -+ -+struct qxl_string { -+ uint32_t data_size; -+ uint16_t length; -+ uint16_t flags; -+ struct qxl_data_chunk chunk; -+}; -+ -+struct qxl_copy_bits { -+ struct qxl_point src_pos; -+}; -+ -+enum qxl_effect_type { -+ QXL_EFFECT_BLEND = 0, -+ QXL_EFFECT_OPAQUE = 1, -+ QXL_EFFECT_REVERT_ON_DUP = 2, -+ QXL_EFFECT_BLACKNESS_ON_DUP = 3, -+ QXL_EFFECT_WHITENESS_ON_DUP = 4, -+ QXL_EFFECT_NOP_ON_DUP = 5, -+ QXL_EFFECT_NOP = 6, -+ QXL_EFFECT_OPAQUE_BRUSH = 7 -+}; -+ -+struct qxl_pattern { -+ QXLPHYSICAL pat; -+ struct qxl_point pos; -+}; -+ -+struct qxl_brush { -+ uint32_t type; -+ union { -+ uint32_t color; -+ struct qxl_pattern pattern; -+ } u; -+}; -+ -+struct qxl_q_mask { -+ uint8_t flags; -+ struct qxl_point pos; -+ QXLPHYSICAL bitmap; -+}; -+ -+struct qxl_fill { -+ struct qxl_brush brush; -+ uint16_t rop_descriptor; -+ struct qxl_q_mask mask; -+}; -+ -+struct qxl_opaque { -+ QXLPHYSICAL src_bitmap; -+ struct qxl_rect src_area; -+ struct qxl_brush brush; -+ uint16_t rop_descriptor; -+ uint8_t scale_mode; -+ struct qxl_q_mask mask; -+}; -+ -+struct qxl_copy { -+ QXLPHYSICAL src_bitmap; -+ struct qxl_rect src_area; -+ uint16_t rop_descriptor; -+ uint8_t scale_mode; -+ struct qxl_q_mask mask; -+}; -+ -+struct qxl_transparent { -+ QXLPHYSICAL src_bitmap; -+ struct qxl_rect src_area; -+ uint32_t src_color; -+ uint32_t true_color; -+}; -+ -+struct qxl_alpha_blend { -+ uint16_t alpha_flags; -+ uint8_t alpha; -+ QXLPHYSICAL src_bitmap; -+ struct qxl_rect src_area; -+}; -+ -+struct qxl_compat_alpha_blend { -+ uint8_t alpha; -+ QXLPHYSICAL src_bitmap; -+ struct qxl_rect src_area; -+}; -+ -+struct qxl_rop_3 { -+ QXLPHYSICAL src_bitmap; -+ struct qxl_rect src_area; -+ struct qxl_brush brush; -+ uint8_t rop3; -+ uint8_t scale_mode; -+ struct qxl_q_mask mask; -+}; -+ -+struct qxl_line_attr { -+ uint8_t flags; -+ uint8_t join_style; -+ uint8_t end_style; -+ uint8_t style_nseg; -+ QXLFIXED width; -+ QXLFIXED miter_limit; -+ QXLPHYSICAL style; -+}; -+ -+struct qxl_stroke { -+ QXLPHYSICAL path; -+ struct qxl_line_attr attr; -+ struct qxl_brush brush; -+ uint16_t fore_mode; -+ uint16_t back_mode; -+}; -+ -+struct qxl_text { -+ QXLPHYSICAL str; -+ struct qxl_rect back_area; -+ struct qxl_brush fore_brush; -+ struct qxl_brush back_brush; -+ uint16_t fore_mode; -+ uint16_t back_mode; -+}; -+ -+struct qxl_mask { -+ struct qxl_q_mask mask; -+}; -+ -+struct qxl_clip { -+ uint32_t type; -+ QXLPHYSICAL data; -+}; -+ -+enum qxl_operator { -+ QXL_OP_CLEAR = 0x00, -+ QXL_OP_SOURCE = 0x01, -+ QXL_OP_DST = 0x02, -+ QXL_OP_OVER = 0x03, -+ QXL_OP_OVER_REVERSE = 0x04, -+ QXL_OP_IN = 0x05, -+ QXL_OP_IN_REVERSE = 0x06, -+ QXL_OP_OUT = 0x07, -+ QXL_OP_OUT_REVERSE = 0x08, -+ QXL_OP_ATOP = 0x09, -+ QXL_OP_ATOP_REVERSE = 0x0a, -+ QXL_OP_XOR = 0x0b, -+ QXL_OP_ADD = 0x0c, -+ QXL_OP_SATURATE = 0x0d, -+ /* Note the jump here from 0x0d to 0x30 */ -+ QXL_OP_MULTIPLY = 0x30, -+ QXL_OP_SCREEN = 0x31, -+ QXL_OP_OVERLAY = 0x32, -+ QXL_OP_DARKEN = 0x33, -+ QXL_OP_LIGHTEN = 0x34, -+ QXL_OP_COLOR_DODGE = 0x35, -+ QXL_OP_COLOR_BURN = 0x36, -+ QXL_OP_HARD_LIGHT = 0x37, -+ QXL_OP_SOFT_LIGHT = 0x38, -+ QXL_OP_DIFFERENCE = 0x39, -+ QXL_OP_EXCLUSION = 0x3a, -+ QXL_OP_HSL_HUE = 0x3b, -+ QXL_OP_HSL_SATURATION = 0x3c, -+ QXL_OP_HSL_COLOR = 0x3d, -+ QXL_OP_HSL_LUMINOSITY = 0x3e -+}; -+ -+struct qxl_transform { -+ uint32_t t00; -+ uint32_t t01; -+ uint32_t t02; -+ uint32_t t10; -+ uint32_t t11; -+ uint32_t t12; -+}; -+ -+/* The flags field has the following bit fields: -+ * -+ * operator: [ 0 - 7 ] -+ * src_filter: [ 8 - 10 ] -+ * mask_filter: [ 11 - 13 ] -+ * src_repeat: [ 14 - 15 ] -+ * mask_repeat: [ 16 - 17 ] -+ * component_alpha: [ 18 - 18 ] -+ * reserved: [ 19 - 31 ] -+ * -+ * The repeat and filter values are those of pixman: -+ * REPEAT_NONE = 0 -+ * REPEAT_NORMAL = 1 -+ * REPEAT_PAD = 2 -+ * REPEAT_REFLECT = 3 -+ * -+ * The filter values are: -+ * FILTER_NEAREST = 0 -+ * FILTER_BILINEAR = 1 -+ */ -+struct qxl_composite { -+ uint32_t flags; -+ -+ QXLPHYSICAL src; -+ QXLPHYSICAL src_transform; /* May be NULL */ -+ QXLPHYSICAL mask; /* May be NULL */ -+ QXLPHYSICAL mask_transform; /* May be NULL */ -+ struct qxl_point_1_6 src_origin; -+ struct qxl_point_1_6 mask_origin; -+}; -+ -+struct qxl_compat_drawable { -+ union qxl_release_info release_info; -+ uint8_t effect; -+ uint8_t type; -+ uint16_t bitmap_offset; -+ struct qxl_rect bitmap_area; -+ struct qxl_rect bbox; -+ struct qxl_clip clip; -+ uint32_t mm_time; -+ union { -+ struct qxl_fill fill; -+ struct qxl_opaque opaque; -+ struct qxl_copy copy; -+ struct qxl_transparent transparent; -+ struct qxl_compat_alpha_blend alpha_blend; -+ struct qxl_copy_bits copy_bits; -+ struct qxl_copy blend; -+ struct qxl_rop_3 rop3; -+ struct qxl_stroke stroke; -+ struct qxl_text text; -+ struct qxl_mask blackness; -+ struct qxl_mask invers; -+ struct qxl_mask whiteness; -+ } u; -+}; -+ -+struct qxl_drawable { -+ union qxl_release_info release_info; -+ uint32_t surface_id; -+ uint8_t effect; -+ uint8_t type; -+ uint8_t self_bitmap; -+ struct qxl_rect self_bitmap_area; -+ struct qxl_rect bbox; -+ struct qxl_clip clip; -+ uint32_t mm_time; -+ int32_t surfaces_dest[3]; -+ struct qxl_rect surfaces_rects[3]; -+ union { -+ struct qxl_fill fill; -+ struct qxl_opaque opaque; -+ struct qxl_copy copy; -+ struct qxl_transparent transparent; -+ struct qxl_alpha_blend alpha_blend; -+ struct qxl_copy_bits copy_bits; -+ struct qxl_copy blend; -+ struct qxl_rop_3 rop3; -+ struct qxl_stroke stroke; -+ struct qxl_text text; -+ struct qxl_mask blackness; -+ struct qxl_mask invers; -+ struct qxl_mask whiteness; -+ struct qxl_composite composite; -+ } u; -+}; -+ -+enum qxl_surface_cmd_type { -+ QXL_SURFACE_CMD_CREATE, -+ QXL_SURFACE_CMD_DESTROY, -+}; -+ -+struct qxl_surface { -+ uint32_t format; -+ uint32_t width; -+ uint32_t height; -+ int32_t stride; -+ QXLPHYSICAL data; -+}; -+ -+struct qxl_surface_cmd { -+ union qxl_release_info release_info; -+ uint32_t surface_id; -+ uint8_t type; -+ uint32_t flags; -+ union { -+ struct qxl_surface surface_create; -+ } u; -+}; -+ -+struct qxl_clip_rects { -+ uint32_t num_rects; -+ struct qxl_data_chunk chunk; -+}; -+ -+enum { -+ QXL_PATH_BEGIN = (1 << 0), -+ QXL_PATH_END = (1 << 1), -+ QXL_PATH_CLOSE = (1 << 3), -+ QXL_PATH_BEZIER = (1 << 4), -+}; -+ -+struct qxl_path_seg { -+ uint32_t flags; -+ uint32_t count; -+ struct qxl_point_fix points[0]; -+}; -+ -+struct qxl_path { -+ uint32_t data_size; -+ struct qxl_data_chunk chunk; -+}; -+ -+enum { -+ QXL_IMAGE_GROUP_DRIVER, -+ QXL_IMAGE_GROUP_DEVICE, -+ QXL_IMAGE_GROUP_RED, -+ QXL_IMAGE_GROUP_DRIVER_DONT_CACHE, -+}; -+ -+struct qxl_image_id { -+ uint32_t group; -+ uint32_t unique; -+}; -+ -+union qxl_image_id_union { -+ struct qxl_image_id id; -+ uint64_t value; -+}; -+ -+enum qxl_image_flags { -+ QXL_IMAGE_CACHE = (1 << 0), -+ QXL_IMAGE_HIGH_BITS_SET = (1 << 1), -+}; -+ -+enum qxl_bitmap_flags { -+ QXL_BITMAP_DIRECT = (1 << 0), -+ QXL_BITMAP_UNSTABLE = (1 << 1), -+ QXL_BITMAP_TOP_DOWN = (1 << 2), /* == SPICE_BITMAP_FLAGS_TOP_DOWN */ -+}; -+ -+#define QXL_SET_IMAGE_ID(image, _group, _unique) { \ -+ (image)->descriptor.id = (((uint64_t)_unique) << 32) | _group; \ -+} -+ -+struct qxl_image_descriptor { -+ uint64_t id; -+ uint8_t type; -+ uint8_t flags; -+ uint32_t width; -+ uint32_t height; -+}; -+ -+struct qxl_palette { -+ uint64_t unique; -+ uint16_t num_ents; -+ uint32_t ents[0]; -+}; -+ -+struct qxl_bitmap { -+ uint8_t format; -+ uint8_t flags; -+ uint32_t x; -+ uint32_t y; -+ uint32_t stride; -+ QXLPHYSICAL palette; -+ QXLPHYSICAL data; /* data[0] ? */ -+}; -+ -+struct qxl_surface_id { -+ uint32_t surface_id; -+}; -+ -+struct qxl_encoder_data { -+ uint32_t data_size; -+ uint8_t data[0]; -+}; -+ -+struct qxl_image { -+ struct qxl_image_descriptor descriptor; -+ union { /* variable length */ -+ struct qxl_bitmap bitmap; -+ struct qxl_encoder_data quic; -+ struct qxl_surface_id surface_image; -+ } u; -+}; -+ -+/* A QXLHead is a single monitor output backed by a QXLSurface. -+ * x and y offsets are unsigned since they are used in relation to -+ * the given surface, not the same as the x, y coordinates in the guest -+ * screen reference frame. */ -+struct qxl_head { -+ uint32_t id; -+ uint32_t surface_id; -+ uint32_t width; -+ uint32_t height; -+ uint32_t x; -+ uint32_t y; -+ uint32_t flags; -+}; -+ -+struct qxl_monitors_config { -+ uint16_t count; -+ uint16_t max_allowed; /* If it is 0 no fixed limit is given by the -+ driver */ -+ struct qxl_head heads[0]; -+}; -+ -+#pragma pack(pop) -+ -+#endif /* _H_QXL_DEV */ -diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c -new file mode 100644 -index 0000000..c80ddfe ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_display.c -@@ -0,0 +1,981 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+ -+#include "linux/crc32.h" -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+#include "drm_crtc_helper.h" -+ -+static void qxl_crtc_set_to_mode(struct qxl_device *qdev, -+ struct drm_connector *connector, -+ struct qxl_head *head) -+{ -+ struct drm_device *dev = connector->dev; -+ struct drm_display_mode *mode, *t; -+ int width = head->width; -+ int height = head->height; -+ -+ if (width < 320 || height < 240) { -+ qxl_io_log(qdev, "%s: bad head: %dx%d", width, height); -+ width = 1024; -+ height = 768; -+ } -+ if (width * height * 4 > 16*1024*1024) { -+ width = 1024; -+ height = 768; -+ } -+ /* TODO: go over regular modes and removed preferred? */ -+ list_for_each_entry_safe(mode, t, &connector->probed_modes, head) -+ drm_mode_remove(connector, mode); -+ mode = drm_cvt_mode(dev, width, height, 60, false, false, false); -+ mode->type |= DRM_MODE_TYPE_PREFERRED; -+ mode->status = MODE_OK; -+ drm_mode_probed_add(connector, mode); -+ qxl_io_log(qdev, "%s: %d x %d\n", __func__, width, height); -+} -+ -+void qxl_crtc_set_from_monitors_config(struct qxl_device *qdev) -+{ -+ struct drm_connector *connector; -+ int i; -+ struct drm_device *dev = qdev->ddev; -+ -+ i = 0; -+ qxl_io_log(qdev, "%s: %d, %d\n", __func__, -+ dev->mode_config.num_connector, -+ qdev->monitors_config->count); -+ list_for_each_entry(connector, &dev->mode_config.connector_list, head) { -+ if (i > qdev->monitors_config->count) { -+ /* crtc will be reported as disabled */ -+ continue; -+ } -+ qxl_crtc_set_to_mode(qdev, connector, -+ &qdev->monitors_config->heads[i]); -+ ++i; -+ } -+} -+ -+void qxl_alloc_client_monitors_config(struct qxl_device *qdev, unsigned count) -+{ -+ if (qdev->client_monitors_config && -+ count > qdev->client_monitors_config->count) { -+ kfree(qdev->client_monitors_config); -+ } -+ if (!qdev->client_monitors_config) { -+ qdev->client_monitors_config = kzalloc( -+ sizeof(struct qxl_monitors_config) + -+ sizeof(struct qxl_head) * count, GFP_KERNEL); -+ if (!qdev->client_monitors_config) { -+ qxl_io_log(qdev, -+ "%s: allocation failure for %u heads\n", -+ __func__, count); -+ return; -+ } -+ } -+ qdev->client_monitors_config->count = count; -+} -+ -+static int qxl_display_copy_rom_client_monitors_config(struct qxl_device *qdev) -+{ -+ int i; -+ int num_monitors; -+ uint32_t crc; -+ -+ BUG_ON(!qdev->monitors_config); -+ num_monitors = qdev->rom->client_monitors_config.count; -+ crc = crc32(0, (const uint8_t *)&qdev->rom->client_monitors_config, -+ sizeof(qdev->rom->client_monitors_config)); -+ if (crc != qdev->rom->client_monitors_config_crc) { -+ qxl_io_log(qdev, "crc mismatch: have %X (%d) != %X\n", crc, -+ sizeof(qdev->rom->client_monitors_config), -+ qdev->rom->client_monitors_config_crc); -+ return 1; -+ } -+ if (num_monitors > qdev->monitors_config->max_allowed) { -+ DRM_INFO("client monitors list will be truncated: %d < %d\n", -+ qdev->monitors_config->max_allowed, num_monitors); -+ num_monitors = qdev->monitors_config->max_allowed; -+ } else { -+ num_monitors = qdev->rom->client_monitors_config.count; -+ } -+ qxl_alloc_client_monitors_config(qdev, num_monitors); -+ /* we copy max from the client but it isn't used */ -+ qdev->client_monitors_config->max_allowed = -+ qdev->monitors_config->max_allowed; -+ for (i = 0 ; i < qdev->client_monitors_config->count ; ++i) { -+ struct qxl_urect *c_rect = -+ &qdev->rom->client_monitors_config.heads[i]; -+ struct qxl_head *client_head = -+ &qdev->client_monitors_config->heads[i]; -+ struct qxl_head *head = &qdev->monitors_config->heads[i]; -+ client_head->x = head->x = c_rect->left; -+ client_head->y = head->y = c_rect->top; -+ client_head->width = head->width = -+ c_rect->right - c_rect->left; -+ client_head->height = head->height = -+ c_rect->bottom - c_rect->top; -+ client_head->surface_id = head->surface_id = 0; -+ client_head->id = head->id = i; -+ client_head->flags = head->flags = 0; -+ QXL_DEBUG(qdev, "read %dx%d+%d+%d\n", head->width, head->height, -+ head->x, head->y); -+ } -+ return 0; -+} -+ -+void qxl_display_read_client_monitors_config(struct qxl_device *qdev) -+{ -+ -+ while (qxl_display_copy_rom_client_monitors_config(qdev)) { -+ qxl_io_log(qdev, "failed crc check for client_monitors_config," -+ " retrying\n"); -+ } -+ qxl_crtc_set_from_monitors_config(qdev); -+ /* fire off a uevent and let userspace tell us what to do */ -+ qxl_io_log(qdev, "calling drm_sysfs_hotplug_event\n"); -+ drm_sysfs_hotplug_event(qdev->ddev); -+} -+ -+static int qxl_add_monitors_config_modes(struct drm_connector *connector) -+{ -+ struct drm_device *dev = connector->dev; -+ struct qxl_device *qdev = dev->dev_private; -+ struct qxl_output *output = drm_connector_to_qxl_output(connector); -+ int h = output->index; -+ struct drm_display_mode *mode = NULL; -+ struct qxl_head *head; -+ -+ if (!qdev->monitors_config) -+ return 0; -+ head = &qdev->monitors_config->heads[h]; -+ -+ mode = drm_cvt_mode(dev, head->width, head->height, 60, false, false, -+ false); -+ mode->type |= DRM_MODE_TYPE_PREFERRED; -+ drm_mode_probed_add(connector, mode); -+ return 1; -+} -+ -+static int qxl_add_common_modes(struct drm_connector *connector) -+{ -+ struct drm_device *dev = connector->dev; -+ struct drm_display_mode *mode = NULL; -+ int i; -+ struct mode_size { -+ int w; -+ int h; -+ } common_modes[] = { -+ { 640, 480}, -+ { 720, 480}, -+ { 800, 600}, -+ { 848, 480}, -+ {1024, 768}, -+ {1152, 768}, -+ {1280, 720}, -+ {1280, 800}, -+ {1280, 854}, -+ {1280, 960}, -+ {1280, 1024}, -+ {1440, 900}, -+ {1400, 1050}, -+ {1680, 1050}, -+ {1600, 1200}, -+ {1920, 1080}, -+ {1920, 1200} -+ }; -+ -+ for (i = 0; i < ARRAY_SIZE(common_modes); i++) { -+ if (common_modes[i].w < 320 || common_modes[i].h < 200) -+ continue; -+ -+ mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h, -+ 60, false, false, false); -+ if (common_modes[i].w == 1024 && common_modes[i].h == 768) -+ mode->type |= DRM_MODE_TYPE_PREFERRED; -+ drm_mode_probed_add(connector, mode); -+ } -+ return i - 1; -+} -+ -+static void qxl_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, -+ u16 *blue, uint32_t start, uint32_t size) -+{ -+ /* TODO */ -+} -+ -+static void qxl_crtc_destroy(struct drm_crtc *crtc) -+{ -+ struct qxl_crtc *qxl_crtc = to_qxl_crtc(crtc); -+ -+ drm_crtc_cleanup(crtc); -+ kfree(qxl_crtc); -+} -+ -+static void -+qxl_hide_cursor(struct qxl_device *qdev) -+{ -+ struct qxl_release *release; -+ struct qxl_cursor_cmd *cmd; -+ int ret; -+ -+ ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd), QXL_RELEASE_CURSOR_CMD, -+ &release, NULL); -+ -+ cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release); -+ cmd->type = QXL_CURSOR_HIDE; -+ qxl_release_unmap(qdev, release, &cmd->release_info); -+ -+ qxl_fence_releaseable(qdev, release); -+ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false); -+ qxl_release_unreserve(qdev, release); -+} -+ -+static int qxl_crtc_cursor_set(struct drm_crtc *crtc, -+ struct drm_file *file_priv, -+ uint32_t handle, -+ uint32_t width, -+ uint32_t height) -+{ -+ struct drm_device *dev = crtc->dev; -+ struct qxl_device *qdev = dev->dev_private; -+ struct qxl_crtc *qcrtc = to_qxl_crtc(crtc); -+ struct drm_gem_object *obj; -+ struct qxl_cursor *cursor; -+ struct qxl_cursor_cmd *cmd; -+ struct qxl_bo *cursor_bo, *user_bo; -+ struct qxl_release *release; -+ void *user_ptr; -+ -+ int size = 64*64*4; -+ int ret = 0; -+ if (!handle) { -+ qxl_hide_cursor(qdev); -+ return 0; -+ } -+ -+ obj = drm_gem_object_lookup(crtc->dev, file_priv, handle); -+ if (!obj) { -+ DRM_ERROR("cannot find cursor object\n"); -+ return -ENOENT; -+ } -+ -+ user_bo = gem_to_qxl_bo(obj); -+ -+ ret = qxl_bo_reserve(user_bo, false); -+ if (ret) -+ goto out_unref; -+ -+ ret = qxl_bo_pin(user_bo, QXL_GEM_DOMAIN_CPU, NULL); -+ if (ret) -+ goto out_unreserve; -+ -+ ret = qxl_bo_kmap(user_bo, &user_ptr); -+ if (ret) -+ goto out_unpin; -+ -+ ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd), -+ QXL_RELEASE_CURSOR_CMD, -+ &release, NULL); -+ if (ret) -+ goto out_kunmap; -+ ret = qxl_alloc_bo_reserved(qdev, sizeof(struct qxl_cursor) + size, -+ &cursor_bo); -+ if (ret) -+ goto out_free_release; -+ ret = qxl_bo_kmap(cursor_bo, (void **)&cursor); -+ if (ret) -+ goto out_free_bo; -+ -+ cursor->header.unique = 0; -+ cursor->header.type = SPICE_CURSOR_TYPE_ALPHA; -+ cursor->header.width = 64; -+ cursor->header.height = 64; -+ cursor->header.hot_spot_x = 0; -+ cursor->header.hot_spot_y = 0; -+ cursor->data_size = size; -+ cursor->chunk.next_chunk = 0; -+ cursor->chunk.prev_chunk = 0; -+ cursor->chunk.data_size = size; -+ -+ memcpy(cursor->chunk.data, user_ptr, size); -+ -+ qxl_bo_kunmap(cursor_bo); -+ -+ /* finish with the userspace bo */ -+ qxl_bo_kunmap(user_bo); -+ qxl_bo_unpin(user_bo); -+ qxl_bo_unreserve(user_bo); -+ drm_gem_object_unreference_unlocked(obj); -+ -+ cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release); -+ cmd->type = QXL_CURSOR_SET; -+ cmd->u.set.position.x = qcrtc->cur_x; -+ cmd->u.set.position.y = qcrtc->cur_y; -+ -+ cmd->u.set.shape = qxl_bo_physical_address(qdev, cursor_bo, 0); -+ qxl_release_add_res(qdev, release, cursor_bo); -+ -+ cmd->u.set.visible = 1; -+ qxl_release_unmap(qdev, release, &cmd->release_info); -+ -+ qxl_fence_releaseable(qdev, release); -+ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false); -+ qxl_release_unreserve(qdev, release); -+ -+ qxl_bo_unreserve(cursor_bo); -+ qxl_bo_unref(&cursor_bo); -+ -+ return ret; -+out_free_bo: -+ qxl_bo_unref(&cursor_bo); -+out_free_release: -+ qxl_release_unreserve(qdev, release); -+ qxl_release_free(qdev, release); -+out_kunmap: -+ qxl_bo_kunmap(user_bo); -+out_unpin: -+ qxl_bo_unpin(user_bo); -+out_unreserve: -+ qxl_bo_unreserve(user_bo); -+out_unref: -+ drm_gem_object_unreference_unlocked(obj); -+ return ret; -+} -+ -+static int qxl_crtc_cursor_move(struct drm_crtc *crtc, -+ int x, int y) -+{ -+ struct drm_device *dev = crtc->dev; -+ struct qxl_device *qdev = dev->dev_private; -+ struct qxl_crtc *qcrtc = to_qxl_crtc(crtc); -+ struct qxl_release *release; -+ struct qxl_cursor_cmd *cmd; -+ int ret; -+ -+ ret = qxl_alloc_release_reserved(qdev, sizeof(*cmd), QXL_RELEASE_CURSOR_CMD, -+ &release, NULL); -+ -+ qcrtc->cur_x = x; -+ qcrtc->cur_y = y; -+ -+ cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release); -+ cmd->type = QXL_CURSOR_MOVE; -+ cmd->u.position.x = qcrtc->cur_x; -+ cmd->u.position.y = qcrtc->cur_y; -+ qxl_release_unmap(qdev, release, &cmd->release_info); -+ -+ qxl_fence_releaseable(qdev, release); -+ qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false); -+ qxl_release_unreserve(qdev, release); -+ return 0; -+} -+ -+ -+static const struct drm_crtc_funcs qxl_crtc_funcs = { -+ .cursor_set = qxl_crtc_cursor_set, -+ .cursor_move = qxl_crtc_cursor_move, -+ .gamma_set = qxl_crtc_gamma_set, -+ .set_config = drm_crtc_helper_set_config, -+ .destroy = qxl_crtc_destroy, -+}; -+ -+static void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb) -+{ -+ struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb); -+ -+ if (qxl_fb->obj) -+ drm_gem_object_unreference_unlocked(qxl_fb->obj); -+ drm_framebuffer_cleanup(fb); -+ kfree(qxl_fb); -+} -+ -+int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb, -+ struct drm_file *file_priv, -+ unsigned flags, unsigned color, -+ struct drm_clip_rect *clips, -+ unsigned num_clips) -+{ -+ /* TODO: vmwgfx where this was cribbed from had locking. Why? */ -+ struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb); -+ struct qxl_device *qdev = qxl_fb->base.dev->dev_private; -+ struct drm_clip_rect norect; -+ struct qxl_bo *qobj; -+ int inc = 1; -+ -+ qobj = gem_to_qxl_bo(qxl_fb->obj); -+ if (qxl_fb != qdev->active_user_framebuffer) { -+ DRM_INFO("%s: qxl_fb 0x%p != qdev->active_user_framebuffer 0x%p\n", -+ __func__, qxl_fb, qdev->active_user_framebuffer); -+ } -+ if (!num_clips) { -+ num_clips = 1; -+ clips = &norect; -+ norect.x1 = norect.y1 = 0; -+ norect.x2 = fb->width; -+ norect.y2 = fb->height; -+ } else if (flags & DRM_MODE_FB_DIRTY_ANNOTATE_COPY) { -+ num_clips /= 2; -+ inc = 2; /* skip source rects */ -+ } -+ -+ qxl_draw_dirty_fb(qdev, qxl_fb, qobj, flags, color, -+ clips, num_clips, inc); -+ return 0; -+} -+ -+static const struct drm_framebuffer_funcs qxl_fb_funcs = { -+ .destroy = qxl_user_framebuffer_destroy, -+ .dirty = qxl_framebuffer_surface_dirty, -+/* TODO? -+ * .create_handle = qxl_user_framebuffer_create_handle, */ -+}; -+ -+int -+qxl_framebuffer_init(struct drm_device *dev, -+ struct qxl_framebuffer *qfb, -+ struct drm_mode_fb_cmd2 *mode_cmd, -+ struct drm_gem_object *obj) -+{ -+ int ret; -+ -+ qfb->obj = obj; -+ ret = drm_framebuffer_init(dev, &qfb->base, &qxl_fb_funcs); -+ if (ret) { -+ qfb->obj = NULL; -+ return ret; -+ } -+ drm_helper_mode_fill_fb_struct(&qfb->base, mode_cmd); -+ return 0; -+} -+ -+static void qxl_crtc_dpms(struct drm_crtc *crtc, int mode) -+{ -+} -+ -+static bool qxl_crtc_mode_fixup(struct drm_crtc *crtc, -+ const struct drm_display_mode *mode, -+ struct drm_display_mode *adjusted_mode) -+{ -+ struct drm_device *dev = crtc->dev; -+ struct qxl_device *qdev = dev->dev_private; -+ -+ qxl_io_log(qdev, "%s: (%d,%d) => (%d,%d)\n", -+ __func__, -+ mode->hdisplay, mode->vdisplay, -+ adjusted_mode->hdisplay, -+ adjusted_mode->vdisplay); -+ return true; -+} -+ -+void -+qxl_send_monitors_config(struct qxl_device *qdev) -+{ -+ int i; -+ -+ BUG_ON(!qdev->ram_header->monitors_config); -+ -+ if (qdev->monitors_config->count == 0) { -+ qxl_io_log(qdev, "%s: 0 monitors??\n", __func__); -+ return; -+ } -+ for (i = 0 ; i < qdev->monitors_config->count ; ++i) { -+ struct qxl_head *head = &qdev->monitors_config->heads[i]; -+ -+ if (head->y > 8192 || head->y < head->x || -+ head->width > 8192 || head->height > 8192) { -+ DRM_ERROR("head %d wrong: %dx%d+%d+%d\n", -+ i, head->width, head->height, -+ head->x, head->y); -+ return; -+ } -+ } -+ qxl_io_monitors_config(qdev); -+} -+ -+static void qxl_monitors_config_set_single(struct qxl_device *qdev, -+ unsigned x, unsigned y, -+ unsigned width, unsigned height) -+{ -+ DRM_DEBUG("%dx%d+%d+%d\n", width, height, x, y); -+ qdev->monitors_config->count = 1; -+ qdev->monitors_config->heads[0].x = x; -+ qdev->monitors_config->heads[0].y = y; -+ qdev->monitors_config->heads[0].width = width; -+ qdev->monitors_config->heads[0].height = height; -+} -+ -+static int qxl_crtc_mode_set(struct drm_crtc *crtc, -+ struct drm_display_mode *mode, -+ struct drm_display_mode *adjusted_mode, -+ int x, int y, -+ struct drm_framebuffer *old_fb) -+{ -+ struct drm_device *dev = crtc->dev; -+ struct qxl_device *qdev = dev->dev_private; -+ struct qxl_mode *m = (void *)mode->private; -+ struct qxl_framebuffer *qfb; -+ struct qxl_bo *bo, *old_bo = NULL; -+ uint32_t width, height, base_offset; -+ bool recreate_primary = false; -+ int ret; -+ -+ if (!crtc->fb) { -+ DRM_DEBUG_KMS("No FB bound\n"); -+ return 0; -+ } -+ -+ if (old_fb) { -+ qfb = to_qxl_framebuffer(old_fb); -+ old_bo = gem_to_qxl_bo(qfb->obj); -+ } -+ qfb = to_qxl_framebuffer(crtc->fb); -+ bo = gem_to_qxl_bo(qfb->obj); -+ if (!m) -+ /* and do we care? */ -+ DRM_DEBUG("%dx%d: not a native mode\n", x, y); -+ else -+ DRM_DEBUG("%dx%d: qxl id %d\n", -+ mode->hdisplay, mode->vdisplay, m->id); -+ DRM_DEBUG("+%d+%d (%d,%d) => (%d,%d)\n", -+ x, y, -+ mode->hdisplay, mode->vdisplay, -+ adjusted_mode->hdisplay, -+ adjusted_mode->vdisplay); -+ -+ recreate_primary = true; -+ -+ width = mode->hdisplay; -+ height = mode->vdisplay; -+ base_offset = 0; -+ -+ ret = qxl_bo_reserve(bo, false); -+ if (ret != 0) -+ return ret; -+ ret = qxl_bo_pin(bo, bo->type, NULL); -+ if (ret != 0) { -+ qxl_bo_unreserve(bo); -+ return -EINVAL; -+ } -+ qxl_bo_unreserve(bo); -+ if (recreate_primary) { -+ qxl_io_destroy_primary(qdev); -+ qxl_io_log(qdev, -+ "recreate primary: %dx%d (was %dx%d,%d,%d)\n", -+ width, height, bo->surf.width, -+ bo->surf.height, bo->surf.stride, bo->surf.format); -+ qxl_io_create_primary(qdev, width, height, base_offset, bo); -+ bo->is_primary = true; -+ } -+ -+ if (old_bo && old_bo != bo) { -+ old_bo->is_primary = false; -+ ret = qxl_bo_reserve(old_bo, false); -+ qxl_bo_unpin(old_bo); -+ qxl_bo_unreserve(old_bo); -+ } -+ -+ if (qdev->monitors_config->count == 0) { -+ qxl_monitors_config_set_single(qdev, x, y, -+ mode->hdisplay, -+ mode->vdisplay); -+ } -+ qdev->mode_set = true; -+ return 0; -+} -+ -+static void qxl_crtc_prepare(struct drm_crtc *crtc) -+{ -+ DRM_DEBUG("current: %dx%d+%d+%d (%d).\n", -+ crtc->mode.hdisplay, crtc->mode.vdisplay, -+ crtc->x, crtc->y, crtc->enabled); -+} -+ -+static void qxl_crtc_commit(struct drm_crtc *crtc) -+{ -+ DRM_DEBUG("\n"); -+} -+ -+void qxl_crtc_load_lut(struct drm_crtc *crtc) -+{ -+ DRM_DEBUG("\n"); -+} -+ -+static const struct drm_crtc_helper_funcs qxl_crtc_helper_funcs = { -+ .dpms = qxl_crtc_dpms, -+ .mode_fixup = qxl_crtc_mode_fixup, -+ .mode_set = qxl_crtc_mode_set, -+ .prepare = qxl_crtc_prepare, -+ .commit = qxl_crtc_commit, -+ .load_lut = qxl_crtc_load_lut, -+}; -+ -+int qdev_crtc_init(struct drm_device *dev, int num_crtc) -+{ -+ struct qxl_crtc *qxl_crtc; -+ -+ qxl_crtc = kzalloc(sizeof(struct qxl_crtc), GFP_KERNEL); -+ if (!qxl_crtc) -+ return -ENOMEM; -+ -+ drm_crtc_init(dev, &qxl_crtc->base, &qxl_crtc_funcs); -+ -+ drm_mode_crtc_set_gamma_size(&qxl_crtc->base, 256); -+ drm_crtc_helper_add(&qxl_crtc->base, &qxl_crtc_helper_funcs); -+ return 0; -+} -+ -+static void qxl_enc_dpms(struct drm_encoder *encoder, int mode) -+{ -+ DRM_DEBUG("\n"); -+} -+ -+static bool qxl_enc_mode_fixup(struct drm_encoder *encoder, -+ const struct drm_display_mode *mode, -+ struct drm_display_mode *adjusted_mode) -+{ -+ DRM_DEBUG("\n"); -+ return true; -+} -+ -+static void qxl_enc_prepare(struct drm_encoder *encoder) -+{ -+ DRM_DEBUG("\n"); -+} -+ -+static void qxl_write_monitors_config_for_encoder(struct qxl_device *qdev, -+ struct drm_encoder *encoder) -+{ -+ int i; -+ struct qxl_head *head; -+ struct drm_display_mode *mode; -+ -+ BUG_ON(!encoder); -+ /* TODO: ugly, do better */ -+ for (i = 0 ; (encoder->possible_crtcs != (1 << i)) && i < 32; ++i) -+ ; -+ if (encoder->possible_crtcs != (1 << i)) { -+ DRM_ERROR("encoder has wrong possible_crtcs: %x\n", -+ encoder->possible_crtcs); -+ return; -+ } -+ if (!qdev->monitors_config || -+ qdev->monitors_config->max_allowed <= i) { -+ DRM_ERROR( -+ "head number too large or missing monitors config: %p, %d", -+ qdev->monitors_config, -+ qdev->monitors_config ? -+ qdev->monitors_config->max_allowed : -1); -+ return; -+ } -+ if (!encoder->crtc) { -+ DRM_ERROR("missing crtc on encoder %p\n", encoder); -+ return; -+ } -+ if (i != 0) -+ DRM_DEBUG("missing for multiple monitors: no head holes\n"); -+ head = &qdev->monitors_config->heads[i]; -+ head->id = i; -+ head->surface_id = 0; -+ if (encoder->crtc->enabled) { -+ mode = &encoder->crtc->mode; -+ head->width = mode->hdisplay; -+ head->height = mode->vdisplay; -+ head->x = encoder->crtc->x; -+ head->y = encoder->crtc->y; -+ if (qdev->monitors_config->count < i + 1) -+ qdev->monitors_config->count = i + 1; -+ } else { -+ head->width = 0; -+ head->height = 0; -+ head->x = 0; -+ head->y = 0; -+ } -+ DRM_DEBUG("setting head %d to +%d+%d %dx%d\n", -+ i, head->x, head->y, head->width, head->height); -+ head->flags = 0; -+ /* TODO - somewhere else to call this for multiple monitors -+ * (config_commit?) */ -+ qxl_send_monitors_config(qdev); -+} -+ -+static void qxl_enc_commit(struct drm_encoder *encoder) -+{ -+ struct qxl_device *qdev = encoder->dev->dev_private; -+ -+ qxl_write_monitors_config_for_encoder(qdev, encoder); -+ DRM_DEBUG("\n"); -+} -+ -+static void qxl_enc_mode_set(struct drm_encoder *encoder, -+ struct drm_display_mode *mode, -+ struct drm_display_mode *adjusted_mode) -+{ -+ DRM_DEBUG("\n"); -+} -+ -+static int qxl_conn_get_modes(struct drm_connector *connector) -+{ -+ int ret = 0; -+ struct qxl_device *qdev = connector->dev->dev_private; -+ -+ DRM_DEBUG_KMS("monitors_config=%p\n", qdev->monitors_config); -+ /* TODO: what should we do here? only show the configured modes for the -+ * device, or allow the full list, or both? */ -+ if (qdev->monitors_config && qdev->monitors_config->count) { -+ ret = qxl_add_monitors_config_modes(connector); -+ if (ret < 0) -+ return ret; -+ } -+ ret += qxl_add_common_modes(connector); -+ return ret; -+} -+ -+static int qxl_conn_mode_valid(struct drm_connector *connector, -+ struct drm_display_mode *mode) -+{ -+ /* TODO: is this called for user defined modes? (xrandr --add-mode) -+ * TODO: check that the mode fits in the framebuffer */ -+ DRM_DEBUG("%s: %dx%d status=%d\n", mode->name, mode->hdisplay, -+ mode->vdisplay, mode->status); -+ return MODE_OK; -+} -+ -+struct drm_encoder *qxl_best_encoder(struct drm_connector *connector) -+{ -+ struct qxl_output *qxl_output = -+ drm_connector_to_qxl_output(connector); -+ -+ DRM_DEBUG("\n"); -+ return &qxl_output->enc; -+} -+ -+ -+static const struct drm_encoder_helper_funcs qxl_enc_helper_funcs = { -+ .dpms = qxl_enc_dpms, -+ .mode_fixup = qxl_enc_mode_fixup, -+ .prepare = qxl_enc_prepare, -+ .mode_set = qxl_enc_mode_set, -+ .commit = qxl_enc_commit, -+}; -+ -+static const struct drm_connector_helper_funcs qxl_connector_helper_funcs = { -+ .get_modes = qxl_conn_get_modes, -+ .mode_valid = qxl_conn_mode_valid, -+ .best_encoder = qxl_best_encoder, -+}; -+ -+static void qxl_conn_save(struct drm_connector *connector) -+{ -+ DRM_DEBUG("\n"); -+} -+ -+static void qxl_conn_restore(struct drm_connector *connector) -+{ -+ DRM_DEBUG("\n"); -+} -+ -+static enum drm_connector_status qxl_conn_detect( -+ struct drm_connector *connector, -+ bool force) -+{ -+ struct qxl_output *output = -+ drm_connector_to_qxl_output(connector); -+ struct drm_device *ddev = connector->dev; -+ struct qxl_device *qdev = ddev->dev_private; -+ int connected; -+ -+ /* The first monitor is always connected */ -+ connected = (output->index == 0) || -+ (qdev->monitors_config && -+ qdev->monitors_config->count > output->index); -+ -+ DRM_DEBUG("\n"); -+ return connected ? connector_status_connected -+ : connector_status_disconnected; -+} -+ -+static int qxl_conn_set_property(struct drm_connector *connector, -+ struct drm_property *property, -+ uint64_t value) -+{ -+ DRM_DEBUG("\n"); -+ return 0; -+} -+ -+static void qxl_conn_destroy(struct drm_connector *connector) -+{ -+ struct qxl_output *qxl_output = -+ drm_connector_to_qxl_output(connector); -+ -+ drm_sysfs_connector_remove(connector); -+ drm_connector_cleanup(connector); -+ kfree(qxl_output); -+} -+ -+static const struct drm_connector_funcs qxl_connector_funcs = { -+ .dpms = drm_helper_connector_dpms, -+ .save = qxl_conn_save, -+ .restore = qxl_conn_restore, -+ .detect = qxl_conn_detect, -+ .fill_modes = drm_helper_probe_single_connector_modes, -+ .set_property = qxl_conn_set_property, -+ .destroy = qxl_conn_destroy, -+}; -+ -+static void qxl_enc_destroy(struct drm_encoder *encoder) -+{ -+ drm_encoder_cleanup(encoder); -+} -+ -+static const struct drm_encoder_funcs qxl_enc_funcs = { -+ .destroy = qxl_enc_destroy, -+}; -+ -+int qdev_output_init(struct drm_device *dev, int num_output) -+{ -+ struct qxl_output *qxl_output; -+ struct drm_connector *connector; -+ struct drm_encoder *encoder; -+ -+ qxl_output = kzalloc(sizeof(struct qxl_output), GFP_KERNEL); -+ if (!qxl_output) -+ return -ENOMEM; -+ -+ qxl_output->index = num_output; -+ -+ connector = &qxl_output->base; -+ encoder = &qxl_output->enc; -+ drm_connector_init(dev, &qxl_output->base, -+ &qxl_connector_funcs, DRM_MODE_CONNECTOR_VIRTUAL); -+ -+ drm_encoder_init(dev, &qxl_output->enc, &qxl_enc_funcs, -+ DRM_MODE_ENCODER_VIRTUAL); -+ -+ encoder->possible_crtcs = 1 << num_output; -+ drm_mode_connector_attach_encoder(&qxl_output->base, -+ &qxl_output->enc); -+ drm_encoder_helper_add(encoder, &qxl_enc_helper_funcs); -+ drm_connector_helper_add(connector, &qxl_connector_helper_funcs); -+ -+ drm_sysfs_connector_add(connector); -+ return 0; -+} -+ -+static struct drm_framebuffer * -+qxl_user_framebuffer_create(struct drm_device *dev, -+ struct drm_file *file_priv, -+ struct drm_mode_fb_cmd2 *mode_cmd) -+{ -+ struct drm_gem_object *obj; -+ struct qxl_framebuffer *qxl_fb; -+ struct qxl_device *qdev = dev->dev_private; -+ int ret; -+ -+ obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]); -+ -+ qxl_fb = kzalloc(sizeof(*qxl_fb), GFP_KERNEL); -+ if (qxl_fb == NULL) -+ return NULL; -+ -+ ret = qxl_framebuffer_init(dev, qxl_fb, mode_cmd, obj); -+ if (ret) { -+ kfree(qxl_fb); -+ drm_gem_object_unreference_unlocked(obj); -+ return NULL; -+ } -+ -+ if (qdev->active_user_framebuffer) { -+ DRM_INFO("%s: active_user_framebuffer %p -> %p\n", -+ __func__, -+ qdev->active_user_framebuffer, qxl_fb); -+ } -+ qdev->active_user_framebuffer = qxl_fb; -+ -+ return &qxl_fb->base; -+} -+ -+static const struct drm_mode_config_funcs qxl_mode_funcs = { -+ .fb_create = qxl_user_framebuffer_create, -+}; -+ -+int qxl_modeset_init(struct qxl_device *qdev) -+{ -+ int i; -+ int ret; -+ struct drm_gem_object *gobj; -+ int max_allowed = QXL_NUM_OUTPUTS; -+ int monitors_config_size = sizeof(struct qxl_monitors_config) + -+ max_allowed * sizeof(struct qxl_head); -+ -+ drm_mode_config_init(qdev->ddev); -+ ret = qxl_gem_object_create(qdev, monitors_config_size, 0, -+ QXL_GEM_DOMAIN_VRAM, -+ false, false, NULL, &gobj); -+ if (ret) { -+ DRM_ERROR("%s: failed to create gem ret=%d\n", __func__, ret); -+ return -ENOMEM; -+ } -+ qdev->monitors_config_bo = gem_to_qxl_bo(gobj); -+ qxl_bo_kmap(qdev->monitors_config_bo, NULL); -+ qdev->monitors_config = qdev->monitors_config_bo->kptr; -+ qdev->ram_header->monitors_config = -+ qxl_bo_physical_address(qdev, qdev->monitors_config_bo, 0); -+ -+ memset(qdev->monitors_config, 0, monitors_config_size); -+ qdev->monitors_config->max_allowed = max_allowed; -+ -+ qdev->ddev->mode_config.funcs = (void *)&qxl_mode_funcs; -+ -+ /* modes will be validated against the framebuffer size */ -+ qdev->ddev->mode_config.min_width = 320; -+ qdev->ddev->mode_config.min_height = 200; -+ qdev->ddev->mode_config.max_width = 8192; -+ qdev->ddev->mode_config.max_height = 8192; -+ -+ qdev->ddev->mode_config.fb_base = qdev->vram_base; -+ for (i = 0 ; i < QXL_NUM_OUTPUTS; ++i) { -+ qdev_crtc_init(qdev->ddev, i); -+ qdev_output_init(qdev->ddev, i); -+ } -+ -+ qdev->mode_info.mode_config_initialized = true; -+ -+ /* primary surface must be created by this point, to allow -+ * issuing command queue commands and having them read by -+ * spice server. */ -+ qxl_fbdev_init(qdev); -+ return 0; -+} -+ -+void qxl_modeset_fini(struct qxl_device *qdev) -+{ -+ qxl_fbdev_fini(qdev); -+ if (qdev->mode_info.mode_config_initialized) { -+ drm_mode_config_cleanup(qdev->ddev); -+ qdev->mode_info.mode_config_initialized = false; -+ } -+} -diff --git a/drivers/gpu/drm/qxl/qxl_draw.c b/drivers/gpu/drm/qxl/qxl_draw.c -new file mode 100644 -index 0000000..7d5396d2 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_draw.c -@@ -0,0 +1,384 @@ -+/* -+ * Copyright 2011 Red Hat, Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * on the rights to use, copy, modify, merge, publish, distribute, sub -+ * license, and/or sell copies of the Software, and to permit persons to whom -+ * the Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+/* returns a pointer to the already allocated qxl_rect array inside -+ * the qxl_clip_rects. This is *not* the same as the memory allocated -+ * on the device, it is offset to qxl_clip_rects.chunk.data */ -+static struct qxl_rect *drawable_set_clipping(struct qxl_device *qdev, -+ struct qxl_drawable *drawable, -+ unsigned num_clips, -+ struct qxl_bo **clips_bo, -+ struct qxl_release *release) -+{ -+ struct qxl_clip_rects *dev_clips; -+ int ret; -+ int size = sizeof(*dev_clips) + sizeof(struct qxl_rect) * num_clips; -+ ret = qxl_alloc_bo_reserved(qdev, size, clips_bo); -+ if (ret) -+ return NULL; -+ -+ ret = qxl_bo_kmap(*clips_bo, (void **)&dev_clips); -+ if (ret) { -+ qxl_bo_unref(clips_bo); -+ return NULL; -+ } -+ dev_clips->num_rects = num_clips; -+ dev_clips->chunk.next_chunk = 0; -+ dev_clips->chunk.prev_chunk = 0; -+ dev_clips->chunk.data_size = sizeof(struct qxl_rect) * num_clips; -+ return (struct qxl_rect *)dev_clips->chunk.data; -+} -+ -+static int -+make_drawable(struct qxl_device *qdev, int surface, uint8_t type, -+ const struct qxl_rect *rect, -+ struct qxl_release **release) -+{ -+ struct qxl_drawable *drawable; -+ int i, ret; -+ -+ ret = qxl_alloc_release_reserved(qdev, sizeof(*drawable), -+ QXL_RELEASE_DRAWABLE, release, -+ NULL); -+ if (ret) -+ return ret; -+ -+ drawable = (struct qxl_drawable *)qxl_release_map(qdev, *release); -+ drawable->type = type; -+ -+ drawable->surface_id = surface; /* Only primary for now */ -+ drawable->effect = QXL_EFFECT_OPAQUE; -+ drawable->self_bitmap = 0; -+ drawable->self_bitmap_area.top = 0; -+ drawable->self_bitmap_area.left = 0; -+ drawable->self_bitmap_area.bottom = 0; -+ drawable->self_bitmap_area.right = 0; -+ /* FIXME: add clipping */ -+ drawable->clip.type = SPICE_CLIP_TYPE_NONE; -+ -+ /* -+ * surfaces_dest[i] should apparently be filled out with the -+ * surfaces that we depend on, and surface_rects should be -+ * filled with the rectangles of those surfaces that we -+ * are going to use. -+ */ -+ for (i = 0; i < 3; ++i) -+ drawable->surfaces_dest[i] = -1; -+ -+ if (rect) -+ drawable->bbox = *rect; -+ -+ drawable->mm_time = qdev->rom->mm_clock; -+ qxl_release_unmap(qdev, *release, &drawable->release_info); -+ return 0; -+} -+ -+static int qxl_palette_create_1bit(struct qxl_bo **palette_bo, -+ const struct qxl_fb_image *qxl_fb_image) -+{ -+ struct qxl_device *qdev = qxl_fb_image->qdev; -+ const struct fb_image *fb_image = &qxl_fb_image->fb_image; -+ uint32_t visual = qxl_fb_image->visual; -+ const uint32_t *pseudo_palette = qxl_fb_image->pseudo_palette; -+ struct qxl_palette *pal; -+ int ret; -+ uint32_t fgcolor, bgcolor; -+ static uint64_t unique; /* we make no attempt to actually set this -+ * correctly globaly, since that would require -+ * tracking all of our palettes. */ -+ -+ ret = qxl_alloc_bo_reserved(qdev, -+ sizeof(struct qxl_palette) + sizeof(uint32_t) * 2, -+ palette_bo); -+ -+ ret = qxl_bo_kmap(*palette_bo, (void **)&pal); -+ pal->num_ents = 2; -+ pal->unique = unique++; -+ if (visual == FB_VISUAL_TRUECOLOR || visual == FB_VISUAL_DIRECTCOLOR) { -+ /* NB: this is the only used branch currently. */ -+ fgcolor = pseudo_palette[fb_image->fg_color]; -+ bgcolor = pseudo_palette[fb_image->bg_color]; -+ } else { -+ fgcolor = fb_image->fg_color; -+ bgcolor = fb_image->bg_color; -+ } -+ pal->ents[0] = bgcolor; -+ pal->ents[1] = fgcolor; -+ qxl_bo_kunmap(*palette_bo); -+ return 0; -+} -+ -+void qxl_draw_opaque_fb(const struct qxl_fb_image *qxl_fb_image, -+ int stride /* filled in if 0 */) -+{ -+ struct qxl_device *qdev = qxl_fb_image->qdev; -+ struct qxl_drawable *drawable; -+ struct qxl_rect rect; -+ const struct fb_image *fb_image = &qxl_fb_image->fb_image; -+ int x = fb_image->dx; -+ int y = fb_image->dy; -+ int width = fb_image->width; -+ int height = fb_image->height; -+ const char *src = fb_image->data; -+ int depth = fb_image->depth; -+ struct qxl_release *release; -+ struct qxl_bo *image_bo; -+ struct qxl_image *image; -+ int ret; -+ -+ if (stride == 0) -+ stride = depth * width / 8; -+ -+ rect.left = x; -+ rect.right = x + width; -+ rect.top = y; -+ rect.bottom = y + height; -+ -+ ret = make_drawable(qdev, 0, QXL_DRAW_COPY, &rect, &release); -+ if (ret) -+ return; -+ -+ ret = qxl_image_create(qdev, release, &image_bo, -+ (const uint8_t *)src, 0, 0, -+ width, height, depth, stride); -+ QXL_INFO(qdev, "image_bo offset %llx\n", -+ image_bo->tbo.addr_space_offset - DRM_FILE_OFFSET); -+ if (depth == 1) { -+ struct qxl_bo *palette_bo; -+ -+ ret = qxl_palette_create_1bit(&palette_bo, qxl_fb_image); -+ qxl_release_add_res(qdev, release, palette_bo); -+ ret = qxl_bo_kmap(image_bo, (void **)&image); -+ image->u.bitmap.palette = -+ qxl_bo_physical_address(qdev, palette_bo, 0); -+ qxl_bo_kunmap(image_bo); -+ qxl_bo_unreserve(palette_bo); -+ qxl_bo_unref(&palette_bo); -+ } -+ -+ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release); -+ -+ drawable->u.copy.src_area.top = 0; -+ drawable->u.copy.src_area.bottom = height; -+ drawable->u.copy.src_area.left = 0; -+ drawable->u.copy.src_area.right = width; -+ -+ drawable->u.copy.rop_descriptor = SPICE_ROPD_OP_PUT; -+ drawable->u.copy.scale_mode = 0; -+ drawable->u.copy.mask.flags = 0; -+ drawable->u.copy.mask.pos.x = 0; -+ drawable->u.copy.mask.pos.y = 0; -+ drawable->u.copy.mask.bitmap = 0; -+ -+ drawable->u.copy.src_bitmap = -+ qxl_bo_physical_address(qdev, image_bo, 0); -+ qxl_release_unmap(qdev, release, &drawable->release_info); -+ -+ qxl_release_add_res(qdev, release, image_bo); -+ qxl_bo_unreserve(image_bo); -+ qxl_bo_unref(&image_bo); -+ -+ qxl_fence_releaseable(qdev, release); -+ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false); -+ qxl_release_unreserve(qdev, release); -+} -+ -+/* push a draw command using the given clipping rectangles as -+ * the sources from the shadow framebuffer. -+ * -+ * Right now implementing with a single draw and a clip list. Clip -+ * lists are known to be a problem performance wise, this can be solved -+ * by treating them differently in the server. -+ */ -+void qxl_draw_dirty_fb(struct qxl_device *qdev, -+ struct qxl_framebuffer *qxl_fb, -+ struct qxl_bo *bo, -+ unsigned flags, unsigned color, -+ struct drm_clip_rect *clips, -+ unsigned num_clips, int inc) -+{ -+ /* -+ * TODO: if flags & DRM_MODE_FB_DIRTY_ANNOTATE_FILL then we should -+ * send a fill command instead, much cheaper. -+ * -+ * See include/drm/drm_mode.h -+ */ -+ struct drm_clip_rect *clips_ptr; -+ int i; -+ int left, right, top, bottom; -+ int width, height; -+ struct qxl_drawable *drawable; -+ struct qxl_rect drawable_rect; -+ struct qxl_rect *rects; -+ int stride = qxl_fb->base.pitches[0]; -+ /* depth is not actually interesting, we don't mask with it */ -+ int depth = qxl_fb->base.bits_per_pixel; -+ uint8_t *surface_base; -+ struct qxl_release *release; -+ struct qxl_bo *image_bo; -+ struct qxl_bo *clips_bo; -+ int ret; -+ -+ left = clips->x1; -+ right = clips->x2; -+ top = clips->y1; -+ bottom = clips->y2; -+ -+ /* skip the first clip rect */ -+ for (i = 1, clips_ptr = clips + inc; -+ i < num_clips; i++, clips_ptr += inc) { -+ left = min_t(int, left, (int)clips_ptr->x1); -+ right = max_t(int, right, (int)clips_ptr->x2); -+ top = min_t(int, top, (int)clips_ptr->y1); -+ bottom = max_t(int, bottom, (int)clips_ptr->y2); -+ } -+ -+ width = right - left; -+ height = bottom - top; -+ drawable_rect.left = left; -+ drawable_rect.right = right; -+ drawable_rect.top = top; -+ drawable_rect.bottom = bottom; -+ ret = make_drawable(qdev, 0, QXL_DRAW_COPY, &drawable_rect, -+ &release); -+ if (ret) -+ return; -+ -+ ret = qxl_bo_kmap(bo, (void **)&surface_base); -+ if (ret) -+ return; -+ -+ ret = qxl_image_create(qdev, release, &image_bo, surface_base, -+ left, top, width, height, depth, stride); -+ qxl_bo_kunmap(bo); -+ if (ret) -+ goto out_unref; -+ -+ rects = drawable_set_clipping(qdev, drawable, num_clips, &clips_bo, release); -+ if (!rects) { -+ qxl_bo_unref(&image_bo); -+ goto out_unref; -+ } -+ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release); -+ -+ drawable->clip.type = SPICE_CLIP_TYPE_RECTS; -+ drawable->clip.data = qxl_bo_physical_address(qdev, -+ clips_bo, 0); -+ qxl_release_add_res(qdev, release, clips_bo); -+ -+ drawable->u.copy.src_area.top = 0; -+ drawable->u.copy.src_area.bottom = height; -+ drawable->u.copy.src_area.left = 0; -+ drawable->u.copy.src_area.right = width; -+ -+ drawable->u.copy.rop_descriptor = SPICE_ROPD_OP_PUT; -+ drawable->u.copy.scale_mode = 0; -+ drawable->u.copy.mask.flags = 0; -+ drawable->u.copy.mask.pos.x = 0; -+ drawable->u.copy.mask.pos.y = 0; -+ drawable->u.copy.mask.bitmap = 0; -+ -+ drawable->u.copy.src_bitmap = qxl_bo_physical_address(qdev, image_bo, 0); -+ qxl_release_unmap(qdev, release, &drawable->release_info); -+ qxl_release_add_res(qdev, release, image_bo); -+ qxl_bo_unreserve(image_bo); -+ qxl_bo_unref(&image_bo); -+ clips_ptr = clips; -+ for (i = 0; i < num_clips; i++, clips_ptr += inc) { -+ rects[i].left = clips_ptr->x1; -+ rects[i].right = clips_ptr->x2; -+ rects[i].top = clips_ptr->y1; -+ rects[i].bottom = clips_ptr->y2; -+ } -+ qxl_bo_kunmap(clips_bo); -+ qxl_bo_unreserve(clips_bo); -+ qxl_bo_unref(&clips_bo); -+ -+ qxl_fence_releaseable(qdev, release); -+ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false); -+ qxl_release_unreserve(qdev, release); -+ return; -+ -+out_unref: -+ qxl_release_unreserve(qdev, release); -+ qxl_release_free(qdev, release); -+} -+ -+void qxl_draw_copyarea(struct qxl_device *qdev, -+ u32 width, u32 height, -+ u32 sx, u32 sy, -+ u32 dx, u32 dy) -+{ -+ struct qxl_drawable *drawable; -+ struct qxl_rect rect; -+ struct qxl_release *release; -+ int ret; -+ -+ rect.left = dx; -+ rect.top = dy; -+ rect.right = dx + width; -+ rect.bottom = dy + height; -+ ret = make_drawable(qdev, 0, QXL_COPY_BITS, &rect, &release); -+ if (ret) -+ return; -+ -+ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release); -+ drawable->u.copy_bits.src_pos.x = sx; -+ drawable->u.copy_bits.src_pos.y = sy; -+ -+ qxl_release_unmap(qdev, release, &drawable->release_info); -+ qxl_fence_releaseable(qdev, release); -+ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false); -+ qxl_release_unreserve(qdev, release); -+} -+ -+void qxl_draw_fill(struct qxl_draw_fill *qxl_draw_fill_rec) -+{ -+ struct qxl_device *qdev = qxl_draw_fill_rec->qdev; -+ struct qxl_rect rect = qxl_draw_fill_rec->rect; -+ uint32_t color = qxl_draw_fill_rec->color; -+ uint16_t rop = qxl_draw_fill_rec->rop; -+ struct qxl_drawable *drawable; -+ struct qxl_release *release; -+ int ret; -+ -+ ret = make_drawable(qdev, 0, QXL_DRAW_FILL, &rect, &release); -+ if (ret) -+ return; -+ -+ drawable = (struct qxl_drawable *)qxl_release_map(qdev, release); -+ drawable->u.fill.brush.type = SPICE_BRUSH_TYPE_SOLID; -+ drawable->u.fill.brush.u.color = color; -+ drawable->u.fill.rop_descriptor = rop; -+ drawable->u.fill.mask.flags = 0; -+ drawable->u.fill.mask.pos.x = 0; -+ drawable->u.fill.mask.pos.y = 0; -+ drawable->u.fill.mask.bitmap = 0; -+ -+ qxl_release_unmap(qdev, release, &drawable->release_info); -+ qxl_fence_releaseable(qdev, release); -+ qxl_push_command_ring_release(qdev, release, QXL_CMD_DRAW, false); -+ qxl_release_unreserve(qdev, release); -+} -diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c -new file mode 100644 -index 0000000..d337da0 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_drv.c -@@ -0,0 +1,145 @@ -+/* vim: set ts=8 sw=8 tw=78 ai noexpandtab */ -+/* qxl_drv.c -- QXL driver -*- linux-c -*- -+ * -+ * Copyright 2011 Red Hat, Inc. -+ * All Rights Reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: -+ * Dave Airlie <airlie@redhat.com> -+ * Alon Levy <alevy@redhat.com> -+ */ -+ -+#include <linux/module.h> -+#include <linux/console.h> -+ -+#include "drmP.h" -+#include "drm/drm.h" -+ -+#include "qxl_drv.h" -+ -+extern int qxl_max_ioctls; -+static DEFINE_PCI_DEVICE_TABLE(pciidlist) = { -+ { 0x1b36, 0x100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, -+ 0xffff00, 0 }, -+ { 0x1b36, 0x100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_OTHER << 8, -+ 0xffff00, 0 }, -+ { 0, 0, 0 }, -+}; -+MODULE_DEVICE_TABLE(pci, pciidlist); -+ -+int qxl_modeset = -1; -+ -+MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); -+module_param_named(modeset, qxl_modeset, int, 0400); -+ -+static struct drm_driver qxl_driver; -+static struct pci_driver qxl_pci_driver; -+ -+static int -+qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) -+{ -+ if (pdev->revision < 4) { -+ DRM_ERROR("qxl too old, doesn't support client_monitors_config," -+ " use xf86-video-qxl in user mode"); -+ return -EINVAL; /* TODO: ENODEV ? */ -+ } -+ return drm_get_pci_dev(pdev, ent, &qxl_driver); -+} -+ -+static void -+qxl_pci_remove(struct pci_dev *pdev) -+{ -+ struct drm_device *dev = pci_get_drvdata(pdev); -+ -+ drm_put_dev(dev); -+} -+ -+static struct pci_driver qxl_pci_driver = { -+ .name = DRIVER_NAME, -+ .id_table = pciidlist, -+ .probe = qxl_pci_probe, -+ .remove = qxl_pci_remove, -+}; -+ -+static const struct file_operations qxl_fops = { -+ .owner = THIS_MODULE, -+ .open = drm_open, -+ .release = drm_release, -+ .unlocked_ioctl = drm_ioctl, -+ .poll = drm_poll, -+ .fasync = drm_fasync, -+ .mmap = qxl_mmap, -+}; -+ -+static struct drm_driver qxl_driver = { -+ .driver_features = DRIVER_GEM | DRIVER_MODESET | -+ DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED, -+ .dev_priv_size = 0, -+ .load = qxl_driver_load, -+ .unload = qxl_driver_unload, -+ -+ .dumb_create = qxl_mode_dumb_create, -+ .dumb_map_offset = qxl_mode_dumb_mmap, -+ .dumb_destroy = qxl_mode_dumb_destroy, -+#if defined(CONFIG_DEBUG_FS) -+ .debugfs_init = qxl_debugfs_init, -+ .debugfs_cleanup = qxl_debugfs_takedown, -+#endif -+ .gem_init_object = qxl_gem_object_init, -+ .gem_free_object = qxl_gem_object_free, -+ .gem_open_object = qxl_gem_object_open, -+ .gem_close_object = qxl_gem_object_close, -+ .fops = &qxl_fops, -+ .ioctls = qxl_ioctls, -+ .irq_handler = qxl_irq_handler, -+ .name = DRIVER_NAME, -+ .desc = DRIVER_DESC, -+ .date = DRIVER_DATE, -+ .major = 0, -+ .minor = 1, -+ .patchlevel = 0, -+}; -+ -+static int __init qxl_init(void) -+{ -+#ifdef CONFIG_VGA_CONSOLE -+ if (vgacon_text_force() && qxl_modeset == -1) -+ return -EINVAL; -+#endif -+ -+ if (qxl_modeset == 0) -+ return -EINVAL; -+ qxl_driver.num_ioctls = qxl_max_ioctls; -+ return drm_pci_init(&qxl_driver, &qxl_pci_driver); -+} -+ -+static void __exit qxl_exit(void) -+{ -+ drm_pci_exit(&qxl_driver, &qxl_pci_driver); -+} -+ -+module_init(qxl_init); -+module_exit(qxl_exit); -+ -+MODULE_AUTHOR(DRIVER_AUTHOR); -+MODULE_DESCRIPTION(DRIVER_DESC); -+MODULE_LICENSE("GPL and additional rights"); -diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h -new file mode 100644 -index 0000000..52b582c ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_drv.h -@@ -0,0 +1,566 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+ -+#ifndef QXL_DRV_H -+#define QXL_DRV_H -+ -+/* -+ * Definitions taken from spice-protocol, plus kernel driver specific bits. -+ */ -+ -+#include <linux/workqueue.h> -+#include <linux/firmware.h> -+#include <linux/platform_device.h> -+ -+#include "drmP.h" -+#include "drm_crtc.h" -+#include <ttm/ttm_bo_api.h> -+#include <ttm/ttm_bo_driver.h> -+#include <ttm/ttm_placement.h> -+#include <ttm/ttm_module.h> -+ -+#include <drm/qxl_drm.h> -+#include "qxl_dev.h" -+ -+#define DRIVER_AUTHOR "Dave Airlie" -+ -+#define DRIVER_NAME "qxl" -+#define DRIVER_DESC "RH QXL" -+#define DRIVER_DATE "20120117" -+ -+#define DRIVER_MAJOR 0 -+#define DRIVER_MINOR 1 -+#define DRIVER_PATCHLEVEL 0 -+ -+#define QXL_NUM_OUTPUTS 1 -+ -+#define QXL_DEBUGFS_MAX_COMPONENTS 32 -+ -+extern int qxl_log_level; -+ -+enum { -+ QXL_INFO_LEVEL = 1, -+ QXL_DEBUG_LEVEL = 2, -+}; -+ -+#define QXL_INFO(qdev, fmt, ...) do { \ -+ if (qxl_log_level >= QXL_INFO_LEVEL) { \ -+ qxl_io_log(qdev, fmt, __VA_ARGS__); \ -+ } \ -+ } while (0) -+#define QXL_DEBUG(qdev, fmt, ...) do { \ -+ if (qxl_log_level >= QXL_DEBUG_LEVEL) { \ -+ qxl_io_log(qdev, fmt, __VA_ARGS__); \ -+ } \ -+ } while (0) -+#define QXL_INFO_ONCE(qdev, fmt, ...) do { \ -+ static int done; \ -+ if (!done) { \ -+ done = 1; \ -+ QXL_INFO(qdev, fmt, __VA_ARGS__); \ -+ } \ -+ } while (0) -+ -+#define DRM_FILE_OFFSET 0x100000000ULL -+#define DRM_FILE_PAGE_OFFSET (DRM_FILE_OFFSET >> PAGE_SHIFT) -+ -+#define QXL_INTERRUPT_MASK (\ -+ QXL_INTERRUPT_DISPLAY |\ -+ QXL_INTERRUPT_CURSOR |\ -+ QXL_INTERRUPT_IO_CMD |\ -+ QXL_INTERRUPT_CLIENT_MONITORS_CONFIG) -+ -+struct qxl_fence { -+ struct qxl_device *qdev; -+ uint32_t num_active_releases; -+ uint32_t *release_ids; -+ struct radix_tree_root tree; -+}; -+ -+struct qxl_bo { -+ /* Protected by gem.mutex */ -+ struct list_head list; -+ /* Protected by tbo.reserved */ -+ u32 placements[3]; -+ struct ttm_placement placement; -+ struct ttm_buffer_object tbo; -+ struct ttm_bo_kmap_obj kmap; -+ unsigned pin_count; -+ void *kptr; -+ int type; -+ /* Constant after initialization */ -+ struct drm_gem_object gem_base; -+ bool is_primary; /* is this now a primary surface */ -+ bool hw_surf_alloc; -+ struct qxl_surface surf; -+ uint32_t surface_id; -+ struct qxl_fence fence; /* per bo fence - list of releases */ -+ struct qxl_release *surf_create; -+ atomic_t reserve_count; -+}; -+#define gem_to_qxl_bo(gobj) container_of((gobj), struct qxl_bo, gem_base) -+ -+struct qxl_gem { -+ struct mutex mutex; -+ struct list_head objects; -+}; -+ -+struct qxl_bo_list { -+ struct list_head lhead; -+ struct qxl_bo *bo; -+}; -+ -+struct qxl_reloc_list { -+ struct list_head bos; -+}; -+ -+struct qxl_crtc { -+ struct drm_crtc base; -+ int cur_x; -+ int cur_y; -+}; -+ -+struct qxl_output { -+ int index; -+ struct drm_connector base; -+ struct drm_encoder enc; -+}; -+ -+struct qxl_framebuffer { -+ struct drm_framebuffer base; -+ struct drm_gem_object *obj; -+}; -+ -+#define to_qxl_crtc(x) container_of(x, struct qxl_crtc, base) -+#define drm_connector_to_qxl_output(x) container_of(x, struct qxl_output, base) -+#define drm_encoder_to_qxl_output(x) container_of(x, struct qxl_output, base) -+#define to_qxl_framebuffer(x) container_of(x, struct qxl_framebuffer, base) -+ -+struct qxl_mman { -+ struct ttm_bo_global_ref bo_global_ref; -+ struct drm_global_reference mem_global_ref; -+ bool mem_global_referenced; -+ struct ttm_bo_device bdev; -+}; -+ -+struct qxl_mode_info { -+ int num_modes; -+ struct qxl_mode *modes; -+ bool mode_config_initialized; -+ -+ /* pointer to fbdev info structure */ -+ struct qxl_fbdev *qfbdev; -+}; -+ -+ -+struct qxl_memslot { -+ uint8_t generation; -+ uint64_t start_phys_addr; -+ uint64_t end_phys_addr; -+ uint64_t high_bits; -+}; -+ -+enum { -+ QXL_RELEASE_DRAWABLE, -+ QXL_RELEASE_SURFACE_CMD, -+ QXL_RELEASE_CURSOR_CMD, -+}; -+ -+/* drm_ prefix to differentiate from qxl_release_info in -+ * spice-protocol/qxl_dev.h */ -+#define QXL_MAX_RES 96 -+struct qxl_release { -+ int id; -+ int type; -+ int bo_count; -+ uint32_t release_offset; -+ uint32_t surface_release_id; -+ struct qxl_bo *bos[QXL_MAX_RES]; -+}; -+ -+struct qxl_fb_image { -+ struct qxl_device *qdev; -+ uint32_t pseudo_palette[16]; -+ struct fb_image fb_image; -+ uint32_t visual; -+}; -+ -+struct qxl_draw_fill { -+ struct qxl_device *qdev; -+ struct qxl_rect rect; -+ uint32_t color; -+ uint16_t rop; -+}; -+ -+/* -+ * Debugfs -+ */ -+struct qxl_debugfs { -+ struct drm_info_list *files; -+ unsigned num_files; -+}; -+ -+int qxl_debugfs_add_files(struct qxl_device *rdev, -+ struct drm_info_list *files, -+ unsigned nfiles); -+int qxl_debugfs_fence_init(struct qxl_device *rdev); -+void qxl_debugfs_remove_files(struct qxl_device *qdev); -+ -+struct qxl_device; -+ -+struct qxl_device { -+ struct device *dev; -+ struct drm_device *ddev; -+ struct pci_dev *pdev; -+ unsigned long flags; -+ -+ resource_size_t vram_base, vram_size; -+ resource_size_t surfaceram_base, surfaceram_size; -+ resource_size_t rom_base, rom_size; -+ struct qxl_rom *rom; -+ -+ struct qxl_mode *modes; -+ struct qxl_bo *monitors_config_bo; -+ struct qxl_monitors_config *monitors_config; -+ -+ /* last received client_monitors_config */ -+ struct qxl_monitors_config *client_monitors_config; -+ -+ int io_base; -+ void *ram; -+ struct qxl_mman mman; -+ struct qxl_gem gem; -+ struct qxl_mode_info mode_info; -+ -+ /* -+ * last created framebuffer with fb_create -+ * only used by debugfs dumbppm -+ */ -+ struct qxl_framebuffer *active_user_framebuffer; -+ -+ struct fb_info *fbdev_info; -+ struct qxl_framebuffer *fbdev_qfb; -+ void *ram_physical; -+ -+ struct qxl_ring *release_ring; -+ struct qxl_ring *command_ring; -+ struct qxl_ring *cursor_ring; -+ -+ struct qxl_ram_header *ram_header; -+ bool mode_set; -+ -+ bool primary_created; -+ -+ struct qxl_memslot *mem_slots; -+ uint8_t n_mem_slots; -+ -+ uint8_t main_mem_slot; -+ uint8_t surfaces_mem_slot; -+ uint8_t slot_id_bits; -+ uint8_t slot_gen_bits; -+ uint64_t va_slot_mask; -+ -+ struct idr release_idr; -+ spinlock_t release_idr_lock; -+ struct mutex async_io_mutex; -+ unsigned int last_sent_io_cmd; -+ -+ /* interrupt handling */ -+ atomic_t irq_received; -+ atomic_t irq_received_display; -+ atomic_t irq_received_cursor; -+ atomic_t irq_received_io_cmd; -+ unsigned irq_received_error; -+ wait_queue_head_t display_event; -+ wait_queue_head_t cursor_event; -+ wait_queue_head_t io_cmd_event; -+ struct work_struct client_monitors_config_work; -+ -+ /* debugfs */ -+ struct qxl_debugfs debugfs[QXL_DEBUGFS_MAX_COMPONENTS]; -+ unsigned debugfs_count; -+ -+ struct mutex update_area_mutex; -+ -+ struct idr surf_id_idr; -+ spinlock_t surf_id_idr_lock; -+ int last_alloced_surf_id; -+ -+ struct mutex surf_evict_mutex; -+ struct io_mapping *vram_mapping; -+ struct io_mapping *surface_mapping; -+ -+ /* */ -+ struct mutex release_mutex; -+ struct qxl_bo *current_release_bo[3]; -+ int current_release_bo_offset[3]; -+ -+ struct workqueue_struct *gc_queue; -+ struct work_struct gc_work; -+ -+}; -+ -+/* forward declaration for QXL_INFO_IO */ -+void qxl_io_log(struct qxl_device *qdev, const char *fmt, ...); -+ -+extern struct drm_ioctl_desc qxl_ioctls[]; -+extern int qxl_max_ioctl; -+ -+int qxl_driver_load(struct drm_device *dev, unsigned long flags); -+int qxl_driver_unload(struct drm_device *dev); -+ -+int qxl_modeset_init(struct qxl_device *qdev); -+void qxl_modeset_fini(struct qxl_device *qdev); -+ -+int qxl_bo_init(struct qxl_device *qdev); -+void qxl_bo_fini(struct qxl_device *qdev); -+ -+struct qxl_ring *qxl_ring_create(struct qxl_ring_header *header, -+ int element_size, -+ int n_elements, -+ int prod_notify, -+ bool set_prod_notify, -+ wait_queue_head_t *push_event); -+void qxl_ring_free(struct qxl_ring *ring); -+ -+static inline void * -+qxl_fb_virtual_address(struct qxl_device *qdev, unsigned long physical) -+{ -+ QXL_INFO(qdev, "not implemented (%lu)\n", physical); -+ return 0; -+} -+ -+static inline uint64_t -+qxl_bo_physical_address(struct qxl_device *qdev, struct qxl_bo *bo, -+ unsigned long offset) -+{ -+ int slot_id = bo->type == QXL_GEM_DOMAIN_VRAM ? qdev->main_mem_slot : qdev->surfaces_mem_slot; -+ struct qxl_memslot *slot = &(qdev->mem_slots[slot_id]); -+ -+ /* TODO - need to hold one of the locks to read tbo.offset */ -+ return slot->high_bits | (bo->tbo.offset + offset); -+} -+ -+/* qxl_fb.c */ -+#define QXLFB_CONN_LIMIT 1 -+ -+int qxl_fbdev_init(struct qxl_device *qdev); -+void qxl_fbdev_fini(struct qxl_device *qdev); -+int qxl_get_handle_for_primary_fb(struct qxl_device *qdev, -+ struct drm_file *file_priv, -+ uint32_t *handle); -+ -+/* qxl_display.c */ -+int -+qxl_framebuffer_init(struct drm_device *dev, -+ struct qxl_framebuffer *rfb, -+ struct drm_mode_fb_cmd2 *mode_cmd, -+ struct drm_gem_object *obj); -+void qxl_display_read_client_monitors_config(struct qxl_device *qdev); -+void qxl_send_monitors_config(struct qxl_device *qdev); -+ -+/* used by qxl_debugfs only */ -+void qxl_crtc_set_from_monitors_config(struct qxl_device *qdev); -+void qxl_alloc_client_monitors_config(struct qxl_device *qdev, unsigned count); -+ -+/* qxl_gem.c */ -+int qxl_gem_init(struct qxl_device *qdev); -+void qxl_gem_fini(struct qxl_device *qdev); -+int qxl_gem_object_create(struct qxl_device *qdev, int size, -+ int alignment, int initial_domain, -+ bool discardable, bool kernel, -+ struct qxl_surface *surf, -+ struct drm_gem_object **obj); -+int qxl_gem_object_pin(struct drm_gem_object *obj, uint32_t pin_domain, -+ uint64_t *gpu_addr); -+void qxl_gem_object_unpin(struct drm_gem_object *obj); -+int qxl_gem_object_create_with_handle(struct qxl_device *qdev, -+ struct drm_file *file_priv, -+ u32 domain, -+ size_t size, -+ struct qxl_surface *surf, -+ struct qxl_bo **qobj, -+ uint32_t *handle); -+int qxl_gem_object_init(struct drm_gem_object *obj); -+void qxl_gem_object_free(struct drm_gem_object *gobj); -+int qxl_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv); -+void qxl_gem_object_close(struct drm_gem_object *obj, -+ struct drm_file *file_priv); -+void qxl_bo_force_delete(struct qxl_device *qdev); -+int qxl_bo_kmap(struct qxl_bo *bo, void **ptr); -+ -+/* qxl_dumb.c */ -+int qxl_mode_dumb_create(struct drm_file *file_priv, -+ struct drm_device *dev, -+ struct drm_mode_create_dumb *args); -+int qxl_mode_dumb_destroy(struct drm_file *file_priv, -+ struct drm_device *dev, -+ uint32_t handle); -+int qxl_mode_dumb_mmap(struct drm_file *filp, -+ struct drm_device *dev, -+ uint32_t handle, uint64_t *offset_p); -+ -+ -+/* qxl ttm */ -+int qxl_ttm_init(struct qxl_device *qdev); -+void qxl_ttm_fini(struct qxl_device *qdev); -+int qxl_mmap(struct file *filp, struct vm_area_struct *vma); -+ -+/* qxl image */ -+ -+int qxl_image_create(struct qxl_device *qdev, -+ struct qxl_release *release, -+ struct qxl_bo **image_bo, -+ const uint8_t *data, -+ int x, int y, int width, int height, -+ int depth, int stride); -+void qxl_update_screen(struct qxl_device *qxl); -+ -+/* qxl io operations (qxl_cmd.c) */ -+ -+void qxl_io_create_primary(struct qxl_device *qdev, -+ unsigned width, unsigned height, unsigned offset, -+ struct qxl_bo *bo); -+void qxl_io_destroy_primary(struct qxl_device *qdev); -+void qxl_io_memslot_add(struct qxl_device *qdev, uint8_t id); -+void qxl_io_notify_oom(struct qxl_device *qdev); -+ -+int qxl_io_update_area(struct qxl_device *qdev, struct qxl_bo *surf, -+ const struct qxl_rect *area); -+ -+void qxl_io_reset(struct qxl_device *qdev); -+void qxl_io_monitors_config(struct qxl_device *qdev); -+int qxl_ring_push(struct qxl_ring *ring, const void *new_elt, bool interruptible); -+void qxl_io_flush_release(struct qxl_device *qdev); -+void qxl_io_flush_surfaces(struct qxl_device *qdev); -+ -+int qxl_release_reserve(struct qxl_device *qdev, -+ struct qxl_release *release, bool no_wait); -+void qxl_release_unreserve(struct qxl_device *qdev, -+ struct qxl_release *release); -+union qxl_release_info *qxl_release_map(struct qxl_device *qdev, -+ struct qxl_release *release); -+void qxl_release_unmap(struct qxl_device *qdev, -+ struct qxl_release *release, -+ union qxl_release_info *info); -+/* -+ * qxl_bo_add_resource. -+ * -+ */ -+void qxl_bo_add_resource(struct qxl_bo *main_bo, struct qxl_bo *resource); -+ -+int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, -+ enum qxl_surface_cmd_type surface_cmd_type, -+ struct qxl_release *create_rel, -+ struct qxl_release **release); -+int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, -+ int type, struct qxl_release **release, -+ struct qxl_bo **rbo); -+int qxl_fence_releaseable(struct qxl_device *qdev, -+ struct qxl_release *release); -+int -+qxl_push_command_ring_release(struct qxl_device *qdev, struct qxl_release *release, -+ uint32_t type, bool interruptible); -+int -+qxl_push_cursor_ring_release(struct qxl_device *qdev, struct qxl_release *release, -+ uint32_t type, bool interruptible); -+int qxl_alloc_bo_reserved(struct qxl_device *qdev, unsigned long size, -+ struct qxl_bo **_bo); -+/* qxl drawing commands */ -+ -+void qxl_draw_opaque_fb(const struct qxl_fb_image *qxl_fb_image, -+ int stride /* filled in if 0 */); -+ -+void qxl_draw_dirty_fb(struct qxl_device *qdev, -+ struct qxl_framebuffer *qxl_fb, -+ struct qxl_bo *bo, -+ unsigned flags, unsigned color, -+ struct drm_clip_rect *clips, -+ unsigned num_clips, int inc); -+ -+void qxl_draw_fill(struct qxl_draw_fill *qxl_draw_fill_rec); -+ -+void qxl_draw_copyarea(struct qxl_device *qdev, -+ u32 width, u32 height, -+ u32 sx, u32 sy, -+ u32 dx, u32 dy); -+ -+uint64_t -+qxl_release_alloc(struct qxl_device *qdev, int type, -+ struct qxl_release **ret); -+ -+void qxl_release_free(struct qxl_device *qdev, -+ struct qxl_release *release); -+void qxl_release_add_res(struct qxl_device *qdev, -+ struct qxl_release *release, -+ struct qxl_bo *bo); -+/* used by qxl_debugfs_release */ -+struct qxl_release *qxl_release_from_id_locked(struct qxl_device *qdev, -+ uint64_t id); -+ -+bool qxl_queue_garbage_collect(struct qxl_device *qdev, bool flush); -+int qxl_garbage_collect(struct qxl_device *qdev); -+ -+/* debugfs */ -+ -+int qxl_debugfs_init(struct drm_minor *minor); -+void qxl_debugfs_takedown(struct drm_minor *minor); -+ -+/* qxl_irq.c */ -+int qxl_irq_init(struct qxl_device *qdev); -+irqreturn_t qxl_irq_handler(DRM_IRQ_ARGS); -+ -+/* qxl_fb.c */ -+int qxl_fb_init(struct qxl_device *qdev); -+ -+int qxl_debugfs_add_files(struct qxl_device *qdev, -+ struct drm_info_list *files, -+ unsigned nfiles); -+ -+int qxl_surface_id_alloc(struct qxl_device *qdev, -+ struct qxl_bo *surf); -+void qxl_surface_id_dealloc(struct qxl_device *qdev, -+ uint32_t surface_id); -+int qxl_hw_surface_alloc(struct qxl_device *qdev, -+ struct qxl_bo *surf, -+ struct ttm_mem_reg *mem); -+int qxl_hw_surface_dealloc(struct qxl_device *qdev, -+ struct qxl_bo *surf); -+ -+int qxl_bo_check_id(struct qxl_device *qdev, struct qxl_bo *bo); -+ -+struct qxl_drv_surface * -+qxl_surface_lookup(struct drm_device *dev, int surface_id); -+void qxl_surface_evict(struct qxl_device *qdev, struct qxl_bo *surf, bool freeing); -+int qxl_update_surface(struct qxl_device *qdev, struct qxl_bo *surf); -+ -+/* qxl_fence.c */ -+int qxl_fence_add_release(struct qxl_fence *qfence, uint32_t rel_id); -+int qxl_fence_remove_release(struct qxl_fence *qfence, uint32_t rel_id); -+int qxl_fence_init(struct qxl_device *qdev, struct qxl_fence *qfence); -+void qxl_fence_fini(struct qxl_fence *qfence); -+ -+#endif -diff --git a/drivers/gpu/drm/qxl/qxl_dumb.c b/drivers/gpu/drm/qxl/qxl_dumb.c -new file mode 100644 -index 0000000..847c4ee ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_dumb.c -@@ -0,0 +1,93 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+/* dumb ioctls implementation */ -+ -+int qxl_mode_dumb_create(struct drm_file *file_priv, -+ struct drm_device *dev, -+ struct drm_mode_create_dumb *args) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct qxl_bo *qobj; -+ uint32_t handle; -+ int r; -+ struct qxl_surface surf; -+ uint32_t pitch, format; -+ pitch = args->width * ((args->bpp + 1) / 8); -+ args->size = pitch * args->height; -+ args->size = ALIGN(args->size, PAGE_SIZE); -+ -+ switch (args->bpp) { -+ case 16: -+ format = SPICE_SURFACE_FMT_16_565; -+ break; -+ case 32: -+ format = SPICE_SURFACE_FMT_32_xRGB; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ surf.width = args->width; -+ surf.height = args->height; -+ surf.stride = pitch; -+ surf.format = format; -+ r = qxl_gem_object_create_with_handle(qdev, file_priv, -+ QXL_GEM_DOMAIN_VRAM, -+ args->size, &surf, &qobj, -+ &handle); -+ if (r) -+ return r; -+ args->pitch = pitch; -+ args->handle = handle; -+ return 0; -+} -+ -+int qxl_mode_dumb_destroy(struct drm_file *file_priv, -+ struct drm_device *dev, -+ uint32_t handle) -+{ -+ return drm_gem_handle_delete(file_priv, handle); -+} -+ -+int qxl_mode_dumb_mmap(struct drm_file *file_priv, -+ struct drm_device *dev, -+ uint32_t handle, uint64_t *offset_p) -+{ -+ struct drm_gem_object *gobj; -+ struct qxl_bo *qobj; -+ -+ BUG_ON(!offset_p); -+ gobj = drm_gem_object_lookup(dev, file_priv, handle); -+ if (gobj == NULL) -+ return -ENOENT; -+ qobj = gem_to_qxl_bo(gobj); -+ *offset_p = qxl_bo_mmap_offset(qobj); -+ drm_gem_object_unreference_unlocked(gobj); -+ return 0; -+} -diff --git a/drivers/gpu/drm/qxl/qxl_fb.c b/drivers/gpu/drm/qxl/qxl_fb.c -new file mode 100644 -index 0000000..0c5067d ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_fb.c -@@ -0,0 +1,567 @@ -+/* -+ * Copyright © 2013 Red Hat -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: -+ * David Airlie -+ */ -+#include <linux/module.h> -+#include <linux/fb.h> -+ -+#include "drmP.h" -+#include "drm/drm.h" -+#include "drm/drm_crtc.h" -+#include "drm/drm_crtc_helper.h" -+#include "qxl_drv.h" -+ -+#include "qxl_object.h" -+#include "drm_fb_helper.h" -+ -+#define QXL_DIRTY_DELAY (HZ / 30) -+ -+struct qxl_fbdev { -+ struct drm_fb_helper helper; -+ struct qxl_framebuffer qfb; -+ struct list_head fbdev_list; -+ struct qxl_device *qdev; -+ -+ void *shadow; -+ int size; -+ -+ /* dirty memory logging */ -+ struct { -+ spinlock_t lock; -+ bool active; -+ unsigned x1; -+ unsigned y1; -+ unsigned x2; -+ unsigned y2; -+ } dirty; -+}; -+ -+static void qxl_fb_image_init(struct qxl_fb_image *qxl_fb_image, -+ struct qxl_device *qdev, struct fb_info *info, -+ const struct fb_image *image) -+{ -+ qxl_fb_image->qdev = qdev; -+ if (info) { -+ qxl_fb_image->visual = info->fix.visual; -+ if (qxl_fb_image->visual == FB_VISUAL_TRUECOLOR || -+ qxl_fb_image->visual == FB_VISUAL_DIRECTCOLOR) -+ memcpy(&qxl_fb_image->pseudo_palette, -+ info->pseudo_palette, -+ sizeof(qxl_fb_image->pseudo_palette)); -+ } else { -+ /* fallback */ -+ if (image->depth == 1) -+ qxl_fb_image->visual = FB_VISUAL_MONO10; -+ else -+ qxl_fb_image->visual = FB_VISUAL_DIRECTCOLOR; -+ } -+ if (image) { -+ memcpy(&qxl_fb_image->fb_image, image, -+ sizeof(qxl_fb_image->fb_image)); -+ } -+} -+ -+static void qxl_fb_dirty_flush(struct fb_info *info) -+{ -+ struct qxl_fbdev *qfbdev = info->par; -+ struct qxl_device *qdev = qfbdev->qdev; -+ struct qxl_fb_image qxl_fb_image; -+ struct fb_image *image = &qxl_fb_image.fb_image; -+ u32 x1, x2, y1, y2; -+ -+ /* TODO: hard coding 32 bpp */ -+ int stride = qfbdev->qfb.base.pitches[0] * 4; -+ -+ x1 = qfbdev->dirty.x1; -+ x2 = qfbdev->dirty.x2; -+ y1 = qfbdev->dirty.y1; -+ y2 = qfbdev->dirty.y2; -+ /* -+ * we are using a shadow draw buffer, at qdev->surface0_shadow -+ */ -+ qxl_io_log(qdev, "dirty x[%d, %d], y[%d, %d]", x1, x2, y1, y2); -+ image->dx = x1; -+ image->dy = y1; -+ image->width = x2 - x1; -+ image->height = y2 - y1; -+ image->fg_color = 0xffffffff; /* unused, just to avoid uninitialized -+ warnings */ -+ image->bg_color = 0; -+ image->depth = 32; /* TODO: take from somewhere? */ -+ image->cmap.start = 0; -+ image->cmap.len = 0; -+ image->cmap.red = NULL; -+ image->cmap.green = NULL; -+ image->cmap.blue = NULL; -+ image->cmap.transp = NULL; -+ image->data = qfbdev->shadow + (x1 * 4) + (stride * y1); -+ -+ qxl_fb_image_init(&qxl_fb_image, qdev, info, NULL); -+ qxl_draw_opaque_fb(&qxl_fb_image, stride); -+ qfbdev->dirty.x1 = 0; -+ qfbdev->dirty.x2 = 0; -+ qfbdev->dirty.y1 = 0; -+ qfbdev->dirty.y2 = 0; -+} -+ -+static void qxl_deferred_io(struct fb_info *info, -+ struct list_head *pagelist) -+{ -+ struct qxl_fbdev *qfbdev = info->par; -+ unsigned long start, end, min, max; -+ struct page *page; -+ int y1, y2; -+ -+ min = ULONG_MAX; -+ max = 0; -+ list_for_each_entry(page, pagelist, lru) { -+ start = page->index << PAGE_SHIFT; -+ end = start + PAGE_SIZE - 1; -+ min = min(min, start); -+ max = max(max, end); -+ } -+ -+ if (min < max) { -+ y1 = min / info->fix.line_length; -+ y2 = (max / info->fix.line_length) + 1; -+ -+ /* TODO: add spin lock? */ -+ /* spin_lock_irqsave(&qfbdev->dirty.lock, flags); */ -+ qfbdev->dirty.x1 = 0; -+ qfbdev->dirty.y1 = y1; -+ qfbdev->dirty.x2 = info->var.xres; -+ qfbdev->dirty.y2 = y2; -+ /* spin_unlock_irqrestore(&qfbdev->dirty.lock, flags); */ -+ } -+ -+ qxl_fb_dirty_flush(info); -+}; -+ -+ -+struct fb_deferred_io qxl_defio = { -+ .delay = QXL_DIRTY_DELAY, -+ .deferred_io = qxl_deferred_io, -+}; -+ -+static void qxl_fb_fillrect(struct fb_info *info, -+ const struct fb_fillrect *fb_rect) -+{ -+ struct qxl_fbdev *qfbdev = info->par; -+ struct qxl_device *qdev = qfbdev->qdev; -+ struct qxl_rect rect; -+ uint32_t color; -+ int x = fb_rect->dx; -+ int y = fb_rect->dy; -+ int width = fb_rect->width; -+ int height = fb_rect->height; -+ uint16_t rop; -+ struct qxl_draw_fill qxl_draw_fill_rec; -+ -+ if (info->fix.visual == FB_VISUAL_TRUECOLOR || -+ info->fix.visual == FB_VISUAL_DIRECTCOLOR) -+ color = ((u32 *) (info->pseudo_palette))[fb_rect->color]; -+ else -+ color = fb_rect->color; -+ rect.left = x; -+ rect.right = x + width; -+ rect.top = y; -+ rect.bottom = y + height; -+ switch (fb_rect->rop) { -+ case ROP_XOR: -+ rop = SPICE_ROPD_OP_XOR; -+ break; -+ case ROP_COPY: -+ rop = SPICE_ROPD_OP_PUT; -+ break; -+ default: -+ pr_err("qxl_fb_fillrect(): unknown rop, " -+ "defaulting to SPICE_ROPD_OP_PUT\n"); -+ rop = SPICE_ROPD_OP_PUT; -+ } -+ qxl_draw_fill_rec.qdev = qdev; -+ qxl_draw_fill_rec.rect = rect; -+ qxl_draw_fill_rec.color = color; -+ qxl_draw_fill_rec.rop = rop; -+ if (!drm_can_sleep()) { -+ qxl_io_log(qdev, -+ "%s: TODO use RCU, mysterious locks with spin_lock\n", -+ __func__); -+ return; -+ } -+ qxl_draw_fill(&qxl_draw_fill_rec); -+} -+ -+static void qxl_fb_copyarea(struct fb_info *info, -+ const struct fb_copyarea *region) -+{ -+ struct qxl_fbdev *qfbdev = info->par; -+ -+ qxl_draw_copyarea(qfbdev->qdev, -+ region->width, region->height, -+ region->sx, region->sy, -+ region->dx, region->dy); -+} -+ -+static void qxl_fb_imageblit_safe(struct qxl_fb_image *qxl_fb_image) -+{ -+ qxl_draw_opaque_fb(qxl_fb_image, 0); -+} -+ -+static void qxl_fb_imageblit(struct fb_info *info, -+ const struct fb_image *image) -+{ -+ struct qxl_fbdev *qfbdev = info->par; -+ struct qxl_device *qdev = qfbdev->qdev; -+ struct qxl_fb_image qxl_fb_image; -+ -+ if (!drm_can_sleep()) { -+ /* we cannot do any ttm_bo allocation since that will fail on -+ * ioremap_wc..__get_vm_area_node, so queue the work item -+ * instead This can happen from printk inside an interrupt -+ * context, i.e.: smp_apic_timer_interrupt..check_cpu_stall */ -+ qxl_io_log(qdev, -+ "%s: TODO use RCU, mysterious locks with spin_lock\n", -+ __func__); -+ return; -+ } -+ -+ /* ensure proper order of rendering operations - TODO: must do this -+ * for everything. */ -+ qxl_fb_image_init(&qxl_fb_image, qfbdev->qdev, info, image); -+ qxl_fb_imageblit_safe(&qxl_fb_image); -+} -+ -+int qxl_fb_init(struct qxl_device *qdev) -+{ -+ return 0; -+} -+ -+static struct fb_ops qxlfb_ops = { -+ .owner = THIS_MODULE, -+ .fb_check_var = drm_fb_helper_check_var, -+ .fb_set_par = drm_fb_helper_set_par, /* TODO: copy vmwgfx */ -+ .fb_fillrect = qxl_fb_fillrect, -+ .fb_copyarea = qxl_fb_copyarea, -+ .fb_imageblit = qxl_fb_imageblit, -+ .fb_pan_display = drm_fb_helper_pan_display, -+ .fb_blank = drm_fb_helper_blank, -+ .fb_setcmap = drm_fb_helper_setcmap, -+ .fb_debug_enter = drm_fb_helper_debug_enter, -+ .fb_debug_leave = drm_fb_helper_debug_leave, -+}; -+ -+static void qxlfb_destroy_pinned_object(struct drm_gem_object *gobj) -+{ -+ struct qxl_bo *qbo = gem_to_qxl_bo(gobj); -+ int ret; -+ -+ ret = qxl_bo_reserve(qbo, false); -+ if (likely(ret == 0)) { -+ qxl_bo_kunmap(qbo); -+ qxl_bo_unpin(qbo); -+ qxl_bo_unreserve(qbo); -+ } -+ drm_gem_object_unreference_unlocked(gobj); -+} -+ -+int qxl_get_handle_for_primary_fb(struct qxl_device *qdev, -+ struct drm_file *file_priv, -+ uint32_t *handle) -+{ -+ int r; -+ struct drm_gem_object *gobj = qdev->fbdev_qfb->obj; -+ -+ BUG_ON(!gobj); -+ /* drm_get_handle_create adds a reference - good */ -+ r = drm_gem_handle_create(file_priv, gobj, handle); -+ if (r) -+ return r; -+ return 0; -+} -+ -+static int qxlfb_create_pinned_object(struct qxl_fbdev *qfbdev, -+ struct drm_mode_fb_cmd2 *mode_cmd, -+ struct drm_gem_object **gobj_p) -+{ -+ struct qxl_device *qdev = qfbdev->qdev; -+ struct drm_gem_object *gobj = NULL; -+ struct qxl_bo *qbo = NULL; -+ int ret; -+ int aligned_size, size; -+ int height = mode_cmd->height; -+ int bpp; -+ int depth; -+ -+ drm_fb_get_bpp_depth(mode_cmd->pixel_format, &bpp, &depth); -+ -+ size = mode_cmd->pitches[0] * height; -+ aligned_size = ALIGN(size, PAGE_SIZE); -+ /* TODO: unallocate and reallocate surface0 for real. Hack to just -+ * have a large enough surface0 for 1024x768 Xorg 32bpp mode */ -+ ret = qxl_gem_object_create(qdev, aligned_size, 0, -+ QXL_GEM_DOMAIN_SURFACE, -+ false, /* is discardable */ -+ false, /* is kernel (false means device) */ -+ NULL, -+ &gobj); -+ if (ret) { -+ pr_err("failed to allocate framebuffer (%d)\n", -+ aligned_size); -+ return -ENOMEM; -+ } -+ qbo = gem_to_qxl_bo(gobj); -+ -+ qbo->surf.width = mode_cmd->width; -+ qbo->surf.height = mode_cmd->height; -+ qbo->surf.stride = mode_cmd->pitches[0]; -+ qbo->surf.format = SPICE_SURFACE_FMT_32_xRGB; -+ ret = qxl_bo_reserve(qbo, false); -+ if (unlikely(ret != 0)) -+ goto out_unref; -+ ret = qxl_bo_pin(qbo, QXL_GEM_DOMAIN_SURFACE, NULL); -+ if (ret) { -+ qxl_bo_unreserve(qbo); -+ goto out_unref; -+ } -+ ret = qxl_bo_kmap(qbo, NULL); -+ qxl_bo_unreserve(qbo); /* unreserve, will be mmaped */ -+ if (ret) -+ goto out_unref; -+ -+ *gobj_p = gobj; -+ return 0; -+out_unref: -+ qxlfb_destroy_pinned_object(gobj); -+ *gobj_p = NULL; -+ return ret; -+} -+ -+static int qxlfb_create(struct qxl_fbdev *qfbdev, -+ struct drm_fb_helper_surface_size *sizes) -+{ -+ struct qxl_device *qdev = qfbdev->qdev; -+ struct fb_info *info; -+ struct drm_framebuffer *fb = NULL; -+ struct drm_mode_fb_cmd2 mode_cmd; -+ struct drm_gem_object *gobj = NULL; -+ struct qxl_bo *qbo = NULL; -+ struct device *device = &qdev->pdev->dev; -+ int ret; -+ int size; -+ int bpp = sizes->surface_bpp; -+ int depth = sizes->surface_depth; -+ void *shadow; -+ -+ mode_cmd.width = sizes->surface_width; -+ mode_cmd.height = sizes->surface_height; -+ -+ mode_cmd.pitches[0] = ALIGN(mode_cmd.width * ((bpp + 1) / 8), 64); -+ mode_cmd.pixel_format = drm_mode_legacy_fb_format(bpp, depth); -+ -+ ret = qxlfb_create_pinned_object(qfbdev, &mode_cmd, &gobj); -+ qbo = gem_to_qxl_bo(gobj); -+ QXL_INFO(qdev, "%s: %dx%d %d\n", __func__, mode_cmd.width, -+ mode_cmd.height, mode_cmd.pitches[0]); -+ -+ shadow = vmalloc(mode_cmd.pitches[0] * mode_cmd.height); -+ /* TODO: what's the usual response to memory allocation errors? */ -+ BUG_ON(!shadow); -+ QXL_INFO(qdev, -+ "surface0 at gpu offset %lld, mmap_offset %lld (virt %p, shadow %p)\n", -+ qxl_bo_gpu_offset(qbo), -+ qxl_bo_mmap_offset(qbo), -+ qbo->kptr, -+ shadow); -+ size = mode_cmd.pitches[0] * mode_cmd.height; -+ -+ info = framebuffer_alloc(0, device); -+ if (info == NULL) { -+ ret = -ENOMEM; -+ goto out_unref; -+ } -+ -+ info->par = qfbdev; -+ -+ qxl_framebuffer_init(qdev->ddev, &qfbdev->qfb, &mode_cmd, gobj); -+ -+ fb = &qfbdev->qfb.base; -+ -+ /* setup helper with fb data */ -+ qfbdev->helper.fb = fb; -+ qfbdev->helper.fbdev = info; -+ qfbdev->shadow = shadow; -+ strcpy(info->fix.id, "qxldrmfb"); -+ -+ drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); -+ -+ info->flags = FBINFO_DEFAULT; -+ info->fbops = &qxlfb_ops; -+ -+ /* -+ * TODO: using gobj->size in various places in this function. Not sure -+ * what the difference between the different sizes is. -+ */ -+ info->fix.smem_start = qdev->vram_base; /* TODO - correct? */ -+ info->fix.smem_len = gobj->size; -+ info->screen_base = qfbdev->shadow; -+ info->screen_size = gobj->size; -+ -+ drm_fb_helper_fill_var(info, &qfbdev->helper, sizes->fb_width, -+ sizes->fb_height); -+ -+ /* setup aperture base/size for vesafb takeover */ -+ info->apertures = alloc_apertures(1); -+ if (!info->apertures) { -+ ret = -ENOMEM; -+ goto out_unref; -+ } -+ info->apertures->ranges[0].base = qdev->ddev->mode_config.fb_base; -+ info->apertures->ranges[0].size = qdev->vram_size; -+ -+ info->fix.mmio_start = 0; -+ info->fix.mmio_len = 0; -+ -+ if (info->screen_base == NULL) { -+ ret = -ENOSPC; -+ goto out_unref; -+ } -+ -+ ret = fb_alloc_cmap(&info->cmap, 256, 0); -+ if (ret) { -+ ret = -ENOMEM; -+ goto out_unref; -+ } -+ -+ info->fbdefio = &qxl_defio; -+ fb_deferred_io_init(info); -+ -+ qdev->fbdev_info = info; -+ qdev->fbdev_qfb = &qfbdev->qfb; -+ DRM_INFO("fb mappable at 0x%lX, size %lu\n", info->fix.smem_start, (unsigned long)info->screen_size); -+ DRM_INFO("fb: depth %d, pitch %d, width %d, height %d\n", fb->depth, fb->pitches[0], fb->width, fb->height); -+ return 0; -+ -+out_unref: -+ if (qbo) { -+ ret = qxl_bo_reserve(qbo, false); -+ if (likely(ret == 0)) { -+ qxl_bo_kunmap(qbo); -+ qxl_bo_unpin(qbo); -+ qxl_bo_unreserve(qbo); -+ } -+ } -+ if (fb && ret) { -+ drm_gem_object_unreference(gobj); -+ drm_framebuffer_cleanup(fb); -+ kfree(fb); -+ } -+ drm_gem_object_unreference(gobj); -+ return ret; -+} -+ -+static int qxl_fb_find_or_create_single( -+ struct drm_fb_helper *helper, -+ struct drm_fb_helper_surface_size *sizes) -+{ -+ struct qxl_fbdev *qfbdev = (struct qxl_fbdev *)helper; -+ int new_fb = 0; -+ int ret; -+ -+ if (!helper->fb) { -+ ret = qxlfb_create(qfbdev, sizes); -+ if (ret) -+ return ret; -+ new_fb = 1; -+ } -+ return new_fb; -+} -+ -+static int qxl_fbdev_destroy(struct drm_device *dev, struct qxl_fbdev *qfbdev) -+{ -+ struct fb_info *info; -+ struct qxl_framebuffer *qfb = &qfbdev->qfb; -+ -+ if (qfbdev->helper.fbdev) { -+ info = qfbdev->helper.fbdev; -+ -+ unregister_framebuffer(info); -+ framebuffer_release(info); -+ } -+ if (qfb->obj) { -+ qxlfb_destroy_pinned_object(qfb->obj); -+ qfb->obj = NULL; -+ } -+ drm_fb_helper_fini(&qfbdev->helper); -+ vfree(qfbdev->shadow); -+ drm_framebuffer_cleanup(&qfb->base); -+ -+ return 0; -+} -+ -+static struct drm_fb_helper_funcs qxl_fb_helper_funcs = { -+ /* TODO -+ .gamma_set = qxl_crtc_fb_gamma_set, -+ .gamma_get = qxl_crtc_fb_gamma_get, -+ */ -+ .fb_probe = qxl_fb_find_or_create_single, -+}; -+ -+int qxl_fbdev_init(struct qxl_device *qdev) -+{ -+ struct qxl_fbdev *qfbdev; -+ int bpp_sel = 32; /* TODO: parameter from somewhere? */ -+ int ret; -+ -+ qfbdev = kzalloc(sizeof(struct qxl_fbdev), GFP_KERNEL); -+ if (!qfbdev) -+ return -ENOMEM; -+ -+ qfbdev->qdev = qdev; -+ qdev->mode_info.qfbdev = qfbdev; -+ qfbdev->helper.funcs = &qxl_fb_helper_funcs; -+ -+ ret = drm_fb_helper_init(qdev->ddev, &qfbdev->helper, -+ 1 /* num_crtc - QXL supports just 1 */, -+ QXLFB_CONN_LIMIT); -+ if (ret) { -+ kfree(qfbdev); -+ return ret; -+ } -+ -+ drm_fb_helper_single_add_all_connectors(&qfbdev->helper); -+ drm_fb_helper_initial_config(&qfbdev->helper, bpp_sel); -+ return 0; -+} -+ -+void qxl_fbdev_fini(struct qxl_device *qdev) -+{ -+ if (!qdev->mode_info.qfbdev) -+ return; -+ -+ qxl_fbdev_destroy(qdev->ddev, qdev->mode_info.qfbdev); -+ kfree(qdev->mode_info.qfbdev); -+ qdev->mode_info.qfbdev = NULL; -+} -+ -+ -diff --git a/drivers/gpu/drm/qxl/qxl_fence.c b/drivers/gpu/drm/qxl/qxl_fence.c -new file mode 100644 -index 0000000..63c6715 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_fence.c -@@ -0,0 +1,97 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+ -+#include "qxl_drv.h" -+ -+/* QXL fencing- -+ -+ When we submit operations to the GPU we pass a release reference to the GPU -+ with them, the release reference is then added to the release ring when -+ the GPU is finished with that particular operation and has removed it from -+ its tree. -+ -+ So we have can have multiple outstanding non linear fences per object. -+ -+ From a TTM POV we only care if the object has any outstanding releases on -+ it. -+ -+ we wait until all outstanding releases are processeed. -+ -+ sync object is just a list of release ids that represent that fence on -+ that buffer. -+ -+ we just add new releases onto the sync object attached to the object. -+ -+ This currently uses a radix tree to store the list of release ids. -+ -+ For some reason every so often qxl hw fails to release, things go wrong. -+*/ -+ -+ -+int qxl_fence_add_release(struct qxl_fence *qfence, uint32_t rel_id) -+{ -+ struct qxl_bo *bo = container_of(qfence, struct qxl_bo, fence); -+ -+ spin_lock(&bo->tbo.bdev->fence_lock); -+ radix_tree_insert(&qfence->tree, rel_id, qfence); -+ qfence->num_active_releases++; -+ spin_unlock(&bo->tbo.bdev->fence_lock); -+ return 0; -+} -+ -+int qxl_fence_remove_release(struct qxl_fence *qfence, uint32_t rel_id) -+{ -+ void *ret; -+ int retval = 0; -+ struct qxl_bo *bo = container_of(qfence, struct qxl_bo, fence); -+ -+ spin_lock(&bo->tbo.bdev->fence_lock); -+ -+ ret = radix_tree_delete(&qfence->tree, rel_id); -+ if (ret == qfence) -+ qfence->num_active_releases--; -+ else { -+ DRM_DEBUG("didn't find fence in radix tree for %d\n", rel_id); -+ retval = -ENOENT; -+ } -+ spin_unlock(&bo->tbo.bdev->fence_lock); -+ return retval; -+} -+ -+ -+int qxl_fence_init(struct qxl_device *qdev, struct qxl_fence *qfence) -+{ -+ qfence->qdev = qdev; -+ qfence->num_active_releases = 0; -+ INIT_RADIX_TREE(&qfence->tree, GFP_ATOMIC); -+ return 0; -+} -+ -+void qxl_fence_fini(struct qxl_fence *qfence) -+{ -+ kfree(qfence->release_ids); -+ qfence->num_active_releases = 0; -+} -diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c -new file mode 100644 -index 0000000..adc1ee2 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_gem.c -@@ -0,0 +1,178 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include "drmP.h" -+#include "drm/drm.h" -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+int qxl_gem_object_init(struct drm_gem_object *obj) -+{ -+ /* we do nothings here */ -+ return 0; -+} -+ -+void qxl_gem_object_free(struct drm_gem_object *gobj) -+{ -+ struct qxl_bo *qobj = gem_to_qxl_bo(gobj); -+ -+ if (qobj) -+ qxl_bo_unref(&qobj); -+} -+ -+int qxl_gem_object_create(struct qxl_device *qdev, int size, -+ int alignment, int initial_domain, -+ bool discardable, bool kernel, -+ struct qxl_surface *surf, -+ struct drm_gem_object **obj) -+{ -+ struct qxl_bo *qbo; -+ int r; -+ -+ *obj = NULL; -+ /* At least align on page size */ -+ if (alignment < PAGE_SIZE) -+ alignment = PAGE_SIZE; -+ r = qxl_bo_create(qdev, size, kernel, initial_domain, surf, &qbo); -+ if (r) { -+ if (r != -ERESTARTSYS) -+ DRM_ERROR( -+ "Failed to allocate GEM object (%d, %d, %u, %d)\n", -+ size, initial_domain, alignment, r); -+ return r; -+ } -+ *obj = &qbo->gem_base; -+ -+ mutex_lock(&qdev->gem.mutex); -+ list_add_tail(&qbo->list, &qdev->gem.objects); -+ mutex_unlock(&qdev->gem.mutex); -+ -+ return 0; -+} -+ -+int qxl_gem_object_create_with_handle(struct qxl_device *qdev, -+ struct drm_file *file_priv, -+ u32 domain, -+ size_t size, -+ struct qxl_surface *surf, -+ struct qxl_bo **qobj, -+ uint32_t *handle) -+{ -+ struct drm_gem_object *gobj; -+ int r; -+ -+ BUG_ON(!qobj); -+ BUG_ON(!handle); -+ -+ r = qxl_gem_object_create(qdev, size, 0, -+ domain, -+ false, false, surf, -+ &gobj); -+ if (r) -+ return -ENOMEM; -+ r = drm_gem_handle_create(file_priv, gobj, handle); -+ if (r) -+ return r; -+ /* drop reference from allocate - handle holds it now */ -+ *qobj = gem_to_qxl_bo(gobj); -+ drm_gem_object_unreference_unlocked(gobj); -+ return 0; -+} -+ -+int qxl_gem_object_pin(struct drm_gem_object *obj, uint32_t pin_domain, -+ uint64_t *gpu_addr) -+{ -+ struct qxl_bo *qobj = obj->driver_private; -+ int r; -+ -+ r = qxl_bo_reserve(qobj, false); -+ if (unlikely(r != 0)) -+ return r; -+ r = qxl_bo_pin(qobj, pin_domain, gpu_addr); -+ qxl_bo_unreserve(qobj); -+ return r; -+} -+ -+void qxl_gem_object_unpin(struct drm_gem_object *obj) -+{ -+ struct qxl_bo *qobj = obj->driver_private; -+ int r; -+ -+ r = qxl_bo_reserve(qobj, false); -+ if (likely(r == 0)) { -+ qxl_bo_unpin(qobj); -+ qxl_bo_unreserve(qobj); -+ } -+} -+ -+int qxl_gem_set_domain(struct drm_gem_object *gobj, -+ uint32_t rdomain, uint32_t wdomain) -+{ -+ struct qxl_bo *qobj; -+ uint32_t domain; -+ int r; -+ -+ /* FIXME: reeimplement */ -+ qobj = gobj->driver_private; -+ /* work out where to validate the buffer to */ -+ domain = wdomain; -+ if (!domain) -+ domain = rdomain; -+ if (!domain) { -+ /* Do nothings */ -+ pr_warn("Set domain withou domain !\n"); -+ return 0; -+ } -+ if (domain == QXL_GEM_DOMAIN_CPU) { -+ /* Asking for cpu access wait for object idle */ -+ r = qxl_bo_wait(qobj, NULL, false); -+ if (r) { -+ pr_err("Failed to wait for object !\n"); -+ return r; -+ } -+ } -+ return 0; -+} -+ -+int qxl_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv) -+{ -+ return 0; -+} -+ -+void qxl_gem_object_close(struct drm_gem_object *obj, -+ struct drm_file *file_priv) -+{ -+} -+ -+int qxl_gem_init(struct qxl_device *qdev) -+{ -+ INIT_LIST_HEAD(&qdev->gem.objects); -+ return 0; -+} -+ -+void qxl_gem_fini(struct qxl_device *qdev) -+{ -+ qxl_bo_force_delete(qdev); -+} -diff --git a/drivers/gpu/drm/qxl/qxl_image.c b/drivers/gpu/drm/qxl/qxl_image.c -new file mode 100644 -index 0000000..7fc7204 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_image.c -@@ -0,0 +1,120 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include <linux/gfp.h> -+#include <linux/slab.h> -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+static int -+qxl_image_create_helper(struct qxl_device *qdev, -+ struct qxl_release *release, -+ struct qxl_bo **image_bo, -+ const uint8_t *data, -+ int width, int height, -+ int depth, unsigned int hash, -+ int stride) -+{ -+ struct qxl_image *image; -+ struct qxl_data_chunk *chunk; -+ int i; -+ int chunk_stride; -+ int linesize = width * depth / 8; -+ struct qxl_bo *chunk_bo; -+ int ret; -+ /* Chunk */ -+ /* FIXME: Check integer overflow */ -+ /* TODO: variable number of chunks */ -+ chunk_stride = stride; /* TODO: should use linesize, but it renders -+ wrong (check the bitmaps are sent correctly -+ first) */ -+ ret = qxl_alloc_bo_reserved(qdev, sizeof(*chunk) + height * chunk_stride, -+ &chunk_bo); -+ ret = qxl_bo_kmap(chunk_bo, (void **)&chunk); -+ chunk->data_size = height * chunk_stride; -+ chunk->prev_chunk = 0; -+ chunk->next_chunk = 0; -+ -+ if (stride == linesize && chunk_stride == stride) -+ memcpy(chunk->data, data, linesize * height); -+ else -+ for (i = 0 ; i < height ; ++i) -+ memcpy(chunk->data + i*chunk_stride, data + i*stride, -+ linesize); -+ -+ qxl_bo_kunmap(chunk_bo); -+ -+ /* Image */ -+ ret = qxl_alloc_bo_reserved(qdev, sizeof(*image), image_bo); -+ qxl_bo_kmap(*image_bo, (void **)&image); -+ -+ image->descriptor.id = 0; -+ image->descriptor.type = SPICE_IMAGE_TYPE_BITMAP; -+ -+ image->descriptor.flags = 0; -+ image->descriptor.width = width; -+ image->descriptor.height = height; -+ -+ switch (depth) { -+ case 1: -+ /* TODO: BE? check by arch? */ -+ image->u.bitmap.format = SPICE_BITMAP_FMT_1BIT_BE; -+ break; -+ case 24: -+ image->u.bitmap.format = SPICE_BITMAP_FMT_24BIT; -+ break; -+ case 32: -+ image->u.bitmap.format = SPICE_BITMAP_FMT_32BIT; -+ break; -+ default: -+ DRM_ERROR("unsupported image bit depth\n"); -+ return -EINVAL; /* TODO: cleanup */ -+ } -+ image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN; -+ image->u.bitmap.x = width; -+ image->u.bitmap.y = height; -+ image->u.bitmap.stride = chunk_stride; -+ image->u.bitmap.palette = 0; -+ image->u.bitmap.data = qxl_bo_physical_address(qdev, chunk_bo, 0); -+ qxl_release_add_res(qdev, release, chunk_bo); -+ qxl_bo_unreserve(chunk_bo); -+ qxl_bo_unref(&chunk_bo); -+ -+ qxl_bo_kunmap(*image_bo); -+ return 0; -+} -+ -+int qxl_image_create(struct qxl_device *qdev, -+ struct qxl_release *release, -+ struct qxl_bo **image_bo, -+ const uint8_t *data, -+ int x, int y, int width, int height, -+ int depth, int stride) -+{ -+ data += y * stride + x * (depth / 8); -+ return qxl_image_create_helper(qdev, release, image_bo, data, -+ width, height, depth, 0, stride); -+} -diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c -new file mode 100644 -index 0000000..83ca4f7 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c -@@ -0,0 +1,411 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+/* -+ * TODO: allocating a new gem(in qxl_bo) for each request. -+ * This is wasteful since bo's are page aligned. -+ */ -+int qxl_alloc_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file_priv) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct drm_qxl_alloc *qxl_alloc = data; -+ int ret; -+ struct qxl_bo *qobj; -+ uint32_t handle; -+ u32 domain = QXL_GEM_DOMAIN_VRAM; -+ -+ if (qxl_alloc->size == 0) { -+ DRM_ERROR("invalid size %d\n", qxl_alloc->size); -+ return -EINVAL; -+ } -+ ret = qxl_gem_object_create_with_handle(qdev, file_priv, -+ domain, -+ qxl_alloc->size, -+ NULL, -+ &qobj, &handle); -+ if (ret) { -+ DRM_ERROR("%s: failed to create gem ret=%d\n", -+ __func__, ret); -+ return -ENOMEM; -+ } -+ qxl_alloc->handle = handle; -+ return 0; -+} -+ -+int qxl_map_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file_priv) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct drm_qxl_map *qxl_map = data; -+ -+ return qxl_mode_dumb_mmap(file_priv, qdev->ddev, qxl_map->handle, -+ &qxl_map->offset); -+} -+ -+/* -+ * dst must be validated, i.e. whole bo on vram/surfacesram (right now all bo's -+ * are on vram). -+ * *(dst + dst_off) = qxl_bo_physical_address(src, src_off) -+ */ -+static void -+apply_reloc(struct qxl_device *qdev, struct qxl_bo *dst, uint64_t dst_off, -+ struct qxl_bo *src, uint64_t src_off) -+{ -+ void *reloc_page; -+ -+ reloc_page = qxl_bo_kmap_atomic_page(qdev, dst, dst_off & PAGE_MASK); -+ *(uint64_t *)(reloc_page + (dst_off & ~PAGE_MASK)) = qxl_bo_physical_address(qdev, -+ src, src_off); -+ qxl_bo_kunmap_atomic_page(qdev, dst, reloc_page); -+} -+ -+static void -+apply_surf_reloc(struct qxl_device *qdev, struct qxl_bo *dst, uint64_t dst_off, -+ struct qxl_bo *src) -+{ -+ uint32_t id = 0; -+ void *reloc_page; -+ -+ if (src && !src->is_primary) -+ id = src->surface_id; -+ -+ reloc_page = qxl_bo_kmap_atomic_page(qdev, dst, dst_off & PAGE_MASK); -+ *(uint32_t *)(reloc_page + (dst_off & ~PAGE_MASK)) = id; -+ qxl_bo_kunmap_atomic_page(qdev, dst, reloc_page); -+} -+ -+/* return holding the reference to this object */ -+struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev, -+ struct drm_file *file_priv, uint64_t handle, -+ struct qxl_reloc_list *reloc_list) -+{ -+ struct drm_gem_object *gobj; -+ struct qxl_bo *qobj; -+ int ret; -+ -+ gobj = drm_gem_object_lookup(qdev->ddev, file_priv, handle); -+ if (!gobj) { -+ DRM_ERROR("bad bo handle %lld\n", handle); -+ return NULL; -+ } -+ qobj = gem_to_qxl_bo(gobj); -+ -+ ret = qxl_bo_list_add(reloc_list, qobj); -+ if (ret) -+ return NULL; -+ -+ return qobj; -+} -+ -+/* -+ * Usage of execbuffer: -+ * Relocations need to take into account the full QXLDrawable size. -+ * However, the command as passed from user space must *not* contain the initial -+ * QXLReleaseInfo struct (first XXX bytes) -+ */ -+int qxl_execbuffer_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file_priv) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct drm_qxl_execbuffer *execbuffer = data; -+ struct drm_qxl_command user_cmd; -+ int cmd_num; -+ struct qxl_bo *reloc_src_bo; -+ struct qxl_bo *reloc_dst_bo; -+ struct drm_qxl_reloc reloc; -+ void *fb_cmd; -+ int i, ret; -+ struct qxl_reloc_list reloc_list; -+ int unwritten; -+ uint32_t reloc_dst_offset; -+ INIT_LIST_HEAD(&reloc_list.bos); -+ -+ for (cmd_num = 0; cmd_num < execbuffer->commands_num; ++cmd_num) { -+ struct qxl_release *release; -+ struct qxl_bo *cmd_bo; -+ int release_type; -+ struct drm_qxl_command *commands = -+ (struct drm_qxl_command *)execbuffer->commands; -+ -+ if (DRM_COPY_FROM_USER(&user_cmd, &commands[cmd_num], -+ sizeof(user_cmd))) -+ return -EFAULT; -+ switch (user_cmd.type) { -+ case QXL_CMD_DRAW: -+ release_type = QXL_RELEASE_DRAWABLE; -+ break; -+ case QXL_CMD_SURFACE: -+ case QXL_CMD_CURSOR: -+ default: -+ DRM_DEBUG("Only draw commands in execbuffers\n"); -+ return -EINVAL; -+ break; -+ } -+ -+ if (user_cmd.command_size > PAGE_SIZE - sizeof(union qxl_release_info)) -+ return -EINVAL; -+ -+ ret = qxl_alloc_release_reserved(qdev, -+ sizeof(union qxl_release_info) + -+ user_cmd.command_size, -+ release_type, -+ &release, -+ &cmd_bo); -+ if (ret) -+ return ret; -+ -+ /* TODO copy slow path code from i915 */ -+ fb_cmd = qxl_bo_kmap_atomic_page(qdev, cmd_bo, (release->release_offset & PAGE_SIZE)); -+ unwritten = __copy_from_user_inatomic_nocache(fb_cmd + sizeof(union qxl_release_info) + (release->release_offset & ~PAGE_SIZE), (void *)(unsigned long)user_cmd.command, user_cmd.command_size); -+ qxl_bo_kunmap_atomic_page(qdev, cmd_bo, fb_cmd); -+ if (unwritten) { -+ DRM_ERROR("got unwritten %d\n", unwritten); -+ qxl_release_unreserve(qdev, release); -+ qxl_release_free(qdev, release); -+ return -EFAULT; -+ } -+ -+ for (i = 0 ; i < user_cmd.relocs_num; ++i) { -+ if (DRM_COPY_FROM_USER(&reloc, -+ &((struct drm_qxl_reloc *)user_cmd.relocs)[i], -+ sizeof(reloc))) { -+ qxl_bo_list_unreserve(&reloc_list, true); -+ qxl_release_unreserve(qdev, release); -+ qxl_release_free(qdev, release); -+ return -EFAULT; -+ } -+ -+ /* add the bos to the list of bos to validate - -+ need to validate first then process relocs? */ -+ if (reloc.dst_handle) { -+ reloc_dst_bo = qxlhw_handle_to_bo(qdev, file_priv, -+ reloc.dst_handle, &reloc_list); -+ if (!reloc_dst_bo) { -+ qxl_bo_list_unreserve(&reloc_list, true); -+ qxl_release_unreserve(qdev, release); -+ qxl_release_free(qdev, release); -+ return -EINVAL; -+ } -+ reloc_dst_offset = 0; -+ } else { -+ reloc_dst_bo = cmd_bo; -+ reloc_dst_offset = release->release_offset; -+ } -+ -+ /* reserve and validate the reloc dst bo */ -+ if (reloc.reloc_type == QXL_RELOC_TYPE_BO || reloc.src_handle > 0) { -+ reloc_src_bo = -+ qxlhw_handle_to_bo(qdev, file_priv, -+ reloc.src_handle, &reloc_list); -+ if (!reloc_src_bo) { -+ if (reloc_dst_bo != cmd_bo) -+ drm_gem_object_unreference_unlocked(&reloc_dst_bo->gem_base); -+ qxl_bo_list_unreserve(&reloc_list, true); -+ qxl_release_unreserve(qdev, release); -+ qxl_release_free(qdev, release); -+ return -EINVAL; -+ } -+ } else -+ reloc_src_bo = NULL; -+ if (reloc.reloc_type == QXL_RELOC_TYPE_BO) { -+ apply_reloc(qdev, reloc_dst_bo, reloc_dst_offset + reloc.dst_offset, -+ reloc_src_bo, reloc.src_offset); -+ } else if (reloc.reloc_type == QXL_RELOC_TYPE_SURF) { -+ apply_surf_reloc(qdev, reloc_dst_bo, reloc_dst_offset + reloc.dst_offset, reloc_src_bo); -+ } else { -+ DRM_ERROR("unknown reloc type %d\n", reloc.reloc_type); -+ return -EINVAL; -+ } -+ -+ if (reloc_src_bo && reloc_src_bo != cmd_bo) { -+ qxl_release_add_res(qdev, release, reloc_src_bo); -+ drm_gem_object_unreference_unlocked(&reloc_src_bo->gem_base); -+ } -+ -+ if (reloc_dst_bo != cmd_bo) -+ drm_gem_object_unreference_unlocked(&reloc_dst_bo->gem_base); -+ } -+ qxl_fence_releaseable(qdev, release); -+ -+ ret = qxl_push_command_ring_release(qdev, release, user_cmd.type, true); -+ if (ret == -ERESTARTSYS) { -+ qxl_release_unreserve(qdev, release); -+ qxl_release_free(qdev, release); -+ qxl_bo_list_unreserve(&reloc_list, true); -+ return ret; -+ } -+ qxl_release_unreserve(qdev, release); -+ } -+ qxl_bo_list_unreserve(&reloc_list, 0); -+ return 0; -+} -+ -+int qxl_update_area_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct drm_qxl_update_area *update_area = data; -+ struct qxl_rect area = {.left = update_area->left, -+ .top = update_area->top, -+ .right = update_area->right, -+ .bottom = update_area->bottom}; -+ int ret; -+ struct drm_gem_object *gobj = NULL; -+ struct qxl_bo *qobj = NULL; -+ -+ if (update_area->left >= update_area->right || -+ update_area->top >= update_area->bottom) -+ return -EINVAL; -+ -+ gobj = drm_gem_object_lookup(dev, file, update_area->handle); -+ if (gobj == NULL) -+ return -ENOENT; -+ -+ qobj = gem_to_qxl_bo(gobj); -+ -+ ret = qxl_bo_reserve(qobj, false); -+ if (ret) -+ goto out; -+ -+ if (!qobj->pin_count) { -+ ret = ttm_bo_validate(&qobj->tbo, &qobj->placement, -+ true, false); -+ if (unlikely(ret)) -+ goto out; -+ } -+ -+ ret = qxl_bo_check_id(qdev, qobj); -+ if (ret) -+ goto out2; -+ if (!qobj->surface_id) -+ DRM_ERROR("got update area for surface with no id %d\n", update_area->handle); -+ ret = qxl_io_update_area(qdev, qobj, &area); -+ -+out2: -+ qxl_bo_unreserve(qobj); -+ -+out: -+ drm_gem_object_unreference_unlocked(gobj); -+ return ret; -+} -+ -+static int qxl_getparam_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file_priv) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct drm_qxl_getparam *param = data; -+ -+ switch (param->param) { -+ case QXL_PARAM_NUM_SURFACES: -+ param->value = qdev->rom->n_surfaces; -+ break; -+ case QXL_PARAM_MAX_RELOCS: -+ param->value = QXL_MAX_RES; -+ break; -+ default: -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+static int qxl_clientcap_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file_priv) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct drm_qxl_clientcap *param = data; -+ int byte, idx; -+ -+ byte = param->index / 8; -+ idx = param->index % 8; -+ -+ if (qdev->pdev->revision < 4) -+ return -ENOSYS; -+ -+ if (byte > 58) -+ return -ENOSYS; -+ -+ if (qdev->rom->client_capabilities[byte] & (1 << idx)) -+ return 0; -+ return -ENOSYS; -+} -+ -+static int qxl_alloc_surf_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ struct drm_qxl_alloc_surf *param = data; -+ struct qxl_bo *qobj; -+ int handle; -+ int ret; -+ int size, actual_stride; -+ struct qxl_surface surf; -+ -+ /* work out size allocate bo with handle */ -+ actual_stride = param->stride < 0 ? -param->stride : param->stride; -+ size = actual_stride * param->height + actual_stride; -+ -+ surf.format = param->format; -+ surf.width = param->width; -+ surf.height = param->height; -+ surf.stride = param->stride; -+ surf.data = 0; -+ -+ ret = qxl_gem_object_create_with_handle(qdev, file, -+ QXL_GEM_DOMAIN_SURFACE, -+ size, -+ &surf, -+ &qobj, &handle); -+ if (ret) { -+ DRM_ERROR("%s: failed to create gem ret=%d\n", -+ __func__, ret); -+ return -ENOMEM; -+ } else -+ param->handle = handle; -+ return ret; -+} -+ -+struct drm_ioctl_desc qxl_ioctls[] = { -+ DRM_IOCTL_DEF_DRV(QXL_ALLOC, qxl_alloc_ioctl, DRM_AUTH|DRM_UNLOCKED), -+ -+ DRM_IOCTL_DEF_DRV(QXL_MAP, qxl_map_ioctl, DRM_AUTH|DRM_UNLOCKED), -+ -+ DRM_IOCTL_DEF_DRV(QXL_EXECBUFFER, qxl_execbuffer_ioctl, -+ DRM_AUTH|DRM_UNLOCKED), -+ DRM_IOCTL_DEF_DRV(QXL_UPDATE_AREA, qxl_update_area_ioctl, -+ DRM_AUTH|DRM_UNLOCKED), -+ DRM_IOCTL_DEF_DRV(QXL_GETPARAM, qxl_getparam_ioctl, -+ DRM_AUTH|DRM_UNLOCKED), -+ DRM_IOCTL_DEF_DRV(QXL_CLIENTCAP, qxl_clientcap_ioctl, -+ DRM_AUTH|DRM_UNLOCKED), -+ -+ DRM_IOCTL_DEF_DRV(QXL_ALLOC_SURF, qxl_alloc_surf_ioctl, -+ DRM_AUTH|DRM_UNLOCKED), -+}; -+ -+int qxl_max_ioctls = DRM_ARRAY_SIZE(qxl_ioctls); -diff --git a/drivers/gpu/drm/qxl/qxl_irq.c b/drivers/gpu/drm/qxl/qxl_irq.c -new file mode 100644 -index 0000000..21393dc ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_irq.c -@@ -0,0 +1,97 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include "qxl_drv.h" -+ -+irqreturn_t qxl_irq_handler(DRM_IRQ_ARGS) -+{ -+ struct drm_device *dev = (struct drm_device *) arg; -+ struct qxl_device *qdev = (struct qxl_device *)dev->dev_private; -+ uint32_t pending; -+ -+ pending = xchg(&qdev->ram_header->int_pending, 0); -+ -+ atomic_inc(&qdev->irq_received); -+ -+ if (pending & QXL_INTERRUPT_DISPLAY) { -+ atomic_inc(&qdev->irq_received_display); -+ wake_up_all(&qdev->display_event); -+ qxl_queue_garbage_collect(qdev, false); -+ } -+ if (pending & QXL_INTERRUPT_CURSOR) { -+ atomic_inc(&qdev->irq_received_cursor); -+ wake_up_all(&qdev->cursor_event); -+ } -+ if (pending & QXL_INTERRUPT_IO_CMD) { -+ atomic_inc(&qdev->irq_received_io_cmd); -+ wake_up_all(&qdev->io_cmd_event); -+ } -+ if (pending & QXL_INTERRUPT_ERROR) { -+ /* TODO: log it, reset device (only way to exit this condition) -+ * (do it a certain number of times, afterwards admit defeat, -+ * to avoid endless loops). -+ */ -+ qdev->irq_received_error++; -+ qxl_io_log(qdev, "%s: driver is in bug mode.\n", __func__); -+ } -+ if (pending & QXL_INTERRUPT_CLIENT_MONITORS_CONFIG) { -+ qxl_io_log(qdev, "QXL_INTERRUPT_CLIENT_MONITORS_CONFIG\n"); -+ schedule_work(&qdev->client_monitors_config_work); -+ } -+ qdev->ram_header->int_mask = QXL_INTERRUPT_MASK; -+ outb(0, qdev->io_base + QXL_IO_UPDATE_IRQ); -+ return IRQ_HANDLED; -+} -+ -+static void qxl_client_monitors_config_work_func(struct work_struct *work) -+{ -+ struct qxl_device *qdev = container_of(work, struct qxl_device, -+ client_monitors_config_work); -+ -+ qxl_display_read_client_monitors_config(qdev); -+} -+ -+int qxl_irq_init(struct qxl_device *qdev) -+{ -+ int ret; -+ -+ init_waitqueue_head(&qdev->display_event); -+ init_waitqueue_head(&qdev->cursor_event); -+ init_waitqueue_head(&qdev->io_cmd_event); -+ INIT_WORK(&qdev->client_monitors_config_work, -+ qxl_client_monitors_config_work_func); -+ atomic_set(&qdev->irq_received, 0); -+ atomic_set(&qdev->irq_received_display, 0); -+ atomic_set(&qdev->irq_received_cursor, 0); -+ atomic_set(&qdev->irq_received_io_cmd, 0); -+ qdev->irq_received_error = 0; -+ ret = drm_irq_install(qdev->ddev); -+ qdev->ram_header->int_mask = QXL_INTERRUPT_MASK; -+ if (unlikely(ret != 0)) { -+ DRM_ERROR("Failed installing irq: %d\n", ret); -+ return 1; -+ } -+ return 0; -+} -diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c -new file mode 100644 -index 0000000..036e0de ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_kms.c -@@ -0,0 +1,302 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+#include <linux/io-mapping.h> -+ -+int qxl_log_level; -+ -+static void qxl_dump_mode(struct qxl_device *qdev, void *p) -+{ -+ struct qxl_mode *m = p; -+ DRM_DEBUG_KMS("%d: %dx%d %d bits, stride %d, %dmm x %dmm, orientation %d\n", -+ m->id, m->x_res, m->y_res, m->bits, m->stride, m->x_mili, -+ m->y_mili, m->orientation); -+} -+ -+static bool qxl_check_device(struct qxl_device *qdev) -+{ -+ struct qxl_rom *rom = qdev->rom; -+ int mode_offset; -+ int i; -+ -+ if (rom->magic != 0x4f525851) { -+ DRM_ERROR("bad rom signature %x\n", rom->magic); -+ return false; -+ } -+ -+ DRM_INFO("Device Version %d.%d\n", rom->id, rom->update_id); -+ DRM_INFO("Compression level %d log level %d\n", rom->compression_level, -+ rom->log_level); -+ DRM_INFO("Currently using mode #%d, list at 0x%x\n", -+ rom->mode, rom->modes_offset); -+ DRM_INFO("%d io pages at offset 0x%x\n", -+ rom->num_io_pages, rom->pages_offset); -+ DRM_INFO("%d byte draw area at offset 0x%x\n", -+ rom->surface0_area_size, rom->draw_area_offset); -+ -+ qdev->vram_size = rom->surface0_area_size; -+ DRM_INFO("RAM header offset: 0x%x\n", rom->ram_header_offset); -+ -+ mode_offset = rom->modes_offset / 4; -+ qdev->mode_info.num_modes = ((u32 *)rom)[mode_offset]; -+ DRM_INFO("rom modes offset 0x%x for %d modes\n", rom->modes_offset, -+ qdev->mode_info.num_modes); -+ qdev->mode_info.modes = (void *)((uint32_t *)rom + mode_offset + 1); -+ for (i = 0; i < qdev->mode_info.num_modes; i++) -+ qxl_dump_mode(qdev, qdev->mode_info.modes + i); -+ return true; -+} -+ -+static uint8_t setup_slot(struct qxl_device *qdev, uint8_t slot_index_offset, -+ unsigned long start_phys_addr, unsigned long end_phys_addr) -+{ -+ uint64_t high_bits; -+ struct qxl_memslot *slot; -+ uint8_t slot_index; -+ struct qxl_ram_header *ram_header = qdev->ram_header; -+ -+ slot_index = qdev->rom->slots_start + slot_index_offset; -+ slot = &qdev->mem_slots[slot_index]; -+ slot->start_phys_addr = start_phys_addr; -+ slot->end_phys_addr = end_phys_addr; -+ ram_header->mem_slot.mem_start = slot->start_phys_addr; -+ ram_header->mem_slot.mem_end = slot->end_phys_addr; -+ qxl_io_memslot_add(qdev, slot_index); -+ slot->generation = qdev->rom->slot_generation; -+ high_bits = slot_index << qdev->slot_gen_bits; -+ high_bits |= slot->generation; -+ high_bits <<= (64 - (qdev->slot_gen_bits + qdev->slot_id_bits)); -+ slot->high_bits = high_bits; -+ return slot_index; -+} -+ -+static void qxl_gc_work(struct work_struct *work) -+{ -+ struct qxl_device *qdev = container_of(work, struct qxl_device, gc_work); -+ qxl_garbage_collect(qdev); -+} -+ -+int qxl_device_init(struct qxl_device *qdev, -+ struct drm_device *ddev, -+ struct pci_dev *pdev, -+ unsigned long flags) -+{ -+ int r; -+ -+ qdev->dev = &pdev->dev; -+ qdev->ddev = ddev; -+ qdev->pdev = pdev; -+ qdev->flags = flags; -+ -+ mutex_init(&qdev->gem.mutex); -+ mutex_init(&qdev->update_area_mutex); -+ mutex_init(&qdev->release_mutex); -+ mutex_init(&qdev->surf_evict_mutex); -+ INIT_LIST_HEAD(&qdev->gem.objects); -+ -+ qdev->rom_base = pci_resource_start(pdev, 2); -+ qdev->rom_size = pci_resource_len(pdev, 2); -+ qdev->vram_base = pci_resource_start(pdev, 0); -+ qdev->surfaceram_base = pci_resource_start(pdev, 1); -+ qdev->surfaceram_size = pci_resource_len(pdev, 1); -+ qdev->io_base = pci_resource_start(pdev, 3); -+ -+ qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0)); -+ qdev->surface_mapping = io_mapping_create_wc(qdev->surfaceram_base, qdev->surfaceram_size); -+ DRM_DEBUG_KMS("qxl: vram %p-%p(%dM %dk), surface %p-%p(%dM %dk)\n", -+ (void *)qdev->vram_base, (void *)pci_resource_end(pdev, 0), -+ (int)pci_resource_len(pdev, 0) / 1024 / 1024, -+ (int)pci_resource_len(pdev, 0) / 1024, -+ (void *)qdev->surfaceram_base, -+ (void *)pci_resource_end(pdev, 1), -+ (int)qdev->surfaceram_size / 1024 / 1024, -+ (int)qdev->surfaceram_size / 1024); -+ -+ qdev->rom = ioremap(qdev->rom_base, qdev->rom_size); -+ if (!qdev->rom) { -+ pr_err("Unable to ioremap ROM\n"); -+ return -ENOMEM; -+ } -+ -+ qxl_check_device(qdev); -+ -+ r = qxl_bo_init(qdev); -+ if (r) { -+ DRM_ERROR("bo init failed %d\n", r); -+ return r; -+ } -+ -+ qdev->ram_header = ioremap(qdev->vram_base + -+ qdev->rom->ram_header_offset, -+ sizeof(*qdev->ram_header)); -+ -+ qdev->command_ring = qxl_ring_create(&(qdev->ram_header->cmd_ring_hdr), -+ sizeof(struct qxl_command), -+ QXL_COMMAND_RING_SIZE, -+ qdev->io_base + QXL_IO_NOTIFY_CMD, -+ false, -+ &qdev->display_event); -+ -+ qdev->cursor_ring = qxl_ring_create( -+ &(qdev->ram_header->cursor_ring_hdr), -+ sizeof(struct qxl_command), -+ QXL_CURSOR_RING_SIZE, -+ qdev->io_base + QXL_IO_NOTIFY_CMD, -+ false, -+ &qdev->cursor_event); -+ -+ qdev->release_ring = qxl_ring_create( -+ &(qdev->ram_header->release_ring_hdr), -+ sizeof(uint64_t), -+ QXL_RELEASE_RING_SIZE, 0, true, -+ NULL); -+ -+ /* TODO - slot initialization should happen on reset. where is our -+ * reset handler? */ -+ qdev->n_mem_slots = qdev->rom->slots_end; -+ qdev->slot_gen_bits = qdev->rom->slot_gen_bits; -+ qdev->slot_id_bits = qdev->rom->slot_id_bits; -+ qdev->va_slot_mask = -+ (~(uint64_t)0) >> (qdev->slot_id_bits + qdev->slot_gen_bits); -+ -+ qdev->mem_slots = -+ kmalloc(qdev->n_mem_slots * sizeof(struct qxl_memslot), -+ GFP_KERNEL); -+ -+ idr_init(&qdev->release_idr); -+ spin_lock_init(&qdev->release_idr_lock); -+ -+ idr_init(&qdev->surf_id_idr); -+ spin_lock_init(&qdev->surf_id_idr_lock); -+ -+ mutex_init(&qdev->async_io_mutex); -+ -+ /* reset the device into a known state - no memslots, no primary -+ * created, no surfaces. */ -+ qxl_io_reset(qdev); -+ -+ /* must initialize irq before first async io - slot creation */ -+ r = qxl_irq_init(qdev); -+ if (r) -+ return r; -+ -+ /* -+ * Note that virtual is surface0. We rely on the single ioremap done -+ * before. -+ */ -+ qdev->main_mem_slot = setup_slot(qdev, 0, -+ (unsigned long)qdev->vram_base, -+ (unsigned long)qdev->vram_base + qdev->rom->ram_header_offset); -+ qdev->surfaces_mem_slot = setup_slot(qdev, 1, -+ (unsigned long)qdev->surfaceram_base, -+ (unsigned long)qdev->surfaceram_base + qdev->surfaceram_size); -+ DRM_INFO("main mem slot %d [%lx,%x)\n", -+ qdev->main_mem_slot, -+ (unsigned long)qdev->vram_base, qdev->rom->ram_header_offset); -+ -+ -+ qdev->gc_queue = create_singlethread_workqueue("qxl_gc"); -+ INIT_WORK(&qdev->gc_work, qxl_gc_work); -+ -+ r = qxl_fb_init(qdev); -+ if (r) -+ return r; -+ -+ return 0; -+} -+ -+void qxl_device_fini(struct qxl_device *qdev) -+{ -+ if (qdev->current_release_bo[0]) -+ qxl_bo_unref(&qdev->current_release_bo[0]); -+ if (qdev->current_release_bo[1]) -+ qxl_bo_unref(&qdev->current_release_bo[1]); -+ flush_workqueue(qdev->gc_queue); -+ destroy_workqueue(qdev->gc_queue); -+ qdev->gc_queue = NULL; -+ -+ qxl_ring_free(qdev->command_ring); -+ qxl_ring_free(qdev->cursor_ring); -+ qxl_ring_free(qdev->release_ring); -+ qxl_bo_fini(qdev); -+ io_mapping_free(qdev->surface_mapping); -+ io_mapping_free(qdev->vram_mapping); -+ iounmap(qdev->ram_header); -+ iounmap(qdev->rom); -+ qdev->rom = NULL; -+ qdev->mode_info.modes = NULL; -+ qdev->mode_info.num_modes = 0; -+ qxl_debugfs_remove_files(qdev); -+} -+ -+int qxl_driver_unload(struct drm_device *dev) -+{ -+ struct qxl_device *qdev = dev->dev_private; -+ -+ if (qdev == NULL) -+ return 0; -+ qxl_modeset_fini(qdev); -+ qxl_device_fini(qdev); -+ -+ kfree(qdev); -+ dev->dev_private = NULL; -+ return 0; -+} -+ -+int qxl_driver_load(struct drm_device *dev, unsigned long flags) -+{ -+ struct qxl_device *qdev; -+ int r; -+ -+ /* require kms */ -+ if (!drm_core_check_feature(dev, DRIVER_MODESET)) -+ return -ENODEV; -+ -+ qdev = kzalloc(sizeof(struct qxl_device), GFP_KERNEL); -+ if (qdev == NULL) -+ return -ENOMEM; -+ -+ dev->dev_private = qdev; -+ -+ r = qxl_device_init(qdev, dev, dev->pdev, flags); -+ if (r) -+ goto out; -+ -+ r = qxl_modeset_init(qdev); -+ if (r) { -+ qxl_driver_unload(dev); -+ goto out; -+ } -+ -+ return 0; -+out: -+ kfree(qdev); -+ return r; -+} -+ -+ -diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c -new file mode 100644 -index 0000000..51efb94 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_object.c -@@ -0,0 +1,365 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+#include <linux/io-mapping.h> -+static void qxl_ttm_bo_destroy(struct ttm_buffer_object *tbo) -+{ -+ struct qxl_bo *bo; -+ struct qxl_device *qdev; -+ -+ bo = container_of(tbo, struct qxl_bo, tbo); -+ qdev = (struct qxl_device *)bo->gem_base.dev->dev_private; -+ -+ qxl_surface_evict(qdev, bo, false); -+ qxl_fence_fini(&bo->fence); -+ mutex_lock(&qdev->gem.mutex); -+ list_del_init(&bo->list); -+ mutex_unlock(&qdev->gem.mutex); -+ drm_gem_object_release(&bo->gem_base); -+ kfree(bo); -+} -+ -+bool qxl_ttm_bo_is_qxl_bo(struct ttm_buffer_object *bo) -+{ -+ if (bo->destroy == &qxl_ttm_bo_destroy) -+ return true; -+ return false; -+} -+ -+void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain) -+{ -+ u32 c = 0; -+ -+ qbo->placement.fpfn = 0; -+ qbo->placement.lpfn = 0; -+ qbo->placement.placement = qbo->placements; -+ qbo->placement.busy_placement = qbo->placements; -+ if (domain & QXL_GEM_DOMAIN_VRAM) -+ qbo->placements[c++] = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_VRAM; -+ if (domain & QXL_GEM_DOMAIN_SURFACE) -+ qbo->placements[c++] = TTM_PL_FLAG_CACHED | TTM_PL_FLAG_PRIV0; -+ if (domain & QXL_GEM_DOMAIN_CPU) -+ qbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; -+ if (!c) -+ qbo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; -+ qbo->placement.num_placement = c; -+ qbo->placement.num_busy_placement = c; -+} -+ -+ -+int qxl_bo_create(struct qxl_device *qdev, -+ unsigned long size, bool kernel, u32 domain, -+ struct qxl_surface *surf, -+ struct qxl_bo **bo_ptr) -+{ -+ struct qxl_bo *bo; -+ enum ttm_bo_type type; -+ int r; -+ -+ if (unlikely(qdev->mman.bdev.dev_mapping == NULL)) -+ qdev->mman.bdev.dev_mapping = qdev->ddev->dev_mapping; -+ if (kernel) -+ type = ttm_bo_type_kernel; -+ else -+ type = ttm_bo_type_device; -+ *bo_ptr = NULL; -+ bo = kzalloc(sizeof(struct qxl_bo), GFP_KERNEL); -+ if (bo == NULL) -+ return -ENOMEM; -+ size = roundup(size, PAGE_SIZE); -+ r = drm_gem_object_init(qdev->ddev, &bo->gem_base, size); -+ if (unlikely(r)) { -+ kfree(bo); -+ return r; -+ } -+ bo->gem_base.driver_private = NULL; -+ bo->type = domain; -+ bo->pin_count = 0; -+ bo->surface_id = 0; -+ qxl_fence_init(qdev, &bo->fence); -+ INIT_LIST_HEAD(&bo->list); -+ atomic_set(&bo->reserve_count, 0); -+ if (surf) -+ bo->surf = *surf; -+ -+ qxl_ttm_placement_from_domain(bo, domain); -+ -+ r = ttm_bo_init(&qdev->mman.bdev, &bo->tbo, size, type, -+ &bo->placement, 0, !kernel, NULL, size, -+ NULL, &qxl_ttm_bo_destroy); -+ if (unlikely(r != 0)) { -+ if (r != -ERESTARTSYS) -+ dev_err(qdev->dev, -+ "object_init failed for (%lu, 0x%08X)\n", -+ size, domain); -+ return r; -+ } -+ *bo_ptr = bo; -+ return 0; -+} -+ -+int qxl_bo_kmap(struct qxl_bo *bo, void **ptr) -+{ -+ bool is_iomem; -+ int r; -+ -+ if (bo->kptr) { -+ if (ptr) -+ *ptr = bo->kptr; -+ return 0; -+ } -+ r = ttm_bo_kmap(&bo->tbo, 0, bo->tbo.num_pages, &bo->kmap); -+ if (r) -+ return r; -+ bo->kptr = ttm_kmap_obj_virtual(&bo->kmap, &is_iomem); -+ if (ptr) -+ *ptr = bo->kptr; -+ return 0; -+} -+ -+void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev, -+ struct qxl_bo *bo, int page_offset) -+{ -+ struct ttm_mem_type_manager *man = &bo->tbo.bdev->man[bo->tbo.mem.mem_type]; -+ void *rptr; -+ int ret; -+ struct io_mapping *map; -+ -+ if (bo->tbo.mem.mem_type == TTM_PL_VRAM) -+ map = qdev->vram_mapping; -+ else if (bo->tbo.mem.mem_type == TTM_PL_PRIV0) -+ map = qdev->surface_mapping; -+ else -+ goto fallback; -+ -+ (void) ttm_mem_io_lock(man, false); -+ ret = ttm_mem_io_reserve(bo->tbo.bdev, &bo->tbo.mem); -+ ttm_mem_io_unlock(man); -+ -+ return io_mapping_map_atomic_wc(map, bo->tbo.mem.bus.offset + page_offset); -+fallback: -+ if (bo->kptr) { -+ rptr = bo->kptr + (page_offset * PAGE_SIZE); -+ return rptr; -+ } -+ -+ ret = qxl_bo_kmap(bo, &rptr); -+ if (ret) -+ return NULL; -+ -+ rptr += page_offset * PAGE_SIZE; -+ return rptr; -+} -+ -+void qxl_bo_kunmap(struct qxl_bo *bo) -+{ -+ if (bo->kptr == NULL) -+ return; -+ bo->kptr = NULL; -+ ttm_bo_kunmap(&bo->kmap); -+} -+ -+void qxl_bo_kunmap_atomic_page(struct qxl_device *qdev, -+ struct qxl_bo *bo, void *pmap) -+{ -+ struct ttm_mem_type_manager *man = &bo->tbo.bdev->man[bo->tbo.mem.mem_type]; -+ struct io_mapping *map; -+ -+ if (bo->tbo.mem.mem_type == TTM_PL_VRAM) -+ map = qdev->vram_mapping; -+ else if (bo->tbo.mem.mem_type == TTM_PL_PRIV0) -+ map = qdev->surface_mapping; -+ else -+ goto fallback; -+ -+ io_mapping_unmap_atomic(pmap); -+ -+ (void) ttm_mem_io_lock(man, false); -+ ttm_mem_io_free(bo->tbo.bdev, &bo->tbo.mem); -+ ttm_mem_io_unlock(man); -+ return ; -+ fallback: -+ qxl_bo_kunmap(bo); -+} -+ -+void qxl_bo_unref(struct qxl_bo **bo) -+{ -+ struct ttm_buffer_object *tbo; -+ -+ if ((*bo) == NULL) -+ return; -+ tbo = &((*bo)->tbo); -+ ttm_bo_unref(&tbo); -+ if (tbo == NULL) -+ *bo = NULL; -+} -+ -+struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo) -+{ -+ ttm_bo_reference(&bo->tbo); -+ return bo; -+} -+ -+int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr) -+{ -+ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private; -+ int r, i; -+ -+ if (bo->pin_count) { -+ bo->pin_count++; -+ if (gpu_addr) -+ *gpu_addr = qxl_bo_gpu_offset(bo); -+ return 0; -+ } -+ qxl_ttm_placement_from_domain(bo, domain); -+ for (i = 0; i < bo->placement.num_placement; i++) -+ bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; -+ r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); -+ if (likely(r == 0)) { -+ bo->pin_count = 1; -+ if (gpu_addr != NULL) -+ *gpu_addr = qxl_bo_gpu_offset(bo); -+ } -+ if (unlikely(r != 0)) -+ dev_err(qdev->dev, "%p pin failed\n", bo); -+ return r; -+} -+ -+int qxl_bo_unpin(struct qxl_bo *bo) -+{ -+ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private; -+ int r, i; -+ -+ if (!bo->pin_count) { -+ dev_warn(qdev->dev, "%p unpin not necessary\n", bo); -+ return 0; -+ } -+ bo->pin_count--; -+ if (bo->pin_count) -+ return 0; -+ for (i = 0; i < bo->placement.num_placement; i++) -+ bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT; -+ r = ttm_bo_validate(&bo->tbo, &bo->placement, false, false); -+ if (unlikely(r != 0)) -+ dev_err(qdev->dev, "%p validate failed for unpin\n", bo); -+ return r; -+} -+ -+void qxl_bo_force_delete(struct qxl_device *qdev) -+{ -+ struct qxl_bo *bo, *n; -+ -+ if (list_empty(&qdev->gem.objects)) -+ return; -+ dev_err(qdev->dev, "Userspace still has active objects !\n"); -+ list_for_each_entry_safe(bo, n, &qdev->gem.objects, list) { -+ mutex_lock(&qdev->ddev->struct_mutex); -+ dev_err(qdev->dev, "%p %p %lu %lu force free\n", -+ &bo->gem_base, bo, (unsigned long)bo->gem_base.size, -+ *((unsigned long *)&bo->gem_base.refcount)); -+ mutex_lock(&qdev->gem.mutex); -+ list_del_init(&bo->list); -+ mutex_unlock(&qdev->gem.mutex); -+ /* this should unref the ttm bo */ -+ drm_gem_object_unreference(&bo->gem_base); -+ mutex_unlock(&qdev->ddev->struct_mutex); -+ } -+} -+ -+int qxl_bo_init(struct qxl_device *qdev) -+{ -+ return qxl_ttm_init(qdev); -+} -+ -+void qxl_bo_fini(struct qxl_device *qdev) -+{ -+ qxl_ttm_fini(qdev); -+} -+ -+int qxl_bo_check_id(struct qxl_device *qdev, struct qxl_bo *bo) -+{ -+ int ret; -+ if (bo->type == QXL_GEM_DOMAIN_SURFACE && bo->surface_id == 0) { -+ /* allocate a surface id for this surface now */ -+ ret = qxl_surface_id_alloc(qdev, bo); -+ if (ret) -+ return ret; -+ -+ ret = qxl_hw_surface_alloc(qdev, bo, NULL); -+ if (ret) -+ return ret; -+ } -+ return 0; -+} -+ -+void qxl_bo_list_unreserve(struct qxl_reloc_list *reloc_list, bool failed) -+{ -+ struct qxl_bo_list *entry, *sf; -+ -+ list_for_each_entry_safe(entry, sf, &reloc_list->bos, lhead) { -+ qxl_bo_unreserve(entry->bo); -+ list_del(&entry->lhead); -+ kfree(entry); -+ } -+} -+ -+int qxl_bo_list_add(struct qxl_reloc_list *reloc_list, struct qxl_bo *bo) -+{ -+ struct qxl_bo_list *entry; -+ int ret; -+ -+ list_for_each_entry(entry, &reloc_list->bos, lhead) { -+ if (entry->bo == bo) -+ return 0; -+ } -+ -+ entry = kmalloc(sizeof(struct qxl_bo_list), GFP_KERNEL); -+ if (!entry) -+ return -ENOMEM; -+ -+ entry->bo = bo; -+ list_add(&entry->lhead, &reloc_list->bos); -+ -+ ret = qxl_bo_reserve(bo, false); -+ if (ret) -+ return ret; -+ -+ if (!bo->pin_count) { -+ qxl_ttm_placement_from_domain(bo, bo->type); -+ ret = ttm_bo_validate(&bo->tbo, &bo->placement, -+ true, false); -+ if (ret) -+ return ret; -+ } -+ -+ /* allocate a surface for reserved + validated buffers */ -+ ret = qxl_bo_check_id(bo->gem_base.dev->dev_private, bo); -+ if (ret) -+ return ret; -+ return 0; -+} -diff --git a/drivers/gpu/drm/qxl/qxl_object.h b/drivers/gpu/drm/qxl/qxl_object.h -new file mode 100644 -index 0000000..b4fd89f ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_object.h -@@ -0,0 +1,112 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+#ifndef QXL_OBJECT_H -+#define QXL_OBJECT_H -+ -+#include "qxl_drv.h" -+ -+static inline int qxl_bo_reserve(struct qxl_bo *bo, bool no_wait) -+{ -+ int r; -+ -+ r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); -+ if (unlikely(r != 0)) { -+ if (r != -ERESTARTSYS) { -+ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private; -+ dev_err(qdev->dev, "%p reserve failed\n", bo); -+ } -+ return r; -+ } -+ return 0; -+} -+ -+static inline void qxl_bo_unreserve(struct qxl_bo *bo) -+{ -+ ttm_bo_unreserve(&bo->tbo); -+} -+ -+static inline u64 qxl_bo_gpu_offset(struct qxl_bo *bo) -+{ -+ return bo->tbo.offset; -+} -+ -+static inline unsigned long qxl_bo_size(struct qxl_bo *bo) -+{ -+ return bo->tbo.num_pages << PAGE_SHIFT; -+} -+ -+static inline bool qxl_bo_is_reserved(struct qxl_bo *bo) -+{ -+ return !!atomic_read(&bo->tbo.reserved); -+} -+ -+static inline u64 qxl_bo_mmap_offset(struct qxl_bo *bo) -+{ -+ return bo->tbo.addr_space_offset; -+} -+ -+static inline int qxl_bo_wait(struct qxl_bo *bo, u32 *mem_type, -+ bool no_wait) -+{ -+ int r; -+ -+ r = ttm_bo_reserve(&bo->tbo, true, no_wait, false, 0); -+ if (unlikely(r != 0)) { -+ if (r != -ERESTARTSYS) { -+ struct qxl_device *qdev = (struct qxl_device *)bo->gem_base.dev->dev_private; -+ dev_err(qdev->dev, "%p reserve failed for wait\n", -+ bo); -+ } -+ return r; -+ } -+ spin_lock(&bo->tbo.bdev->fence_lock); -+ if (mem_type) -+ *mem_type = bo->tbo.mem.mem_type; -+ if (bo->tbo.sync_obj) -+ r = ttm_bo_wait(&bo->tbo, true, true, no_wait); -+ spin_unlock(&bo->tbo.bdev->fence_lock); -+ ttm_bo_unreserve(&bo->tbo); -+ return r; -+} -+ -+extern int qxl_bo_create(struct qxl_device *qdev, -+ unsigned long size, -+ bool kernel, u32 domain, -+ struct qxl_surface *surf, -+ struct qxl_bo **bo_ptr); -+extern int qxl_bo_kmap(struct qxl_bo *bo, void **ptr); -+extern void qxl_bo_kunmap(struct qxl_bo *bo); -+void *qxl_bo_kmap_atomic_page(struct qxl_device *qdev, struct qxl_bo *bo, int page_offset); -+void qxl_bo_kunmap_atomic_page(struct qxl_device *qdev, struct qxl_bo *bo, void *map); -+extern struct qxl_bo *qxl_bo_ref(struct qxl_bo *bo); -+extern void qxl_bo_unref(struct qxl_bo **bo); -+extern int qxl_bo_pin(struct qxl_bo *bo, u32 domain, u64 *gpu_addr); -+extern int qxl_bo_unpin(struct qxl_bo *bo); -+extern void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain); -+extern bool qxl_ttm_bo_is_qxl_bo(struct ttm_buffer_object *bo); -+ -+extern int qxl_bo_list_add(struct qxl_reloc_list *reloc_list, struct qxl_bo *bo); -+extern void qxl_bo_list_unreserve(struct qxl_reloc_list *reloc_list, bool failed); -+#endif -diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c -new file mode 100644 -index 0000000..1600781 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_release.c -@@ -0,0 +1,307 @@ -+/* -+ * Copyright 2011 Red Hat, Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * on the rights to use, copy, modify, merge, publish, distribute, sub -+ * license, and/or sell copies of the Software, and to permit persons to whom -+ * the Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+/* -+ * drawable cmd cache - allocate a bunch of VRAM pages, suballocate -+ * into 256 byte chunks for now - gives 16 cmds per page. -+ * -+ * use an ida to index into the chunks? -+ */ -+/* manage releaseables */ -+/* stack them 16 high for now -drawable object is 191 */ -+#define RELEASE_SIZE 256 -+#define RELEASES_PER_BO (4096 / RELEASE_SIZE) -+/* put an alloc/dealloc surface cmd into one bo and round up to 128 */ -+#define SURFACE_RELEASE_SIZE 128 -+#define SURFACE_RELEASES_PER_BO (4096 / SURFACE_RELEASE_SIZE) -+ -+static const int release_size_per_bo[] = { RELEASE_SIZE, SURFACE_RELEASE_SIZE, RELEASE_SIZE }; -+static const int releases_per_bo[] = { RELEASES_PER_BO, SURFACE_RELEASES_PER_BO, RELEASES_PER_BO }; -+uint64_t -+qxl_release_alloc(struct qxl_device *qdev, int type, -+ struct qxl_release **ret) -+{ -+ struct qxl_release *release; -+ int handle = 0; -+ size_t size = sizeof(*release); -+ int idr_ret; -+ -+ release = kmalloc(size, GFP_KERNEL); -+ if (!release) { -+ DRM_ERROR("Out of memory\n"); -+ return 0; -+ } -+ release->type = type; -+ release->bo_count = 0; -+ release->release_offset = 0; -+ release->surface_release_id = 0; -+again: -+ if (idr_pre_get(&qdev->release_idr, GFP_KERNEL) == 0) { -+ DRM_ERROR("Out of memory for release idr\n"); -+ kfree(release); -+ goto release_fail; -+ } -+ spin_lock(&qdev->release_idr_lock); -+ idr_ret = idr_get_new_above(&qdev->release_idr, release, 1, &handle); -+ spin_unlock(&qdev->release_idr_lock); -+ if (idr_ret == -EAGAIN) -+ goto again; -+ if (ret) -+ *ret = release; -+ QXL_INFO(qdev, "allocated release %lld\n", handle); -+ release->id = handle; -+release_fail: -+ -+ return handle; -+} -+ -+void -+qxl_release_free(struct qxl_device *qdev, -+ struct qxl_release *release) -+{ -+ int i; -+ -+ QXL_INFO(qdev, "release %d, type %d, %d bos\n", release->id, -+ release->type, release->bo_count); -+ -+ if (release->surface_release_id) -+ qxl_surface_id_dealloc(qdev, release->surface_release_id); -+ -+ for (i = 0 ; i < release->bo_count; ++i) { -+ QXL_INFO(qdev, "release %llx\n", -+ release->bos[i]->tbo.addr_space_offset -+ - DRM_FILE_OFFSET); -+ qxl_fence_remove_release(&release->bos[i]->fence, release->id); -+ qxl_bo_unref(&release->bos[i]); -+ } -+ spin_lock(&qdev->release_idr_lock); -+ idr_remove(&qdev->release_idr, release->id); -+ spin_unlock(&qdev->release_idr_lock); -+ kfree(release); -+} -+ -+void -+qxl_release_add_res(struct qxl_device *qdev, struct qxl_release *release, -+ struct qxl_bo *bo) -+{ -+ int i; -+ for (i = 0; i < release->bo_count; i++) -+ if (release->bos[i] == bo) -+ return; -+ -+ if (release->bo_count >= QXL_MAX_RES) { -+ DRM_ERROR("exceeded max resource on a qxl_release item\n"); -+ return; -+ } -+ release->bos[release->bo_count++] = qxl_bo_ref(bo); -+} -+ -+int qxl_release_bo_alloc(struct qxl_device *qdev, -+ struct qxl_bo **bo) -+{ -+ int ret; -+ ret = qxl_bo_create(qdev, PAGE_SIZE, false, QXL_GEM_DOMAIN_VRAM, NULL, -+ bo); -+ return ret; -+} -+ -+int qxl_release_reserve(struct qxl_device *qdev, -+ struct qxl_release *release, bool no_wait) -+{ -+ int ret; -+ if (atomic_inc_return(&release->bos[0]->reserve_count) == 1) { -+ ret = qxl_bo_reserve(release->bos[0], no_wait); -+ if (ret) -+ return ret; -+ } -+ return 0; -+} -+ -+void qxl_release_unreserve(struct qxl_device *qdev, -+ struct qxl_release *release) -+{ -+ if (atomic_dec_and_test(&release->bos[0]->reserve_count)) -+ qxl_bo_unreserve(release->bos[0]); -+} -+ -+int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, -+ enum qxl_surface_cmd_type surface_cmd_type, -+ struct qxl_release *create_rel, -+ struct qxl_release **release) -+{ -+ int ret; -+ -+ if (surface_cmd_type == QXL_SURFACE_CMD_DESTROY && create_rel) { -+ int idr_ret; -+ struct qxl_bo *bo; -+ union qxl_release_info *info; -+ -+ /* stash the release after the create command */ -+ idr_ret = qxl_release_alloc(qdev, QXL_RELEASE_SURFACE_CMD, release); -+ bo = qxl_bo_ref(create_rel->bos[0]); -+ -+ (*release)->release_offset = create_rel->release_offset + 64; -+ -+ qxl_release_add_res(qdev, *release, bo); -+ -+ ret = qxl_release_reserve(qdev, *release, false); -+ if (ret) { -+ DRM_ERROR("release reserve failed\n"); -+ goto out_unref; -+ } -+ info = qxl_release_map(qdev, *release); -+ info->id = idr_ret; -+ qxl_release_unmap(qdev, *release, info); -+ -+ -+out_unref: -+ qxl_bo_unref(&bo); -+ return ret; -+ } -+ -+ return qxl_alloc_release_reserved(qdev, sizeof(struct qxl_surface_cmd), -+ QXL_RELEASE_SURFACE_CMD, release, NULL); -+} -+ -+int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, -+ int type, struct qxl_release **release, -+ struct qxl_bo **rbo) -+{ -+ struct qxl_bo *bo; -+ int idr_ret; -+ int ret; -+ union qxl_release_info *info; -+ int cur_idx; -+ -+ if (type == QXL_RELEASE_DRAWABLE) -+ cur_idx = 0; -+ else if (type == QXL_RELEASE_SURFACE_CMD) -+ cur_idx = 1; -+ else if (type == QXL_RELEASE_CURSOR_CMD) -+ cur_idx = 2; -+ else { -+ DRM_ERROR("got illegal type: %d\n", type); -+ return -EINVAL; -+ } -+ -+ idr_ret = qxl_release_alloc(qdev, type, release); -+ -+ mutex_lock(&qdev->release_mutex); -+ if (qdev->current_release_bo_offset[cur_idx] + 1 >= releases_per_bo[cur_idx]) { -+ qxl_bo_unref(&qdev->current_release_bo[cur_idx]); -+ qdev->current_release_bo_offset[cur_idx] = 0; -+ qdev->current_release_bo[cur_idx] = NULL; -+ } -+ if (!qdev->current_release_bo[cur_idx]) { -+ ret = qxl_release_bo_alloc(qdev, &qdev->current_release_bo[cur_idx]); -+ if (ret) { -+ mutex_unlock(&qdev->release_mutex); -+ return ret; -+ } -+ -+ /* pin releases bo's they are too messy to evict */ -+ ret = qxl_bo_reserve(qdev->current_release_bo[cur_idx], false); -+ qxl_bo_pin(qdev->current_release_bo[cur_idx], QXL_GEM_DOMAIN_VRAM, NULL); -+ qxl_bo_unreserve(qdev->current_release_bo[cur_idx]); -+ } -+ -+ bo = qxl_bo_ref(qdev->current_release_bo[cur_idx]); -+ -+ (*release)->release_offset = qdev->current_release_bo_offset[cur_idx] * release_size_per_bo[cur_idx]; -+ qdev->current_release_bo_offset[cur_idx]++; -+ -+ if (rbo) -+ *rbo = bo; -+ -+ qxl_release_add_res(qdev, *release, bo); -+ -+ ret = qxl_release_reserve(qdev, *release, false); -+ mutex_unlock(&qdev->release_mutex); -+ if (ret) -+ goto out_unref; -+ -+ info = qxl_release_map(qdev, *release); -+ info->id = idr_ret; -+ qxl_release_unmap(qdev, *release, info); -+ -+out_unref: -+ qxl_bo_unref(&bo); -+ return ret; -+} -+ -+int qxl_fence_releaseable(struct qxl_device *qdev, -+ struct qxl_release *release) -+{ -+ int i, ret; -+ for (i = 0; i < release->bo_count; i++) { -+ if (!release->bos[i]->tbo.sync_obj) -+ release->bos[i]->tbo.sync_obj = &release->bos[i]->fence; -+ ret = qxl_fence_add_release(&release->bos[i]->fence, release->id); -+ if (ret) -+ return ret; -+ } -+ return 0; -+} -+ -+struct qxl_release *qxl_release_from_id_locked(struct qxl_device *qdev, -+ uint64_t id) -+{ -+ struct qxl_release *release; -+ -+ spin_lock(&qdev->release_idr_lock); -+ release = idr_find(&qdev->release_idr, id); -+ spin_unlock(&qdev->release_idr_lock); -+ if (!release) { -+ DRM_ERROR("failed to find id in release_idr\n"); -+ return NULL; -+ } -+ if (release->bo_count < 1) { -+ DRM_ERROR("read a released resource with 0 bos\n"); -+ return NULL; -+ } -+ return release; -+} -+ -+union qxl_release_info *qxl_release_map(struct qxl_device *qdev, -+ struct qxl_release *release) -+{ -+ void *ptr; -+ union qxl_release_info *info; -+ struct qxl_bo *bo = release->bos[0]; -+ -+ ptr = qxl_bo_kmap_atomic_page(qdev, bo, release->release_offset & PAGE_SIZE); -+ info = ptr + (release->release_offset & ~PAGE_SIZE); -+ return info; -+} -+ -+void qxl_release_unmap(struct qxl_device *qdev, -+ struct qxl_release *release, -+ union qxl_release_info *info) -+{ -+ struct qxl_bo *bo = release->bos[0]; -+ void *ptr; -+ -+ ptr = ((void *)info) - (release->release_offset & ~PAGE_SIZE); -+ qxl_bo_kunmap_atomic_page(qdev, bo, ptr); -+} -diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c -new file mode 100644 -index 0000000..aa9fb9a ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_ttm.c -@@ -0,0 +1,577 @@ -+/* -+ * Copyright 2013 Red Hat Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: Dave Airlie -+ * Alon Levy -+ */ -+ -+#include <ttm/ttm_bo_api.h> -+#include <ttm/ttm_bo_driver.h> -+#include <ttm/ttm_placement.h> -+#include <ttm/ttm_page_alloc.h> -+#include <ttm/ttm_module.h> -+#include <drm/drmP.h> -+#include <drm/drm.h> -+#include <drm/qxl_drm.h> -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+#include <linux/delay.h> -+static int qxl_ttm_debugfs_init(struct qxl_device *qdev); -+ -+static struct qxl_device *qxl_get_qdev(struct ttm_bo_device *bdev) -+{ -+ struct qxl_mman *mman; -+ struct qxl_device *qdev; -+ -+ mman = container_of(bdev, struct qxl_mman, bdev); -+ qdev = container_of(mman, struct qxl_device, mman); -+ return qdev; -+} -+ -+static int qxl_ttm_mem_global_init(struct drm_global_reference *ref) -+{ -+ return ttm_mem_global_init(ref->object); -+} -+ -+static void qxl_ttm_mem_global_release(struct drm_global_reference *ref) -+{ -+ ttm_mem_global_release(ref->object); -+} -+ -+static int qxl_ttm_global_init(struct qxl_device *qdev) -+{ -+ struct drm_global_reference *global_ref; -+ int r; -+ -+ qdev->mman.mem_global_referenced = false; -+ global_ref = &qdev->mman.mem_global_ref; -+ global_ref->global_type = DRM_GLOBAL_TTM_MEM; -+ global_ref->size = sizeof(struct ttm_mem_global); -+ global_ref->init = &qxl_ttm_mem_global_init; -+ global_ref->release = &qxl_ttm_mem_global_release; -+ -+ r = drm_global_item_ref(global_ref); -+ if (r != 0) { -+ DRM_ERROR("Failed setting up TTM memory accounting " -+ "subsystem.\n"); -+ return r; -+ } -+ -+ qdev->mman.bo_global_ref.mem_glob = -+ qdev->mman.mem_global_ref.object; -+ global_ref = &qdev->mman.bo_global_ref.ref; -+ global_ref->global_type = DRM_GLOBAL_TTM_BO; -+ global_ref->size = sizeof(struct ttm_bo_global); -+ global_ref->init = &ttm_bo_global_init; -+ global_ref->release = &ttm_bo_global_release; -+ r = drm_global_item_ref(global_ref); -+ if (r != 0) { -+ DRM_ERROR("Failed setting up TTM BO subsystem.\n"); -+ drm_global_item_unref(&qdev->mman.mem_global_ref); -+ return r; -+ } -+ -+ qdev->mman.mem_global_referenced = true; -+ return 0; -+} -+ -+static void qxl_ttm_global_fini(struct qxl_device *qdev) -+{ -+ if (qdev->mman.mem_global_referenced) { -+ drm_global_item_unref(&qdev->mman.bo_global_ref.ref); -+ drm_global_item_unref(&qdev->mman.mem_global_ref); -+ qdev->mman.mem_global_referenced = false; -+ } -+} -+ -+static struct vm_operations_struct qxl_ttm_vm_ops; -+static const struct vm_operations_struct *ttm_vm_ops; -+ -+static int qxl_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) -+{ -+ struct ttm_buffer_object *bo; -+ struct qxl_device *qdev; -+ int r; -+ -+ bo = (struct ttm_buffer_object *)vma->vm_private_data; -+ if (bo == NULL) -+ return VM_FAULT_NOPAGE; -+ qdev = qxl_get_qdev(bo->bdev); -+ r = ttm_vm_ops->fault(vma, vmf); -+ return r; -+} -+ -+int qxl_mmap(struct file *filp, struct vm_area_struct *vma) -+{ -+ struct drm_file *file_priv; -+ struct qxl_device *qdev; -+ int r; -+ -+ if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) { -+ pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n", -+ __func__, vma->vm_pgoff); -+ return drm_mmap(filp, vma); -+ } -+ -+ file_priv = filp->private_data; -+ qdev = file_priv->minor->dev->dev_private; -+ if (qdev == NULL) { -+ DRM_ERROR( -+ "filp->private_data->minor->dev->dev_private == NULL\n"); -+ return -EINVAL; -+ } -+ QXL_INFO(qdev, "%s: filp->private_data = 0x%p, vma->vm_pgoff = %lx\n", -+ __func__, filp->private_data, vma->vm_pgoff); -+ -+ r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev); -+ if (unlikely(r != 0)) -+ return r; -+ if (unlikely(ttm_vm_ops == NULL)) { -+ ttm_vm_ops = vma->vm_ops; -+ qxl_ttm_vm_ops = *ttm_vm_ops; -+ qxl_ttm_vm_ops.fault = &qxl_ttm_fault; -+ } -+ vma->vm_ops = &qxl_ttm_vm_ops; -+ return 0; -+} -+ -+static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags) -+{ -+ return 0; -+} -+ -+static int qxl_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, -+ struct ttm_mem_type_manager *man) -+{ -+ struct qxl_device *qdev; -+ -+ qdev = qxl_get_qdev(bdev); -+ -+ switch (type) { -+ case TTM_PL_SYSTEM: -+ /* System memory */ -+ man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; -+ man->available_caching = TTM_PL_MASK_CACHING; -+ man->default_caching = TTM_PL_FLAG_CACHED; -+ break; -+ case TTM_PL_VRAM: -+ case TTM_PL_PRIV0: -+ /* "On-card" video ram */ -+ man->func = &ttm_bo_manager_func; -+ man->gpu_offset = 0; -+ man->flags = TTM_MEMTYPE_FLAG_FIXED | -+ TTM_MEMTYPE_FLAG_MAPPABLE; -+ man->available_caching = TTM_PL_MASK_CACHING; -+ man->default_caching = TTM_PL_FLAG_CACHED; -+ break; -+ default: -+ DRM_ERROR("Unsupported memory type %u\n", (unsigned)type); -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+static void qxl_evict_flags(struct ttm_buffer_object *bo, -+ struct ttm_placement *placement) -+{ -+ struct qxl_bo *qbo; -+ static u32 placements = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; -+ -+ if (!qxl_ttm_bo_is_qxl_bo(bo)) { -+ placement->fpfn = 0; -+ placement->lpfn = 0; -+ placement->placement = &placements; -+ placement->busy_placement = &placements; -+ placement->num_placement = 1; -+ placement->num_busy_placement = 1; -+ return; -+ } -+ qbo = container_of(bo, struct qxl_bo, tbo); -+ qxl_ttm_placement_from_domain(qbo, QXL_GEM_DOMAIN_CPU); -+ *placement = qbo->placement; -+} -+ -+static int qxl_verify_access(struct ttm_buffer_object *bo, struct file *filp) -+{ -+ return 0; -+} -+ -+static int qxl_ttm_io_mem_reserve(struct ttm_bo_device *bdev, -+ struct ttm_mem_reg *mem) -+{ -+ struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; -+ struct qxl_device *qdev = qxl_get_qdev(bdev); -+ -+ mem->bus.addr = NULL; -+ mem->bus.offset = 0; -+ mem->bus.size = mem->num_pages << PAGE_SHIFT; -+ mem->bus.base = 0; -+ mem->bus.is_iomem = false; -+ if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) -+ return -EINVAL; -+ switch (mem->mem_type) { -+ case TTM_PL_SYSTEM: -+ /* system memory */ -+ return 0; -+ case TTM_PL_VRAM: -+ mem->bus.is_iomem = true; -+ mem->bus.base = qdev->vram_base; -+ mem->bus.offset = mem->start << PAGE_SHIFT; -+ break; -+ case TTM_PL_PRIV0: -+ mem->bus.is_iomem = true; -+ mem->bus.base = qdev->surfaceram_base; -+ mem->bus.offset = mem->start << PAGE_SHIFT; -+ break; -+ default: -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+static void qxl_ttm_io_mem_free(struct ttm_bo_device *bdev, -+ struct ttm_mem_reg *mem) -+{ -+} -+ -+/* -+ * TTM backend functions. -+ */ -+struct qxl_ttm_tt { -+ struct ttm_dma_tt ttm; -+ struct qxl_device *qdev; -+ u64 offset; -+}; -+ -+static int qxl_ttm_backend_bind(struct ttm_tt *ttm, -+ struct ttm_mem_reg *bo_mem) -+{ -+ struct qxl_ttm_tt *gtt = (void *)ttm; -+ -+ gtt->offset = (unsigned long)(bo_mem->start << PAGE_SHIFT); -+ if (!ttm->num_pages) { -+ WARN(1, "nothing to bind %lu pages for mreg %p back %p!\n", -+ ttm->num_pages, bo_mem, ttm); -+ } -+ /* Not implemented */ -+ return -1; -+} -+ -+static int qxl_ttm_backend_unbind(struct ttm_tt *ttm) -+{ -+ /* Not implemented */ -+ return -1; -+} -+ -+static void qxl_ttm_backend_destroy(struct ttm_tt *ttm) -+{ -+ struct qxl_ttm_tt *gtt = (void *)ttm; -+ -+ ttm_dma_tt_fini(>t->ttm); -+ kfree(gtt); -+} -+ -+static struct ttm_backend_func qxl_backend_func = { -+ .bind = &qxl_ttm_backend_bind, -+ .unbind = &qxl_ttm_backend_unbind, -+ .destroy = &qxl_ttm_backend_destroy, -+}; -+ -+static int qxl_ttm_tt_populate(struct ttm_tt *ttm) -+{ -+ int r; -+ -+ if (ttm->state != tt_unpopulated) -+ return 0; -+ -+ r = ttm_pool_populate(ttm); -+ if (r) -+ return r; -+ -+ return 0; -+} -+ -+static void qxl_ttm_tt_unpopulate(struct ttm_tt *ttm) -+{ -+ ttm_pool_unpopulate(ttm); -+} -+ -+struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev, -+ unsigned long size, uint32_t page_flags, -+ struct page *dummy_read_page) -+{ -+ struct qxl_device *qdev; -+ struct qxl_ttm_tt *gtt; -+ -+ qdev = qxl_get_qdev(bdev); -+ gtt = kzalloc(sizeof(struct qxl_ttm_tt), GFP_KERNEL); -+ if (gtt == NULL) -+ return NULL; -+ gtt->ttm.ttm.func = &qxl_backend_func; -+ gtt->qdev = qdev; -+ if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags, -+ dummy_read_page)) { -+ kfree(gtt); -+ return NULL; -+ } -+ return >t->ttm.ttm; -+} -+ -+static void qxl_move_null(struct ttm_buffer_object *bo, -+ struct ttm_mem_reg *new_mem) -+{ -+ struct ttm_mem_reg *old_mem = &bo->mem; -+ -+ BUG_ON(old_mem->mm_node != NULL); -+ *old_mem = *new_mem; -+ new_mem->mm_node = NULL; -+} -+ -+static int qxl_bo_move(struct ttm_buffer_object *bo, -+ bool evict, bool interruptible, -+ bool no_wait_gpu, -+ struct ttm_mem_reg *new_mem) -+{ -+ struct ttm_mem_reg *old_mem = &bo->mem; -+ if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { -+ qxl_move_null(bo, new_mem); -+ return 0; -+ } -+ return ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem); -+} -+ -+ -+static int qxl_sync_obj_wait(void *sync_obj, -+ bool lazy, bool interruptible) -+{ -+ struct qxl_fence *qfence = (struct qxl_fence *)sync_obj; -+ int count = 0, sc = 0; -+ struct qxl_bo *bo = container_of(qfence, struct qxl_bo, fence); -+ -+ if (qfence->num_active_releases == 0) -+ return 0; -+ -+retry: -+ if (sc == 0) { -+ if (bo->type == QXL_GEM_DOMAIN_SURFACE) -+ qxl_update_surface(qfence->qdev, bo); -+ } else if (sc >= 1) { -+ qxl_io_notify_oom(qfence->qdev); -+ } -+ -+ sc++; -+ -+ for (count = 0; count < 10; count++) { -+ bool ret; -+ ret = qxl_queue_garbage_collect(qfence->qdev, true); -+ if (ret == false) -+ break; -+ -+ if (qfence->num_active_releases == 0) -+ return 0; -+ } -+ -+ if (qfence->num_active_releases) { -+ bool have_drawable_releases = false; -+ void **slot; -+ struct radix_tree_iter iter; -+ int release_id; -+ -+ radix_tree_for_each_slot(slot, &qfence->tree, &iter, 0) { -+ struct qxl_release *release; -+ -+ release_id = iter.index; -+ release = qxl_release_from_id_locked(qfence->qdev, release_id); -+ if (release == NULL) -+ continue; -+ -+ if (release->type == QXL_RELEASE_DRAWABLE) -+ have_drawable_releases = true; -+ } -+ -+ qxl_queue_garbage_collect(qfence->qdev, true); -+ -+ if (have_drawable_releases || sc < 4) { -+ if (sc > 2) -+ /* back off */ -+ usleep_range(500, 1000); -+ if (have_drawable_releases && sc > 300) { -+ WARN(1, "sync obj %d still has outstanding releases %d %d %d %ld %d\n", sc, bo->surface_id, bo->is_primary, bo->pin_count, (unsigned long)bo->gem_base.size, qfence->num_active_releases); -+ return -EBUSY; -+ } -+ goto retry; -+ } -+ } -+ return 0; -+} -+ -+static int qxl_sync_obj_flush(void *sync_obj) -+{ -+ return 0; -+} -+ -+static void qxl_sync_obj_unref(void **sync_obj) -+{ -+} -+ -+static void *qxl_sync_obj_ref(void *sync_obj) -+{ -+ return sync_obj; -+} -+ -+static bool qxl_sync_obj_signaled(void *sync_obj) -+{ -+ struct qxl_fence *qfence = (struct qxl_fence *)sync_obj; -+ return (qfence->num_active_releases == 0); -+} -+ -+static void qxl_bo_move_notify(struct ttm_buffer_object *bo, -+ struct ttm_mem_reg *new_mem) -+{ -+ struct qxl_bo *qbo; -+ struct qxl_device *qdev; -+ -+ if (!qxl_ttm_bo_is_qxl_bo(bo)) -+ return; -+ qbo = container_of(bo, struct qxl_bo, tbo); -+ qdev = qbo->gem_base.dev->dev_private; -+ -+ if (bo->mem.mem_type == TTM_PL_PRIV0 && qbo->surface_id) -+ qxl_surface_evict(qdev, qbo, new_mem ? true : false); -+} -+ -+static struct ttm_bo_driver qxl_bo_driver = { -+ .ttm_tt_create = &qxl_ttm_tt_create, -+ .ttm_tt_populate = &qxl_ttm_tt_populate, -+ .ttm_tt_unpopulate = &qxl_ttm_tt_unpopulate, -+ .invalidate_caches = &qxl_invalidate_caches, -+ .init_mem_type = &qxl_init_mem_type, -+ .evict_flags = &qxl_evict_flags, -+ .move = &qxl_bo_move, -+ .verify_access = &qxl_verify_access, -+ .io_mem_reserve = &qxl_ttm_io_mem_reserve, -+ .io_mem_free = &qxl_ttm_io_mem_free, -+ .sync_obj_signaled = &qxl_sync_obj_signaled, -+ .sync_obj_wait = &qxl_sync_obj_wait, -+ .sync_obj_flush = &qxl_sync_obj_flush, -+ .sync_obj_unref = &qxl_sync_obj_unref, -+ .sync_obj_ref = &qxl_sync_obj_ref, -+ .move_notify = &qxl_bo_move_notify, -+}; -+ -+ -+ -+int qxl_ttm_init(struct qxl_device *qdev) -+{ -+ int r; -+ int num_io_pages; /* != rom->num_io_pages, we include surface0 */ -+ -+ r = qxl_ttm_global_init(qdev); -+ if (r) -+ return r; -+ /* No others user of address space so set it to 0 */ -+ r = ttm_bo_device_init(&qdev->mman.bdev, -+ qdev->mman.bo_global_ref.ref.object, -+ &qxl_bo_driver, DRM_FILE_PAGE_OFFSET, 0); -+ if (r) { -+ DRM_ERROR("failed initializing buffer object driver(%d).\n", r); -+ return r; -+ } -+ /* NOTE: this includes the framebuffer (aka surface 0) */ -+ num_io_pages = qdev->rom->ram_header_offset / PAGE_SIZE; -+ r = ttm_bo_init_mm(&qdev->mman.bdev, TTM_PL_VRAM, -+ num_io_pages); -+ if (r) { -+ DRM_ERROR("Failed initializing VRAM heap.\n"); -+ return r; -+ } -+ r = ttm_bo_init_mm(&qdev->mman.bdev, TTM_PL_PRIV0, -+ qdev->surfaceram_size / PAGE_SIZE); -+ if (r) { -+ DRM_ERROR("Failed initializing Surfaces heap.\n"); -+ return r; -+ } -+ DRM_INFO("qxl: %uM of VRAM memory size\n", -+ (unsigned)qdev->vram_size / (1024 * 1024)); -+ DRM_INFO("qxl: %luM of IO pages memory ready (VRAM domain)\n", -+ ((unsigned)num_io_pages * PAGE_SIZE) / (1024 * 1024)); -+ if (unlikely(qdev->mman.bdev.dev_mapping == NULL)) -+ qdev->mman.bdev.dev_mapping = qdev->ddev->dev_mapping; -+ r = qxl_ttm_debugfs_init(qdev); -+ if (r) { -+ DRM_ERROR("Failed to init debugfs\n"); -+ return r; -+ } -+ return 0; -+} -+ -+void qxl_ttm_fini(struct qxl_device *qdev) -+{ -+ ttm_bo_clean_mm(&qdev->mman.bdev, TTM_PL_VRAM); -+ ttm_bo_clean_mm(&qdev->mman.bdev, TTM_PL_PRIV0); -+ ttm_bo_device_release(&qdev->mman.bdev); -+ qxl_ttm_global_fini(qdev); -+ DRM_INFO("qxl: ttm finalized\n"); -+} -+ -+ -+#define QXL_DEBUGFS_MEM_TYPES 2 -+ -+#if defined(CONFIG_DEBUG_FS) -+static int qxl_mm_dump_table(struct seq_file *m, void *data) -+{ -+ struct drm_info_node *node = (struct drm_info_node *)m->private; -+ struct drm_mm *mm = (struct drm_mm *)node->info_ent->data; -+ struct drm_device *dev = node->minor->dev; -+ struct qxl_device *rdev = dev->dev_private; -+ int ret; -+ struct ttm_bo_global *glob = rdev->mman.bdev.glob; -+ -+ spin_lock(&glob->lru_lock); -+ ret = drm_mm_dump_table(m, mm); -+ spin_unlock(&glob->lru_lock); -+ return ret; -+} -+#endif -+ -+static int qxl_ttm_debugfs_init(struct qxl_device *qdev) -+{ -+ static struct drm_info_list qxl_mem_types_list[QXL_DEBUGFS_MEM_TYPES]; -+ static char qxl_mem_types_names[QXL_DEBUGFS_MEM_TYPES][32]; -+ unsigned i; -+ -+ for (i = 0; i < QXL_DEBUGFS_MEM_TYPES; i++) { -+ if (i == 0) -+ sprintf(qxl_mem_types_names[i], "qxl_mem_mm"); -+ else -+ sprintf(qxl_mem_types_names[i], "qxl_surf_mm"); -+ qxl_mem_types_list[i].name = qxl_mem_types_names[i]; -+ qxl_mem_types_list[i].show = &qxl_mm_dump_table; -+ qxl_mem_types_list[i].driver_features = 0; -+ if (i == 0) -+ qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv; -+ else -+ qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV0].priv; -+ -+ } -+ return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i); -+} -diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild -index ba99ce3..a042a95 100644 ---- a/include/uapi/drm/Kbuild -+++ b/include/uapi/drm/Kbuild -@@ -8,6 +8,7 @@ header-y += i810_drm.h - header-y += i915_drm.h - header-y += mga_drm.h - header-y += nouveau_drm.h -+header-y += qxl_drm.h - header-y += r128_drm.h - header-y += radeon_drm.h - header-y += savage_drm.h -diff --git a/include/uapi/drm/qxl_drm.h b/include/uapi/drm/qxl_drm.h -new file mode 100644 -index 0000000..ebebd36 ---- /dev/null -+++ b/include/uapi/drm/qxl_drm.h -@@ -0,0 +1,152 @@ -+/* -+ * Copyright 2013 Red Hat -+ * All Rights Reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+#ifndef QXL_DRM_H -+#define QXL_DRM_H -+ -+#include <stddef.h> -+#include "drm/drm.h" -+ -+/* Please note that modifications to all structs defined here are -+ * subject to backwards-compatibility constraints. -+ * -+ * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel -+ * compatibility Keep fields aligned to their size -+ */ -+ -+#define QXL_GEM_DOMAIN_CPU 0 -+#define QXL_GEM_DOMAIN_VRAM 1 -+#define QXL_GEM_DOMAIN_SURFACE 2 -+ -+#define DRM_QXL_ALLOC 0x00 -+#define DRM_QXL_MAP 0x01 -+#define DRM_QXL_EXECBUFFER 0x02 -+#define DRM_QXL_UPDATE_AREA 0x03 -+#define DRM_QXL_GETPARAM 0x04 -+#define DRM_QXL_CLIENTCAP 0x05 -+ -+#define DRM_QXL_ALLOC_SURF 0x06 -+ -+struct drm_qxl_alloc { -+ uint32_t size; -+ uint32_t handle; /* 0 is an invalid handle */ -+}; -+ -+struct drm_qxl_map { -+ uint64_t offset; /* use for mmap system call */ -+ uint32_t handle; -+ uint32_t pad; -+}; -+ -+/* -+ * dest is the bo we are writing the relocation into -+ * src is bo we are relocating. -+ * *(dest_handle.base_addr + dest_offset) = physical_address(src_handle.addr + -+ * src_offset) -+ */ -+#define QXL_RELOC_TYPE_BO 1 -+#define QXL_RELOC_TYPE_SURF 2 -+ -+struct drm_qxl_reloc { -+ uint64_t src_offset; /* offset into src_handle or src buffer */ -+ uint64_t dst_offset; /* offset in dest handle */ -+ uint32_t src_handle; /* dest handle to compute address from */ -+ uint32_t dst_handle; /* 0 if to command buffer */ -+ uint32_t reloc_type; -+ uint32_t pad; -+}; -+ -+struct drm_qxl_command { -+ uint64_t __user command; /* void* */ -+ uint64_t __user relocs; /* struct drm_qxl_reloc* */ -+ uint32_t type; -+ uint32_t command_size; -+ uint32_t relocs_num; -+ uint32_t pad; -+}; -+ -+/* XXX: call it drm_qxl_commands? */ -+struct drm_qxl_execbuffer { -+ uint32_t flags; /* for future use */ -+ uint32_t commands_num; -+ uint64_t __user commands; /* struct drm_qxl_command* */ -+}; -+ -+struct drm_qxl_update_area { -+ uint32_t handle; -+ uint32_t top; -+ uint32_t left; -+ uint32_t bottom; -+ uint32_t right; -+ uint32_t pad; -+}; -+ -+#define QXL_PARAM_NUM_SURFACES 1 /* rom->n_surfaces */ -+#define QXL_PARAM_MAX_RELOCS 2 -+struct drm_qxl_getparam { -+ uint64_t param; -+ uint64_t value; -+}; -+ -+/* these are one bit values */ -+struct drm_qxl_clientcap { -+ uint32_t index; -+ uint32_t pad; -+}; -+ -+struct drm_qxl_alloc_surf { -+ uint32_t format; -+ uint32_t width; -+ uint32_t height; -+ int32_t stride; -+ uint32_t handle; -+ uint32_t pad; -+}; -+ -+#define DRM_IOCTL_QXL_ALLOC \ -+ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC, struct drm_qxl_alloc) -+ -+#define DRM_IOCTL_QXL_MAP \ -+ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_MAP, struct drm_qxl_map) -+ -+#define DRM_IOCTL_QXL_EXECBUFFER \ -+ DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_EXECBUFFER,\ -+ struct drm_qxl_execbuffer) -+ -+#define DRM_IOCTL_QXL_UPDATE_AREA \ -+ DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_UPDATE_AREA,\ -+ struct drm_qxl_update_area) -+ -+#define DRM_IOCTL_QXL_GETPARAM \ -+ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_GETPARAM,\ -+ struct drm_qxl_getparam) -+ -+#define DRM_IOCTL_QXL_CLIENTCAP \ -+ DRM_IOW(DRM_COMMAND_BASE + DRM_QXL_CLIENTCAP,\ -+ struct drm_qxl_clientcap) -+ -+#define DRM_IOCTL_QXL_ALLOC_SURF \ -+ DRM_IOWR(DRM_COMMAND_BASE + DRM_QXL_ALLOC_SURF,\ -+ struct drm_qxl_alloc_surf) -+ -+#endif --- -1.8.1.4 - diff --git a/freed-ora/current/master/drm-radeon-Disable-writeback-by-default-on-ppc.patch b/freed-ora/current/master/drm-radeon-Disable-writeback-by-default-on-ppc.patch new file mode 100644 index 000000000..0defb1340 --- /dev/null +++ b/freed-ora/current/master/drm-radeon-Disable-writeback-by-default-on-ppc.patch @@ -0,0 +1,85 @@ +From b67e0a6a7409f9c1a12e573fb7d8d80ee455b103 Mon Sep 17 00:00:00 2001 +From: Adam Jackson <ajax@redhat.com> +Date: Mon, 17 Jun 2013 09:59:34 -0400 +Subject: [PATCH] drm/radeon: Disable writeback by default on ppc + +At least on an IBM Power 720, this check passes, but several piglit +tests will reliably trigger GPU resets due to the ring buffer pointers +not being updated. There's probably a better way to limit this to just +affected machines though. + +Signed-off-by: Adam Jackson <ajax@redhat.com> +--- + drivers/gpu/drm/radeon/r600_cp.c | 7 +++++++ + drivers/gpu/drm/radeon/radeon_cp.c | 7 +++++++ + drivers/gpu/drm/radeon/radeon_device.c | 4 ++-- + drivers/gpu/drm/radeon/radeon_drv.c | 2 +- + 4 files changed, 17 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c +index 1c51c08..ef28532 100644 +--- a/drivers/gpu/drm/radeon/r600_cp.c ++++ b/drivers/gpu/drm/radeon/r600_cp.c +@@ -552,6 +552,13 @@ static void r600_test_writeback(drm_radeon_private_t *dev_priv) + dev_priv->writeback_works = 0; + DRM_INFO("writeback test failed\n"); + } ++#if defined(__ppc__) || defined(__ppc64__) ++ /* the test might succeed on ppc, but it's usually not reliable */ ++ if (radeon_no_wb == -1) { ++ radeon_no_wb = 1; ++ DRM_INFO("not trusting writeback test due to arch quirk\n"); ++ } ++#endif + if (radeon_no_wb == 1) { + dev_priv->writeback_works = 0; + DRM_INFO("writeback forced off\n"); +diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c +index efc4f64..a967b33 100644 +--- a/drivers/gpu/drm/radeon/radeon_cp.c ++++ b/drivers/gpu/drm/radeon/radeon_cp.c +@@ -892,6 +892,13 @@ static void radeon_test_writeback(drm_radeon_private_t * dev_priv) + dev_priv->writeback_works = 0; + DRM_INFO("writeback test failed\n"); + } ++#if defined(__ppc__) || defined(__ppc64__) ++ /* the test might succeed on ppc, but it's usually not reliable */ ++ if (radeon_no_wb == -1) { ++ radeon_no_wb = 1; ++ DRM_INFO("not trusting writeback test due to arch quirk\n"); ++ } ++#endif + if (radeon_no_wb == 1) { + dev_priv->writeback_works = 0; + DRM_INFO("writeback forced off\n"); +diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c +index 1899738..524046e 100644 +--- a/drivers/gpu/drm/radeon/radeon_device.c ++++ b/drivers/gpu/drm/radeon/radeon_device.c +@@ -322,8 +322,8 @@ int radeon_wb_init(struct radeon_device *rdev) + /* disable event_write fences */ + rdev->wb.use_event = false; + /* disabled via module param */ +- if (radeon_no_wb == 1) { +- rdev->wb.enabled = false; ++ if (radeon_no_wb != -1) { ++ rdev->wb.enabled = !!radeon_no_wb; + } else { + if (rdev->flags & RADEON_IS_AGP) { + /* often unreliable on AGP */ +diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c +index 094e7e5..04809d4 100644 +--- a/drivers/gpu/drm/radeon/radeon_drv.c ++++ b/drivers/gpu/drm/radeon/radeon_drv.c +@@ -146,7 +146,7 @@ static inline void radeon_register_atpx_handler(void) {} + static inline void radeon_unregister_atpx_handler(void) {} + #endif + +-int radeon_no_wb; ++int radeon_no_wb = -1; + int radeon_modeset = -1; + int radeon_dynclks = -1; + int radeon_r4xx_atom = 0; +-- +1.8.2.1 + diff --git a/freed-ora/current/master/drm-ttm-exports-for-qxl.patch b/freed-ora/current/master/drm-ttm-exports-for-qxl.patch deleted file mode 100644 index 6134b5119..000000000 --- a/freed-ora/current/master/drm-ttm-exports-for-qxl.patch +++ /dev/null @@ -1,86 +0,0 @@ -From b538d2921b8aaaa1d7abf1bf0ba3ab9330b0b0c8 Mon Sep 17 00:00:00 2001 -From: Dave Airlie <airlied@gmail.com> -Date: Tue, 22 Jan 2013 13:56:04 +1000 -Subject: [PATCH 1/2] ttm: export functions to allow qxl do its own iomapping - -qxl wants to use io mapping like i915 gem does, for now -just export the symbols so the driver can implement atomic -page maps using io mapping. - -Signed-off-by: Dave Airlie <airlied@redhat.com> ---- - drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +++++++++---- - include/drm/ttm/ttm_bo_driver.h | 4 ++++ - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c -index 44420fc..aaf6f47 100644 ---- a/drivers/gpu/drm/ttm/ttm_bo_util.c -+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c -@@ -86,6 +86,7 @@ int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible) - mutex_lock(&man->io_reserve_mutex); - return 0; - } -+EXPORT_SYMBOL(ttm_mem_io_lock); - - void ttm_mem_io_unlock(struct ttm_mem_type_manager *man) - { -@@ -94,6 +95,7 @@ void ttm_mem_io_unlock(struct ttm_mem_type_manager *man) - - mutex_unlock(&man->io_reserve_mutex); - } -+EXPORT_SYMBOL(ttm_mem_io_unlock); - - static int ttm_mem_io_evict(struct ttm_mem_type_manager *man) - { -@@ -111,8 +113,9 @@ static int ttm_mem_io_evict(struct ttm_mem_type_manager *man) - return 0; - } - --static int ttm_mem_io_reserve(struct ttm_bo_device *bdev, -- struct ttm_mem_reg *mem) -+ -+int ttm_mem_io_reserve(struct ttm_bo_device *bdev, -+ struct ttm_mem_reg *mem) - { - struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; - int ret = 0; -@@ -134,9 +137,10 @@ retry: - } - return ret; - } -+EXPORT_SYMBOL(ttm_mem_io_reserve); - --static void ttm_mem_io_free(struct ttm_bo_device *bdev, -- struct ttm_mem_reg *mem) -+void ttm_mem_io_free(struct ttm_bo_device *bdev, -+ struct ttm_mem_reg *mem) - { - struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; - -@@ -149,6 +153,7 @@ static void ttm_mem_io_free(struct ttm_bo_device *bdev, - bdev->driver->io_mem_free(bdev, mem); - - } -+EXPORT_SYMBOL(ttm_mem_io_free); - - int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo) - { -diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h -index 0fbd046..9c8dca7 100644 ---- a/include/drm/ttm/ttm_bo_driver.h -+++ b/include/drm/ttm/ttm_bo_driver.h -@@ -902,6 +902,10 @@ extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); - * ttm_bo_util.c - */ - -+int ttm_mem_io_reserve(struct ttm_bo_device *bdev, -+ struct ttm_mem_reg *mem); -+void ttm_mem_io_free(struct ttm_bo_device *bdev, -+ struct ttm_mem_reg *mem); - /** - * ttm_bo_move_ttm - * --- -1.8.1.4 - diff --git a/freed-ora/current/master/fanotify-info-leak-in-copy_event_to_user.patch b/freed-ora/current/master/fanotify-info-leak-in-copy_event_to_user.patch new file mode 100644 index 000000000..92b218b1c --- /dev/null +++ b/freed-ora/current/master/fanotify-info-leak-in-copy_event_to_user.patch @@ -0,0 +1,14 @@ +diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c +index 6c80083..77cc85d 100644 +--- a/fs/notify/fanotify/fanotify_user.c ++++ b/fs/notify/fanotify/fanotify_user.c +@@ -122,6 +122,7 @@ static int fill_event_metadata(struct fsnotify_group *group, + metadata->event_len = FAN_EVENT_METADATA_LEN; + metadata->metadata_len = FAN_EVENT_METADATA_LEN; + metadata->vers = FANOTIFY_METADATA_VERSION; ++ metadata->reserved = 0; + metadata->mask = event->mask & FAN_ALL_OUTGOING_EVENTS; + metadata->pid = pid_vnr(event->tgid); + if (unlikely(event->mask & FAN_Q_OVERFLOW)) + +
\ No newline at end of file diff --git a/freed-ora/current/master/forcedeth-dma-error-check.patch b/freed-ora/current/master/forcedeth-dma-error-check.patch deleted file mode 100644 index 0baee2a61..000000000 --- a/freed-ora/current/master/forcedeth-dma-error-check.patch +++ /dev/null @@ -1,132 +0,0 @@ -This backtrace was recently reported on a 3.9 kernel: - -Actual results: from syslog /var/log/messsages: -kernel: [17539.340285] ------------[ cut here ]------------ -kernel: [17539.341012] WARNING: at lib/dma-debug.c:937 check_unmap+0x493/0x960() -kernel: [17539.341012] Hardware name: MS-7125 -kernel: [17539.341012] forcedeth 0000:00:0a.0: DMA-API: device driver failed to -check map error[device address=0x0000000013c88000] [size=544 bytes] [mapped as -page] -kernel: [17539.341012] Modules linked in: fuse ebtable_nat ipt_MASQUERADE -nf_conntrack_netbios_ns nf_conntrack_broadcast ip6table_nat nf_nat_ipv6 -ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 iptable_nat -nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack -nf_conntrack bnep bluetooth rfkill ebtable_filter ebtables ip6table_filter -ip6_tables snd_hda_codec_hdmi snd_cmipci snd_mpu401_uart snd_hda_intel -snd_intel8x0 snd_opl3_lib snd_ac97_codec gameport snd_hda_codec snd_rawmidi -ac97_bus snd_hwdep snd_seq snd_seq_device snd_pcm snd_page_alloc snd_timer snd -k8temp soundcore serio_raw i2c_nforce2 forcedeth ata_generic pata_acpi nouveau -video mxm_wmi wmi i2c_algo_bit drm_kms_helper ttm drm i2c_core sata_sil pata_amd -sata_nv uinput -kernel: [17539.341012] Pid: 17340, comm: sshd Not tainted -3.9.0-0.rc4.git0.1.fc19.i686.PAE #1 -kernel: [17539.341012] Call Trace: -kernel: [17539.341012] [<c045573c>] warn_slowpath_common+0x6c/0xa0 -kernel: [17539.341012] [<c0701953>] ? check_unmap+0x493/0x960 -kernel: [17539.341012] [<c0701953>] ? check_unmap+0x493/0x960 -kernel: [17539.341012] [<c04557a3>] warn_slowpath_fmt+0x33/0x40 -kernel: [17539.341012] [<c0701953>] check_unmap+0x493/0x960 -kernel: [17539.341012] [<c049238f>] ? sched_clock_cpu+0xdf/0x150 -kernel: [17539.341012] [<c0701e87>] debug_dma_unmap_page+0x67/0x70 -kernel: [17539.341012] [<f7eae8f2>] nv_unmap_txskb.isra.32+0x92/0x100 - -Its pretty plainly the result of an skb fragment getting unmapped without having -its initial mapping operation checked for errors. This patch corrects that. - -Signed-off-by: Neil Horman <nhorman@tuxdriver.com> -CC: "David S. Miller" <davem@davemloft.net> ---- - drivers/net/ethernet/nvidia/forcedeth.c | 41 ++++++++++++++++++++++++++++++++- - 1 file changed, 40 insertions(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c -index b62262c..5ae1247 100644 ---- a/drivers/net/ethernet/nvidia/forcedeth.c -+++ b/drivers/net/ethernet/nvidia/forcedeth.c -@@ -2200,6 +2200,7 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev) - struct ring_desc *start_tx; - struct ring_desc *prev_tx; - struct nv_skb_map *prev_tx_ctx; -+ struct nv_skb_map *tmp_tx_ctx = NULL, *start_tx_ctx = NULL; - unsigned long flags; - - /* add fragments to entries count */ -@@ -2261,12 +2262,31 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev) - do { - prev_tx = put_tx; - prev_tx_ctx = np->put_tx_ctx; -+ if (!start_tx_ctx) -+ start_tx_ctx = tmp_tx_ctx = np->put_tx_ctx; -+ - bcnt = (frag_size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : frag_size; - np->put_tx_ctx->dma = skb_frag_dma_map( - &np->pci_dev->dev, - frag, offset, - bcnt, - DMA_TO_DEVICE); -+ if (dma_mapping_error(&np->pci_dev->dev, np->put_tx_ctx->dma)) { -+ -+ /* Unwind the mapped fragments */ -+ do { -+ nv_unmap_txskb(np, start_tx_ctx); -+ if (unlikely(tmp_tx_ctx++ == np->last_tx_ctx)) -+ tmp_tx_ctx = np->first_tx_ctx; -+ } while (tmp_tx_ctx != np->put_tx_ctx); -+ kfree_skb(skb); -+ np->put_tx_ctx = start_tx_ctx; -+ u64_stats_update_begin(&np->swstats_tx_syncp); -+ np->stat_tx_dropped++; -+ u64_stats_update_end(&np->swstats_tx_syncp); -+ return NETDEV_TX_OK; -+ } -+ - np->put_tx_ctx->dma_len = bcnt; - np->put_tx_ctx->dma_single = 0; - put_tx->buf = cpu_to_le32(np->put_tx_ctx->dma); -@@ -2327,7 +2347,8 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb, - struct ring_desc_ex *start_tx; - struct ring_desc_ex *prev_tx; - struct nv_skb_map *prev_tx_ctx; -- struct nv_skb_map *start_tx_ctx; -+ struct nv_skb_map *start_tx_ctx = NULL; -+ struct nv_skb_map *tmp_tx_ctx = NULL; - unsigned long flags; - - /* add fragments to entries count */ -@@ -2392,11 +2413,29 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb, - prev_tx = put_tx; - prev_tx_ctx = np->put_tx_ctx; - bcnt = (frag_size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : frag_size; -+ if (!start_tx_ctx) -+ start_tx_ctx = tmp_tx_ctx = np->put_tx_ctx; - np->put_tx_ctx->dma = skb_frag_dma_map( - &np->pci_dev->dev, - frag, offset, - bcnt, - DMA_TO_DEVICE); -+ -+ if (dma_mapping_error(&np->pci_dev->dev, np->put_tx_ctx->dma)) { -+ -+ /* Unwind the mapped fragments */ -+ do { -+ nv_unmap_txskb(np, start_tx_ctx); -+ if (unlikely(tmp_tx_ctx++ == np->last_tx_ctx)) -+ tmp_tx_ctx = np->first_tx_ctx; -+ } while (tmp_tx_ctx != np->put_tx_ctx); -+ kfree_skb(skb); -+ np->put_tx_ctx = start_tx_ctx; -+ u64_stats_update_begin(&np->swstats_tx_syncp); -+ np->stat_tx_dropped++; -+ u64_stats_update_end(&np->swstats_tx_syncp); -+ return NETDEV_TX_OK; -+ } - np->put_tx_ctx->dma_len = bcnt; - np->put_tx_ctx->dma_single = 0; - put_tx->bufhigh = cpu_to_le32(dma_high(np->put_tx_ctx->dma)); --- -1.7.11.7 - --- -To unsubscribe from this list: send the line "unsubscribe netdev" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html
\ No newline at end of file diff --git a/freed-ora/current/master/intel_iommu-Downgrade-the-warning-if-enabling-irq-remapping-fails.patch b/freed-ora/current/master/intel_iommu-Downgrade-the-warning-if-enabling-irq-remapping-fails.patch new file mode 100644 index 000000000..424d60350 --- /dev/null +++ b/freed-ora/current/master/intel_iommu-Downgrade-the-warning-if-enabling-irq-remapping-fails.patch @@ -0,0 +1,25 @@ +This triggers on a MacBook Pro. + +Signed-off-by: Andy Lutomirski <luto@amacapital.net> +https://bugzilla.redhat.com/show_bug.cgi?id=948262 +--- + drivers/iommu/intel_irq_remapping.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c +index f3b8f23..a7e0ad1 100644 +--- a/drivers/iommu/intel_irq_remapping.c ++++ b/drivers/iommu/intel_irq_remapping.c +@@ -654,8 +654,7 @@ error: + */ + + if (x2apic_present) +- WARN(1, KERN_WARNING +- "Failed to enable irq remapping. You are vulnerable to irq-injection attacks.\n"); ++ pr_warn("Failed to enable irq remapping. You are vulnerable to irq-injection attacks.\n"); + + return -1; + } +-- +1.8.1.4 + diff --git a/freed-ora/current/master/iwlwifi-fix-freeing-uninitialized-pointer.patch b/freed-ora/current/master/iwlwifi-fix-freeing-uninitialized-pointer.patch deleted file mode 100644 index 90e6b6f64..000000000 --- a/freed-ora/current/master/iwlwifi-fix-freeing-uninitialized-pointer.patch +++ /dev/null @@ -1,51 +0,0 @@ -If on iwl_dump_nic_event_log() error occurs before that function -initialize buf, we process uninitiated pointer in -iwl_dbgfs_log_event_read() and can hit "BUG at mm/slub.c:3409" - -Resolves: -https://bugzilla.redhat.com/show_bug.cgi?id=951241 - -Reported-by: ian.odette@eprize.com -Cc: stable@vger.kernel.org -Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> ---- -Patch is only compile tested, but I'm sure it fixes the problem. - - drivers/net/wireless/iwlwifi/dvm/debugfs.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c -index 7b8178b..cb6dd58 100644 ---- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c -+++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c -@@ -2237,15 +2237,15 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file, - size_t count, loff_t *ppos) - { - struct iwl_priv *priv = file->private_data; -- char *buf; -- int pos = 0; -- ssize_t ret = -ENOMEM; -+ char *buf = NULL; -+ ssize_t ret; - -- ret = pos = iwl_dump_nic_event_log(priv, true, &buf, true); -- if (buf) { -- ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); -- kfree(buf); -- } -+ ret = iwl_dump_nic_event_log(priv, true, &buf, true); -+ if (ret < 0) -+ goto err; -+ ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret); -+err: -+ kfree(buf); - return ret; - } - --- -1.7.11.7 - --- -To unsubscribe from this list: send the line "unsubscribe linux-wireless" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html
\ No newline at end of file diff --git a/freed-ora/current/master/kernel.spec b/freed-ora/current/master/kernel.spec index 113805413..7fb54730e 100644 --- a/freed-ora/current/master/kernel.spec +++ b/freed-ora/current/master/kernel.spec @@ -68,7 +68,7 @@ Summary: The Linux kernel # base_sublevel is the kernel version we're starting with and patching # on top of -- for example, 3.1-rc7-git1 starts with a 3.0 base, # which yields a base_sublevel of 0. -%define base_sublevel 9 +%define base_sublevel 10 # librev starts empty, then 1, etc, as the linux-libre tarball # changes. This is only used to determine which tarball to use. @@ -131,7 +131,7 @@ Summary: The Linux kernel # The next upstream release sublevel (base_sublevel+1) %define upstream_sublevel %(echo $((%{base_sublevel} + 1))) # The rc snapshot level -%define rcrev 8 +%define rcrev 0 # The git snapshot level %define gitrev 0 # Set rpm version accordingly @@ -152,7 +152,7 @@ Summary: The Linux kernel %define with_up %{?_without_up: 0} %{?!_without_up: 1} # kernel-smp (only valid for ppc 32-bit) %define with_smp %{?_without_smp: 0} %{?!_without_smp: 1} -# kernel-PAE (only valid for i686) +# kernel PAE (only valid for i686 (PAE) and ARM (lpae)) %define with_pae %{?_without_pae: 0} %{?!_without_pae: 1} # kernel-debug %define with_debug %{?_without_debug: 0} %{?!_without_debug: 1} @@ -172,10 +172,6 @@ Summary: The Linux kernel %define with_bootwrapper %{?_without_bootwrapper: 0} %{?!_without_bootwrapper: 1} # Want to build a the vsdo directories installed %define with_vdso_install %{?_without_vdso_install: 0} %{?!_without_vdso_install: 1} -# ARM Cortex-A15 support with LPAE and HW Virtualisation -%define with_lpae %{?_without_lpae: 0} %{?!_without_lpae: 1} -# kernel-tegra (only valid for arm) -%define with_tegra %{?_without_tegra: 0} %{?!_without_tegra: 1} # # Additional options for user-friendly one-off kernel building: # @@ -191,6 +187,9 @@ Summary: The Linux kernel # should we do C=1 builds with sparse %define with_sparse %{?_with_sparse: 1} %{?!_with_sparse: 0} # +# Cross compile requested? +%define with_cross %{?_with_cross: 1} %{?!_with_cross: 0} +# # build a release kernel on rawhide %define with_release %{?_with_release: 1} %{?!_with_release: 0} @@ -285,17 +284,11 @@ Summary: The Linux kernel %endif %define debuginfodir /usr/lib/debug -# kernel-PAE is only built on i686. -%ifnarch i686 +# kernel PAE is only built on i686 and ARMv7. +%ifnarch i686 armv7hl %define with_pae 0 %endif -# kernel up (unified kernel target), unified LPAE, tegra are only built on armv7 hfp -%ifnarch armv7hl -%define with_lpae 0 -%define with_tegra 0 -%endif - # if requested, only build base kernel %if %{with_baseonly} %define with_smp 0 @@ -333,7 +326,7 @@ Summary: The Linux kernel %if %{with_vdso_install} # These arches install vdso/ directories. -%define vdso_arches %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x +%define vdso_arches %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x aarch64 %endif # Overrides for generic default options @@ -378,6 +371,7 @@ Summary: The Linux kernel %ifarch %{all_x86} %define asmarch x86 %define hdrarch i386 +%define pae PAE %define all_arch_configs kernel-%{version}-i?86*.config %define image_install_path boot %define kernel_image arch/x86/boot/bzImage @@ -425,8 +419,11 @@ Summary: The Linux kernel %define image_install_path boot %define asmarch arm %define hdrarch arm +%define pae lpae %define make_target bzImage %define kernel_image arch/arm/boot/zImage +# http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/091404.html +%define kernel_mflags KALLSYMS_EXTRA_PASS=1 # we only build headers/perf/tools on the base arm arches # just like we used to only build them on i386 for x86 %ifnarch armv7hl @@ -436,6 +433,15 @@ Summary: The Linux kernel %endif %endif +%ifarch aarch64 +%define all_arch_configs kernel-%{version}-arm64.config +%define asmarch arm64 +%define hdrarch arm64 +%define make_target Image.gz +%define kernel_image arch/arm64/boot/Image.gz +%define image_install_path boot +%endif + # Should make listnewconfig fail if there's config options # printed out? %if %{nopatches}%{using_upstream_branch} @@ -469,7 +475,7 @@ Summary: The Linux kernel %endif # Architectures we build tools/cpupower on -%define cpupowerarchs %{ix86} x86_64 ppc ppc64 ppc64p7 %{arm} +%define cpupowerarchs %{ix86} x86_64 ppc ppc64 ppc64p7 %{arm} aarch64 # # Three sets of minimum package version requirements in the form of Conflicts: @@ -498,8 +504,8 @@ Summary: The Linux kernel # Packages that need to be installed before the kernel is, because the %%post # scripts use them. # -%define kernel_prereq fileutils, module-init-tools >= 3.16-4, initscripts >= 8.11.1-1, grubby >= 8.3-1 -%define initrd_prereq dracut >= 001-7 +%define kernel_prereq fileutils, module-init-tools >= 3.16-4, initscripts >= 8.11.1-1, systemd >= 203-2 +%define initrd_prereq dracut >= 027 # # This macro does requires, provides, conflicts, obsoletes for a kernel package. @@ -528,13 +534,16 @@ Provides: kernel-omap\ Provides: kernel-libre-nomap\ Provides: kernel-omap-uname-r = %{KVERREL}%{?1:.%{1}}\ Provides: kernel-libre-omap-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-tegra\ +Provides: kernel-libre-tegra\ +Provides: kernel-tegra-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-libre-tegra-uname-r = %{KVERREL}%{?1:.%{1}}\ Requires(pre): %{kernel_prereq}\ Requires(pre): %{initrd_prereq}\ %if %{with_firmware}\ Requires(pre): kernel-libre-firmware >= %{rpmversion}-%{pkg_release}\ %endif\ -Requires(post): /sbin/new-kernel-pkg\ -Requires(preun): /sbin/new-kernel-pkg\ +Requires(preun): systemd >= 200\ Conflicts: %{kernel_dot_org_conflicts}\ Conflicts: %{package_conflicts}\ %{expand:%%{?kernel%{?1:_%{1}}_conflicts:Conflicts: %%{kernel%{?1:_%{1}}_conflicts}}}\ @@ -555,7 +564,7 @@ Version: %{rpmversion} Release: %{pkg_release} # DO NOT CHANGE THE 'ExclusiveArch' LINE TO TEMPORARILY EXCLUDE AN ARCHITECTURE BUILD. # SET %%nobuildarches (ABOVE) INSTEAD -ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x %{arm} +ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ppc64p7 s390 s390x %{arm} aarch64 ExclusiveOS: Linux %kernel_reqprovconf @@ -593,6 +602,11 @@ BuildRequires: openssl BuildRequires: pesign >= 0.10-4 %endif +%if %{with_cross} +BuildRequires: binutils-%{_build_arch}-linux-gnu, gcc-%{_build_arch}-linux-gnu +%define cross_opts CROSS_COMPILE=%{_build_arch}-linux-gnu- +%endif + Source0: http://linux-libre.fsfla.org/pub/linux-libre/freed-ora/src/linux%{?baselibre}-%{kversion}%{basegnu}.tar.xz # For documentation purposes only. @@ -631,11 +645,14 @@ Source54: config-powerpc64p7 Source70: config-s390x +Source100: config-arm-generic + # Unified ARM kernels -Source100: config-armv7-generic -Source101: config-armv7 -Source102: config-armv7-lpae -Source103: config-armv7-tegra +Source101: config-armv7-generic +Source102: config-armv7 +Source103: config-armv7-lpae + +Source110: config-arm64 # This file is intentionally left empty in the stock kernel. Its a nicety # added for those wanting to do custom rebuilds with altered config opts. @@ -700,7 +717,7 @@ Patch100: taint-vbox.patch Patch110: vmbugon-warnon.patch -Patch200: debug-bad-pte-dmi.patch +#atch200: debug-bad-pte-dmi.patch Patch201: debug-bad-pte-modules.patch Patch390: defaults-acpi-video.patch @@ -722,15 +739,14 @@ Patch800: crash-driver.patch # crypto/ # secure boot -Patch1000: devel-pekey-secure-boot-20130306.patch +Patch1000: devel-pekey-secure-boot-20130502.patch # virt + ksm patches # DRM #atch1700: drm-edid-try-harder-to-fix-up-broken-headers.patch #Patch1800: drm-vgem.patch -Patch1700: drm-ttm-exports-for-qxl.patch -Patch1701: drm-qxl-driver.patch + # nouveau + drm fixes # intel drm is all merged upstream Patch1824: drm-intel-next.patch @@ -760,21 +776,25 @@ Patch14000: hibernate-freeze-filesystems.patch Patch14010: lis3-improve-handling-of-null-rate.patch +Patch15000: nowatchdog-on-virt.patch + +# ARM64 + +Patch16000: arm64-makefile-vdso_install.patch # ARM -Patch21000: arm-export-read_current_timer.patch -# https://lists.ozlabs.org/pipermail/devicetree-discuss/2013-March/029029.html -Patch21001: arm-of-dma.patch # lpae -Patch21002: arm-lpae-ax88796.patch +Patch21001: arm-lpae-ax88796.patch +Patch21002: drm-exynos-fix-multiple-definition-build-error.patch + +Patch21003: v2-thermal-cpu_cooling-fix-stub-function.patch # ARM omap -Patch21003: arm-omap-ehci-fix.patch +Patch21004: arm-omap-load-tfp410.patch # ARM tegra Patch21005: arm-tegra-usb-no-reset-linux33.patch -Patch21006: arm-tegra-fixclk.patch #rhbz 754518 Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch @@ -788,16 +808,6 @@ Patch21242: criu-no-expert.patch #rhbz 892811 Patch21247: ath9k_rx_dma_stop_check.patch -#rhbz 903192 -Patch21261: 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch - -#rhbz 856863 892599 -Patch21273: cfg80211-mac80211-disconnect-on-suspend.patch -Patch21274: mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch - -#rhbz 859282 -Patch21275: VMX-x86-handle-host-TSC-calibration-failure.patch - Patch22000: weird-root-dentry-name-debug.patch #selinux ptrace child permissions @@ -806,16 +816,38 @@ Patch22001: selinux-apply-different-permission-to-ptrace-child.patch #rhbz 927469 Patch23006: fix-child-thread-introspection.patch -#rhbz 928024 -Patch23008: forcedeth-dma-error-check.patch +#rhbz 948262 +Patch25024: intel_iommu-Downgrade-the-warning-if-enabling-irq-remapping-fails.patch + +#CVE-2013-2140 rhbz 971146 971148 +Patch25031: xen-blkback-Check-device-permissions-before-allowing.patch + +#CVE-2013-2147 rhbz 971242 971249 +Patch25032: cve-2013-2147-ciss-info-leak.patch + +#CVE-2013-2148 rhbz 971258 971261 +Patch25033: fanotify-info-leak-in-copy_event_to_user.patch -#rhbz 919176 -Patch25010: wireless-regulatory-fix-channel-disabling-race-condition.patch +#CVE-2013-2851 rhbz 969515 971662 +Patch25035: block-do-not-pass-disk-names-as-format-strings.patch -#rhbz 951241 -Patch25011: iwlwifi-fix-freeing-uninitialized-pointer.patch +#CVE-2013-2164 rhbz 973100 973109 +Patch25038: cdrom-use-kzalloc-for-failing-hardware.patch -Patch25014: blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch +#rhbz 969644 +Patch25046: KVM-x86-handle-idiv-overflow-at-kvm_write_tsc.patch + +Patch25047: drm-radeon-Disable-writeback-by-default-on-ppc.patch + +#rhbz 903741 +Patch25052: HID-input-return-ENODATA-if-reading-battery-attrs-fails.patch + +#rhbz 880035 +Patch25053: bridge-only-expire-the-mdb-entry-when-query-is-received.patch +Patch25054: bridge-send-query-as-soon-as-leave-is-received.patch + +#rhbz 977558 +Patch25055: ath3k-dont-use-stack-memory-for-DMA.patch # END OF PATCH DEFINITIONS @@ -1095,13 +1127,21 @@ Install the kernel-libre-smp package if your machine uses two or more CPUs. +%ifnarch armv7hl %define variant_summary The Linux kernel compiled for PAE capable machines -%kernel_variant_package PAE -%description PAE +%kernel_variant_package %{pae} +%description %{pae} This package includes a version of the Linux kernel with support for up to 64GB of high memory. It requires a CPU with Physical Address Extensions (PAE). The non-PAE kernel can only address up to 4GB of memory. Install the kernel-PAE package if your machine has more than 4GB of memory. +%else +%define variant_summary The Linux kernel compiled for Cortex-A15 +%kernel_variant_package %{pae} +%description %{pae} +This package includes a version of the Linux kernel with support for +Cortex-A15 devices with LPAE and HW virtualisation support +%endif The kernel-libre-PAE package is the upstream kernel without the non-Free blobs it includes by default. @@ -1109,9 +1149,9 @@ non-Free blobs it includes by default. %define variant_summary The Linux kernel compiled with extra debugging enabled for PAE capable machines -%kernel_variant_package PAEdebug +%kernel_variant_package %{pae}debug Obsoletes: kernel-PAE-debug -%description PAEdebug +%description %{pae}debug This package includes a version of the Linux kernel with support for up to 64GB of high memory. It requires a CPU with Physical Address Extensions (PAE). The non-PAE kernel can only address up to 4GB of memory. @@ -1140,18 +1180,6 @@ on kernel bugs, as some of these options impact performance noticably. The kernel-libre-debug package is the upstream kernel without the non-Free blobs it includes by default. -%define variant_summary The Linux kernel compiled for Cortex-A15 -%kernel_variant_package lpae -%description lpae -This package includes a version of the Linux kernel with support for -Cortex-A15 devices with LPAE and HW virtualisation support - -%define variant_summary The Linux kernel compiled for tegra boards -%kernel_variant_package tegra -%description tegra -This package includes a version of the Linux kernel with support for -nvidia tegra based systems, i.e., trimslice, ac-100. - %prep # do a few sanity-checks for --with *only builds @@ -1398,14 +1426,12 @@ make -f %{SOURCE19} config-release make -f %{SOURCE20} VERSION=%{version} configs # Merge in any user-provided local config option changes -%if %{?all_arch_configs:1}%{!?all_arch_configs:0} -for i in %{all_arch_configs} +for i in kernel-%{version}-*.config do mv $i $i.tmp ./merge.pl %{SOURCE1000} $i.tmp > $i rm $i.tmp done -%endif ApplyPatch makefile-after_link.patch @@ -1426,21 +1452,23 @@ ApplyPatch taint-vbox.patch ApplyPatch vmbugon-warnon.patch -ApplyPatch debug-bad-pte-dmi.patch +#plyPatch debug-bad-pte-dmi.patch ApplyPatch debug-bad-pte-modules.patch # Architecture patches # x86(-64) +# ARM64 +ApplyPatch arm64-makefile-vdso_install.patch + # # ARM # -ApplyPatch arm-export-read_current_timer.patch -ApplyPatch arm-of-dma.patch ApplyPatch arm-lpae-ax88796.patch -ApplyPatch arm-omap-ehci-fix.patch +ApplyPatch drm-exynos-fix-multiple-definition-build-error.patch +ApplyPatch arm-omap-load-tfp410.patch +ApplyPatch v2-thermal-cpu_cooling-fix-stub-function.patch ApplyPatch arm-tegra-usb-no-reset-linux33.patch -ApplyPatch arm-tegra-fixclk.patch # # bugfixes to drivers and filesystems @@ -1506,13 +1534,11 @@ ApplyPatch crash-driver.patch # crypto/ # secure boot -ApplyPatch devel-pekey-secure-boot-20130306.patch +ApplyPatch devel-pekey-secure-boot-20130502.patch # Assorted Virt Fixes # DRM core -ApplyPatch drm-ttm-exports-for-qxl.patch -ApplyPatch drm-qxl-driver.patch #ApplyPatch drm-edid-try-harder-to-fix-up-broken-headers.patch #ApplyPatch drm-vgem.patch @@ -1543,6 +1569,9 @@ ApplyPatch efi-dont-map-boot-services-on-32bit.patch ApplyPatch lis3-improve-handling-of-null-rate.patch +# Disable watchdog on virtual machines. +ApplyPatch nowatchdog-on-virt.patch + #rhbz 754518 ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch @@ -1560,29 +1589,41 @@ ApplyPatch criu-no-expert.patch #rhbz 892811 ApplyPatch ath9k_rx_dma_stop_check.patch -#rhbz 903192 -ApplyPatch 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch +#rhbz 927469 +ApplyPatch fix-child-thread-introspection.patch + +#rhbz 948262 +ApplyPatch intel_iommu-Downgrade-the-warning-if-enabling-irq-remapping-fails.patch -#rhbz 856863 892599 -ApplyPatch cfg80211-mac80211-disconnect-on-suspend.patch -ApplyPatch mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch +#CVE-2013-2140 rhbz 971146 971148 +ApplyPatch xen-blkback-Check-device-permissions-before-allowing.patch -#rhbz 859282 -ApplyPatch VMX-x86-handle-host-TSC-calibration-failure.patch +#CVE-2013-2147 rhbz 971242 971249 +ApplyPatch cve-2013-2147-ciss-info-leak.patch -#rhbz 927469 -ApplyPatch fix-child-thread-introspection.patch +#CVE-2013-2148 rhbz 971258 971261 +ApplyPatch fanotify-info-leak-in-copy_event_to_user.patch + +#CVE-2013-2851 rhbz 969515 971662 +ApplyPatch block-do-not-pass-disk-names-as-format-strings.patch + +#CVE-2013-2164 rhbz 973100 973109 +ApplyPatch cdrom-use-kzalloc-for-failing-hardware.patch + +#rhbz 969644 +ApplyPatch KVM-x86-handle-idiv-overflow-at-kvm_write_tsc.patch -#rhbz 928024 -ApplyPatch forcedeth-dma-error-check.patch +ApplyPatch drm-radeon-Disable-writeback-by-default-on-ppc.patch -#rhbz 919176 -ApplyPatch wireless-regulatory-fix-channel-disabling-race-condition.patch +#rhbz 903741 +ApplyPatch HID-input-return-ENODATA-if-reading-battery-attrs-fails.patch -#rhbz 951241 -ApplyPatch iwlwifi-fix-freeing-uninitialized-pointer.patch +#rhbz 880035 +ApplyPatch bridge-only-expire-the-mdb-entry-when-query-is-received.patch +ApplyPatch bridge-send-query-as-soon-as-leave-is-received.patch -ApplyPatch blkcg-fix-scheduling-while-atomic-in-blk_queue_bypass_start.patch +#rhbz 977558 +ApplyPatch ath3k-dont-use-stack-memory-for-DMA.patch # END OF PATCH APPLICATIONS @@ -1604,6 +1645,8 @@ mkdir configs rm -f kernel-%{version}-*debug.config %endif +%define make make %{?cross_opts} + # now run oldconfig over all the config files for i in *.config do @@ -1710,18 +1753,15 @@ BuildKernel() { echo USING ARCH=$Arch make -s ARCH=$Arch oldnoconfig >/dev/null -%ifarch %{arm} - # http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/091404.html - make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags} KALLSYMS_EXTRA_PASS=1 + %{make} -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags} %{?kernel_mflags} + %{make} -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1 - make -s ARCH=$Arch V=1 dtbs +%ifarch %{arm} + %{make} -s ARCH=$Arch V=1 dtbs mkdir -p $RPM_BUILD_ROOT/%{image_install_path}/dtb-$KernelVer install -m 644 arch/arm/boot/dts/*.dtb $RPM_BUILD_ROOT/boot/dtb-$KernelVer/ rm -f arch/arm/boot/dts/*.dtb -%else - make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags} %endif - make -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1 # Start installing the results %if %{with_debuginfo} @@ -1756,10 +1796,10 @@ BuildKernel() { mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer # Override $(mod-fw) because we don't want it to install any firmware # we'll get it from the linux-firmware package and we don't want conflicts - make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw= + %{make} -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=$KernelVer mod-fw= %ifarch %{vdso_arches} - make -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer + %{make} -s ARCH=$Arch INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=$KernelVer if [ ! -s ldconfig-kernel.conf ]; then echo > ldconfig-kernel.conf "\ # Placeholder file, no vDSO hwcap entries used in this kernel." @@ -1865,18 +1905,13 @@ BuildKernel() { 'drm_crtc_init' # detect missing or incorrect license tags - rm -f modinfo - while read i - do - echo -n "${i#$RPM_BUILD_ROOT/lib/modules/$KernelVer/} " >> modinfo - /sbin/modinfo -l $i >> modinfo - done < modnames - - grep -E -v \ - 'GPL( v2)?$|Dual BSD/GPL$|Dual MPL/GPL$|GPL and additional rights$' \ - modinfo && exit 1 + ( find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name '*.ko' | xargs /sbin/modinfo -l | \ + grep -E -v 'GPL( v2)?$|Dual BSD/GPL$|Dual MPL/GPL$|GPL and additional rights$' ) && exit 1 - rm -f modinfo modnames + # remove files that will be auto generated by depmod at rpm -i time + pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/ + rm -f modules.{alias*,builtin.bin,dep*,*map,symbols*,devname,softdep} + popd # Call the modules-extra script to move things around %{SOURCE17} $RPM_BUILD_ROOT/lib/modules/$KernelVer %{SOURCE16} @@ -1887,12 +1922,6 @@ BuildKernel() { cp signing_key.x509 signing_key.x509.sign${Flav} %endif - # remove files that will be auto generated by depmod at rpm -i time - for i in alias alias.bin builtin.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap devname softdep - do - rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.$i - done - # Move the devel headers out of the root file system mkdir -p $RPM_BUILD_ROOT/usr/src/kernels mv $RPM_BUILD_ROOT/lib/modules/$KernelVer/build $RPM_BUILD_ROOT/$DevelDir @@ -1923,19 +1952,11 @@ BuildKernel %make_target %kernel_image debug %endif %if %{with_pae_debug} -BuildKernel %make_target %kernel_image PAEdebug +BuildKernel %make_target %kernel_image %{pae}debug %endif %if %{with_pae} -BuildKernel %make_target %kernel_image PAE -%endif - -%if %{with_lpae} -BuildKernel %make_target %kernel_image lpae -%endif - -%if %{with_tegra} -BuildKernel %make_target %kernel_image tegra +BuildKernel %make_target %kernel_image %{pae} %endif %if %{with_up} @@ -1947,7 +1968,7 @@ BuildKernel %make_target %kernel_image smp %endif %global perf_make \ - make %{?_smp_mflags} -C tools/perf -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} + make -s %{?cross_opts} %{?_smp_mflags} -C tools/perf V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} %if %{with_perf} # perf %{perf_make} all @@ -1959,23 +1980,23 @@ BuildKernel %make_target %kernel_image smp # cpupower # make sure version-gen.sh is executable. chmod +x tools/power/cpupower/utils/version-gen.sh -make %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false +%{make} %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false %ifarch %{ix86} pushd tools/power/cpupower/debug/i386 - make %{?_smp_mflags} centrino-decode powernow-k8-decode + %{make} %{?_smp_mflags} centrino-decode powernow-k8-decode popd %endif %ifarch x86_64 pushd tools/power/cpupower/debug/x86_64 - make %{?_smp_mflags} centrino-decode powernow-k8-decode + %{make} %{?_smp_mflags} centrino-decode powernow-k8-decode popd %endif %ifarch %{ix86} x86_64 pushd tools/power/x86/x86_energy_perf_policy/ - make + %{make} popd pushd tools/power/x86/turbostat - make + %{make} popd %endif #turbostat/x86_energy_perf_policy %endif @@ -2004,13 +2025,13 @@ find Documentation -type d | xargs chmod u+w %define __modsign_install_post \ if [ "%{signmodules}" -eq "1" ]; then \ if [ "%{with_pae}" -ne "0" ]; then \ - %{modsign_cmd} signing_key.priv.sign.PAE signing_key.x509.sign.PAE $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAE/ \ + %{modsign_cmd} signing_key.priv.sign.%{pae} signing_key.x509.sign.%{pae} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.%{pae}/ \ fi \ if [ "%{with_debug}" -ne "0" ]; then \ %{modsign_cmd} signing_key.priv.sign.debug signing_key.x509.sign.debug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.debug/ \ fi \ if [ "%{with_pae_debug}" -ne "0" ]; then \ - %{modsign_cmd} signing_key.priv.sign.PAEdebug signing_key.x509.sign.PAEdebug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAEdebug/ \ + %{modsign_cmd} signing_key.priv.sign.%{pae}debug signing_key.x509.sign.%{pae}debug $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.%{pae}debug/ \ fi \ if [ "%{with_up}" -ne "0" ]; then \ %{modsign_cmd} signing_key.priv.sign signing_key.x509.sign $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \ @@ -2094,11 +2115,6 @@ find $RPM_BUILD_ROOT/usr/include \ \( -name .install -o -name .check -o \ -name ..install.cmd -o -name ..check.cmd \) | xargs rm -f -# glibc provides scsi headers for itself, for now -rm -rf $RPM_BUILD_ROOT/usr/include/scsi -rm -f $RPM_BUILD_ROOT/usr/include/asm*/atomic.h -rm -f $RPM_BUILD_ROOT/usr/include/asm*/io.h -rm -f $RPM_BUILD_ROOT/usr/include/asm*/irq.h %endif %if %{with_perf} @@ -2114,7 +2130,7 @@ rm -f $RPM_BUILD_ROOT/usr/include/asm*/irq.h %if %{with_tools} %ifarch %{cpupowerarchs} -make -C tools/power/cpupower DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install +%{make} -C tools/power/cpupower DESTDIR=$RPM_BUILD_ROOT libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install rm -f %{buildroot}%{_libdir}/*.{a,la} %find_lang cpupower mv cpupower.lang ../ @@ -2208,8 +2224,7 @@ fi\ # %define kernel_variant_posttrans() \ %{expand:%%posttrans %{?1}}\ -/sbin/new-kernel-pkg --package kernel-libre%{?-v:-%{-v*}} --mkinitrd --dracut --depmod --update %{KVERREL}%{?-v:.%{-v*}} || exit $?\ -/sbin/new-kernel-pkg --package kernel-libre%{?1:-%{1}} --rpmposttrans %{KVERREL}%{?1:.%{1}} || exit $?\ +/bin/kernel-install add %{KVERREL}%{?1:.%{1}} /%{image_install_path}/vmlinuz-%{KVERREL}%{?1:.%{1}} || exit $?\ %{nil} # @@ -2227,9 +2242,6 @@ if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&\ [ -f /etc/sysconfig/kernel ]; then\ /bin/sed -r -i -e 's/^DEFAULTKERNEL=%{-r*}$/DEFAULTKERNEL=kernel-libre%{?-v:-%{-v*}}/' /etc/sysconfig/kernel || exit $?\ fi}\ -%{expand:\ -/sbin/new-kernel-pkg --package kernel-libre%{?-v:-%{-v*}} --install %{KVERREL}%{?-v:.%{-v*}} || exit $?\ -}\ %{nil} # @@ -2238,7 +2250,7 @@ fi}\ # %define kernel_variant_preun() \ %{expand:%%preun %{?1}}\ -/sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}%{?1:.%{1}} || exit $?\ +/bin/kernel-install remove %{KVERREL}%{?1:.%{1}} /%{image_install_path}/vmlinuz-%{KVERREL}%{?1:.%{1}} || exit $?\ %{nil} %kernel_variant_preun @@ -2247,21 +2259,15 @@ fi}\ %kernel_variant_preun smp %kernel_variant_post -v smp -%kernel_variant_preun PAE -%kernel_variant_post -v PAE -r (kernel|kernel-smp) +%kernel_variant_preun %{pae} +%kernel_variant_post -v %{pae} -r (kernel|kernel-smp) + +%kernel_variant_post -v %{pae}debug -r (kernel|kernel-smp) +%kernel_variant_preun %{pae}debug %kernel_variant_preun debug %kernel_variant_post -v debug -%kernel_variant_post -v PAEdebug -r (kernel|kernel-smp) -%kernel_variant_preun PAEdebug - -%kernel_variant_preun lpae -%kernel_variant_post -v lpae - -%kernel_variant_preun tegra -%kernel_variant_post -v tegra - if [ -x /sbin/ldconfig ] then /sbin/ldconfig -X || exit $? @@ -2410,10 +2416,8 @@ fi %kernel_variant_files %{with_up} %kernel_variant_files %{with_smp} smp %kernel_variant_files %{with_debug} debug -%kernel_variant_files %{with_pae} PAE -%kernel_variant_files %{with_pae_debug} PAEdebug -%kernel_variant_files %{with_lpae} lpae -%kernel_variant_files %{with_tegra} tegra +%kernel_variant_files %{with_pae} %{pae} +%kernel_variant_files %{with_pae_debug} %{pae}debug # plz don't put in a version string unless you're going to tag # and build. @@ -2428,6 +2432,334 @@ fi # ||----w | # || || %changelog +* Mon Jul 1 2013 Alexandre Oliva <lxoliva@fsfla.org> -libre +- GNU Linux-libre 3.10-gnu. + +* Mon Jul 01 2013 Justin M. Forbes <jforbes@redhat.com> - 3.10-1 +- Linux v3.10 + +* Fri Jun 28 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Only enable ARM A15 errata on the LPAE kernel as it breaks A8 + +* Thu Jun 27 2013 Josh Boyer <jwboyer@redhat.com> +- Fix stack memory usage for DMA in ath3k (rhbz 977558) + +* Wed Jun 26 2013 Josh Boyer <jwboyer@redhat.com> +- Add two patches to fix bridge networking issues (rhbz 880035) + +* Mon Jun 24 2013 Josh Boyer <jwboyer@redhat.com> +- Fix battery issue with bluetooth keyboards (rhbz 903741) + +* Mon Jun 24 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc7.git0.1 +- Linux v3.10-rc7 +- Disable debugging options. + +* Tue Jun 18 2013 Dave Jones <davej@redhat.com> +- Disable MTRR sanitizer by default. + +* Tue Jun 18 2013 Justin M. Forbes <jforbes@redhat.com> - 3.10.0-0.rc6.git0.4 +- Testing the test harness + +* Tue Jun 18 2013 Justin M. Forbes <jforbes@redhat.com> - 3.10.0-0.rc6.git0.3 +- Reenable debugging options. + +* Mon Jun 17 2013 Josh Boyer <jwboyer@redhat.com> +- Add patch to fix radeon issues on powerpc + +* Mon Jun 17 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc6.git0.1 +- Linux v3.10-rc6 + +* Fri Jun 14 2013 Kyle McMartin <kyle@redhat.com> +- ARM64 support (config-arm64) + Split out some config-armv7-generic options common between 32-bit and 64-bit + ARM into a new config-arm-generic, and use that as a base for + both. + Buildable in rawhide, and F-19 by installing {gcc,binutils}-aarch64-linux-gnu + and running: + rpmbuild --rebuild --target $ARCH --with cross --without perf \ + --without tools --without debuginfo --define "_arch aarch64" \ + --define "_build_arch aarch64" \ + --define "__strip /usr/bin/aarch64-linux-gnu-strip" kernel*.src.rpm + As rpm in F-19 doesn't have aarch64-linux macros yet. + +* Thu Jun 13 2013 Kyle McMartin <kyle@redhat.com> +- Introduce infrastructure for cross-compiling Fedora kernels. Intended to + assist building for secondary architectures like ppc64, s390x, and arm. + To use, create an .src.rpm using "fedpkg srpm" and then run + "rpmbuild --rebuild --target t --with cross --without perf --without tools \ + kernel*.src.rpm" to cross compile. This requires binutils and gcc + packages named like %_target_cpu, which all but powerpc64 currently provides + in rawhide/F-19. Can't (currently) cross compile perf or kernel-tools, since + libc is missing from the cross environment. + +* Thu Jun 13 2013 Kyle McMartin <kyle@redhat.com> +- arm-export-read_current_timer.patch: drop upstream patch + (results in duplicate exports) + +* Wed Jun 12 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor ARM config updates + +* Wed Jun 12 2013 Kyle McMartin <kmcmarti@redhat.com> +- Merge %{with_pae} and %{with_lpae} so both ARM and i686 use the same + flavours. Set %{pae} to the flavour name {lpae, PAE}. Merging + the descriptions would be nice, but is somewhat irrelevant... + +* Wed Jun 12 2013 Josh Boyer <jwboyer@redhat.com> +- Fix KVM divide by zero error (rhbz 969644) +- Add fix for rt5390/rt3290 regression (rhbz 950735) + +* Tue Jun 11 2013 Dave Jones <davej@redhat.com> +- Disable soft lockup detector on virtual machines. (rhbz 971139) + +* Tue Jun 11 2013 Josh Boyer <jwboyer@redhat.com> +- Add patches to fix MTRR issues in 3.9.5 (rhbz 973185) +- Add two patches to fix issues with vhost_net and macvlan (rhbz 954181) + +* Tue Jun 11 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc5.git0.1 +- Linux v3.10-rc5 +- CVE-2013-2164 information leak in cdrom driver (rhbz 973100 973109) + +* Mon Jun 10 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Enable Freescale i.MX platforms and initial config + +* Fri Jun 07 2013 Josh Boyer <jwboyer@redhat.com> +- CVE-2013-2851 block: passing disk names as format strings (rhbz 969515 971662) +- CVE-2013-2852 b43: format string leaking into error msgs (rhbz 969518 971665) + +* Thu Jun 06 2013 Josh Boyer <jwboyer@redhat.com> +- CVE-2013-2148 fanotify: info leak in copy_event_to_user (rhbz 971258 971261) +- CVE-2013-2147 cpqarray/cciss: information leak via ioctl (rhbz 971242 971249) + +* Wed Jun 05 2013 Josh Boyer <jwboyer@redhat.com> +- CVE-2013-2140 xen: blkback: insufficient permission checks for BLKIF_OP_DISCARD (rhbz 971146 971148) + +* Tue Jun 04 2013 Dave Jones <davej@redhat.com> - 3.10.0-0.rc4.git0.1 +- 3.10-rc4 + merged: radeon-use-max_bus-speed-to-activate-gen2-speeds.patch + merged: iscsi-target-fix-heap-buffer-overflow-on-error.patch + +* Mon Jun 03 2013 Josh Boyer <jwboyer@redhat.com> +- Fix UEFI anti-bricking code (rhbz 964335) + +* Mon Jun 3 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor ARM config changes + +* Sun Jun 2 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Add patch to fix DRM/X on omap (panda) +- Enable Cortex-A8 errata on multiplatform kernels (omap3) +- Minor ARM config updates + +* Fri May 31 2013 Josh Boyer <jwboyer@redhat.com> +- CVE-2013-2850 iscsi-target: heap buffer overflow on large key error (rhbz 968036 969272) + +* Thu May 30 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor ARM config update for tegra (AC100) + +* Mon May 27 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc3.git0.1 +- Linux v3.10-rc3 +- Disable debugging options. + +* Mon May 27 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor ARM updates + +* Fri May 24 2013 Josh Boyer <jwboyer@redhat.com> +- Add patch to quiet irq remapping failures (rhbz 948262) + +* Fri May 24 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc2.git3.1 +- Linux v3.10-rc2-328-g0e255f1 + +* Fri May 24 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc2.git2.1 +- Linux v3.10-rc2-221-g514e250 + +* Thu May 23 2013 Kyle McMartin <kyle@redhat.com> +- Fix modules.* removal from /lib/modules/$KernelVer + +* Thu May 23 2013 Josh Boyer <jwboyer@redhat.com> +- Fix oops from incorrect rfkill set in hp-wmi (rhbz 964367) + +* Wed May 22 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc2.git1.1 +- Linux v3.10-rc2-68-gbb3ec6b +- Reenable debugging options. + +* Tue May 21 2013 Kyle McMartin <kyle@redhat.com> +- Rewrite the modinfo license check to generate significantly less noise in + build logs. +- Ditto for the modules.* removal (and move it earlier, as pointed out by jwb) + +* Tue May 21 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Enable OMAP5 on ARM multiplatform + +* Tue May 21 2013 Kyle McMartin <kyle@redhat.com> - 3.10.0-0.rc2.git0.2 +- Disable debugging options. + +* Mon May 20 2013 Kyle McMartin <kyle@redhat.com> - 3.10.0-0.rc2.git0.1 +- Linux v3.10-rc2 +- Disable debugging options + +* Mon May 20 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor ARM update + +* Mon May 20 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git7.1 +- Linux v3.10-rc1-369-g343cd4f + +* Fri May 17 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git6.1 +- Linux v3.10-rc1-266-gec50f2a + +* Thu May 16 2013 Josh Boyer <jwboyer@redhat.com> +- Enable memory cgroup swap accounting (rhbz 918951) +- Fix config-local usage (rhbz 950841) + +* Wed May 15 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git5.1 +- Linux v3.10-rc1-185-gc240a53 + +* Wed May 15 2013 Josh Boyer <jwboyer@redhat.com> +- Add patch from Harald Hoyer to migrate to using kernel-install + +* Wed May 15 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git4.1 +- Linux v3.10-rc1-120-gb973425 + +* Tue May 14 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git3.1 +- Linux v3.10-rc1-113-ga2c7a54 + +* Tue May 14 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git2.1 +- Linux v3.10-rc1-79-gdbbffe6 + +* Mon May 13 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git1.1 +- Linux v3.10-rc1-34-g1f63876 + +* Mon May 13 2013 Josh Boyer <jwboyer@redhat.com> +- Add radeon fixes for PCI-e gen2 speed issues (rhbz 961527) + +* Mon May 13 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git0.2 +- Reenable debugging options. + +* Mon May 13 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc1.git0.1 +- Linux v3.10-rc1 +- Disable debugging options. + +* Sat May 11 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Another patch to fix ARM kernel build + +* Fri May 10 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Add patch to fix exynosdrm build, drop old tegra patches, minor config updates + +* Fri May 10 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git26.1 +- Linux v3.9-12555-g2dbd3ca + +* Fri May 10 2013 Josh Boyer <jwboyer@redhat.com> +- Enable RTLWIFI_DEBUG in debug kernels (rhbz 889425) +- Switch the loop driver to a module and change to doing on-demand creation + (rhbz 896160) +- Disable CRYPTOLOOP as F18 util-linux is the last to support it (rhbz 896160) + +* Fri May 10 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git25.1 +- Linux v3.9-12316-g70eba42 + +* Thu May 09 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git24.1 +- Linux v3.9-12070-g8cbc95e + +* Thu May 9 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Enable DMA for ARM sound drivers + +* Thu May 09 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git23.1 +- Linux v3.9-11789-ge0fd9af + +* Wed May 8 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Enable RemoteProc drivers on ARM + +* Wed May 08 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git22.1 +- Linux v3.9-11572-g5af43c2 + +* Tue May 07 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git21.1 +- Linux v3.9-11485-gbb9055b + +* Tue May 07 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git20.1 +- Linux v3.9-10996-g0f47c94 + +* Tue May 07 2013 Josh Boyer <jwboyer@redhat.com> +- Fix dmesg_restrict patch to avoid regression (rhbz 952655) + +* Mon May 06 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git19.1 +- Linux v3.9-10936-g51a26ae + +* Mon May 6 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Enable TPS65217 (am33xx) and EC on ChromeOS devices + +* Mon May 06 2013 Josh Boyer <jwboyer@redhat.com> +- Don't remove headers explicitly exported via UAPI (rhbz 959467) + +* Mon May 06 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git18.1 +- Linux v3.9-10518-gd7ab730 + +* Mon May 06 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git17.1 +- Linux v3.9-10104-g1aaf6d3 + +* Sun May 5 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Update ARM config + +* Sat May 04 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git16.1 +- Linux v3.9-9472-g1db7722 + +* Fri May 03 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git15.1 +- Linux v3.9-9409-g8665218 + +* Fri May 03 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git14.1 +- Linux v3.9-8933-gce85722 + +* Fri May 3 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- ARM 3.10 merge and general cleanup +- Drop dedicated tegra kernel as now Multiplatform enabled +- Enable Tegra and UX500 (Snowball) in Multiplatform + +* Thu May 02 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git13.1 +- Linux v3.9-8153-g5a148af + +* Thu May 02 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git12.1 +- Linux v3.9-7992-g99c6bcf + +* Thu May 02 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git11.1 +- Linux v3.9-7391-g20b4fb4 + +* Wed May 01 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git10.1 +- Linux v3.9-5308-g8a72f38 + +* Wed May 01 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git9.1 +- Linux v3.9-5293-g823e75f + +* Wed May 1 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Minor ARM updates + +* Wed May 01 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git8.1 +- Linux v3.9-5165-g5f56886 + +* Tue Apr 30 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git7.1 +- Linux v3.9-4597-g8c55f14 + +* Tue Apr 30 2013 Peter Robinson <pbrobinson@fedoraproject.org> +- Enable CONFIG_SERIAL_8250_DW on ARM + +* Tue Apr 30 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git6.1 +- Linux v3.9-4516-gc9ef713 + +* Tue Apr 30 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git5.1 +- Linux v3.9-3520-g5a5a1bf + +* Tue Apr 30 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git4.1 +- Linux v3.9-3143-g56847d8 + +* Mon Apr 29 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git3.1 +- Linux v3.9-2154-gec25e24 + +* Mon Apr 29 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git2.1 +- Linux v3.9-332-g92ddcf4 + +* Mon Apr 29 2013 Josh Boyer <jwboyer@redhat.com> - 3.10.0-0.rc0.git1.1 +- Linux v3.9-84-g916bb6d7 +- Reenable debugging options. + +* Mon Apr 29 2013 Neil Horman <nhorman@redhat.com> +- Enable CONFIG_PACKET_DIAG (rhbz 956870) + * Mon Apr 29 2013 Alexandre Oliva <lxoliva@fsfla.org> -libre - GNU Linux-libre 3.9-gnu. diff --git a/freed-ora/current/master/linux-libre-3.10-gnu.tar.xz.sign b/freed-ora/current/master/linux-libre-3.10-gnu.tar.xz.sign new file mode 100644 index 000000000..247b36de9 --- /dev/null +++ b/freed-ora/current/master/linux-libre-3.10-gnu.tar.xz.sign @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.19 (GNU/Linux) + +iEYEABECAAYFAlHRnUgACgkQvLfPh359R6dCKwCdG4XyQc5aWM00sMviGqKjlwWv +2pwAnR8OAuVUk8Ce4p8395wWZ7eGX3ia +=fhcd +-----END PGP SIGNATURE----- diff --git a/freed-ora/current/master/linux-libre-3.10-gnu.xdelta.xz b/freed-ora/current/master/linux-libre-3.10-gnu.xdelta.xz Binary files differnew file mode 100644 index 000000000..5c363f141 --- /dev/null +++ b/freed-ora/current/master/linux-libre-3.10-gnu.xdelta.xz diff --git a/freed-ora/current/master/linux-libre-3.10-gnu.xdelta.xz.sign b/freed-ora/current/master/linux-libre-3.10-gnu.xdelta.xz.sign new file mode 100644 index 000000000..037b21624 --- /dev/null +++ b/freed-ora/current/master/linux-libre-3.10-gnu.xdelta.xz.sign @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.19 (GNU/Linux) + +iEYEABECAAYFAlHRnUkACgkQvLfPh359R6dH6ACcC8Ybxl8hcXVNrCPm3rvobfS/ +1UUAn2OM8826FgitcyyKBEGx0tUJkzeX +=jAu3 +-----END PGP SIGNATURE----- diff --git a/freed-ora/current/master/linux-libre-3.9-gnu.tar.xz.sign b/freed-ora/current/master/linux-libre-3.9-gnu.tar.xz.sign deleted file mode 100644 index 66420e941..000000000 --- a/freed-ora/current/master/linux-libre-3.9-gnu.tar.xz.sign +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) - -iEYEABECAAYFAlF96RIACgkQvLfPh359R6eCvQCfTMCIiwhjO0zVWUN7BFq4iXTN -XnAAnj5wlMRZ/WlRj6KvpbryCoJzI5t8 -=Hh7s ------END PGP SIGNATURE----- diff --git a/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz b/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz Binary files differdeleted file mode 100644 index 076d0507b..000000000 --- a/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz +++ /dev/null diff --git a/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz.sign b/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz.sign deleted file mode 100644 index b8bfcb535..000000000 --- a/freed-ora/current/master/linux-libre-3.9-gnu.xdelta.xz.sign +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) - -iEYEABECAAYFAlF96RYACgkQvLfPh359R6eeBQCgpW5JbSHUrYM4pPQl74uQeptO -j1kAnRDwCU4LQwlJW9CKzUGjXjp8X2Kg -=lmjv ------END PGP SIGNATURE----- diff --git a/freed-ora/current/master/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch b/freed-ora/current/master/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch deleted file mode 100644 index 7d49d9834..000000000 --- a/freed-ora/current/master/mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c -index baaa860..7a3d675 100644 ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -748,8 +748,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, - sdata->dev->addr_len); - spin_unlock_bh(&local->filter_lock); - netif_addr_unlock_bh(sdata->dev); -- -- ieee80211_configure_filter(local); -+ /* configure filter latter (if not suspended) */ - } - - del_timer_sync(&local->dynamic_ps_timer); -@@ -814,10 +813,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, - } - - ieee80211_adjust_monitor_flags(sdata, -1); -- ieee80211_configure_filter(local); -- mutex_lock(&local->mtx); -- ieee80211_recalc_idle(local); -- mutex_unlock(&local->mtx); -+ /* tell driver latter (if not suspended) */ - break; - case NL80211_IFTYPE_P2P_DEVICE: - /* relies on synchronize_rcu() below */ -@@ -848,28 +844,31 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, - - drv_remove_interface_debugfs(local, sdata); - -- if (going_down) -+ if (going_down && !local->suspended) - drv_remove_interface(local, sdata); - } - - sdata->bss = NULL; - -- ieee80211_recalc_ps(local, -1); -- -- if (local->open_count == 0) { -- if (local->ops->napi_poll) -- napi_disable(&local->napi); -- ieee80211_clear_tx_pending(local); -- ieee80211_stop_device(local); -- -- /* no reconfiguring after stop! */ -- hw_reconf_flags = 0; -+ if (!local->suspended) { -+ if (local->open_count == 0) { -+ if (local->ops->napi_poll) -+ napi_disable(&local->napi); -+ ieee80211_clear_tx_pending(local); -+ ieee80211_stop_device(local); -+ } else { -+ ieee80211_configure_filter(local); -+ ieee80211_recalc_ps(local, -1); -+ -+ mutex_lock(&local->mtx); -+ ieee80211_recalc_idle(local); -+ mutex_unlock(&local->mtx); -+ -+ if (hw_reconf_flags) -+ ieee80211_hw_config(local, hw_reconf_flags); -+ } - } - -- /* do after stop to avoid reconfiguring when we stop anyway */ -- if (hw_reconf_flags) -- ieee80211_hw_config(local, hw_reconf_flags); -- - spin_lock_irqsave(&local->queue_stop_reason_lock, flags); - for (i = 0; i < IEEE80211_MAX_QUEUES; i++) { - skb_queue_walk_safe(&local->pending[i], skb, tmp) { diff --git a/freed-ora/current/master/nowatchdog-on-virt.patch b/freed-ora/current/master/nowatchdog-on-virt.patch new file mode 100644 index 000000000..b20642204 --- /dev/null +++ b/freed-ora/current/master/nowatchdog-on-virt.patch @@ -0,0 +1,67 @@ +Disable watchdog on virtual machines. + +For various reasons, VMs seem to trigger the soft lockup detector a lot, +in cases where it's just not possible for a lockup to occur. +(Example: https://bugzilla.redhat.com/show_bug.cgi?id=971139) + +In some cases it seems that the host just never scheduled the app running +the VM for a very long time (Could be the host was under heavy load). + +Just disable the detector on VMs. + +Signed-off-by: Dave Jones <davej@redhat.com> + +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index 05039e3..a28aab9 100644 +--- a/kernel/watchdog.c ++++ b/kernel/watchdog.c +@@ -24,6 +24,7 @@ + #include <linux/sysctl.h> + #include <linux/smpboot.h> + #include <linux/sched/rt.h> ++#include <linux/dmi.h> + + #include <asm/irq_regs.h> + #include <linux/kvm_para.h> +@@ -96,6 +97,32 @@ static int __init nosoftlockup_setup(char *str) + __setup("nosoftlockup", nosoftlockup_setup); + /* */ + ++static int disable_watchdog(const struct dmi_system_id *d) ++{ ++ printk(KERN_INFO "watchdog: disabled (inside virtual machine)\n"); ++ watchdog_enabled = 0; ++ return 0; ++} ++ ++static const struct dmi_system_id watchdog_virt_dmi_table[] = { ++ { ++ .callback = disable_watchdog, ++ .ident = "VMware", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "VMware, Inc."), ++ }, ++ }, ++ { ++ .callback = disable_watchdog, ++ .ident = "Bochs", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Bochs Bochs"), ++ }, ++ }, ++ {} ++}; ++ ++ + /* + * Hard-lockup warnings should be triggered after just a few seconds. Soft- + * lockups can have false positives under extreme conditions. So we generally +@@ -543,6 +570,8 @@ static struct smp_hotplug_thread watchdog_threads = { + + void __init lockup_detector_init(void) + { ++ dmi_check_system(watchdog_virt_dmi_table); ++ + set_sample_period(); + if (smpboot_register_percpu_thread(&watchdog_threads)) { + pr_err("Failed to create watchdog threads, disabled\n"); diff --git a/freed-ora/current/master/sources b/freed-ora/current/master/sources index 993cd6ddc..4187c2a6b 100644 --- a/freed-ora/current/master/sources +++ b/freed-ora/current/master/sources @@ -1 +1 @@ -120df29f88622dabf7015a22c7cc8e25 linux-libre-3.9-gnu.tar.xz +d562fd52580a3b6b18b6eeb5921d1d5c linux-libre-3.10-gnu.tar.xz diff --git a/freed-ora/current/master/v2-thermal-cpu_cooling-fix-stub-function.patch b/freed-ora/current/master/v2-thermal-cpu_cooling-fix-stub-function.patch new file mode 100644 index 000000000..55a5e7c30 --- /dev/null +++ b/freed-ora/current/master/v2-thermal-cpu_cooling-fix-stub-function.patch @@ -0,0 +1,22 @@ +diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h +index 282e270..a5d52ee 100644 +--- a/include/linux/cpu_cooling.h ++++ b/include/linux/cpu_cooling.h +@@ -41,7 +41,7 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus); + */ + void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); + +-unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int); ++unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq); + #else /* !CONFIG_CPU_THERMAL */ + static inline struct thermal_cooling_device * + cpufreq_cooling_register(const struct cpumask *clip_cpus) +@@ -54,7 +54,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) + return; + } + static inline +-unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int) ++unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq) + { + return THERMAL_CSTATE_INVALID; + } diff --git a/freed-ora/current/master/wireless-regulatory-fix-channel-disabling-race-condition.patch b/freed-ora/current/master/wireless-regulatory-fix-channel-disabling-race-condition.patch deleted file mode 100644 index 313735377..000000000 --- a/freed-ora/current/master/wireless-regulatory-fix-channel-disabling-race-condition.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Johannes Berg <johannes.berg@intel.com> - -When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz -part of the scan disables a 5.2 GHz channel due to, e.g. receiving -country or frequency information, that 5.2 GHz channel might already -be in the list of channels to scan next. Then, when the driver checks -if it should do a passive scan, that will return false and attempt an -active scan. This is not only wrong but can also lead to the iwlwifi -device firmware crashing since it checks regulatory as well. - -Fix this by not setting the channel flags to just disabled but rather -OR'ing in the disabled flag. That way, even if the race happens, the -channel will be scanned passively which is still (mostly) correct. - -Cc: stable@vger.kernel.org -Signed-off-by: Johannes Berg <johannes.berg@intel.com> ---- - net/wireless/reg.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/wireless/reg.c b/net/wireless/reg.c -index 93ab840..507c28e 100644 ---- a/net/wireless/reg.c -+++ b/net/wireless/reg.c -@@ -855,7 +855,7 @@ static void handle_channel(struct wiphy *wiphy, - return; - - REG_DBG_PRINT("Disabling freq %d MHz\n", chan->center_freq); -- chan->flags = IEEE80211_CHAN_DISABLED; -+ chan->flags |= IEEE80211_CHAN_DISABLED; - return; - } - --- -1.8.0 - --- -To unsubscribe from this list: send the line "unsubscribe linux-wireless" in -the body of a message to majordomo@vger.kernel.org -More majordomo info at http://vger.kernel.org/majordomo-info.html
\ No newline at end of file diff --git a/freed-ora/current/master/xen-blkback-Check-device-permissions-before-allowing.patch b/freed-ora/current/master/xen-blkback-Check-device-permissions-before-allowing.patch new file mode 100644 index 000000000..933e82890 --- /dev/null +++ b/freed-ora/current/master/xen-blkback-Check-device-permissions-before-allowing.patch @@ -0,0 +1,54 @@ +From e029d62efa5eb46831a9e1414468e582379b743f Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk <konrad.wilk () oracle com> +Date: Wed, 16 Jan 2013 11:33:52 -0500 +Subject: [PATCH] xen/blkback: Check device permissions before allowing + OP_DISCARD + +We need to make sure that the device is not RO or that +the request is not past the number of sectors we want to +issue the DISCARD operation for. + +Cc: stable () vger kernel org +Acked-by: Jan Beulich <JBeulich () suse com> +Acked-by: Ian Campbell <Ian.Campbell () citrix com> +[v1: Made it pr_warn instead of pr_debug] +Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk () oracle com> +--- + drivers/block/xen-blkback/blkback.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c +index e79ab45..4119bcd 100644 +--- a/drivers/block/xen-blkback/blkback.c ++++ b/drivers/block/xen-blkback/blkback.c +@@ -876,7 +876,18 @@ static int dispatch_discard_io(struct xen_blkif *blkif, + int status = BLKIF_RSP_OKAY; + struct block_device *bdev = blkif->vbd.bdev; + unsigned long secure; ++ struct phys_req preq; ++ ++ preq.sector_number = req->u.discard.sector_number; ++ preq.nr_sects = req->u.discard.nr_sectors; + ++ err = xen_vbd_translate(&preq, blkif, WRITE); ++ if (err) { ++ pr_warn(DRV_PFX "access denied: DISCARD [%llu->%llu] on dev=%04x\n", ++ preq.sector_number, ++ preq.sector_number + preq.nr_sects, blkif->vbd.pdevice); ++ goto fail_response; ++ } + blkif->st_ds_req++; + + xen_blkif_get(blkif); +@@ -887,7 +898,7 @@ static int dispatch_discard_io(struct xen_blkif *blkif, + err = blkdev_issue_discard(bdev, req->u.discard.sector_number, + req->u.discard.nr_sectors, + GFP_KERNEL, secure); +- ++fail_response: + if (err == -EOPNOTSUPP) { + pr_debug(DRV_PFX "discard op failed, not supported\n"); + status = BLKIF_RSP_EOPNOTSUPP; +-- +1.8.1.4 + |