diff --git a/.gitignore b/.gitignore index a23ef2db8..b30f1f64f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ clog *.rpm *.orig kernel-[23].*/ +perf-man-*.tar.gz diff --git a/0001-HID-rmi-do-not-handle-touchscreens-through-hid-rmi.patch b/0001-HID-rmi-do-not-handle-touchscreens-through-hid-rmi.patch new file mode 100644 index 000000000..e9015c9ad --- /dev/null +++ b/0001-HID-rmi-do-not-handle-touchscreens-through-hid-rmi.patch @@ -0,0 +1,102 @@ +Bugzilla: 1089583 +Upstream-status: Sent for 3.15 + +From 4cebb979af8d7bd1ec463406eaf57a44bd5b9f04 Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Tue, 22 Apr 2014 11:21:00 -0400 +Subject: [PATCH] HID: rmi: do not handle touchscreens through hid-rmi + +Currently, hid-rmi drives every Synaptics product, but the touchscreens +on the Windows tablets should be handled through hid-multitouch. + +Instead of providing a long list of PIDs, rely on the scan_report +capability to detect which should go to hid-multitouch, and which +should not go to hid-rmi. + +We introduce a generic HID_GROUP_HAVE_SPECIAL_DRIVER which can be reused +amoung other drivers if they want to have a catch rule but still +have multitouch devices handled through hid-multitouch. + +related bug: +https://bugzilla.kernel.org/show_bug.cgi?id=74241 +https://bugzilla.redhat.com/show_bug.cgi?id=1089583 + +Signed-off-by: Benjamin Tissoires +--- + drivers/hid/hid-core.c | 10 ++++++++-- + drivers/hid/hid-rmi.c | 6 ++++-- + include/linux/hid.h | 13 +++++++++++++ + 3 files changed, 25 insertions(+), 4 deletions(-) + +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index 6ba2fd0..ea18639 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -776,6 +776,14 @@ static int hid_scan_report(struct hid_device *hid) + (hid->group == HID_GROUP_MULTITOUCH)) + hid->group = HID_GROUP_MULTITOUCH_WIN_8; + ++ /* ++ * Vendor specific handlings ++ */ ++ if ((hid->vendor == USB_VENDOR_ID_SYNAPTICS) && ++ (hid->group == HID_GROUP_GENERIC)) ++ /* hid-rmi should take care of them, not hid-generic */ ++ hid->group = HID_GROUP_HAVE_SPECIAL_DRIVER; ++ + vfree(parser); + return 0; + } +@@ -1840,8 +1848,6 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, +- { HID_I2C_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, + { HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) }, +diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c +index a4f04d4..a97a373 100644 +--- a/drivers/hid/hid-rmi.c ++++ b/drivers/hid/hid-rmi.c +@@ -863,8 +863,10 @@ static void rmi_remove(struct hid_device *hdev) + } + + static const struct hid_device_id rmi_id[] = { +- { HID_I2C_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, +- { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, ++ { HID_DEVICE(BUS_I2C, HID_GROUP_HAVE_SPECIAL_DRIVER, ++ USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, ++ { HID_DEVICE(BUS_USB, HID_GROUP_HAVE_SPECIAL_DRIVER, ++ USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, + { } + }; + MODULE_DEVICE_TABLE(hid, rmi_id); +diff --git a/include/linux/hid.h b/include/linux/hid.h +index 1b5f1e9..2fdd612 100644 +--- a/include/linux/hid.h ++++ b/include/linux/hid.h +@@ -299,6 +299,19 @@ struct hid_item { + #define HID_GROUP_MULTITOUCH 0x0002 + #define HID_GROUP_SENSOR_HUB 0x0003 + #define HID_GROUP_MULTITOUCH_WIN_8 0x0004 ++#define HID_GROUP_HAVE_SPECIAL_DRIVER 0xffff ++/* ++ * HID_GROUP_HAVE_SPECIAL_DRIVER should be used when the device needs to be ++ * scanned in case it is handled by either hid-multitouch, hid-generic, ++ * hid-sensor-hub or any other generic hid driver. ++ * ++ * Devices declared in hid_have_special_driver[] in hid-core.c can use ++ * HID_GROUP_ANY instead because there will be not overlap between their ++ * specific driver and a generic one. ++ * ++ * Note: HID_GROUP_ANY is declared in linux/mod_devicetable.h ++ * and has a value of 0x0000 ++ */ + + /* + * This is the global environment of the parser. This information is +-- +1.9.0 + diff --git a/0001-HID-rmi-introduce-RMI-driver-for-Synaptics-touchpads.patch b/0001-HID-rmi-introduce-RMI-driver-for-Synaptics-touchpads.patch new file mode 100644 index 000000000..b3ec026c3 --- /dev/null +++ b/0001-HID-rmi-introduce-RMI-driver-for-Synaptics-touchpads.patch @@ -0,0 +1,1054 @@ +Bugzilla: 1048314 +Upstream-status: Queued for 3.16 + +From 39141443c8ea2900af627d688a255e064e2b6e19 Mon Sep 17 00:00:00 2001 +From: Benjamin Tissoires +Date: Wed, 9 Apr 2014 11:09:21 -0400 +Subject: [PATCH] HID: rmi: introduce RMI driver for Synaptics touchpads + +This driver add support for RMI4 over USB or I2C. +The current state is that it uses its own RMI4 implementation, but once +RMI4 is merged upstream, the driver will be a transport driver for the +RMI4 library. + +Part of this driver should be considered as temporary. Most of the RMI4 +processing and input handling will be deleted at some point. + +I based my work on Andrew's regarding its port of RMI4 over HID (see +https://github.com/mightybigcar/synaptics-rmi4/tree/rmihid ) +This repo presents how the driver may looks like at the end: +https://github.com/mightybigcar/synaptics-rmi4/blob/rmihid/drivers/input/rmi4/rmi_hid.c + +Without this temporary solution, the workaround we gave to users +is to disable i2c-hid, which leads to disabling the touchscreen on the +XPS 11 and 12 (Haswell generation). + +Related bugs: +https://bugzilla.redhat.com/show_bug.cgi?id=1048314 +https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1218973 + +Signed-off-by: Andrew Duggan +Signed-off-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina + +- Removed obviously wrong hid_hw_stop() at the end of probe +- emulate hid_hw_raw_request and hid_hw_output_report that has been + interoduced in 3.15 + +Signed-off-by: Benjamin Tissoires +--- + drivers/hid/Kconfig | 8 + + drivers/hid/Makefile | 1 + + drivers/hid/compat.h | 43 +++ + drivers/hid/hid-core.c | 2 + + drivers/hid/hid-rmi.c | 890 +++++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/hid.h | 2 + + 6 files changed, 946 insertions(+) + create mode 100644 drivers/hid/compat.h + create mode 100644 drivers/hid/hid-rmi.c + +diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig +index 34e2d39..b2d733b 100644 +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -645,6 +645,14 @@ config HID_SUNPLUS + ---help--- + Support for Sunplus wireless desktop. + ++config HID_RMI ++ tristate "Synaptics RMI4 device support" ++ depends on HID ++ ---help--- ++ Support for Synaptics RMI4 touchpads. ++ Say Y here if you have a Synaptics RMI4 touchpads over i2c-hid or usbhid ++ and want support for its special functionalities. ++ + config HID_GREENASIA + tristate "GreenAsia (Product ID 0x12) game controller support" + depends on HID +diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile +index 30e4431..b326f79 100644 +--- a/drivers/hid/Makefile ++++ b/drivers/hid/Makefile +@@ -96,6 +96,7 @@ obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \ + hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \ + hid-roccat-koneplus.o hid-roccat-konepure.o hid-roccat-kovaplus.o \ + hid-roccat-lua.o hid-roccat-pyra.o hid-roccat-ryos.o hid-roccat-savu.o ++obj-$(CONFIG_HID_RMI) += hid-rmi.o + obj-$(CONFIG_HID_SAITEK) += hid-saitek.o + obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o + obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o +diff --git a/drivers/hid/compat.h b/drivers/hid/compat.h +new file mode 100644 +index 0000000..1318ca6e +--- /dev/null ++++ b/drivers/hid/compat.h +@@ -0,0 +1,43 @@ ++/* ++ * Copyright (c) 2014 Benjamin Tissoires ++ * Copyright (c) 2014 Red Hat, Inc ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the Free ++ * Software Foundation; either version 2 of the License, or (at your option) ++ * any later version. ++ */ ++ ++#include ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) ++ ++static inline int hid_hw_raw_request(struct hid_device *hdev, ++ unsigned char reportnum, __u8 *buf, ++ size_t len, unsigned char rtype, int reqtype) ++{ ++ if (len < 1 || len > HID_MAX_BUFFER_SIZE || !buf) ++ return -EINVAL; ++ ++ switch (reqtype) { ++ case HID_REQ_SET_REPORT: ++ if (reportnum != buf[0]) ++ return -EINVAL; ++ return hdev->hid_output_raw_report(hdev, buf, len, rtype); ++ case HID_REQ_GET_REPORT: ++ return hdev->hid_get_raw_report(hdev, reportnum, buf, len, rtype); ++ } ++ ++ return -ENOSYS; ++} ++ ++static inline int hid_hw_output_report(struct hid_device *hdev, __u8 *buf, ++ size_t len) ++{ ++ if (len < 1 || len > HID_MAX_BUFFER_SIZE || !buf) ++ return -EINVAL; ++ ++ return hdev->hid_output_raw_report(hdev, buf, len, HID_OUTPUT_REPORT); ++} ++ ++#endif +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c +index 253fe23..543dd1f 100644 +--- a/drivers/hid/hid-core.c ++++ b/drivers/hid/hid-core.c +@@ -1836,6 +1836,8 @@ static const struct hid_device_id hid_have_special_driver[] = { + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) }, + { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, ++ { HID_I2C_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, + { HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) }, + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) }, +diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c +new file mode 100644 +index 0000000..a4f04d4 +--- /dev/null ++++ b/drivers/hid/hid-rmi.c +@@ -0,0 +1,890 @@ ++/* ++ * Copyright (c) 2013 Andrew Duggan ++ * Copyright (c) 2013 Synaptics Incorporated ++ * Copyright (c) 2014 Benjamin Tissoires ++ * Copyright (c) 2014 Red Hat, Inc ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the Free ++ * Software Foundation; either version 2 of the License, or (at your option) ++ * any later version. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "hid-ids.h" ++ ++#include "compat.h" ++ ++#define RMI_MOUSE_REPORT_ID 0x01 /* Mouse emulation Report */ ++#define RMI_WRITE_REPORT_ID 0x09 /* Output Report */ ++#define RMI_READ_ADDR_REPORT_ID 0x0a /* Output Report */ ++#define RMI_READ_DATA_REPORT_ID 0x0b /* Input Report */ ++#define RMI_ATTN_REPORT_ID 0x0c /* Input Report */ ++#define RMI_SET_RMI_MODE_REPORT_ID 0x0f /* Feature Report */ ++ ++/* flags */ ++#define RMI_READ_REQUEST_PENDING BIT(0) ++#define RMI_READ_DATA_PENDING BIT(1) ++#define RMI_STARTED BIT(2) ++ ++enum rmi_mode_type { ++ RMI_MODE_OFF = 0, ++ RMI_MODE_ATTN_REPORTS = 1, ++ RMI_MODE_NO_PACKED_ATTN_REPORTS = 2, ++}; ++ ++struct rmi_function { ++ unsigned page; /* page of the function */ ++ u16 query_base_addr; /* base address for queries */ ++ u16 command_base_addr; /* base address for commands */ ++ u16 control_base_addr; /* base address for controls */ ++ u16 data_base_addr; /* base address for datas */ ++ unsigned int interrupt_base; /* cross-function interrupt number ++ * (uniq in the device)*/ ++ unsigned int interrupt_count; /* number of interrupts */ ++ unsigned int report_size; /* size of a report */ ++ unsigned long irq_mask; /* mask of the interrupts ++ * (to be applied against ATTN IRQ) */ ++}; ++ ++/** ++ * struct rmi_data - stores information for hid communication ++ * ++ * @page_mutex: Locks current page to avoid changing pages in unexpected ways. ++ * @page: Keeps track of the current virtual page ++ * ++ * @wait: Used for waiting for read data ++ * ++ * @writeReport: output buffer when writing RMI registers ++ * @readReport: input buffer when reading RMI registers ++ * ++ * @input_report_size: size of an input report (advertised by HID) ++ * @output_report_size: size of an output report (advertised by HID) ++ * ++ * @flags: flags for the current device (started, reading, etc...) ++ * ++ * @f11: placeholder of internal RMI function F11 description ++ * @f30: placeholder of internal RMI function F30 description ++ * ++ * @max_fingers: maximum finger count reported by the device ++ * @max_x: maximum x value reported by the device ++ * @max_y: maximum y value reported by the device ++ * ++ * @gpio_led_count: count of GPIOs + LEDs reported by F30 ++ * @button_count: actual physical buttons count ++ * @button_mask: button mask used to decode GPIO ATTN reports ++ * @button_state_mask: pull state of the buttons ++ * ++ * @input: pointer to the kernel input device ++ * ++ * @reset_work: worker which will be called in case of a mouse report ++ * @hdev: pointer to the struct hid_device ++ */ ++struct rmi_data { ++ struct mutex page_mutex; ++ int page; ++ ++ wait_queue_head_t wait; ++ ++ u8 *writeReport; ++ u8 *readReport; ++ ++ int input_report_size; ++ int output_report_size; ++ ++ unsigned long flags; ++ ++ struct rmi_function f11; ++ struct rmi_function f30; ++ ++ unsigned int max_fingers; ++ unsigned int max_x; ++ unsigned int max_y; ++ unsigned int x_size_mm; ++ unsigned int y_size_mm; ++ ++ unsigned int gpio_led_count; ++ unsigned int button_count; ++ unsigned long button_mask; ++ unsigned long button_state_mask; ++ ++ struct input_dev *input; ++ ++ struct work_struct reset_work; ++ struct hid_device *hdev; ++}; ++ ++#define RMI_PAGE(addr) (((addr) >> 8) & 0xff) ++ ++static int rmi_write_report(struct hid_device *hdev, u8 *report, int len); ++ ++/** ++ * rmi_set_page - Set RMI page ++ * @hdev: The pointer to the hid_device struct ++ * @page: The new page address. ++ * ++ * RMI devices have 16-bit addressing, but some of the physical ++ * implementations (like SMBus) only have 8-bit addressing. So RMI implements ++ * a page address at 0xff of every page so we can reliable page addresses ++ * every 256 registers. ++ * ++ * The page_mutex lock must be held when this function is entered. ++ * ++ * Returns zero on success, non-zero on failure. ++ */ ++static int rmi_set_page(struct hid_device *hdev, u8 page) ++{ ++ struct rmi_data *data = hid_get_drvdata(hdev); ++ int retval; ++ ++ data->writeReport[0] = RMI_WRITE_REPORT_ID; ++ data->writeReport[1] = 1; ++ data->writeReport[2] = 0xFF; ++ data->writeReport[4] = page; ++ ++ retval = rmi_write_report(hdev, data->writeReport, ++ data->output_report_size); ++ if (retval != data->output_report_size) { ++ dev_err(&hdev->dev, ++ "%s: set page failed: %d.", __func__, retval); ++ return retval; ++ } ++ ++ data->page = page; ++ return 0; ++} ++ ++static int rmi_set_mode(struct hid_device *hdev, u8 mode) ++{ ++ int ret; ++ u8 txbuf[2] = {RMI_SET_RMI_MODE_REPORT_ID, mode}; ++ ++ ret = hid_hw_raw_request(hdev, RMI_SET_RMI_MODE_REPORT_ID, txbuf, ++ sizeof(txbuf), HID_FEATURE_REPORT, HID_REQ_SET_REPORT); ++ if (ret < 0) { ++ dev_err(&hdev->dev, "unable to set rmi mode to %d (%d)\n", mode, ++ ret); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static int rmi_write_report(struct hid_device *hdev, u8 *report, int len) ++{ ++ int ret; ++ ++ ret = hid_hw_output_report(hdev, (void *)report, len); ++ if (ret < 0) { ++ dev_err(&hdev->dev, "failed to write hid report (%d)\n", ret); ++ return ret; ++ } ++ ++ return ret; ++} ++ ++static int rmi_read_block(struct hid_device *hdev, u16 addr, void *buf, ++ const int len) ++{ ++ struct rmi_data *data = hid_get_drvdata(hdev); ++ int ret; ++ int bytes_read; ++ int bytes_needed; ++ int retries; ++ int read_input_count; ++ ++ mutex_lock(&data->page_mutex); ++ ++ if (RMI_PAGE(addr) != data->page) { ++ ret = rmi_set_page(hdev, RMI_PAGE(addr)); ++ if (ret < 0) ++ goto exit; ++ } ++ ++ for (retries = 5; retries > 0; retries--) { ++ data->writeReport[0] = RMI_READ_ADDR_REPORT_ID; ++ data->writeReport[1] = 0; /* old 1 byte read count */ ++ data->writeReport[2] = addr & 0xFF; ++ data->writeReport[3] = (addr >> 8) & 0xFF; ++ data->writeReport[4] = len & 0xFF; ++ data->writeReport[5] = (len >> 8) & 0xFF; ++ ++ set_bit(RMI_READ_REQUEST_PENDING, &data->flags); ++ ++ ret = rmi_write_report(hdev, data->writeReport, ++ data->output_report_size); ++ if (ret != data->output_report_size) { ++ clear_bit(RMI_READ_REQUEST_PENDING, &data->flags); ++ dev_err(&hdev->dev, ++ "failed to write request output report (%d)\n", ++ ret); ++ goto exit; ++ } ++ ++ bytes_read = 0; ++ bytes_needed = len; ++ while (bytes_read < len) { ++ if (!wait_event_timeout(data->wait, ++ test_bit(RMI_READ_DATA_PENDING, &data->flags), ++ msecs_to_jiffies(1000))) { ++ hid_warn(hdev, "%s: timeout elapsed\n", ++ __func__); ++ ret = -EAGAIN; ++ break; ++ } ++ ++ read_input_count = data->readReport[1]; ++ memcpy(buf + bytes_read, &data->readReport[2], ++ read_input_count < bytes_needed ? ++ read_input_count : bytes_needed); ++ ++ bytes_read += read_input_count; ++ bytes_needed -= read_input_count; ++ clear_bit(RMI_READ_DATA_PENDING, &data->flags); ++ } ++ ++ if (ret >= 0) { ++ ret = 0; ++ break; ++ } ++ } ++ ++exit: ++ clear_bit(RMI_READ_REQUEST_PENDING, &data->flags); ++ mutex_unlock(&data->page_mutex); ++ return ret; ++} ++ ++static inline int rmi_read(struct hid_device *hdev, u16 addr, void *buf) ++{ ++ return rmi_read_block(hdev, addr, buf, 1); ++} ++ ++static void rmi_f11_process_touch(struct rmi_data *hdata, int slot, ++ u8 finger_state, u8 *touch_data) ++{ ++ int x, y, wx, wy; ++ int wide, major, minor; ++ int z; ++ ++ input_mt_slot(hdata->input, slot); ++ input_mt_report_slot_state(hdata->input, MT_TOOL_FINGER, ++ finger_state == 0x01); ++ if (finger_state == 0x01) { ++ x = (touch_data[0] << 4) | (touch_data[2] & 0x07); ++ y = (touch_data[1] << 4) | (touch_data[2] >> 4); ++ wx = touch_data[3] & 0x07; ++ wy = touch_data[3] >> 4; ++ wide = (wx > wy); ++ major = max(wx, wy); ++ minor = min(wx, wy); ++ z = touch_data[4]; ++ ++ /* y is inverted */ ++ y = hdata->max_y - y; ++ ++ input_event(hdata->input, EV_ABS, ABS_MT_POSITION_X, x); ++ input_event(hdata->input, EV_ABS, ABS_MT_POSITION_Y, y); ++ input_event(hdata->input, EV_ABS, ABS_MT_ORIENTATION, wide); ++ input_event(hdata->input, EV_ABS, ABS_MT_PRESSURE, z); ++ input_event(hdata->input, EV_ABS, ABS_MT_TOUCH_MAJOR, major); ++ input_event(hdata->input, EV_ABS, ABS_MT_TOUCH_MINOR, minor); ++ } ++} ++ ++static void rmi_reset_work(struct work_struct *work) ++{ ++ struct rmi_data *hdata = container_of(work, struct rmi_data, ++ reset_work); ++ ++ /* switch the device to RMI if we receive a generic mouse report */ ++ rmi_set_mode(hdata->hdev, RMI_MODE_ATTN_REPORTS); ++} ++ ++static inline int rmi_schedule_reset(struct hid_device *hdev) ++{ ++ struct rmi_data *hdata = hid_get_drvdata(hdev); ++ return schedule_work(&hdata->reset_work); ++} ++ ++static int rmi_f11_input_event(struct hid_device *hdev, u8 irq, u8 *data, ++ int size) ++{ ++ struct rmi_data *hdata = hid_get_drvdata(hdev); ++ int offset; ++ int i; ++ ++ if (size < hdata->f11.report_size) ++ return 0; ++ ++ if (!(irq & hdata->f11.irq_mask)) ++ return 0; ++ ++ offset = (hdata->max_fingers >> 2) + 1; ++ for (i = 0; i < hdata->max_fingers; i++) { ++ int fs_byte_position = i >> 2; ++ int fs_bit_position = (i & 0x3) << 1; ++ int finger_state = (data[fs_byte_position] >> fs_bit_position) & ++ 0x03; ++ ++ rmi_f11_process_touch(hdata, i, finger_state, ++ &data[offset + 5 * i]); ++ } ++ input_mt_sync_frame(hdata->input); ++ input_sync(hdata->input); ++ return hdata->f11.report_size; ++} ++ ++static int rmi_f30_input_event(struct hid_device *hdev, u8 irq, u8 *data, ++ int size) ++{ ++ struct rmi_data *hdata = hid_get_drvdata(hdev); ++ int i; ++ int button = 0; ++ bool value; ++ ++ if (!(irq & hdata->f30.irq_mask)) ++ return 0; ++ ++ for (i = 0; i < hdata->gpio_led_count; i++) { ++ if (test_bit(i, &hdata->button_mask)) { ++ value = (data[i / 8] >> (i & 0x07)) & BIT(0); ++ if (test_bit(i, &hdata->button_state_mask)) ++ value = !value; ++ input_event(hdata->input, EV_KEY, BTN_LEFT + button++, ++ value); ++ } ++ } ++ return hdata->f30.report_size; ++} ++ ++static int rmi_input_event(struct hid_device *hdev, u8 *data, int size) ++{ ++ struct rmi_data *hdata = hid_get_drvdata(hdev); ++ unsigned long irq_mask = 0; ++ unsigned index = 2; ++ ++ if (!(test_bit(RMI_STARTED, &hdata->flags))) ++ return 0; ++ ++ irq_mask |= hdata->f11.irq_mask; ++ irq_mask |= hdata->f30.irq_mask; ++ ++ if (data[1] & ~irq_mask) ++ hid_warn(hdev, "unknown intr source:%02lx %s:%d\n", ++ data[1] & ~irq_mask, __FILE__, __LINE__); ++ ++ if (hdata->f11.interrupt_base < hdata->f30.interrupt_base) { ++ index += rmi_f11_input_event(hdev, data[1], &data[index], ++ size - index); ++ index += rmi_f30_input_event(hdev, data[1], &data[index], ++ size - index); ++ } else { ++ index += rmi_f30_input_event(hdev, data[1], &data[index], ++ size - index); ++ index += rmi_f11_input_event(hdev, data[1], &data[index], ++ size - index); ++ } ++ ++ return 1; ++} ++ ++static int rmi_read_data_event(struct hid_device *hdev, u8 *data, int size) ++{ ++ struct rmi_data *hdata = hid_get_drvdata(hdev); ++ ++ if (!test_bit(RMI_READ_REQUEST_PENDING, &hdata->flags)) { ++ hid_err(hdev, "no read request pending\n"); ++ return 0; ++ } ++ ++ memcpy(hdata->readReport, data, size < hdata->input_report_size ? ++ size : hdata->input_report_size); ++ set_bit(RMI_READ_DATA_PENDING, &hdata->flags); ++ wake_up(&hdata->wait); ++ ++ return 1; ++} ++ ++static int rmi_raw_event(struct hid_device *hdev, ++ struct hid_report *report, u8 *data, int size) ++{ ++ switch (data[0]) { ++ case RMI_READ_DATA_REPORT_ID: ++ return rmi_read_data_event(hdev, data, size); ++ case RMI_ATTN_REPORT_ID: ++ return rmi_input_event(hdev, data, size); ++ case RMI_MOUSE_REPORT_ID: ++ rmi_schedule_reset(hdev); ++ break; ++ } ++ ++ return 0; ++} ++ ++static int rmi_post_reset(struct hid_device *hdev) ++{ ++ return rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); ++} ++ ++static int rmi_post_resume(struct hid_device *hdev) ++{ ++ return rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); ++} ++ ++#define RMI4_MAX_PAGE 0xff ++#define RMI4_PAGE_SIZE 0x0100 ++ ++#define PDT_START_SCAN_LOCATION 0x00e9 ++#define PDT_END_SCAN_LOCATION 0x0005 ++#define RMI4_END_OF_PDT(id) ((id) == 0x00 || (id) == 0xff) ++ ++struct pdt_entry { ++ u8 query_base_addr:8; ++ u8 command_base_addr:8; ++ u8 control_base_addr:8; ++ u8 data_base_addr:8; ++ u8 interrupt_source_count:3; ++ u8 bits3and4:2; ++ u8 function_version:2; ++ u8 bit7:1; ++ u8 function_number:8; ++} __attribute__((__packed__)); ++ ++static inline unsigned long rmi_gen_mask(unsigned irq_base, unsigned irq_count) ++{ ++ return GENMASK(irq_count + irq_base - 1, irq_base); ++} ++ ++static void rmi_register_function(struct rmi_data *data, ++ struct pdt_entry *pdt_entry, int page, unsigned interrupt_count) ++{ ++ struct rmi_function *f = NULL; ++ u16 page_base = page << 8; ++ ++ switch (pdt_entry->function_number) { ++ case 0x11: ++ f = &data->f11; ++ break; ++ case 0x30: ++ f = &data->f30; ++ break; ++ } ++ ++ if (f) { ++ f->page = page; ++ f->query_base_addr = page_base | pdt_entry->query_base_addr; ++ f->command_base_addr = page_base | pdt_entry->command_base_addr; ++ f->control_base_addr = page_base | pdt_entry->control_base_addr; ++ f->data_base_addr = page_base | pdt_entry->data_base_addr; ++ f->interrupt_base = interrupt_count; ++ f->interrupt_count = pdt_entry->interrupt_source_count; ++ f->irq_mask = rmi_gen_mask(f->interrupt_base, ++ f->interrupt_count); ++ } ++} ++ ++static int rmi_scan_pdt(struct hid_device *hdev) ++{ ++ struct rmi_data *data = hid_get_drvdata(hdev); ++ struct pdt_entry entry; ++ int page; ++ bool page_has_function; ++ int i; ++ int retval; ++ int interrupt = 0; ++ u16 page_start, pdt_start , pdt_end; ++ ++ hid_info(hdev, "Scanning PDT...\n"); ++ ++ for (page = 0; (page <= RMI4_MAX_PAGE); page++) { ++ page_start = RMI4_PAGE_SIZE * page; ++ pdt_start = page_start + PDT_START_SCAN_LOCATION; ++ pdt_end = page_start + PDT_END_SCAN_LOCATION; ++ ++ page_has_function = false; ++ for (i = pdt_start; i >= pdt_end; i -= sizeof(entry)) { ++ retval = rmi_read_block(hdev, i, &entry, sizeof(entry)); ++ if (retval) { ++ hid_err(hdev, ++ "Read of PDT entry at %#06x failed.\n", ++ i); ++ goto error_exit; ++ } ++ ++ if (RMI4_END_OF_PDT(entry.function_number)) ++ break; ++ ++ page_has_function = true; ++ ++ hid_info(hdev, "Found F%02X on page %#04x\n", ++ entry.function_number, page); ++ ++ rmi_register_function(data, &entry, page, interrupt); ++ interrupt += entry.interrupt_source_count; ++ } ++ ++ if (!page_has_function) ++ break; ++ } ++ ++ hid_info(hdev, "%s: Done with PDT scan.\n", __func__); ++ retval = 0; ++ ++error_exit: ++ return retval; ++} ++ ++static int rmi_populate_f11(struct hid_device *hdev) ++{ ++ struct rmi_data *data = hid_get_drvdata(hdev); ++ u8 buf[20]; ++ int ret; ++ bool has_query12; ++ bool has_physical_props; ++ unsigned x_size, y_size; ++ ++ if (!data->f11.query_base_addr) { ++ hid_err(hdev, "No 2D sensor found, giving up.\n"); ++ return -ENODEV; ++ } ++ ++ /* query 0 contains some useful information */ ++ ret = rmi_read(hdev, data->f11.query_base_addr, buf); ++ if (ret) { ++ hid_err(hdev, "can not get query 0: %d.\n", ret); ++ return ret; ++ } ++ has_query12 = !!(buf[0] & BIT(5)); ++ ++ /* query 1 to get the max number of fingers */ ++ ret = rmi_read(hdev, data->f11.query_base_addr + 1, buf); ++ if (ret) { ++ hid_err(hdev, "can not get NumberOfFingers: %d.\n", ret); ++ return ret; ++ } ++ data->max_fingers = (buf[0] & 0x07) + 1; ++ if (data->max_fingers > 5) ++ data->max_fingers = 10; ++ ++ data->f11.report_size = data->max_fingers * 5 + ++ DIV_ROUND_UP(data->max_fingers, 4); ++ ++ if (!(buf[0] & BIT(4))) { ++ hid_err(hdev, "No absolute events, giving up.\n"); ++ return -ENODEV; ++ } ++ ++ /* ++ * query 12 to know if the physical properties are reported ++ * (query 12 is at offset 10 for HID devices) ++ */ ++ if (has_query12) { ++ ret = rmi_read(hdev, data->f11.query_base_addr + 10, buf); ++ if (ret) { ++ hid_err(hdev, "can not get query 12: %d.\n", ret); ++ return ret; ++ } ++ has_physical_props = !!(buf[0] & BIT(5)); ++ ++ if (has_physical_props) { ++ ret = rmi_read_block(hdev, ++ data->f11.query_base_addr + 11, buf, 4); ++ if (ret) { ++ hid_err(hdev, "can not read query 15-18: %d.\n", ++ ret); ++ return ret; ++ } ++ ++ x_size = buf[0] | (buf[1] << 8); ++ y_size = buf[2] | (buf[3] << 8); ++ ++ data->x_size_mm = DIV_ROUND_CLOSEST(x_size, 10); ++ data->y_size_mm = DIV_ROUND_CLOSEST(y_size, 10); ++ ++ hid_info(hdev, "%s: size in mm: %d x %d\n", ++ __func__, data->x_size_mm, data->y_size_mm); ++ } ++ } ++ ++ /* retrieve the ctrl registers */ ++ ret = rmi_read_block(hdev, data->f11.control_base_addr, buf, 20); ++ if (ret) { ++ hid_err(hdev, "can not read ctrl block of size 20: %d.\n", ret); ++ return ret; ++ } ++ ++ data->max_x = buf[6] | (buf[7] << 8); ++ data->max_y = buf[8] | (buf[9] << 8); ++ ++ return 0; ++} ++ ++static int rmi_populate_f30(struct hid_device *hdev) ++{ ++ struct rmi_data *data = hid_get_drvdata(hdev); ++ u8 buf[20]; ++ int ret; ++ bool has_gpio, has_led; ++ unsigned bytes_per_ctrl; ++ u8 ctrl2_addr; ++ int ctrl2_3_length; ++ int i; ++ ++ /* function F30 is for physical buttons */ ++ if (!data->f30.query_base_addr) { ++ hid_err(hdev, "No GPIO/LEDs found, giving up.\n"); ++ return -ENODEV; ++ } ++ ++ ret = rmi_read_block(hdev, data->f30.query_base_addr, buf, 2); ++ if (ret) { ++ hid_err(hdev, "can not get F30 query registers: %d.\n", ret); ++ return ret; ++ } ++ ++ has_gpio = !!(buf[0] & BIT(3)); ++ has_led = !!(buf[0] & BIT(2)); ++ data->gpio_led_count = buf[1] & 0x1f; ++ ++ /* retrieve ctrl 2 & 3 registers */ ++ bytes_per_ctrl = (data->gpio_led_count + 7) / 8; ++ /* Ctrl0 is present only if both has_gpio and has_led are set*/ ++ ctrl2_addr = (has_gpio && has_led) ? bytes_per_ctrl : 0; ++ /* Ctrl1 is always be present */ ++ ctrl2_addr += bytes_per_ctrl; ++ ctrl2_3_length = 2 * bytes_per_ctrl; ++ ++ data->f30.report_size = bytes_per_ctrl; ++ ++ ret = rmi_read_block(hdev, data->f30.control_base_addr + ctrl2_addr, ++ buf, ctrl2_3_length); ++ if (ret) { ++ hid_err(hdev, "can not read ctrl 2&3 block of size %d: %d.\n", ++ ctrl2_3_length, ret); ++ return ret; ++ } ++ ++ for (i = 0; i < data->gpio_led_count; i++) { ++ int byte_position = i >> 3; ++ int bit_position = i & 0x07; ++ u8 dir_byte = buf[byte_position]; ++ u8 data_byte = buf[byte_position + bytes_per_ctrl]; ++ bool dir = (dir_byte >> bit_position) & BIT(0); ++ bool dat = (data_byte >> bit_position) & BIT(0); ++ ++ if (dir == 0) { ++ /* input mode */ ++ if (dat) { ++ /* actual buttons have pull up resistor */ ++ data->button_count++; ++ set_bit(i, &data->button_mask); ++ set_bit(i, &data->button_state_mask); ++ } ++ } ++ ++ } ++ ++ return 0; ++} ++ ++static int rmi_populate(struct hid_device *hdev) ++{ ++ int ret; ++ ++ ret = rmi_scan_pdt(hdev); ++ if (ret) { ++ hid_err(hdev, "PDT scan failed with code %d.\n", ret); ++ return ret; ++ } ++ ++ ret = rmi_populate_f11(hdev); ++ if (ret) { ++ hid_err(hdev, "Error while initializing F11 (%d).\n", ret); ++ return ret; ++ } ++ ++ ret = rmi_populate_f30(hdev); ++ if (ret) ++ hid_warn(hdev, "Error while initializing F30 (%d).\n", ret); ++ ++ return 0; ++} ++ ++static void rmi_input_configured(struct hid_device *hdev, struct hid_input *hi) ++{ ++ struct rmi_data *data = hid_get_drvdata(hdev); ++ struct input_dev *input = hi->input; ++ int ret; ++ int res_x, res_y, i; ++ ++ data->input = input; ++ ++ hid_dbg(hdev, "Opening low level driver\n"); ++ ret = hid_hw_open(hdev); ++ if (ret) ++ return; ++ ++ /* Allow incoming hid reports */ ++ hid_device_io_start(hdev); ++ ++ ret = rmi_set_mode(hdev, RMI_MODE_ATTN_REPORTS); ++ if (ret < 0) { ++ dev_err(&hdev->dev, "failed to set rmi mode\n"); ++ goto exit; ++ } ++ ++ ret = rmi_set_page(hdev, 0); ++ if (ret < 0) { ++ dev_err(&hdev->dev, "failed to set page select to 0.\n"); ++ goto exit; ++ } ++ ++ ret = rmi_populate(hdev); ++ if (ret) ++ goto exit; ++ ++ __set_bit(EV_ABS, input->evbit); ++ input_set_abs_params(input, ABS_MT_POSITION_X, 1, data->max_x, 0, 0); ++ input_set_abs_params(input, ABS_MT_POSITION_Y, 1, data->max_y, 0, 0); ++ ++ if (data->x_size_mm && data->x_size_mm) { ++ res_x = (data->max_x - 1) / data->x_size_mm; ++ res_y = (data->max_y - 1) / data->x_size_mm; ++ ++ input_abs_set_res(input, ABS_MT_POSITION_X, res_x); ++ input_abs_set_res(input, ABS_MT_POSITION_Y, res_y); ++ } ++ ++ input_set_abs_params(input, ABS_MT_ORIENTATION, 0, 1, 0, 0); ++ input_set_abs_params(input, ABS_MT_PRESSURE, 0, 0xff, 0, 0); ++ input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 0x0f, 0, 0); ++ input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 0x0f, 0, 0); ++ ++ input_mt_init_slots(input, data->max_fingers, INPUT_MT_POINTER); ++ ++ if (data->button_count) { ++ __set_bit(EV_KEY, input->evbit); ++ for (i = 0; i < data->button_count; i++) ++ __set_bit(BTN_LEFT + i, input->keybit); ++ ++ if (data->button_count == 1) ++ __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); ++ } ++ ++ set_bit(RMI_STARTED, &data->flags); ++ ++exit: ++ hid_device_io_stop(hdev); ++ hid_hw_close(hdev); ++} ++ ++static int rmi_input_mapping(struct hid_device *hdev, ++ struct hid_input *hi, struct hid_field *field, ++ struct hid_usage *usage, unsigned long **bit, int *max) ++{ ++ /* we want to make HID ignore the advertised HID collection */ ++ return -1; ++} ++ ++static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id) ++{ ++ struct rmi_data *data = NULL; ++ int ret; ++ size_t alloc_size; ++ ++ data = devm_kzalloc(&hdev->dev, sizeof(struct rmi_data), GFP_KERNEL); ++ if (!data) ++ return -ENOMEM; ++ ++ INIT_WORK(&data->reset_work, rmi_reset_work); ++ data->hdev = hdev; ++ ++ hid_set_drvdata(hdev, data); ++ ++ hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; ++ ++ ret = hid_parse(hdev); ++ if (ret) { ++ hid_err(hdev, "parse failed\n"); ++ return ret; ++ } ++ ++ data->input_report_size = (hdev->report_enum[HID_INPUT_REPORT] ++ .report_id_hash[RMI_ATTN_REPORT_ID]->size >> 3) ++ + 1 /* report id */; ++ data->output_report_size = (hdev->report_enum[HID_OUTPUT_REPORT] ++ .report_id_hash[RMI_WRITE_REPORT_ID]->size >> 3) ++ + 1 /* report id */; ++ ++ alloc_size = data->output_report_size + data->input_report_size; ++ ++ data->writeReport = devm_kzalloc(&hdev->dev, alloc_size, GFP_KERNEL); ++ if (!data->writeReport) { ++ ret = -ENOMEM; ++ return ret; ++ } ++ ++ data->readReport = data->writeReport + data->output_report_size; ++ ++ init_waitqueue_head(&data->wait); ++ ++ mutex_init(&data->page_mutex); ++ ++ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); ++ if (ret) { ++ hid_err(hdev, "hw start failed\n"); ++ return ret; ++ } ++ ++ if (!test_bit(RMI_STARTED, &data->flags)) { ++ hid_hw_stop(hdev); ++ return -EIO; ++ } ++ ++ return 0; ++} ++ ++static void rmi_remove(struct hid_device *hdev) ++{ ++ struct rmi_data *hdata = hid_get_drvdata(hdev); ++ ++ clear_bit(RMI_STARTED, &hdata->flags); ++ ++ hid_hw_stop(hdev); ++} ++ ++static const struct hid_device_id rmi_id[] = { ++ { HID_I2C_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, ++ { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, HID_ANY_ID) }, ++ { } ++}; ++MODULE_DEVICE_TABLE(hid, rmi_id); ++ ++static struct hid_driver rmi_driver = { ++ .name = "hid-rmi", ++ .id_table = rmi_id, ++ .probe = rmi_probe, ++ .remove = rmi_remove, ++ .raw_event = rmi_raw_event, ++ .input_mapping = rmi_input_mapping, ++ .input_configured = rmi_input_configured, ++#ifdef CONFIG_PM ++ .resume = rmi_post_resume, ++ .reset_resume = rmi_post_reset, ++#endif ++}; ++ ++module_hid_driver(rmi_driver); ++ ++MODULE_AUTHOR("Andrew Duggan "); ++MODULE_DESCRIPTION("RMI HID driver"); ++MODULE_LICENSE("GPL"); +diff --git a/include/linux/hid.h b/include/linux/hid.h +index 31b9d29..1b5f1e9 100644 +--- a/include/linux/hid.h ++++ b/include/linux/hid.h +@@ -571,6 +571,8 @@ struct hid_descriptor { + .bus = BUS_USB, .vendor = (ven), .product = (prod) + #define HID_BLUETOOTH_DEVICE(ven, prod) \ + .bus = BUS_BLUETOOTH, .vendor = (ven), .product = (prod) ++#define HID_I2C_DEVICE(ven, prod) \ ++ .bus = BUS_I2C, .vendor = (ven), .product = (prod) + + #define HID_REPORT_ID(rep) \ + .report_type = (rep) +-- +1.8.3.1 + diff --git a/0001-acpi-video-Add-4-new-models-to-the-use_native_backli.patch b/0001-acpi-video-Add-4-new-models-to-the-use_native_backli.patch new file mode 100644 index 000000000..29da90b39 --- /dev/null +++ b/0001-acpi-video-Add-4-new-models-to-the-use_native_backli.patch @@ -0,0 +1,100 @@ +From 5d5ef0e96f03a975feb67f70d57e55cd502885fe Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 30 Apr 2014 15:24:19 +0200 +Subject: [PATCH] acpi-video: Add 4 new models to the use_native_backlight dmi + list + +Acer Aspire V5-171 +https://bugzilla.redhat.com/show_bug.cgi?id=983342 + +Acer Aspire V5-471G +Lenovo Yoga 2 11 +Reported-and-tested-by: Vincent Gerris + +HP EliteBook 8470p +https://bugzilla.redhat.com/show_bug.cgi?id=1093120 + +Cc: stable@vger.kernel.org +Signed-off-by: Hans de Goede + +Backport to 3.14, Conflicts: drivers/acpi/video.c, 3.14 is missing the +Thinkpad Helix entry from master add that while at it. +--- + drivers/acpi/video.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c +index b6ba88e..083c89f 100644 +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -491,6 +491,22 @@ static struct dmi_system_id video_dmi_table[] __initdata = { + }, + { + .callback = video_set_use_native_backlight, ++ .ident = "Lenovo Yoga 2 11", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2 11"), ++ }, ++ }, ++ { ++ .callback = video_set_use_native_backlight, ++ .ident = "Thinkpad Helix", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Helix"), ++ }, ++ }, ++ { ++ .callback = video_set_use_native_backlight, + .ident = "Dell Inspiron 7520", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +@@ -507,6 +523,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { + }, + { + .callback = video_set_use_native_backlight, ++ .ident = "Acer Aspire V5-171", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Acer"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "V5-171"), ++ }, ++ }, ++ { ++ .callback = video_set_use_native_backlight, + .ident = "Acer Aspire V5-431", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), +@@ -514,6 +538,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { + }, + }, + { ++ .callback = video_set_use_native_backlight, ++ .ident = "Acer Aspire V5-471G", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "Acer"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-471G"), ++ }, ++ }, ++ { + .callback = video_set_use_native_backlight, + .ident = "HP ProBook 4340s", + .matches = { +@@ -565,6 +597,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { + }, + { + .callback = video_set_use_native_backlight, ++ .ident = "HP EliteBook 8470p", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8470p"), ++ }, ++ }, ++ { ++ .callback = video_set_use_native_backlight, + .ident = "HP EliteBook 8780w", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +-- +1.9.0 + diff --git a/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch b/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch deleted file mode 100644 index a14532b22..000000000 --- a/0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch +++ /dev/null @@ -1,61 +0,0 @@ -From fe7963cbe464048cfae4523975aa208a6c7dc420 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Mon, 18 Feb 2013 10:32:13 -0500 -Subject: [PATCH] bluetooth: Add support for atheros 04ca:3004 device to ath3k - -Yet another version of the atheros bluetooth chipset - -T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=01 Dev#= 3 Spd=12 MxCh= 0 -D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 -P: Vendor=04ca ProdID=3004 Rev=00.01 -S: Manufacturer=Atheros Communications -S: Product=Bluetooth USB Host Controller -S: SerialNumber=Alaska Day 2006 -C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA -I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb -I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb - -This resolves https://bugzilla.redhat.com/show_bug.cgi?id=844750 - -Reported-by: niktr@mail.ru -Signed-off-by: Josh Boyer ---- - drivers/bluetooth/ath3k.c | 2 ++ - drivers/bluetooth/btusb.c | 1 + - 2 files changed, 3 insertions(+) - -diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c -index 33c9a44..b9908dd 100644 ---- a/drivers/bluetooth/ath3k.c -+++ b/drivers/bluetooth/ath3k.c -@@ -76,6 +76,7 @@ static struct usb_device_id ath3k_table[] = { - { USB_DEVICE(0x0CF3, 0x3004) }, - { USB_DEVICE(0x0CF3, 0x311D) }, - { USB_DEVICE(0x13d3, 0x3375) }, -+ { USB_DEVICE(0x04CA, 0x3004) }, - { USB_DEVICE(0x04CA, 0x3005) }, - { USB_DEVICE(0x04CA, 0x3006) }, - { USB_DEVICE(0x04CA, 0x3008) }, -@@ -108,6 +109,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { - { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, -+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, -diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index 7e351e3..59cde8e 100644 ---- a/drivers/bluetooth/btusb.c -+++ b/drivers/bluetooth/btusb.c -@@ -134,6 +134,7 @@ static struct usb_device_id blacklist_table[] = { - { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, -+ { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 }, - { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, --- -1.8.1.2 - diff --git a/0001-ideapad-laptop-Blacklist-rfkill-control-on-the-Lenov.patch b/0001-ideapad-laptop-Blacklist-rfkill-control-on-the-Lenov.patch new file mode 100644 index 000000000..29df8d781 --- /dev/null +++ b/0001-ideapad-laptop-Blacklist-rfkill-control-on-the-Lenov.patch @@ -0,0 +1,73 @@ +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1021036 +Upstream-status: Accepted into 3.16 + +From ec5a006650d13c183124bd4279b95625f85efc6d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 2 Jun 2014 17:41:00 +0200 +Subject: [PATCH 03/14] ideapad-laptop: Blacklist rfkill control on the Lenovo + Yoga 2 11 + +The Lenovo Yoga 2 11 always reports everything as blocked, causing userspace +to not even try to use the wlan / bluetooth even though they work fine. + +Note this patch also removes the "else priv->rfk[i] = NULL;" bit of the +rfkill initialization, it is not necessary as the priv struct is allocated +with kzalloc. + +Reported-and-tested-by: Vincent Gerris +Signed-off-by: Hans de Goede +--- + drivers/platform/x86/ideapad-laptop.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c +index 6dd060a0bb65..219eb289a909 100644 +--- a/drivers/platform/x86/ideapad-laptop.c ++++ b/drivers/platform/x86/ideapad-laptop.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + #define IDEAPAD_RFKILL_DEV_NUM (3) + +@@ -819,6 +820,19 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) + } + } + ++/* Blacklist for devices where the ideapad rfkill interface does not work */ ++static struct dmi_system_id rfkill_blacklist[] = { ++ /* The Lenovo Yoga 2 11 always reports everything as blocked */ ++ { ++ .ident = "Lenovo Yoga 2 11", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2 11"), ++ }, ++ }, ++ {} ++}; ++ + static int ideapad_acpi_add(struct platform_device *pdev) + { + int ret, i; +@@ -854,11 +868,10 @@ static int ideapad_acpi_add(struct platform_device *pdev) + if (ret) + goto input_failed; + +- for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) { +- if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) +- ideapad_register_rfkill(priv, i); +- else +- priv->rfk[i] = NULL; ++ if (!dmi_check_system(rfkill_blacklist)) { ++ for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) ++ if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) ++ ideapad_register_rfkill(priv, i); + } + ideapad_sync_rfk_state(priv); + ideapad_sync_touchpad_state(priv); +-- +1.9.0 + diff --git a/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch b/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch deleted file mode 100644 index acaf5f881..000000000 --- a/0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch +++ /dev/null @@ -1,46 +0,0 @@ -From feaf4959c30d0640093a607c577940d3e9351076 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Fri, 22 Feb 2013 11:47:37 -0500 -Subject: [PATCH] kmsg: Honor dmesg_restrict sysctl on /dev/kmsg - -Originally, the addition of the dmesg_restrict covered both the syslog -method of accessing dmesg, as well as /dev/kmsg itself. This was done -indirectly by security_syslog calling cap_syslog before doing any LSM -checks. - -However, commit 12b3052c3ee (capabilities/syslog: open code cap_syslog -logic to fix build failure) moved the code around and pushed the checks -into the caller itself. That seems to have inadvertently dropped the -checks for dmesg_restrict on /dev/kmsg. Most people haven't noticed -because util-linux dmesg(1) defaults to using the syslog method for -access in older versions. With util-linux 2.22 and a kernel newer than -3.5, dmesg(1) defaults to reading directly from /dev/kmsg. - -Fix this by making an explicit check in the devkmsg_open function. - -This fixes https://bugzilla.redhat.com/show_bug.cgi?id=903192 - -Reported-by: Christian Kujau -CC: stable@vger.kernel.org -Signed-off-by: Josh Boyer ---- - kernel/printk.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/kernel/printk.c b/kernel/printk.c -index f24633a..398ef9a 100644 ---- a/kernel/printk.c -+++ b/kernel/printk.c -@@ -615,6 +615,9 @@ static int devkmsg_open(struct inode *inode, struct file *file) - struct devkmsg_user *user; - int err; - -+ if (dmesg_restrict && !capable(CAP_SYSLOG)) -+ return -EACCES; -+ - /* write-only does not need any file context */ - if ((file->f_flags & O_ACCMODE) == O_WRONLY) - return 0; --- -1.8.1.2 - diff --git a/0001-lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch b/0001-lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch new file mode 100644 index 000000000..d25452268 --- /dev/null +++ b/0001-lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch @@ -0,0 +1,38 @@ +Bugzilla: N/A +Upstream-status: Nak'd, supposedly replacement coming to auto-select + +From 0f3f5c5b4ca2eb1f41947c50bedb9b17aa1a1f80 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Mon, 11 Nov 2013 08:39:16 -0500 +Subject: [PATCH] lib/cpumask: Make CPUMASK_OFFSTACK usable without debug + dependency + +When CPUMASK_OFFSTACK was added in 2008, it was dependent upon +DEBUG_PER_CPU_MAPS being enabled, or an architecture could select it. +The debug dependency adds additional overhead that isn't required for +operation of the feature, and we need CPUMASK_OFFSTACK to increase the +NR_CPUS value beyond 512 on x86. We drop the current dependency and make +sure SMP is set. + +Signed-off-by: Josh Boyer +--- + lib/Kconfig | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/Kconfig b/lib/Kconfig +index b3c8be0..50b47cd 100644 +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -342,7 +342,8 @@ config CHECK_SIGNATURE + bool + + config CPUMASK_OFFSTACK +- bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS ++ bool "Force CPU masks off stack" ++ depends on SMP + help + Use dynamic allocation for cpumask_var_t, instead of putting + them on the stack. This is a bit more expensive, but avoids +-- +1.8.3.1 + diff --git a/0001-synaptics-Add-min-max-quirk-for-ThinkPad-T431s-L440-.patch b/0001-synaptics-Add-min-max-quirk-for-ThinkPad-T431s-L440-.patch new file mode 100644 index 000000000..920c8eaaf --- /dev/null +++ b/0001-synaptics-Add-min-max-quirk-for-ThinkPad-T431s-L440-.patch @@ -0,0 +1,99 @@ +From 555b84220a7c84c2faa1964d19733d867d7bf61f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 10 Apr 2014 11:36:14 +0200 +Subject: [PATCH v3] synaptics: Add min/max quirk for ThinkPad T431s, L440, + L540, S1 Yoga and X1 + +We expect that all the Haswell series will need such quirks, sigh. + +The T431s seems to be T430 hardware in a T440s case, using the T440s touchpad, +with the same min/max issue. + +The X1 Carbon 3rd generation name says 2nd while it is a 3rd generation. + +The X1 and T431s share a PnPID with the T540p, but the reported ranges are +closer to those of the T440s. + +HdG: Squashed 5 quirk patches into one. T431s + L440 + L540 are written by me, +S1 Yoga and X1 are written by Benjamin Tissoires. + +Hdg: Standardized S1 Yoga and X1 values, Yoga uses the same touchpad as the +X240, X1 uses the same touchpad as the T440. + +Cc: stable@vger.kernel.org +Signed-off-by: Benjamin Tissoires +Signed-off-by: Hans de Goede +--- + drivers/input/mouse/synaptics.c | 42 +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c +index a8b57d7..7c9f509 100644 +--- a/drivers/input/mouse/synaptics.c ++++ b/drivers/input/mouse/synaptics.c +@@ -1566,6 +1566,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = { + .driver_data = (int []){1232, 5710, 1156, 4696}, + }, + { ++ /* Lenovo ThinkPad T431s */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T431"), ++ }, ++ .driver_data = (int []){1024, 5112, 2024, 4832}, ++ }, ++ { + /* Lenovo ThinkPad T440s */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +@@ -1574,6 +1582,14 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = { + .driver_data = (int []){1024, 5112, 2024, 4832}, + }, + { ++ /* Lenovo ThinkPad L440 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L440"), ++ }, ++ .driver_data = (int []){1024, 5112, 2024, 4832}, ++ }, ++ { + /* Lenovo ThinkPad T540p */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +@@ -1581,6 +1597,32 @@ static const struct dmi_system_id min_max_dmi_table[] __initconst = { + }, + .driver_data = (int []){1024, 5056, 2058, 4832}, + }, ++ { ++ /* Lenovo ThinkPad L540 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L540"), ++ }, ++ .driver_data = (int []){1024, 5112, 2024, 4832}, ++ }, ++ { ++ /* Lenovo Yoga S1 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, ++ "ThinkPad S1 Yoga"), ++ }, ++ .driver_data = (int []){1232, 5710, 1156, 4696}, ++ }, ++ { ++ /* Lenovo ThinkPad X1 Carbon Haswell (3rd generation) */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, ++ "ThinkPad X1 Carbon 2nd"), ++ }, ++ .driver_data = (int []){1024, 5112, 2024, 4832}, ++ }, + #endif + { } + }; +-- +1.9.0 + diff --git a/0002-ideapad-laptop-Change-Lenovo-Yoga-2-series-rfkill-ha.patch b/0002-ideapad-laptop-Change-Lenovo-Yoga-2-series-rfkill-ha.patch new file mode 100644 index 000000000..aab1c4e32 --- /dev/null +++ b/0002-ideapad-laptop-Change-Lenovo-Yoga-2-series-rfkill-ha.patch @@ -0,0 +1,138 @@ +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1021036 +Upstream-status: Send upstream for 3.17 + +From 0ad19912cb324f0a356a212433ec0b2a31f61acc Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 20 Jun 2014 10:29:16 +0200 +Subject: [PATCH] ideapad-laptop: Change Lenovo Yoga 2 series rfkill handling + +It seems that the same problems which lead to adding an rfkill blacklist and +putting the Lenovo Yoga 2 11 on it are also present on the Lenovo Yoga 2 13 +and Lenovo Yoga 2 Pro too: +https://bugzilla.redhat.com/show_bug.cgi?id=1021036 +https://forums.lenovo.com/t5/Linux-Discussion/Yoga-2-13-not-Pro-Linux-Warning/m-p/1517612 + +Testing has shown that the firmware rfkill settings are persistent over +reboots. So blacklisting the driver is not good enough, if the wifi is blocked +at the firmware level the wifi needs to be explictly unblocked through the +ideapad-laptop interface. + +And at least on the Lenovo Yoga 2 13 the VPCCMD_RF register which on devices +with hardware kill switch reports the hardware switch state, needs to be +explictly set to 1 (radio enabled / not blocked). + +So this patch does 3 things to get proper rfkill handling on these models: + +1) Instead of blacklisting the rfkill functionality, which means that people +with a firmware blocked wifi get stuck in that situation, ignore the value +reported by the not present hardware rfkill switch, as this is what is causing +ideapad-laptop to wrongly report all radios as hardware blocks. But do register +the rfkill interfaces so that the user can soft [un]block them. + +2) On models without a hardware rfkill switch, explictly set VPCCMD_RF to 1 + +3) Drop the " 11" postfix from the dmi match string, as the entire Yoga 2 +series is affected. + +Yoga 2 11: +Reported-and-tested-by: Vincent Gerris + +Yoga 2 13: +Tested-by: madls05 + +Yoga 2 Pro: +Reported-and-tested-by: Peter F. Patel-Schneider + +Signed-off-by: Hans de Goede +--- + drivers/platform/x86/ideapad-laptop.c | 41 +++++++++++++++++++++++------------ + 1 file changed, 27 insertions(+), 14 deletions(-) + +diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c +index b4c495a..b0e3a2e 100644 +--- a/drivers/platform/x86/ideapad-laptop.c ++++ b/drivers/platform/x86/ideapad-laptop.c +@@ -87,6 +87,7 @@ struct ideapad_private { + struct backlight_device *blightdev; + struct dentry *debug; + unsigned long cfg; ++ bool has_hw_rfkill_switch; + }; + + static bool no_bt_rfkill; +@@ -473,12 +474,14 @@ static struct rfkill_ops ideapad_rfk_ops = { + + static void ideapad_sync_rfk_state(struct ideapad_private *priv) + { +- unsigned long hw_blocked; ++ unsigned long hw_blocked = 0; + int i; + +- if (read_ec_data(priv->adev->handle, VPCCMD_R_RF, &hw_blocked)) +- return; +- hw_blocked = !hw_blocked; ++ if (priv->has_hw_rfkill_switch) { ++ if (read_ec_data(priv->adev->handle, VPCCMD_R_RF, &hw_blocked)) ++ return; ++ hw_blocked = !hw_blocked; ++ } + + for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) + if (priv->rfk[i]) +@@ -821,14 +824,17 @@ static void ideapad_acpi_notify(acpi_handle handle, u32 event, void *data) + } + } + +-/* Blacklist for devices where the ideapad rfkill interface does not work */ +-static struct dmi_system_id rfkill_blacklist[] = { +- /* The Lenovo Yoga 2 11 always reports everything as blocked */ ++/* ++ * Some ideapads don't have a hardware rfkill switch, reading VPCCMD_R_RF ++ * always results in 0 on these models, causing ideapad_laptop to wrongly ++ * report all radios as hardware-blocked. ++ */ ++static struct dmi_system_id no_hw_rfkill_list[] = { + { +- .ident = "Lenovo Yoga 2 11", ++ .ident = "Lenovo Yoga 2 11 / 13 / Pro", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2 11"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2"), + }, + }, + {} +@@ -856,6 +862,7 @@ static int ideapad_acpi_add(struct platform_device *pdev) + priv->cfg = cfg; + priv->adev = adev; + priv->platform_device = pdev; ++ priv->has_hw_rfkill_switch = !dmi_check_system(no_hw_rfkill_list); + + ret = ideapad_sysfs_init(priv); + if (ret) +@@ -869,11 +876,17 @@ static int ideapad_acpi_add(struct platform_device *pdev) + if (ret) + goto input_failed; + +- if (!dmi_check_system(rfkill_blacklist)) { +- for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) +- if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) +- ideapad_register_rfkill(priv, i); +- } ++ /* ++ * On some models without a hw-switch (the yoga 2 13 at least) ++ * VPCCMD_W_RF must be explicitly set to 1 for the wifi to work. ++ */ ++ if (!priv->has_hw_rfkill_switch) ++ write_ec_cmd(priv->adev->handle, VPCCMD_W_RF, 1); ++ ++ for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) ++ if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) ++ ideapad_register_rfkill(priv, i); ++ + ideapad_sync_rfk_state(priv); + ideapad_sync_touchpad_state(priv); + +-- +2.0.0 + diff --git a/0003-samsung-laptop-Add-broken-acpi-video-quirk-for-NC210.patch b/0003-samsung-laptop-Add-broken-acpi-video-quirk-for-NC210.patch new file mode 100644 index 000000000..d76aa2166 --- /dev/null +++ b/0003-samsung-laptop-Add-broken-acpi-video-quirk-for-NC210.patch @@ -0,0 +1,39 @@ +From f46debb4f324d6ab66782de6ad3b884fbf223ec4 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 1 May 2014 14:20:06 +0200 +Subject: [PATCH 3/4] samsung-laptop: Add broken-acpi-video quirk for + NC210/NC110 + +Reported (and tested) here: +https://bugzilla.redhat.com/show_bug.cgi?id=861573 + +Cc: stable@vger.kernel.org +Signed-off-by: Hans de Goede +--- + drivers/platform/x86/samsung-laptop.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c +index d1f03005..98f61f6 100644 +--- a/drivers/platform/x86/samsung-laptop.c ++++ b/drivers/platform/x86/samsung-laptop.c +@@ -1534,6 +1534,16 @@ static struct dmi_system_id __initdata samsung_dmi_table[] = { + }, + .driver_data = &samsung_broken_acpi_video, + }, ++ { ++ .callback = samsung_dmi_matched, ++ .ident = "NC210", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "NC210/NC110"), ++ DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"), ++ }, ++ .driver_data = &samsung_broken_acpi_video, ++ }, + { }, + }; + MODULE_DEVICE_TABLE(dmi, samsung_dmi_table); +-- +1.9.0 + diff --git a/Bluetooth-allocate-static-minor-for-vhci.patch b/Bluetooth-allocate-static-minor-for-vhci.patch new file mode 100644 index 000000000..8acfb308f --- /dev/null +++ b/Bluetooth-allocate-static-minor-for-vhci.patch @@ -0,0 +1,71 @@ +Bugzilla: 1051748 +Upstream-status: Queued for 3.15 + +From b075dd40c95d11c2c8690f6c4d6232fc0d9e7f56 Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi +Date: Tue, 18 Feb 2014 05:19:26 +0000 +Subject: Bluetooth: allocate static minor for vhci + +Commit bfacbb9 (Bluetooth: Use devname:vhci module alias for virtual HCI +driver) added the module alias to hci_vhci module so it's possible to +create the /dev/vhci node. However creating an alias without +specifying the minor doesn't allow us to create the node ahead, +triggerring module auto-load when it's first accessed. + +Starting with depmod from kmod 16 we started to warn if there's a +devname alias without specifying the major and minor. + +Let's do the same done for uhid, kvm, fuse and others, specifying a +fixed minor. In systems with systemd as the init the following will +happen: on early boot systemd will call "kmod static-nodes" to read +/lib/modules/$(uname -r)/modules.devname and then create the nodes. When +first accessed these "dead" nodes will trigger the module loading. + +Signed-off-by: Lucas De Marchi +Acked-by: Greg Kroah-Hartman +Signed-off-by: Marcel Holtmann +--- +diff --git a/Documentation/devices.txt b/Documentation/devices.txt +index 10378cc..04356f5 100644 +--- a/Documentation/devices.txt ++++ b/Documentation/devices.txt +@@ -353,6 +353,7 @@ Your cooperation is appreciated. + 133 = /dev/exttrp External device trap + 134 = /dev/apm_bios Advanced Power Management BIOS + 135 = /dev/rtc Real Time Clock ++ 137 = /dev/vhci Bluetooth virtual HCI driver + 139 = /dev/openprom SPARC OpenBoot PROM + 140 = /dev/relay8 Berkshire Products Octal relay card + 141 = /dev/relay16 Berkshire Products ISO-16 relay card +diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c +index 1ef6990..add1c6a 100644 +--- a/drivers/bluetooth/hci_vhci.c ++++ b/drivers/bluetooth/hci_vhci.c +@@ -359,7 +359,7 @@ static const struct file_operations vhci_fops = { + static struct miscdevice vhci_miscdev= { + .name = "vhci", + .fops = &vhci_fops, +- .minor = MISC_DYNAMIC_MINOR, ++ .minor = VHCI_MINOR, + }; + + static int __init vhci_init(void) +@@ -385,3 +385,4 @@ MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION); + MODULE_VERSION(VERSION); + MODULE_LICENSE("GPL"); + MODULE_ALIAS("devname:vhci"); ++MODULE_ALIAS_MISCDEV(VHCI_MINOR); +diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h +index 3737f72..7bb6148 100644 +--- a/include/linux/miscdevice.h ++++ b/include/linux/miscdevice.h +@@ -23,6 +23,7 @@ + #define TEMP_MINOR 131 /* Temperature Sensor */ + #define RTC_MINOR 135 + #define EFI_RTC_MINOR 136 /* EFI Time services */ ++#define VHCI_MINOR 137 + #define SUN_OPENPROM_MINOR 139 + #define DMAPI_MINOR 140 /* DMAPI */ + #define NVRAM_MINOR 144 +-- +cgit v0.9.2 diff --git a/HID-rmi-do-not-fetch-more-than-16-bytes-in-a-query.patch b/HID-rmi-do-not-fetch-more-than-16-bytes-in-a-query.patch new file mode 100644 index 000000000..972a1b142 --- /dev/null +++ b/HID-rmi-do-not-fetch-more-than-16-bytes-in-a-query.patch @@ -0,0 +1,60 @@ +Bugzilla: 1090161 +Upstream-status: sent https://patchwork.kernel.org/patch/4055781/ + +From patchwork Thu Apr 24 22:26:38 2014 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: HID: rmi: do not fetch more than 16 bytes in a query +From: Benjamin Tissoires +X-Patchwork-Id: 4055781 +Message-Id: <1398378398-24825-1-git-send-email-benjamin.tissoires@redhat.com> +To: Andrew Duggan , + Christopher Heiny , + Jiri Kosina , linux-input@vger.kernel.org, + linux-kernel@vger.kernel.org +Date: Thu, 24 Apr 2014 18:26:38 -0400 + +A firmware bug is present on the XPS Haswell edition which silently +split the request in two responses when the caller ask for a read of +more than 16 bytes. +The FW sends the first 16 then the 4 next, but it says that it answered +the 20 bytes in the first report. + +This occurs only on the retrieving of the min/max of X and Y of the F11 +function. +We only use the first 10 bytes of the Ctrl register, so we can get only +those 10 bytes to prevent the bug from happening. + +Resolves: +https://bugzilla.redhat.com/show_bug.cgi?id=1090161 + +Signed-off-by: Benjamin Tissoires + +--- +drivers/hid/hid-rmi.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c +index 7da9509..cee89c9 100644 +--- a/drivers/hid/hid-rmi.c ++++ b/drivers/hid/hid-rmi.c +@@ -613,10 +613,15 @@ static int rmi_populate_f11(struct hid_device *hdev) + } + } + +- /* retrieve the ctrl registers */ +- ret = rmi_read_block(hdev, data->f11.control_base_addr, buf, 20); ++ /* ++ * retrieve the ctrl registers ++ * the ctrl register has a size of 20 but a fw bug split it into 16 + 4, ++ * and there is no way to know if the first 20 bytes are here or not. ++ * We use only the first 10 bytes, so get only them. ++ */ ++ ret = rmi_read_block(hdev, data->f11.control_base_addr, buf, 10); + if (ret) { +- hid_err(hdev, "can not read ctrl block of size 20: %d.\n", ret); ++ hid_err(hdev, "can not read ctrl block of size 10: %d.\n", ret); + return ret; + } + diff --git a/Input-elantech-add-support-for-newer-elantech-touchpads.patch b/Input-elantech-add-support-for-newer-elantech-touchpads.patch new file mode 100644 index 000000000..448aeae54 --- /dev/null +++ b/Input-elantech-add-support-for-newer-elantech-touchpads.patch @@ -0,0 +1,32 @@ +Bugzilla: 1051668 +Upstream-status: 3.15 + +From ae4bedf0679d99f0a9b80a7ea9b8dd205de05d06 Mon Sep 17 00:00:00 2001 +From: Jordan Rife +Date: Tue, 22 Apr 2014 17:44:51 -0700 +Subject: Input: elantech - add support for newer elantech touchpads + +Newer elantech touchpads are not recognized by the current driver, since it +fails to detect their firmware version number. This prevents more advanced +touchpad features from being usable such as two-finger scrolling. This +patch allows newer touchpads to be detected and be fully functional. Tested +on Sony Vaio SVF13N17PXB. + +Signed-off-by: Jordan Rife +Signed-off-by: Dmitry Torokhov + +diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c +index ef1cf52..088d354 100644 +--- a/drivers/input/mouse/elantech.c ++++ b/drivers/input/mouse/elantech.c +@@ -1353,6 +1353,7 @@ static int elantech_set_properties(struct elantech_data *etd) + case 6: + case 7: + case 8: ++ case 9: + etd->hw_version = 4; + break; + default: +-- +cgit v0.10.1 + diff --git a/KVM-ioapic-fix-assignment-of-ioapic-rtc_status-pending_eoi.patch b/KVM-ioapic-fix-assignment-of-ioapic-rtc_status-pending_eoi.patch new file mode 100644 index 000000000..170911e1d --- /dev/null +++ b/KVM-ioapic-fix-assignment-of-ioapic-rtc_status-pending_eoi.patch @@ -0,0 +1,38 @@ +Bugzilla: 1085016 +Upstream-status: Queued for 3.15 + +From 5678de3f15010b9022ee45673f33bcfc71d47b60 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 28 Mar 2014 20:41:50 +0100 +Subject: KVM: ioapic: fix assignment of ioapic->rtc_status.pending_eoi + (CVE-2014-0155) + +QE reported that they got the BUG_ON in ioapic_service to trigger. +I cannot reproduce it, but there are two reasons why this could happen. + +The less likely but also easiest one, is when kvm_irq_delivery_to_apic +does not deliver to any APIC and returns -1. + +Because irqe.shorthand == 0, the kvm_for_each_vcpu loop in that +function is never reached. However, you can target the similar loop in +kvm_irq_delivery_to_apic_fast; just program a zero logical destination +address into the IOAPIC, or an out-of-range physical destination address. + +Signed-off-by: Paolo Bonzini + +diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c +index d4b6015..d98d107 100644 +--- a/virt/kvm/ioapic.c ++++ b/virt/kvm/ioapic.c +@@ -356,7 +356,7 @@ static int ioapic_service(struct kvm_ioapic *ioapic, int irq, bool line_status) + BUG_ON(ioapic->rtc_status.pending_eoi != 0); + ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe, + ioapic->rtc_status.dest_map); +- ioapic->rtc_status.pending_eoi = ret; ++ ioapic->rtc_status.pending_eoi = (ret < 0 ? 0 : ret); + } else + ret = kvm_irq_delivery_to_apic(ioapic->kvm, NULL, &irqe, NULL); + +-- +cgit v0.10.1 + diff --git a/Makefile.config b/Makefile.config index 78085481b..6e5e5473c 100644 --- a/Makefile.config +++ b/Makefile.config @@ -9,9 +9,7 @@ CONFIGFILES = \ $(CFG)-i686-PAE.config $(CFG)-i686-PAEdebug.config \ $(CFG)-x86_64.config $(CFG)-x86_64-debug.config \ $(CFG)-s390x.config \ - $(CFG)-armv7l.config $(CFG)-armv7hl.config \ - $(CFG)-armv7l-omap.config $(CFG)-armv7hl-omap.config \ - $(CFG)-armv7l-tegra.config $(CFG)-armv7hl-tegra.config \ + $(CFG)-armv7hl.config $(CFG)-armv7hl-lpae.config\ $(CFG)-ppc.config $(CFG)-ppc-smp.config \ $(CFG)-ppc64.config $(CFG)-ppc64p7.config $(CFG)-ppc64-debug.config @@ -33,17 +31,17 @@ temp-generic: config-generic temp-debug-generic: config-generic cat config-generic config-debug > temp-debug-generic -temp-armv7: config-armv7 temp-generic +temp-arm-generic: config-arm-generic temp-generic perl merge.pl $^ > $@ -temp-arm-generic: config-arm-generic temp-generic - perl merge.pl $^ > $@ +temp-armv7-generic: config-armv7-generic temp-arm-generic + perl merge.pl $^ > $@ -temp-armv7l-omap: config-arm-omap temp-arm-generic - perl merge.pl $^ > $@ +temp-armv7: config-armv7 temp-armv7-generic + perl merge.pl $^ > $@ -temp-armv7l-tegra: config-arm-tegra temp-arm-generic - perl merge.pl $^ > $@ +temp-armv7-lpae: config-armv7-lpae temp-armv7-generic + perl merge.pl $^ > $@ temp-x86-32: config-x86-32-generic config-x86-generic perl merge.pl $^ > $@ @@ -108,22 +106,10 @@ kernel-$(VERSION)-ppc64p7.config: config-powerpc64p7 temp-powerpc64-generic kernel-$(VERSION)-s390x.config: config-s390x temp-s390-generic perl merge.pl $^ s390 > $@ -kernel-$(VERSION)-armv7l.config: /dev/null temp-armv7 - perl merge.pl $^ arm > $@ - -kernel-$(VERSION)-armv7l-omap.config: /dev/null temp-armv7l-omap - perl merge.pl $^ arm > $@ - -kernel-$(VERSION)-armv7l-tegra.config: /dev/null temp-armv7l-tegra - perl merge.pl $^ arm > $@ - kernel-$(VERSION)-armv7hl.config: /dev/null temp-armv7 perl merge.pl $^ arm > $@ -kernel-$(VERSION)-armv7hl-omap.config: /dev/null temp-armv7l-omap - perl merge.pl $^ arm > $@ - -kernel-$(VERSION)-armv7hl-tegra.config: /dev/null temp-armv7l-tegra +kernel-$(VERSION)-armv7hl-lpae.config: /dev/null temp-armv7-lpae perl merge.pl $^ arm > $@ kernel-$(VERSION)-ppc.config: /dev/null temp-powerpc32-generic diff --git a/Makefile.release b/Makefile.release index ee811bac2..796338591 100644 --- a/Makefile.release +++ b/Makefile.release @@ -79,3 +79,7 @@ config-release: @# Disable UAS for release until it's ready. (#717633, #744099) @perl -pi -e 's/CONFIG_USB_UAS=m/# CONFIG_USB_UAS is not set/' config-generic + + @perl -pi -e 's/CONFIG_SCHEDSTATS=y/# CONFIG_SCHEDSTATS is not set/' config-nodebug + @perl -pi -e 's/CONFIG_LATENCYTOP=y/# CONFIG_LATENCYTOP is not set/' config-nodebug + diff --git a/Revert-userns-Allow-unprivileged-users-to-create-use.patch b/Revert-userns-Allow-unprivileged-users-to-create-use.patch new file mode 100644 index 000000000..cea6bff01 --- /dev/null +++ b/Revert-userns-Allow-unprivileged-users-to-create-use.patch @@ -0,0 +1,44 @@ +Bugzilla: 917708 +Upstream-status: Fedora mustard + +From e3da68be55914bfeedb8866f191cc0958579611d Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Wed, 13 Nov 2013 10:21:18 -0500 +Subject: [PATCH] Revert "userns: Allow unprivileged users to create user + namespaces." + +This reverts commit 5eaf563e53294d6696e651466697eb9d491f3946. + +Conflicts: + kernel/fork.c +--- + kernel/fork.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/kernel/fork.c b/kernel/fork.c +index f6d11fc..e04c9a7 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -1573,6 +1573,19 @@ long do_fork(unsigned long clone_flags, + long nr; + + /* ++ * Do some preliminary argument and permissions checking before we ++ * actually start allocating stuff ++ */ ++ if (clone_flags & CLONE_NEWUSER) { ++ /* hopefully this check will go away when userns support is ++ * complete ++ */ ++ if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SETUID) || ++ !capable(CAP_SETGID)) ++ return -EPERM; ++ } ++ ++ /* + * Determine whether and which event to report to ptracer. When + * called from kernel_thread or CLONE_UNTRACED is explicitly + * requested, no event is reported; otherwise, report if the event +-- +1.8.3.1 + diff --git a/acpi-sony-nonvs-blacklist.patch b/acpi-sony-nonvs-blacklist.patch deleted file mode 100644 index db500e8bf..000000000 --- a/acpi-sony-nonvs-blacklist.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c -index 3ed80b2..17fc718 100644 ---- a/drivers/acpi/sleep.c -+++ b/drivers/acpi/sleep.c -@@ -390,6 +390,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { - }, - { - .callback = init_nvs_nosave, -+ .ident = "Sony Vaio VGN-FW21E", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), -+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"), -+ }, -+ }, -+ { -+ .callback = init_nvs_nosave, - .ident = "Sony Vaio VGN-SR11M", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), -diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c -index 0e46fae..6d9a3ab 100644 ---- a/drivers/acpi/sleep.c -+++ b/drivers/acpi/sleep.c -@@ -398,6 +398,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { - }, - { - .callback = init_nvs_nosave, -+ .ident = "Sony Vaio VPCEB17FX", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), -+ DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"), -+ }, -+ }, -+ { -+ .callback = init_nvs_nosave, - .ident = "Sony Vaio VGN-SR11M", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), diff --git a/acpi-video-dos.patch b/acpi-video-dos.patch deleted file mode 100644 index 3e2085193..000000000 --- a/acpi-video-dos.patch +++ /dev/null @@ -1,17 +0,0 @@ -Disable firmware video brightness change on AC/Battery switch by default - --- mjg59 - -diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c -index bac2901..93b1a9e 100644 ---- a/drivers/acpi/video.c -+++ b/drivers/acpi/video.c -@@ -1818,7 +1818,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) - - static int acpi_video_bus_start_devices(struct acpi_video_bus *video) - { -- return acpi_video_bus_DOS(video, 0, 0); -+ return acpi_video_bus_DOS(video, 0, 1); - } - - static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) diff --git a/alps-v2.patch b/alps-v2.patch deleted file mode 100644 index bdb57067e..000000000 --- a/alps-v2.patch +++ /dev/null @@ -1,248 +0,0 @@ -From db7192fa07fa5c70c9849d8f658a7ff696cff99d Mon Sep 17 00:00:00 2001 -From: Kevin Cernekee -Date: Sat, 16 Feb 2013 22:40:03 -0800 -Subject: [PATCH 14/15] Input: ALPS - Remove unused argument to - alps_enter_command_mode() - -Now that alps_identify() explicitly issues an EC report using -alps_rpt_cmd(), we no longer need to look at the magic numbers returned -by alps_enter_command_mode(). - -Signed-off-by: Kevin Cernekee ---- - drivers/input/mouse/alps.c | 18 +++++++----------- - 1 file changed, 7 insertions(+), 11 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 7b99fc7..9c97531 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -994,8 +994,7 @@ static int alps_rpt_cmd(struct psmouse *psmouse, int init_command, - return 0; - } - --static int alps_enter_command_mode(struct psmouse *psmouse, -- unsigned char *resp) -+static int alps_enter_command_mode(struct psmouse *psmouse) - { - unsigned char param[4]; - -@@ -1009,9 +1008,6 @@ static int alps_enter_command_mode(struct psmouse *psmouse, - "unknown response while entering command mode\n"); - return -1; - } -- -- if (resp) -- *resp = param[2]; - return 0; - } - -@@ -1176,7 +1172,7 @@ static int alps_passthrough_mode_v3(struct psmouse *psmouse, - { - int reg_val, ret = -1; - -- if (alps_enter_command_mode(psmouse, NULL)) -+ if (alps_enter_command_mode(psmouse)) - return -1; - - reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x0008); -@@ -1216,7 +1212,7 @@ static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base) - { - int ret = -EIO, reg_val; - -- if (alps_enter_command_mode(psmouse, NULL)) -+ if (alps_enter_command_mode(psmouse)) - goto error; - - reg_val = alps_command_mode_read_reg(psmouse, reg_base + 0x08); -@@ -1279,7 +1275,7 @@ static int alps_setup_trackstick_v3(struct psmouse *psmouse, int reg_base) - * supported by this driver. If bit 1 isn't set the packet - * format is different. - */ -- if (alps_enter_command_mode(psmouse, NULL) || -+ if (alps_enter_command_mode(psmouse) || - alps_command_mode_write_reg(psmouse, - reg_base + 0x08, 0x82) || - alps_exit_command_mode(psmouse)) -@@ -1306,7 +1302,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse) - alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO) - goto error; - -- if (alps_enter_command_mode(psmouse, NULL) || -+ if (alps_enter_command_mode(psmouse) || - alps_absolute_mode_v3(psmouse)) { - psmouse_err(psmouse, "Failed to enter absolute mode\n"); - goto error; -@@ -1381,7 +1377,7 @@ static int alps_hw_init_rushmore_v3(struct psmouse *psmouse) - priv->flags &= ~ALPS_DUALPOINT; - } - -- if (alps_enter_command_mode(psmouse, NULL) || -+ if (alps_enter_command_mode(psmouse) || - alps_command_mode_read_reg(psmouse, 0xc2d9) == -1 || - alps_command_mode_write_reg(psmouse, 0xc2cb, 0x00)) - goto error; -@@ -1431,7 +1427,7 @@ static int alps_hw_init_v4(struct psmouse *psmouse) - struct ps2dev *ps2dev = &psmouse->ps2dev; - unsigned char param[4]; - -- if (alps_enter_command_mode(psmouse, NULL)) -+ if (alps_enter_command_mode(psmouse)) - goto error; - - if (alps_absolute_mode_v4(psmouse)) { --- -1.8.1.2 - - -From 10740a25bb3b895b5de7773f926a978416b38409 Mon Sep 17 00:00:00 2001 -From: Dave Turvene -Date: Sat, 16 Feb 2013 22:40:04 -0800 -Subject: [PATCH 15/15] Input: ALPS - Add "Dolphin V1" touchpad support - -These touchpads use a different protocol; they have been seen on Dell -N5110, Dell 17R SE, and others. - -The official ALPS driver identifies them by looking for an exact match -on the E7 report: 73 03 50. Dolphin V1 returns an EC report of -73 01 xx (02 and 0d have been seen); Dolphin V2 returns an EC report of -73 02 xx (02 has been seen). - -Dolphin V2 probably needs a different initialization sequence and/or -report parser, so it is left for a future commit. - -Signed-off-by: Dave Turvene -Signed-off-by: Kevin Cernekee ---- - drivers/input/mouse/alps.c | 67 ++++++++++++++++++++++++++++++++++++++++++++-- - drivers/input/mouse/alps.h | 1 + - 2 files changed, 66 insertions(+), 2 deletions(-) - -diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c -index 9c97531..0238e0e 100644 ---- a/drivers/input/mouse/alps.c -+++ b/drivers/input/mouse/alps.c -@@ -490,6 +490,29 @@ static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p) - f->y_map |= (p[5] & 0x20) << 6; - } - -+static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p) -+{ -+ f->first_mp = !!(p[0] & 0x02); -+ f->is_mp = !!(p[0] & 0x20); -+ -+ f->fingers = ((p[0] & 0x6) >> 1 | -+ (p[0] & 0x10) >> 2); -+ f->x_map = ((p[2] & 0x60) >> 5) | -+ ((p[4] & 0x7f) << 2) | -+ ((p[5] & 0x7f) << 9) | -+ ((p[3] & 0x07) << 16) | -+ ((p[3] & 0x70) << 15) | -+ ((p[0] & 0x01) << 22); -+ f->y_map = (p[1] & 0x7f) | -+ ((p[2] & 0x1f) << 7); -+ -+ f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7)); -+ f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3)); -+ f->z = (p[0] & 4) ? 0 : p[5] & 0x7f; -+ -+ alps_decode_buttons_v3(f, p); -+} -+ - static void alps_process_touchpad_packet_v3(struct psmouse *psmouse) - { - struct alps_data *priv = psmouse->private; -@@ -874,7 +897,8 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) - } - - /* Bytes 2 - pktsize should have 0 in the highest bit */ -- if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && -+ if (priv->proto_version != ALPS_PROTO_V5 && -+ psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && - (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { - psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", - psmouse->pktcnt - 1, -@@ -1003,7 +1027,8 @@ static int alps_enter_command_mode(struct psmouse *psmouse) - return -1; - } - -- if (param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) { -+ if ((param[0] != 0x88 || (param[1] != 0x07 && param[1] != 0x08)) && -+ param[0] != 0x73) { - psmouse_dbg(psmouse, - "unknown response while entering command mode\n"); - return -1; -@@ -1495,6 +1520,23 @@ error: - return -1; - } - -+static int alps_hw_init_dolphin_v1(struct psmouse *psmouse) -+{ -+ struct ps2dev *ps2dev = &psmouse->ps2dev; -+ unsigned char param[2]; -+ -+ /* This is dolphin "v1" as empirically defined by florin9doi */ -+ param[0] = 0x64; -+ param[1] = 0x28; -+ -+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSTREAM) || -+ ps2_command(ps2dev, ¶m[0], PSMOUSE_CMD_SETRATE) || -+ ps2_command(ps2dev, ¶m[1], PSMOUSE_CMD_SETRATE)) -+ return -1; -+ -+ return 0; -+} -+ - static void alps_set_defaults(struct alps_data *priv) - { - priv->byte0 = 0x8f; -@@ -1528,6 +1570,21 @@ static void alps_set_defaults(struct alps_data *priv) - priv->nibble_commands = alps_v4_nibble_commands; - priv->addr_command = PSMOUSE_CMD_DISABLE; - break; -+ case ALPS_PROTO_V5: -+ priv->hw_init = alps_hw_init_dolphin_v1; -+ priv->process_packet = alps_process_packet_v3; -+ priv->decode_fields = alps_decode_dolphin; -+ priv->set_abs_params = alps_set_abs_params_mt; -+ priv->nibble_commands = alps_v3_nibble_commands; -+ priv->addr_command = PSMOUSE_CMD_RESET_WRAP; -+ priv->byte0 = 0xc8; -+ priv->mask0 = 0xc8; -+ priv->flags = 0; -+ priv->x_max = 1360; -+ priv->y_max = 660; -+ priv->x_bits = 23; -+ priv->y_bits = 12; -+ break; - } - } - -@@ -1588,6 +1645,12 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) - - if (alps_match_table(psmouse, priv, e7, ec) == 0) { - return 0; -+ } else if (e7[0] == 0x73 && e7[1] == 0x03 && e7[2] == 0x50 && -+ ec[0] == 0x73 && ec[1] == 0x01) { -+ priv->proto_version = ALPS_PROTO_V5; -+ alps_set_defaults(priv); -+ -+ return 0; - } else if (ec[0] == 0x88 && ec[1] == 0x08) { - priv->proto_version = ALPS_PROTO_V3; - alps_set_defaults(priv); -diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h -index 9704805..eee5985 100644 ---- a/drivers/input/mouse/alps.h -+++ b/drivers/input/mouse/alps.h -@@ -16,6 +16,7 @@ - #define ALPS_PROTO_V2 2 - #define ALPS_PROTO_V3 3 - #define ALPS_PROTO_V4 4 -+#define ALPS_PROTO_V5 5 - - /** - * struct alps_model_info - touchpad ID table --- -1.8.1.2 - diff --git a/arm-export-read_current_timer.patch b/arm-export-read_current_timer.patch deleted file mode 100644 index 5059d6862..000000000 --- a/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/arm-imx6-utilite.patch b/arm-imx6-utilite.patch new file mode 100644 index 000000000..35f34c166 --- /dev/null +++ b/arm-imx6-utilite.patch @@ -0,0 +1,158 @@ +commit 682d055e6ac5c3855f51649de6d68e9bb29c26a6 +Author: Valentin Raevsky +Date: Tue Oct 29 14:11:43 2013 +0200 + + ARM: dts: Add initial support for cm-fx6. + + Add initial support for cm-fx6 module. + + cm-fx6 is a module based on mx6q SoC with the following features: + - Up to 4GB of DDR3 + - 1 LCD/DVI output port + - 1 HDMI output port + - 2 LVDS LCD ports + - Gigabit Ethernet + - Analog Audio + - CAN + - SATA + - NAND + - PCIE + + This patch allows to boot up the module, configures the serial console, + the Ethernet adapter and the heartbeat led. + + cm-fx6 is embedded inside the Utilite computer. + + Signed-off-by: Valentin Raevsky + Signed-off-by: Igor Grinberg + Signed-off-by: Shawn Guo + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index 8081479..5672e91 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -162,6 +162,7 @@ dtb-$(CONFIG_ARCH_MXC) += \ + imx6dl-sabresd.dtb \ + imx6dl-wandboard.dtb \ + imx6q-arm2.dtb \ ++ imx6q-cm-fx6.dtb \ + imx6q-cubox-i.dtb \ + imx6q-phytec-pbab01.dtb \ + imx6q-sabreauto.dtb \ +diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts +new file mode 100644 +index 0000000..99b46f8 +--- /dev/null ++++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts +@@ -0,0 +1,107 @@ ++/* ++ * Copyright 2013 CompuLab Ltd. ++ * ++ * Author: Valentin Raevsky ++ * ++ * The code contained herein is licensed under the GNU General Public ++ * License. You may obtain a copy of the GNU General Public License ++ * Version 2 or later at the following locations: ++ * ++ * http://www.opensource.org/licenses/gpl-license.html ++ * http://www.gnu.org/copyleft/gpl.html ++ */ ++ ++/dts-v1/; ++#include "imx6q.dtsi" ++ ++/ { ++ model = "CompuLab CM-FX6"; ++ compatible = "compulab,cm-fx6", "fsl,imx6q"; ++ ++ memory { ++ reg = <0x10000000 0x80000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ heartbeat-led { ++ label = "Heartbeat"; ++ gpios = <&gpio2 31 0>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++}; ++ ++&fec { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_enet>; ++ phy-mode = "rgmii"; ++ status = "okay"; ++}; ++ ++&gpmi { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_gpmi_nand>; ++ status = "okay"; ++}; ++ ++&iomuxc { ++ imx6q-cm-fx6 { ++ pinctrl_enet: enetgrp { ++ fsl,pins = < ++ MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0 ++ MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0 ++ MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0 ++ MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0 ++ MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0 ++ MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0 ++ MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0 ++ MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0 ++ MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0 ++ MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0 ++ MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0 ++ MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0 ++ MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0 ++ MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0 ++ MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0 ++ MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8 ++ >; ++ }; ++ ++ pinctrl_gpmi_nand: gpminandgrp { ++ fsl,pins = < ++ MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1 ++ MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1 ++ MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1 ++ MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000 ++ MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1 ++ MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1 ++ MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1 ++ MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1 ++ MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1 ++ MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1 ++ MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1 ++ MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1 ++ MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1 ++ MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1 ++ MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1 ++ MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1 ++ MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1 ++ >; ++ }; ++ ++ pinctrl_uart4: uart4grp { ++ fsl,pins = < ++ MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1 ++ MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1 ++ >; ++ }; ++ }; ++}; ++ ++&uart4 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_uart4>; ++ status = "okay"; ++}; ++ ++&sata { ++ status = "okay"; ++}; diff --git a/arm-lpae-ax88796.patch b/arm-lpae-ax88796.patch new file mode 100644 index 000000000..b1bdc760c --- /dev/null +++ b/arm-lpae-ax88796.patch @@ -0,0 +1,21 @@ +X-Git-Url: http://git.linaro.org/gitweb?p=people%2Fahs3%2Farndale-acpi.git;a=blobdiff_plain;f=drivers%2Fnet%2Fethernet%2F8390%2Fax88796.c;fp=drivers%2Fnet%2Fethernet%2F8390%2Fax88796.c;h=763e575c82bc5d24e1927ad685dfbdd7a0eaa19e;hp=70dba5d01ad3cc8178318f9976a5922894a86859;hb=fe8e7c500d3d25234759351096d457b6e557ebd9;hpb=af28003b46fa7b2c5d7b52e0d4bc8f725a6305f1 + +diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c +index 70dba5d..763e575 100644 +--- a/drivers/net/ethernet/8390/ax88796.c ++++ b/drivers/net/ethernet/8390/ax88796.c +@@ -828,7 +828,14 @@ static int ax_probe(struct platform_device *pdev) + struct ei_device *ei_local; + struct ax_device *ax; + struct resource *irq, *mem, *mem2; ++#ifndef CONFIG_ARM_LPAE ++ /* LPAE breaks this code as __aeabi_uldivmod for 64-bit ++ * is not supported in lib1funcs.s yet ++ */ + unsigned long mem_size, mem2_size = 0; ++#else ++ u32 mem_size, mem2_size = 0; ++#endif + int ret = 0; + + dev = ax__alloc_ei_netdev(sizeof(struct ax_device)); diff --git a/arm-omap-load-tfp410.patch b/arm-omap-load-tfp410.patch new file mode 100644 index 000000000..3ef21a062 --- /dev/null +++ b/arm-omap-load-tfp410.patch @@ -0,0 +1,14 @@ +diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c +index 60d3958..0e304ce 100644 +--- a/drivers/video/omap2/dss/core.c ++++ b/drivers/video/omap2/dss/core.c +@@ -298,6 +298,9 @@ static int __init omap_dss_init(void) + int r; + int i; + ++ /* hack to load encoder-tfp410 driver */ ++ request_module("encoder-tfp410"); ++ + r = platform_driver_probe(&omap_dss_driver, omap_dss_probe); + if (r) + return r; diff --git a/arm-sound-soc-samsung-dma-avoid-another-64bit-division.patch b/arm-sound-soc-samsung-dma-avoid-another-64bit-division.patch new file mode 100644 index 000000000..d6de76989 --- /dev/null +++ b/arm-sound-soc-samsung-dma-avoid-another-64bit-division.patch @@ -0,0 +1,13 @@ +diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c +index 21b7926..19e6662 100644 +--- a/sound/soc/samsung/dma.c ++++ b/sound/soc/samsung/dma.c +@@ -76,7 +76,7 @@ static void dma_enqueue(struct snd_pcm_substream *substream) + + pr_debug("Entered %s\n", __func__); + +- limit = (prtd->dma_end - prtd->dma_start) / prtd->dma_period; ++ limit = (u32)(prtd->dma_end - prtd->dma_start) / prtd->dma_period; + + pr_debug("%s: loaded %d, limit %d\n", + __func__, prtd->dma_loaded, limit); diff --git a/arm-tegra-nvec-kconfig.patch b/arm-tegra-nvec-kconfig.patch deleted file mode 100644 index 64aa9f8e3..000000000 --- a/arm-tegra-nvec-kconfig.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- linux-3.8.0-0.rc2.git1.1.fc19.x86_64/drivers/staging/nvec/Kconfig.orig 2013-01-07 11:04:43.493510550 +0000 -+++ linux-3.8.0-0.rc2.git1.1.fc19.x86_64/drivers/staging/nvec/Kconfig 2013-01-07 11:14:18.186033211 +0000 -@@ -1,6 +1,6 @@ - config MFD_NVEC - bool "NV Tegra Embedded Controller SMBus Interface" -- depends on I2C && GPIOLIB && ARCH_TEGRA -+ depends on I2C && GPIOLIB && ARCH_TEGRA && MFD_CORE - select MFD_CORE - help - Say Y here to enable support for a nVidia compliant embedded diff --git a/arm-tegra-paz00-panel-dts.patch b/arm-tegra-paz00-panel-dts.patch new file mode 100644 index 000000000..e64f2ce1e --- /dev/null +++ b/arm-tegra-paz00-panel-dts.patch @@ -0,0 +1,99 @@ +From fb4a8356eb67514b10618d1e9e4059ced14c05f2 Mon Sep 17 00:00:00 2001 +From: Marc Dietrich +Date: Sat, 21 Dec 2013 21:38:13 +0100 +Subject: [PATCH] ARM: tegra: paz00: Add LVDS support to device tree + +Add backlight and panel nodes for the PAZ00 TFT LCD panel. + +Signed-off-by: Marc Dietrich +--- + arch/arm/boot/dts/tegra20-paz00.dts | 46 ++++++++++++++++++++++++++++++++++- + 1 files changed, 45 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts +index c7cd8e6..9a39a80 100644 +--- a/arch/arm/boot/dts/tegra20-paz00.dts ++++ b/arch/arm/boot/dts/tegra20-paz00.dts +@@ -17,6 +17,14 @@ + }; + + host1x@50000000 { ++ dc@54200000 { ++ rgb { ++ status = "okay"; ++ ++ nvidia,panel = <&panel>; ++ }; ++ }; ++ + hdmi@54280000 { + status = "okay"; + +@@ -257,7 +265,11 @@ + status = "okay"; + }; + +- i2c@7000c000 { ++ pwm: pwm@7000a000 { ++ status = "okay"; ++ }; ++ ++ lvds_ddc: i2c@7000c000 { + status = "okay"; + clock-frequency = <400000>; + +@@ -475,6 +487,18 @@ + non-removable; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ ++ enable-gpios = <&gpio TEGRA_GPIO(U, 4) GPIO_ACTIVE_HIGH>; ++ pwms = <&pwm 0 5000000>; ++ ++ brightness-levels = <0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 255>; ++ default-brightness-level = <10>; ++ ++ backlight-boot-off; ++ }; ++ + clocks { + compatible = "simple-bus"; + #address-cells = <1>; +@@ -509,6 +533,16 @@ + }; + }; + ++ panel: panel { ++ compatible = "samsung,ltn101nt05", "simple-panel"; ++ ++ ddc-i2c-bus = <&lvds_ddc>; ++ power-supply = <&vdd_pnl_reg>; ++ enable-gpios = <&gpio TEGRA_GPIO(M, 6) GPIO_ACTIVE_HIGH>; ++ ++ backlight = <&backlight>; ++ }; ++ + regulators { + compatible = "simple-bus"; + #address-cells = <1>; +@@ -522,6 +556,16 @@ + regulator-max-microvolt = <5000000>; + regulator-always-on; + }; ++ ++ vdd_pnl_reg: regulator@1 { ++ compatible = "regulator-fixed"; ++ reg = <1>; ++ regulator-name = "+3VS,vdd_pnl"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio TEGRA_GPIO(A, 4) GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ }; + }; + + sound { +-- +1.7.1 diff --git a/arm-tegra-sdhci-module-fix.patch b/arm-tegra-sdhci-module-fix.patch deleted file mode 100644 index 24ba278ed..000000000 --- a/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/br-fix-use-of-rx_handler_data-in-code-executed-on-no.patch b/br-fix-use-of-rx_handler_data-in-code-executed-on-no.patch new file mode 100644 index 000000000..21e749291 --- /dev/null +++ b/br-fix-use-of-rx_handler_data-in-code-executed-on-no.patch @@ -0,0 +1,83 @@ +Bugzilla: 1025770 +Upstream-status: 3.13 (commit 859828c0ea476b42f3a) + +From 1a62121ead27a218d4b02b7130a6f5f6ca9c247e Mon Sep 17 00:00:00 2001 +From: Jiri Pirko +Date: Thu, 5 Dec 2013 16:27:37 +0100 +Subject: [PATCH] br: fix use of ->rx_handler_data in code executed on + non-rx_handler path + +br_stp_rcv() is reached by non-rx_handler path. That means there is no +guarantee that dev is bridge port and therefore simple NULL check of +->rx_handler_data is not enough. There is need to check if dev is really +bridge port and since only rcu read lock is held here, do it by checking +->rx_handler pointer. + +Note that synchronize_net() in netdev_rx_handler_unregister() ensures +this approach as valid. + +Introduced originally by: +commit f350a0a87374418635689471606454abc7beaa3a + "bridge: use rx_handler_data pointer to store net_bridge_port pointer" + +Fixed but not in the best way by: +commit b5ed54e94d324f17c97852296d61a143f01b227a + "bridge: fix RCU races with bridge port" + +Reintroduced by: +commit 716ec052d2280d511e10e90ad54a86f5b5d4dcc2 + "bridge: fix NULL pointer deref of br_port_get_rcu" + +Please apply to stable trees as well. Thanks. + +RH bugzilla reference: https://bugzilla.redhat.com/show_bug.cgi?id=1025770 + +Reported-by: Laine Stump +Debugged-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Jiri Pirko +Acked-by: Michael S. Tsirkin +Acked-by: Eric Dumazet +Signed-off-by: David S. Miller +--- + net/bridge/br_private.h | 10 ++++++++++ + net/bridge/br_stp_bpdu.c | 2 +- + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h +index e14c33b..9a63c42 100644 +--- a/net/bridge/br_private.h ++++ b/net/bridge/br_private.h +@@ -442,6 +442,16 @@ extern netdev_features_t br_features_recompute(struct net_bridge *br, + extern int br_handle_frame_finish(struct sk_buff *skb); + extern rx_handler_result_t br_handle_frame(struct sk_buff **pskb); + ++static inline bool br_rx_handler_check_rcu(const struct net_device *dev) ++{ ++ return rcu_dereference(dev->rx_handler) == br_handle_frame; ++} ++ ++static inline struct net_bridge_port *br_port_get_check_rcu(const struct net_device *dev) ++{ ++ return br_rx_handler_check_rcu(dev) ? br_port_get_rcu(dev) : NULL; ++} ++ + /* br_ioctl.c */ + extern int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); + extern int br_ioctl_deviceless_stub(struct net *net, unsigned int cmd, void __user *arg); +diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c +index 8660ea3..bdb459d 100644 +--- a/net/bridge/br_stp_bpdu.c ++++ b/net/bridge/br_stp_bpdu.c +@@ -153,7 +153,7 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb, + if (buf[0] != 0 || buf[1] != 0 || buf[2] != 0) + goto err; + +- p = br_port_get_rcu(dev); ++ p = br_port_get_check_rcu(dev); + if (!p) + goto err; + +-- +1.8.3.1 + diff --git a/config-arm-generic b/config-arm-generic index 01e5a1c3c..cd56b2493 100644 --- a/config-arm-generic +++ b/config-arm-generic @@ -1,526 +1,212 @@ -# Generic ARM config. This is common config options that should be -# enabled on all ARM kernels and hence should be added here -# -# FIXME - we need to add debug/nodebug generic build options -# CONFIG_DEBUG_PER_CPU_MAPS is not set - -# Generic ARM processor options -CONFIG_ARM=y - -CONFIG_ARM_THUMB=y -CONFIG_AEABI=y -CONFIG_VFP=y -CONFIG_ARM_UNWIND=y -# CONFIG_ARCH_MULTI_V7 is not set -# CONFIG_OABI_COMPAT is not set - -CONFIG_SMP=y -CONFIG_NR_CPUS=4 -CONFIG_SMP_ON_UP=y - -CONFIG_HAVE_ARM_ARCH_TIMER=y - -CONFIG_CMDLINE="" - -# CONFIG_ARM_LPAE is not set -# CONFIG_FPE_NWFPE is not set -CONFIG_FPE_FASTFPE=y -CONFIG_HIGHPTE=y +CONFIG_KUSER_HELPERS=y +# CONFIG_ASYMMETRIC_KEY_TYPE is not set +CONFIG_COMMON_CLK=y +CONFIG_EARLY_PRINTK=y +CONFIG_FB_SSD1307=m CONFIG_HW_PERF_EVENTS=y -CONFIG_UACCESS_WITH_MEMCPY=y -# CONFIG_GENERIC_CPUFREQ_CPU0 is not set +CONFIG_MMC=y +CONFIG_NFS_FS=y -# Generic ARM Errata -CONFIG_ARM_ERRATA_720789=y -CONFIG_ARM_ERRATA_751472=y -CONFIG_ARM_ERRATA_742230=y -CONFIG_ARM_ERRATA_742231=y -CONFIG_ARM_ERRATA_754327=y -CONFIG_ARM_ERRATA_764369=y -CONFIG_ARM_ERRATA_775420=y -CONFIG_PL310_ERRATA_753970=y - -# Generic ARM config options -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_LOCAL_TIMERS=y - -CONFIG_ATAGS=y -CONFIG_ATAGS_PROC=y - -CONFIG_PL330_DMA=y -CONFIG_AMBA_PL08X=y -CONFIG_PL330_DMA=y -# CONFIG_XIP_KERNEL is not set # CONFIG_PID_IN_CONTEXTIDR is not set -# Generic options we want for ARM that aren't defualt -CONFIG_EARLY_PRINTK=y +# CONFIG_CPU_BIG_ENDIAN is not set +# CONFIG_BIG_LITTLE is not set -CONFIG_HIGHMEM=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_PWM=y +CONFIG_PWM_SYSFS=y -CONFIG_SCHED_MC=y -CONFIG_SCHED_SMT=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_GPIO=y -CONFIG_RCU_FANOUT=32 - -CONFIG_CPU_IDLE=y -# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set -# CONFIG_CPU_IDLE_GOV_LADDER is not set -CONFIG_CPU_IDLE_GOV_MENU=y - -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y - -CONFIG_PM=y -CONFIG_PM_STD_PARTITION="" -CONFIG_SUSPEND=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_CPU_TOPOLOGY=y - -CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 -CONFIG_LSM_MMAP_MIN_ADDR=32768 - -# CONFIG_XEN is not set - -CONFIG_PINCTRL=y -CONFIG_PINCONF=y - -CONFIG_COMMON_CLK=y - -CONFIG_THERMAL=y - -CONFIG_ETHERNET=y - -CONFIG_PERF_EVENTS=y -CONFIG_PERF_COUNTERS=y - -CONFIG_CC_STACKPROTECTOR=y - -CONFIG_SECCOMP=y -CONFIG_STRICT_DEVMEM=y - -CONFIG_SPARSE_IRQ=y - -# Generic HW for all ARM platforms -CONFIG_LEDS_GPIO=m - -CONFIG_LBDAF=y - -CONFIG_GPIOLIB=y -CONFIG_RFKILL_GPIO=m -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y -CONFIG_GPIO_GENERIC_PLATFORM=m -CONFIG_PINCTRL_SINGLE=m -CONFIG_POWER_RESET_GPIO=y -CONFIG_POWER_RESET_RESTART=y - -CONFIG_USB_ULPI=y - -CONFIG_SND_ARM=y -CONFIG_SND_ARMAACI=m -CONFIG_SND_SOC=m -CONFIG_SND_DESIGNWARE_I2S=m -CONFIG_SND_SIMPLE_CARD=m -# CONFIG_SND_SOC_CACHE_LZO is not set -CONFIG_SND_SOC_ALL_CODECS=m -CONFIG_SND_SPI=y - -CONFIG_AX88796=m -CONFIG_AX88796_93CX6=y -CONFIG_SMC91X=m -CONFIG_DM9000=m -CONFIG_DM9000_DEBUGLEVEL=4 -# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set -CONFIG_SMC911X=m -CONFIG_SMSC911X=m - -CONFIG_SERIO_AMBAKMI=m -CONFIG_I2C_NOMADIK=m -CONFIG_ARM_SP805_WATCHDOG=m -CONFIG_FB_ARMCLCD=m -CONFIG_FB_SSD1307=m -CONFIG_MPCORE_WATCHDOG=m +CONFIG_RCU_FANOUT_LEAF=16 +# CONFIG_RTC_DRV_SNVS is not set +# CONFIG_RTC_DRV_HYM8563 is not set CONFIG_BACKLIGHT_PWM=m +CONFIG_INPUT_PWM_BEEPER=m +CONFIG_ARM_SP805_WATCHDOG=m +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +# CONFIG_ARM_DT_BL_CPUFREQ is not set +CONFIG_NR_CPUS=8 -CONFIG_MMC_ARMMMCI=m -CONFIG_MMC_SDHCI_PLTFM=m -CONFIG_MMC_SDHCI_OF=m -CONFIG_MMC_SPI=m -CONFIG_MMC_DW=m -CONFIG_MMC_DW_PLTFM=m -CONFIG_MMC_DW_PCI=m -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_IDMAC is not set -CONFIG_MMC_SDHCI_PXAV3=m -CONFIG_MMC_SDHCI_PXAV2=m +CONFIG_SWIOTLB=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_FB_SIMPLE=y -# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_SPI=y -# Generic GPIO options -CONFIG_GENERIC_GPIO=y +# ARM AMBA generic HW +CONFIG_ARM_AMBA=y +CONFIG_ARM_CCI=y +CONFIG_ARM_DMA_USE_IOMMU=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GLOBAL_TIMER=y +CONFIG_ARM_SMMU=y +CONFIG_MMC_ARMMMCI=y +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIO_AMBAKMI=y +CONFIG_OC_ETM=y +CONFIG_FB_ARMCLCD=y -CONFIG_MTD=m -CONFIG_MTD_TESTS=m -CONFIG_MTD_CMDLINE_PARTS=y -CONFIG_MTD_OF_PARTS=y -CONFIG_MTD_PHYSMAP_OF=y -# CONFIG_MTD_AFS_PARTS is not set -CONFIG_MTD_CHAR=m -CONFIG_MTD_BLKDEVS=m -CONFIG_MTD_BLOCK=m -# CONFIG_MTD_TESTS is not set -# CONFIG_MTD_BLOCK_RO is not set -# CONFIG_MTD_AR7_PARTS is not set -CONFIG_MTD_CFI=m -CONFIG_MTD_CFI_AMDSTD=m -CONFIG_MTD_CFI_ADV_OPTIONS=y -CONFIG_MTD_CFI_NOSWAP=y -CONFIG_MTD_CFI_GEOMETRY=y -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -CONFIG_MTD_CFI_INTELEXT=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_CFI_UTIL=y -CONFIG_MTD_DOC2000=m -CONFIG_MTD_DOC2001=m -CONFIG_MTD_DOC2001PLUS=m -# CONFIG_MTD_DOCPROBE_ADVANCED is not set -CONFIG_MTD_ALAUDA=m -# CONFIG_MTD_ONENAND is not set -CONFIG_MTD_JEDECPROBE=m -CONFIG_MTD_GEN_PROBE=y -CONFIG_MTD_IMPA7=m -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_PHYSMAP=m -# CONFIG_MTD_PHYSMAP_COMPAT is not set -CONFIG_MTD_M25P80=m -CONFIG_M25PXX_USE_FAST_READ=y -CONFIG_MTD_NAND=m -CONFIG_MTD_NAND_ECC=m -CONFIG_MTD_NAND_IDS=m -# CONFIG_MTD_NAND_CAFE is not set -# CONFIG_MTD_NAND_ECC_SMC is not set -# CONFIG_MTD_NAND_DENALI is not set -# CONFIG_MTD_NAND_DOCG4 is not set -CONFIG_MTD_NAND_GPIO=m -# CONFIG_MTD_INTEL_VR_NOR is not set -# CONFIG_MTD_NAND_NANDSIM is not set -CONFIG_MTD_NAND_ORION=m -# CONFIG_MTD_NAND_RICOH is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_OTP is not set -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_PLATRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_SLRAM is not set -CONFIG_MTD_DATAFLASH=m -CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y -CONFIG_MTD_DATAFLASH_OTP=y -CONFIG_MTD_SST25L=m -CONFIG_MTD_UBI=m -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MTD_UBI_BEB_RESERVE=1 -# CONFIG_MTD_UBI_GLUEBI is not set -# CONFIG_MTD_UBI_DEBUG is not set -CONFIG_MG_DISK=m -CONFIG_MG_DISK_RES=0 - -# CONFIG_SM_FTL is not set - -CONFIG_JFFS2_FS=m -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set - -CONFIG_UBIFS_FS=m -CONFIG_UBIFS_FS_XATTR=y -CONFIG_UBIFS_FS_ADVANCED_COMPR=y -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_DEBUG is not set - -# HW crypto and rng -CONFIG_CRYPTO_SHA1_ARM=m -CONFIG_CRYPTO_AES_ARM=m -CONFIG_HW_RANDOM_ATMEL=m -CONFIG_HW_RANDOM_EXYNOS=m +# ARM VExpress +CONFIG_ARCH_VEXPRESS=y +CONFIG_VEXPRESS_CONFIG=y +CONFIG_COMMON_CLK_VERSATILE=y +CONFIG_I2C_VERSATILE=m +CONFIG_POWER_RESET_VEXPRESS=y +CONFIG_REGULATOR_VEXPRESS=m +CONFIG_SENSORS_VEXPRESS=m # Device tree CONFIG_DTC=y -CONFIG_OF=y -CONFIG_USE_OF=y -CONFIG_OF_DEVICE=y -CONFIG_OF_IRQ=y -CONFIG_OF_GPIO=y -CONFIG_ARM_ATAG_DTB_COMPAT=y -CONFIG_ARM_APPENDED_DTB=y +CONFIG_DMA_OF=y CONFIG_PROC_DEVICETREE=y -# CONFIG_OF_SELFTEST is not set - -CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_DEVICE=y +CONFIG_OF_DYNAMIC=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_I2C_MUX_PINCTRL=m +CONFIG_OF_I2C=m +CONFIG_OF_IOMMU=y +CONFIG_OF_IRQ=y CONFIG_OF_MDIO=m -CONFIG_MDIO_BUS_MUX_GPIO=m -CONFIG_MDIO_BUS_MUX_MMIOREG=m +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI_IRQ=m +CONFIG_OF_PCI=m +CONFIG_OF_RESERVED_MEM=y +CONFIG_PATA_OF_PLATFORM=m +# CONFIG_OF_SELFTEST is not set +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_THERMAL_OF=y -CONFIG_BPF_JIT=y - -CONFIG_RCU_FANOUT_LEAF=16 -CONFIG_EDAC=y -CONFIG_EDAC_MM_EDAC=m -CONFIG_EDAC_LEGACY_SYSFS=y - -CONFIG_RTC_DRV_88PM80X=m -CONFIG_RTC_DRV_DS1305=m -CONFIG_RTC_DRV_DS1390=m -CONFIG_RTC_DRV_DS3234=m -CONFIG_RTC_DRV_M41T93=m -CONFIG_RTC_DRV_M41T94=m -CONFIG_RTC_DRV_MAX6902=m -CONFIG_RTC_DRV_MC13XXX=m -CONFIG_RTC_DRV_PCF2123=m -CONFIG_RTC_DRV_PL030=m -CONFIG_RTC_DRV_PL031=m -CONFIG_RTC_DRV_R9701=m -CONFIG_RTC_DRV_RS5C348=m -CONFIG_RTC_DRV_RX4581=m -CONFIG_RTC_DRV_SNVS=m - -CONFIG_RFKILL_REGULATOR=m -CONFIG_INPUT_88PM80X_ONKEY=y -CONFIG_INPUT_GP2A=m -CONFIG_INPUT_GPIO_TILT_POLLED=m -CONFIG_INPUT_PWM_BEEPER=m -CONFIG_INPUT_ARIZONA_HAPTICS=m -CONFIG_INPUT_MC13783_PWRBUTTON=m - -CONFIG_SERIAL_AMBA_PL010=m -CONFIG_SERIAL_AMBA_PL011=m -CONFIG_SERIAL_MAX3100=m -CONFIG_SERIAL_MAX310X=y -CONFIG_SERIAL_IFX6X60=m - -CONFIG_GPIO_74X164=m -CONFIG_GPIO_ADNP=m -CONFIG_GPIO_ARIZONA=m -CONFIG_GPIO_MAX7301=m -CONFIG_GPIO_MC33880=m -CONFIG_GPIO_MCP23S08=m -CONFIG_GPIO_PL061=y - -CONFIG_SPI_ALTERA=m -CONFIG_SPI_BITBANG=m -CONFIG_SPI_BUTTERFLY=m -CONFIG_SPI_DW_MMIO=m -CONFIG_SPI_GPIO=m -CONFIG_SPI_LM70_LLP=m -CONFIG_SPI_OC_TINY=m -CONFIG_SPI_PL022=m -CONFIG_SPI_SC18IS602=m -CONFIG_SPI_XCOMM=m -CONFIG_SPI_XILINX=m -CONFIG_SPI_DESIGNWARE=m -CONFIG_SPI_SPIDEV=m -CONFIG_SPI_TLE62X0=m -CONFIG_BMP085_SPI=m -CONFIG_BMP085_SPI=m -CONFIG_EEPROM_AT25=m -CONFIG_EEPROM_93XX46=m -CONFIG_KS8851=m -CONFIG_MICREL_KS8995MA=m -CONFIG_LIBERTAS_SPI=m -CONFIG_P54_SPI=m -CONFIG_P54_SPI_DEFAULT_EEPROM=y - -CONFIG_MFD_CORE=m -CONFIG_MFD_88PM800=m -CONFIG_MFD_88PM805=m -CONFIG_MFD_ARIZONA_SPI=m -CONFIG_MFD_MC13XXX_SPI=m -CONFIG_MFD_SYSCON=y -# CONFIG_MFD_WM5102 is not set -# CONFIG_MFD_WM5110 is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_MAX8907 is not set - -CONFIG_REGULATOR_VIRTUAL_CONSUMER=m -CONFIG_REGULATOR_USERSPACE_CONSUMER=m -# CONFIG_REGULATOR_DUMMY is not set -CONFIG_REGULATOR_GPIO=m -CONFIG_REGULATOR_AD5398=m -CONFIG_REGULATOR_ANATOP=m -CONFIG_REGULATOR_ARIZONA=m -CONFIG_REGULATOR_FAN53555=m -CONFIG_REGULATOR_ISL6271A=m -CONFIG_REGULATOR_LP3972=m -CONFIG_REGULATOR_LP8755=m -CONFIG_REGULATOR_MAX1586=m -CONFIG_REGULATOR_MAX8649=m -CONFIG_REGULATOR_MAX8660=m -CONFIG_REGULATOR_MAX8952=m -CONFIG_REGULATOR_MAX8973=m -CONFIG_REGULATOR_MC13783=m -CONFIG_REGULATOR_MC13892=m -CONFIG_REGULATOR_LP3971=m -CONFIG_REGULATOR_TPS51632=m -CONFIG_REGULATOR_TPS62360=m -CONFIG_REGULATOR_TPS65023=m -CONFIG_REGULATOR_TPS6524X=m -CONFIG_REGULATOR_TPS6507X=m -CONFIG_CHARGER_MANAGER=y +# External Connectors +CONFIG_EXTCON=m +CONFIG_OF_EXTCON=m CONFIG_EXTCON_GPIO=m +CONFIG_EXTCON_ADC_JACK=m -CONFIG_SENSORS_AD7314=m -CONFIG_SENSORS_ADCXX=m -CONFIG_SENSORS_LM70=m -CONFIG_SENSORS_MAX1111=m -CONFIG_SENSORS_MC13783_ADC=m -CONFIG_SENSORS_ADS7871=m -CONFIG_SENSORS_LIS3_SPI=m +# MTD +CONFIG_MTD_BLKDEVS=m +CONFIG_MTD_BLOCK=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_CFI=m +CONFIG_MTD_CFI_INTELEXT=m +CONFIG_MTD_CFI_AMDSTD=m +CONFIG_MTD_CFI_STAA=m +CONFIG_MTD_OF_PARTS=m +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_PHYSMAP=m +CONFIG_MTD_PHYSMAP_OF=m +# CONFIG_MTD_PHYSMAP_COMPAT is not set -CONFIG_IEEE802154_AT86RF230=m -CONFIG_IEEE802154_MRF24J40=m +# GPIO +CONFIG_GPIO_DEVRES=y +CONFIG_GPIO_GENERIC=m +CONFIG_GPIO_GENERIC_PLATFORM=m +CONFIG_GPIO_WATCHDOG=m +CONFIG_GPIOLIB=y +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_MDIO_GPIO=m +CONFIG_BACKLIGHT_GPIO=m +CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_RESET_RESTART=y -# CONFIG_ARM_VIRT_EXT is not set -# CONFIG_PINCTRL_EXYNOS4 is not set -# CONFIG_PINCTRL_EXYNOS5440 is not set +#i2c +CONFIG_I2C_ARB_GPIO_CHALLENGE=m +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_GPIO=m +CONFIG_I2C_MUX=m +CONFIG_I2C_MUX_GPIO=m +CONFIG_I2C_MUX_PINCTRL=m +CONFIG_I2C_MUX_PCA9541=m -# CONFIG_AUTO_ZRELADDR is not set -# CONFIG_ASYMMETRIC_KEY_TYPE is not set +# Sensors +CONFIG_SENSORS_IIO_HWMON=m +CONFIG_IIO_SYSFS_TRIGGER=m -# CONFIG_VFIO is not set +# PHY framework +CONFIG_GENERIC_PHY=y -# CONFIG_XIP_KERNEL is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -# CONFIG_CPU_DCACHE_DISABLE is not set -# CONFIG_APM_EMULATION is not set -# CONFIG_DEPRECATED_PARAM_STRUCT is not set +# MFD +CONFIG_MFD_CORE=m -# CONFIG_SERIAL_8250_EM is not set -# CONFIG_GPIO_EM is not set -# CONFIG_HVC_DCC is not set -# CONFIG_LEDS_RENESAS_TPU is not set -# CONFIG_LEDS_PWM is not set -CONFIG_LEDS_DAC124S085=m -CONFIG_LEDS_MC13783=m +CONFIG_SMC91X=m +CONFIG_SMC911X=m -# CONFIG_VIRTIO_CONSOLE is not set +CONFIG_CPU_THERMAL=y +CONFIG_THERMAL_GOV_USER_SPACE=y -# Possibly part of Snowball -# CONFIG_MFD_T7L66XB is not set -# CONFIG_MFD_TC6387XB is not set +# Contiguous Memory Allocator +CONFIG_CMA=y +CONFIG_DMA_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_CRYPTO_TEST is not set +# CONFIG_TRANSPARENT_HUGEPAGE is not set +# CONFIG_XEN is not set +# CONFIG_DRM_RCAR_DU is not set +# CONFIG_I2C_RCAR is not set +# CONFIG_DRM_SHMOBILE is not set +# CONFIG_I2C_SH_MOBILE is not set +# CONFIG_MMC_DW_SOCFPGA is not set +# CONFIG_I2C_NOMADIK is not set # CONFIG_IRQ_DOMAIN_DEBUG is not set -# CONFIG_COMMON_CLK_DEBUG is not set -# CONFIG_DEBUG_USER is not set -# CONFIG_DEBUG_LL is not set -# CONFIG_ARM_KPROBES_TEST is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +# CONFIG_LEDS_RENESAS_TPU is not set +# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_PINCTRL is not set +# CONFIG_DRM_ARMADA is not set +# CONFIG_DRM_TEGRA is not set +# CONFIG_SHMOBILE_IOMMU is not set -# HW Disabled because it causes issues on ARM platforms +# CONFIG_COMMON_CLK_SI570 is not set +# CONFIG_COMMON_CLK_QCOM is not set -# disable TPM on arm at least on the trimslices it causes havoc -# CONFIG_TCG_TPM is not set +# CONFIG_ARM_PTDUMP is not set -# CONFIG_IMA is not set +# CONFIG_PATA_PLATFORM is not set -# ERROR: "__bswapsi2" [drivers/staging/crystalhd/crystalhd.ko] undefined! -# CONFIG_CRYSTALHD is not set +### turn off things which make no sense on embedded SoC -# these modules all fail with missing __bad_udelay -# http://www.spinics.net/lists/arm/msg15615.html provides some background -# CONFIG_SUNGEM is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_RADEON is not set -# CONFIG_ATM_HE is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SFC is not set +# core -# these all currently fail due to missing symbols __bad_udelay or -# error: implicit declaration of function ‘iowrite32be’ -# CONFIG_SND_ALI5451 is not set -# CONFIG_MLX4_EN is not set +# CONFIG_INFINIBAND is not set +# CONFIG_ISDN is not set -CONFIG_TOUCHSCREEN_ADS7846=m -CONFIG_TOUCHSCREEN_AD7877=m -CONFIG_TOUCHSCREEN_TSC2005=m -CONFIG_TOUCHSCREEN_MC13783=m +# netdrv -# drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration] -# CONFIG_TOUCHSCREEN_EETI is not set -# CONFIG_TOUCHSCREEN_EGALAX is not set -# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_EXAR is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_BROCADE is not set -# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set -# CONFIG_PANEL_ACX565AKM is not set -# CONFIG_PANEL_N8X0 is not set +# scsi -# CONFIG_LCD_L4F00242T03 is not set -# CONFIG_LCD_LMS283GF05 is not set -# CONFIG_LCD_LTV350QV is not set -# CONFIG_LCD_ILI9320 is not set -# CONFIG_LCD_TDO24M is not set -# CONFIG_LCD_VGG2432A4 is not set -# CONFIG_LCD_S6E63M0 is not set -# CONFIG_LCD_LD9040 is not set -# CONFIG_LCD_AMS369FG06 is not set -# CONFIG_LCD_LMS501KF03 is not set -# CONFIG_LCD_HX8357 is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_BFA_FC is not set -# CONFIG_FB_MX3 is not set -# CONFIG_MX3_IPU is not set -# CONFIG_MX3_IPU_IRQS is not set -# CONFIG_SND_ATMEL_SOC is not set +# serial +# CONFIG_SERIAL_SH_SCI is not set -# CONFIG_NET_VENDOR_CIRRUS is not set -# CONFIG_NET_VENDOR_MICROCHIP is not set -# CONFIG_CS89x0 is not set -# CONFIG_DVB_USB_PCTV452E is not set -# CONFIG_PINCTRL_EXYNOS is not set -# CONFIG_VIRTUALIZATION is not set +CONFIG_CRASH=m -CONFIG_XZ_DEC_ARM=y - -# CONFIG_EZX_PCAP is not set - -# CONFIG_EXTCON_ARIZONA is not set - -# CONFIG_VIRTUALIZATION is not set -# CONFIG_VIRTIO_PCI is not set -# VIRTIO_MMIO is not set -# REMOTEPROC is not set -# RPMSG is not set - -# CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_DRM_TILCDC is not set -CONFIG_OF_DISPLAY_TIMING=y -CONFIG_OF_VIDEOMODE=y +# CONFIG_DEBUG_SET_MODULE_RONX is not set diff --git a/config-arm-omap b/config-arm-omap deleted file mode 100644 index 3ec36d0cf..000000000 --- a/config-arm-omap +++ /dev/null @@ -1,401 +0,0 @@ -CONFIG_ARCH_OMAP=y -CONFIG_ARCH_OMAP_OTG=y -# CONFIG_ARCH_OMAP1 is not set -# 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 -CONFIG_ARCH_OMAP2PLUS=y -# CONFIG_ARCH_MVEBU is not set -# CONFIG_ARCH_BCM is not set -# CONFIG_ARCH_HIGHBANK is not set -# CONFIG_ARCH_SOCFPGA is not set -# CONFIG_ARCH_SUNXI is not set -# CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA is not set -# CONFIG_ARCH_VEXPRESS_CA9X4 is not set -# CONFIG_ARCH_VIRT is not set -# CONFIG_ARCH_WM8850 is not set -# CONFIG_ARCH_ZYNQ is not set -# CONFIG_ARCH_MXC is not set -# CONFIG_ARCH_WM8505 is not set -# CONFIG_ARM_CHARLCD is not set -# CONFIG_PATA_PLATFORM is not set -# CONFIG_I2C_VERSATILE is not set -# CONFIG_SENSORS_VEXPRESS is not set -# CONFIG_REGULATOR_VEXPRESS is not set -# CONFIG_RTC_DRV_LP8788 is not set - -# -# OMAP Feature Selections -# -CONFIG_OMAP_RESET_CLOCKS=y -CONFIG_OMAP_MUX=y -# CONFIG_OMAP_MUX_DEBUG is not set -CONFIG_OMAP_MUX_WARNINGS=y -CONFIG_OMAP_MCBSP=y -CONFIG_OMAP_MBOX_FWK=m -CONFIG_OMAP_MBOX_KFIFO_SIZE=256 -CONFIG_OMAP_32K_TIMER=y -# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set -CONFIG_OMAP_32K_TIMER_HZ=128 -CONFIG_OMAP_DM_TIMER=y -# CONFIG_OMAP_PM_NONE is not set -CONFIG_OMAP_PM_NOOP=y -CONFIG_OMAP_IOMMU=y -# CONFIG_OMAP_IOMMU_DEBUG is not set -CONFIG_OMAP3_EMU=y -CONFIG_HWSPINLOCK_OMAP=m -CONFIG_DMA_OMAP=y -# CONFIG_DMADEVICES_VDEBUG is not set - -# -# TI OMAP2/3/4 Specific Features -# -CONFIG_ARCH_OMAP2PLUS_TYPICAL=y -# CONFIG_ARCH_OMAP2 is not set -CONFIG_ARCH_OMAP3=y -CONFIG_ARCH_OMAP4=y -CONFIG_SOC_OMAP3430=y -CONFIG_SOC_TI81XX=y -CONFIG_SOC_AM33XX=y -CONFIG_SOC_OMAPTI816X=y -# CONFIG_SOC_OMAP5 is not set -CONFIG_OMAP_PACKAGE_CBB=y -CONFIG_OMAP_PACKAGE_CBL=y -CONFIG_OMAP_PACKAGE_CBS=y -# CONFIG_OMAP4_ERRATA_I688 is not set - -# -# 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_CPU_32v6K=y -CONFIG_CPU_V7=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_HAS_ASID=y -CONFIG_ARM_THUMBEE=y -CONFIG_SWP_EMULATE=y -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_OUTER_CACHE=y -CONFIG_OUTER_CACHE_SYNC=y -CONFIG_CACHE_L2X0=y -CONFIG_CACHE_PL310=y -CONFIG_ARM_DMA_MEM_BUFFERABLE=y -CONFIG_ARM_ERRATA_430973=y -# CONFIG_ARM_ERRATA_458693 is not set -# CONFIG_ARM_ERRATA_460075 is not set -# CONFIG_ARM_ERRATA_742230 is not set -# CONFIG_ARM_ERRATA_742231 is not set -CONFIG_PL310_ERRATA_588369=y -CONFIG_PL310_ERRATA_769419=y -CONFIG_ARM_ERRATA_720789=y -# CONFIG_ARM_ERRATA_743622 is not set -# CONFIG_ARM_ERRATA_751472 is not set -# CONFIG_ARM_ERRATA_753970 is not set -# CONFIG_ARM_ERRATA_754322 is not set -# CONFIG_ARM_ERRATA_754327 is not set -# CONFIG_ARM_ERRATA_764369 is not set -CONFIG_ARM_GIC=y -CONFIG_HAVE_ARM_SCU=y -CONFIG_HAVE_ARM_TWD=y -CONFIG_HOTPLUG_CPU=y -CONFIG_HZ=128 -# CONFIG_THUMB2_KERNEL is not set -CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_KSM is not set -CONFIG_ZBOOT_ROM_TEXT=0x0 -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_CMDLINE="" -# CONFIG_AUTO_ZRELADDR is not set -CONFIG_VFPv3=y -CONFIG_NEON=y -CONFIG_BINFMT_MISC=m -CONFIG_PM_DEBUG=y -# CONFIG_PM_ADVANCED_DEBUG is not set -# CONFIG_PM_VERBOSE is not set -CONFIG_CAN_PM_TRACE=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_ARCH_HAS_OPP=y -CONFIG_PM_OPP=y - -# OMAP thermal temp. Can likely be built as module but doesn't autoload so build in to ensure performance on PandaES -CONFIG_OMAP_BANDGAP=y -CONFIG_OMAP4_THERMAL=y -CONFIG_OMAP5_THERMAL=y - -# OMAP3 thermal/power -CONFIG_POWER_AVS=y -CONFIG_POWER_AVS_OMAP=y -CONFIG_POWER_AVS_OMAP_CLASS3=y - -CONFIG_ARM_OMAP2PLUS_CPUFREQ=y - -# -# OMAP Hardware -# -CONFIG_WL_TI=y -CONFIG_WLCORE_SDIO=m -CONFIG_WLCORE_SPI=m -CONFIG_TI_ST=m -CONFIG_TI_DAC7512=m -# CONFIG_TI_CPSW is not set -CONFIG_MTD_NAND_OMAP2=y -CONFIG_MTD_NAND_OMAP_PREFETCH=y -CONFIG_MTD_NAND_OMAP_PREFETCH_DMA=y -CONFIG_WL1251_SPI=m -CONFIG_WL12XX_SPI=m -CONFIG_WL12XX_SDIO_TEST=m -CONFIG_WL18XX=m -CONFIG_SPI_DAVINCI=m -CONFIG_SPI_OMAP24XX=y -CONFIG_MFD_TI_SSP=m -CONFIG_SPI_TI_SSP=m -CONFIG_NFC_WILINK=m -CONFIG_INPUT_TWL4030_PWRBUTTON=m -CONFIG_INPUT_TWL4030_VIBRA=m -CONFIG_INPUT_TWL6040_VIBRA=m -CONFIG_KEYBOARD_OMAP4=m -CONFIG_KEYBOARD_TWL4030=m -CONFIG_TOUCHSCREEN_TI_TSCADC=m -CONFIG_SERIAL_OMAP=y -CONFIG_SERIAL_OMAP_CONSOLE=y -CONFIG_OMAP_WATCHDOG=y -CONFIG_CLK_TWL6040=m -CONFIG_TWL4030_CORE=y -CONFIG_TWL4030_MADC=m -CONFIG_TWL4030_POWER=y -CONFIG_TWL4030_CODEC=y -CONFIG_TWL4030_WATCHDOG=m -CONFIG_GPIO_TWL4030=m -CONFIG_GPIO_TWL6040=m -CONFIG_CHARGER_TWL4030=m -CONFIG_TWL6030_PWM=m -CONFIG_TWL6040_CORE=y -CONFIG_SENSORS_TWL4030_MADC=m -CONFIG_SENSORS_LIS3_I2C=m -CONFIG_TI_DAVINCI_EMAC=m -CONFIG_TI_DAVINCI_MDIO=m -CONFIG_TI_DAVINCI_CPDMA=m - -CONFIG_LEDS_PWM=m -CONFIG_LEDS_LP8788=m -CONFIG_MTD_ONENAND_OMAP2=y -CONFIG_HDQ_MASTER_OMAP=m -CONFIG_I2C_OMAP=m -CONFIG_MFD_OMAP_USB_HOST=y -CONFIG_MFD_WL1273_CORE=m -CONFIG_MFD_LP8788=y -CONFIG_MFD_TPS65910=y -CONFIG_GPIO_TPS65910=y -CONFIG_REGULATOR_TWL4030=y -CONFIG_REGULATOR_LP8788=y -CONFIG_REGULATOR_TPS65217=y -CONFIG_REGULATOR_TPS65910=y -# Enable V4L2 drivers for OMAP2+ -CONFIG_MEDIA_CONTROLLER=y -CONFIG_VIDEO_V4L2_SUBDEV_API=y -CONFIG_V4L_PLATFORM_DRIVERS=y -CONFIG_VIDEO_OMAP2_VOUT=m -CONFIG_VIDEO_OMAP3=m -CONFIG_VIDEO_VPFE_CAPTURE=m -# The ones below are for TI Davinci -# CONFIG_VIDEO_VPSS_SYSTEM is not set -# CONFIG_VIDEO_DM6446_CCDC is not set -# CONFIG_VIDEO_DM644X_VPBE is not set -# CONFIG_VIDEO_DM355_CCDC is not set -# CONFIG_VIDEO_ISIF is not set -# Also enable vivi driver - useful for testing a full kernelspace V4L2 driver -CONFIG_V4L_TEST_DRIVERS=y -CONFIG_VIDEO_VIVI=m - -CONFIG_DRM=m -CONFIG_DRM_OMAP=m -CONFIG_DRM_OMAP_NUM_CRTCS=2 -# CONFIG_DRM_EXYNOS is not set -# CONFIG_DRM_IMX is not set -# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set -# CONFIG_FB_OMAP_LCD_VGA is not set -CONFIG_OMAP2_VRAM=y -CONFIG_OMAP2_VRAM_SIZE=0 -CONFIG_OMAP2_VRFB=y -# CONFIG_FB_OMAP2 is not set - -CONFIG_OMAP2_DSS=m -CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y -# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set -CONFIG_OMAP2_DSS_DPI=y -CONFIG_OMAP2_DSS_RFBI=y -CONFIG_OMAP2_DSS_VENC=y -CONFIG_OMAP4_DSS_HDMI=y -CONFIG_OMAP2_DSS_SDI=y -CONFIG_OMAP2_DSS_DSI=y -# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set -CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0 -CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET=y -CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y - -CONFIG_FB_DA8XX=m -CONFIG_FB_DA8XX_CONSISTENT_DMA_SIZE=5 - -CONFIG_LCD_CLASS_DEVICE=m -CONFIG_PANEL_GENERIC_DPI=m -CONFIG_PANEL_TFP410=m -CONFIG_PANEL_TAAL=m -CONFIG_PANEL_PICODLP=m -CONFIG_PANEL_SHARP_LS037V7DW01=m -CONFIG_PANEL_NEC_NL8048HL11_01B=m -CONFIG_PANEL_TPO_TD043MTEA1=m -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_CLASS_DEVICE=m -CONFIG_BACKLIGHT_LP8788=m -CONFIG_BACKLIGHT_PWM=m -CONFIG_BACKLIGHT_PANDORA=m - - -CONFIG_SND_OMAP_SOC=y -CONFIG_SND_OMAP_SOC_DMIC=m -CONFIG_SND_OMAP_SOC_MCBSP=m -CONFIG_SND_OMAP_SOC_MCPDM=m -CONFIG_SND_OMAP_SOC_OVERO=m -CONFIG_SND_OMAP_SOC_OMAP3EVM=m -CONFIG_SND_OMAP_SOC_AM3517EVM=m -CONFIG_SND_OMAP_SOC_SDP3430=m -CONFIG_SND_OMAP_SOC_SDP4430=m -CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m -CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=m -CONFIG_SND_OMAP_SOC_ZOOM2=m -CONFIG_SND_OMAP_SOC_IGEP0020=m -CONFIG_SND_OMAP_SOC_OMAP_HDMI=m -CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m -CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m -CONFIG_SND_SOC_I2C_AND_SPI=y -# CONFIG_SND_OMAP_SOC_RX51 is not set -# CONFIG_SND_SOC_ALL_CODECS is not set -CONFIG_SND_SOC_TLV320AIC23=m -CONFIG_SND_SOC_TLV320AIC3X=m -CONFIG_SND_SOC_TWL4030=m -CONFIG_SND_SOC_TWL6040=m -CONFIG_RADIO_WL128X=m - -CONFIG_USB_OTG=y -CONFIG_USB_EHCI_HCD_OMAP=y -CONFIG_USB_MUSB_OMAP2PLUS=y -CONFIG_USB_MUSB_HDRC=y -CONFIG_USB_OHCI_HCD_OMAP3=y -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_MUSB_PIO_ONLY is not set -# CONFIG_USB_MUSB_DEBUG is not set -# - -# CONFIG_USB_GADGET_OMAP is not set -# CONFIG_ISP1301_OMAP is not set - -# 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_SPI=y - -CONFIG_MMC_OMAP=y -CONFIG_MMC_OMAP_HS=y -CONFIG_TWL4030_USB=y -CONFIG_TWL6030_USB=y -CONFIG_RTC_DRV_OMAP=m -CONFIG_RTC_DRV_TWL4030=y -CONFIG_RTC_DRV_TPS65910=m - -CONFIG_PWM_TIECAP=m -CONFIG_PWM_TIEHRPWM=m -CONFIG_PWM_TWL=m -CONFIG_PWM_TWL_LED=m - -# CONFIG_IR_RX51 is not set -# CONFIG_BATTERY_RX51 is not set - -# CONFIG_TIDSPBRIDGE is not set -# CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000 -# CONFIG_TIDSPBRIDGE_DEBUG is not set -# CONFIG_TIDSPBRIDGE_RECOVERY=y -# CONFIG_TIDSPBRIDGE_CACHE_LINE_CHECK is not set -# CONFIG_TIDSPBRIDGE_WDT3=y -# CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5 -# CONFIG_TIDSPBRIDGE_NTFY_PWRERR is not set -# CONFIG_TIDSPBRIDGE_BACKTRACE is not set - -# CONFIG_OMAP_REMOTEPROC is not set -# CONFIG_OMAP_IOVMM is not set - -# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set -# CONFIG_CRYPTO_DEV_OMAP_AES is not set - -# CONFIG_NET_VENDOR_BROADCOM is not set -# CONFIG_MTD_NAND_OMAP_BCH is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_REGULATOR_LP3972 is not set -# CONFIG_REGULATOR_LP872X is not set - -# CONFIG_OMAP2_DSS_DEBUG is not set -# CONFIG_OMAP2_DSS_DEBUGFS is not set -# CONFIG_ARM_PSCI is not set -# CONFIG_WILINK_PLATFORM_DATA is not set - -# VIRTIO_PCI is not set -# VIRTIO_MMIO is not set -# REMOTEPROC is not set -# RPMSG is not set diff --git a/config-arm-tegra b/config-arm-tegra deleted file mode 100644 index 53c415312..000000000 --- a/config-arm-tegra +++ /dev/null @@ -1,121 +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_ARM_LPAE is not set - -CONFIG_VFP=y -CONFIG_VFPv3=y - -# 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_DEBUG_UARTD=y -CONFIG_ARM_CPU_TOPOLOGY=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_SPI=y - -CONFIG_MMC_SDHCI_TEGRA=y - -# CONFIG_RCU_BOOST is not set -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_ARM_THUMBEE=y -CONFIG_SWP_EMULATE=y -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_CACHE_L2X0=y -CONFIG_ARM_ERRATA_430973=y -# CONFIG_ARM_ERRATA_458693 is not set -# CONFIG_ARM_ERRATA_460075 is not set -CONFIG_ARM_ERRATA_742230=y -# CONFIG_ARM_ERRATA_742231 is not set -CONFIG_PL310_ERRATA_588369=y -CONFIG_PL310_ERRATA_769419=y -CONFIG_ARM_ERRATA_720789=y -# CONFIG_PL310_ERRATA_727915 is not set -# CONFIG_ARM_ERRATA_743622 is not set -# CONFIG_ARM_ERRATA_751472 is not set -# CONFIG_ARM_ERRATA_753970 is not set -# CONFIG_ARM_ERRATA_754322 is not set -# CONFIG_ARM_ERRATA_754327 is not set -# CONFIG_ARM_ERRATA_764369 is not set -# CONFIG_THUMB2_KERNEL is not set -# CONFIG_NEON is not set -CONFIG_GPIO_GENERIC_PLATFORM=y -# CONFIG_GPIO_MCP23S08 is not set -# CONFIG_KEYBOARD_TEGRA is not set -CONFIG_PINCTRL_TEGRA=y -CONFIG_PINCTRL_TEGRA20=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 - -# AC100 (PAZ00) -# CONFIG_MFD_NVEC is not set -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_DRM_TEGRA=m - -CONFIG_CPU_PM=y -CONFIG_ARM_CPU_SUSPEND=y - -CONFIG_CRYPTO_DEV_TEGRA_AES=m - -CONFIG_PL310_ERRATA_753970=y -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_ARM_PSCI 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 diff --git a/config-armv7 b/config-armv7 index bfc2d13c0..d609bc65d 100644 --- a/config-armv7 +++ b/config-armv7 @@ -1,466 +1,649 @@ # 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_OMAP2PLUS is not set -CONFIG_ARCH_PICOXCELL=y -CONFIG_ARCH_SOCFPGA=y -CONFIG_ARCH_SUNXI=y -CONFIG_ARCH_VEXPRESS_CA9X4=y -CONFIG_ARCH_VEXPRESS_DT=y -CONFIG_ARCH_VIRT=y -# CONFIG_ARCH_WM8850 is not set -# not enabling first round -# CONFIG_ARCH_ZYNQ is not set +# CONFIG_ARCH_BERLIN is not set +# CONFIG_ARCH_KEYSTONE is not set +CONFIG_ARCH_MVEBU=y +CONFIG_ARCH_MXC=y +# CONFIG_ARCH_OMAP2 is not set +CONFIG_ARCH_OMAP3=y +CONFIG_ARCH_OMAP4=y +CONFIG_ARCH_PICOXCELL=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_ARCH_SOCFPGA=y +CONFIG_ARCH_TEGRA=y +CONFIG_ARCH_U8500=y +# CONFIG_ARCH_VIRT is not set +CONFIG_ARCH_ZYNQ=y + +# These are supported in the LPAE kernel +# CONFIG_ARM_LPAE is not set +# CONFIG_XEN is not set +# CONFIG_ARM_VIRT_EXT is not set + +# mvebu CONFIG_MACH_ARMADA_370_XP=y CONFIG_MACH_ARMADA_370=y CONFIG_MACH_ARMADA_XP=y -# generic ARM config options -CONFIG_CMDLINE="" -CONFIG_HAVE_ARM_ARCH_TIMER=y -CONFIG_AEABI=y -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_NEON=y -CONFIG_ZBOOT_ROM_TEXT=0x0 -CONFIG_ZBOOT_ROM_BSS=0x0 -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 -CONFIG_SWP_EMULATE=y -CONFIG_CPU_BPREDICT_DISABLE=y -CONFIG_CACHE_L2X0=y -CONFIG_HIGHPTE=y -# CONFIG_OABI_COMPAT is not set -# CONFIG_ATAGS is not set -# CONFIG_ATAGS_PROC 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 -# CONFIG_DMA_CACHE_RWFO is not set -# CONFIG_ARM_LPAE is not set -# CONFIG_THUMB2_KERNEL is not set -# CONFIG_XEN is not set -# CONFIG_HVC_DCC is not set -# CONFIG_VIRTIO_CONSOLE is not set - -# CONFIG_ARM_VIRT_EXT is not set - -# errata -# v5/v6 -# 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_458693 is not set -# CONFIG_ARM_ERRATA_460075 is not set -# Cortex-A9 -CONFIG_ARM_ERRATA_742230=y -CONFIG_ARM_ERRATA_742231=y -CONFIG_ARM_ERRATA_743622=y -CONFIG_ARM_ERRATA_754322=y -CONFIG_ARM_ERRATA_754327=y -CONFIG_ARM_ERRATA_764369=y -CONFIG_ARM_ERRATA_775420=y -# Disabled due to causing highbank to crash -# CONFIG_PL310_ERRATA_588369 is not set -# CONFIG_PL310_ERRATA_727915 is not set -CONFIG_PL310_ERRATA_769419=y - -# generic that deviates from or should be merged into config-generic -CONFIG_SMP=y -CONFIG_NR_CPUS=4 -CONFIG_SMP_ON_UP=y -CONFIG_HIGHMEM=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y - -CONFIG_SCHED_MC=y -CONFIG_SCHED_SMT=y - -CONFIG_RCU_FANOUT=32 -CONFIG_RCU_FANOUT_LEAF=16 - -CONFIG_CPU_IDLE=y -# CONFIG_CPU_IDLE_GOV_LADDER is not set -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y - -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 - -CONFIG_XZ_DEC_ARM=y - -CONFIG_PM=y -CONFIG_PM_STD_PARTITION="" -CONFIG_SUSPEND=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_CPU_TOPOLOGY=y - -CONFIG_LOCAL_TIMERS=y -CONFIG_HW_PERF_EVENTS=y -CONFIG_UACCESS_WITH_MEMCPY=y -CONFIG_CC_STACKPROTECTOR=y - -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=14 - -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y - -CONFIG_PINCTRL=y -CONFIG_PINCONF=y - -CONFIG_NFS_FS=y -CONFIG_ROOT_NFS=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y -CONFIG_EARLY_PRINTK=y - -CONFIG_LBDAF=y - -CONFIG_COMMON_CLK=y - -# Versatile and highbank -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_RTC_DRV_PL030=y -CONFIG_RTC_DRV_PL031=y - -CONFIG_PL330_DMA=y -CONFIG_AMBA_PL08X=y -CONFIG_ARM_SP805_WATCHDOG=m - -# highbank -CONFIG_CPU_IDLE_CALXEDA=y - -CONFIG_EDAC_HIGHBANK_MC=m -CONFIG_EDAC_HIGHBANK_L2=m - -CONFIG_OC_ETM=y - -CONFIG_SATA_HIGHBANK=m - -# versatile -CONFIG_FB=y -CONFIG_FB_ARMCLCD=m -CONFIG_FB_CFB_COPYAREA=m -CONFIG_FB_CFB_FILLRECT=m -CONFIG_FB_CFB_IMAGEBLIT=m -CONFIG_TOUCHSCREEN_ADS7846=m - -CONFIG_I2C_VERSATILE=m -CONFIG_OC_ETM=y -CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA=y -CONFIG_SENSORS_VEXPRESS=m - -# unknown and needs review -CONFIG_ARM_AMBA=y - -# mvebu +CONFIG_MVEBU_DEVBUS=y +CONFIG_PCI_MVEBU=y +CONFIG_CACHE_TAUROS2=y CONFIG_MV_XOR=y CONFIG_CRYPTO_DEV_MV_CESA=m CONFIG_MV643XX_ETH=m -CONFIG_I2C_MV64XXX=m CONFIG_PINCTRL_MVEBU=y CONFIG_PINCTRL_ARMADA_370=y CONFIG_PINCTRL_ARMADA_XP=y CONFIG_PINCTRL_DOVE=y CONFIG_EDAC_MV64X60=m -CONFIG_SATA_MV=m -CONFIG_MARVELL_PHY=m -CONFIG_RTC_DRV_S35390A=y +CONFIG_RTC_DRV_S35390A=m CONFIG_RTC_DRV_88PM80X=m CONFIG_RTC_DRV_MV=m -CONFIG_MVMDIO=m CONFIG_MVNETA=m CONFIG_GPIO_MVEBU=y CONFIG_MVEBU_CLK_CORE=y +CONFIG_MVEBU_CLK_COREDIV=y CONFIG_MVEBU_CLK_GATING=y +CONFIG_MMC_MVSDIO=m +CONFIG_SPI_ORION=m +CONFIG_USB_MV_UDC=m +CONFIG_MVEBU_MBUS=y +CONFIG_PHY_MVEBU_SATA=y +CONFIG_ARMADA_THERMAL=m +CONFIG_DRM_ARMADA=m -# Allwinner a1x -# CONFIG_SUNXI_RFKILL=y -# CONFIG_SUNXI_NAND=y -# CONFIG_SUNXI_DBGREG=m -# CONFIG_WEMAC_SUN4I=y -# CONFIG_KEYBOARD_SUN4IKEYPAD=m -# CONFIG_KEYBOARD_SUN4I_KEYBOARD=m -# CONFIG_IR_SUN4I=m -# CONFIG_TOUCHSCREEN_SUN4I_TS=m -# CONFIG_SUN4I_G2D=y -# CONFIG_I2C_SUN4I=y -# CONFIG_DRM_MALI=m -# CONFIG_MALI=m -# CONFIG_FB_SUNXI=m -# CONFIG_FB_SUNXI_UMP=y -# CONFIG_FB_SUNXI_LCD=m -# CONFIG_FB_SUNXI_HDMI=m -# CONFIG_SOUND_SUN4I=y -# CONFIG_SND_SUN4I_SOC_CODEC=y -# CONFIG_SND_SUN4I_SOC_HDMIAUDIO=y -# CONFIG_SND_SUN4I_SOC_SPDIF=m -# CONFIG_SND_SUN4I_SOC_I2S_INTERFACE=m -# CONFIG_SND_SOC_I2C_AND_SPI=y -# CONFIG_USB_SW_SUN4I_HCD=y -# CONFIG_USB_SW_SUN4I_HCD0=y -# CONFIG_USB_SW_SUN4I_HCI=y -# CONFIG_USB_SW_SUN4I_EHCI0=y -# CONFIG_USB_SW_SUN4I_EHCI1=y -# CONFIG_USB_SW_SUN4I_OHCI0=y -# CONFIG_USB_SW_SUN4I_OHCI1=y -# CONFIG_USB_SW_SUN4I_USB=y -# CONFIG_USB_SW_SUN4I_USB_MANAGER=y -# CONFIG_MMC_SUNXI_POWER_CONTROL=y -# CONFIG_MMC_SUNXI=y -# CONFIG_RTC_DRV_SUN4I=y +# omap +CONFIG_ARCH_OMAP2PLUS_TYPICAL=y +CONFIG_SOC_OMAP5=y +# CONFIG_SOC_DRA7XX is not set +CONFIG_SOC_OMAP3430=y +CONFIG_SOC_TI81XX=y +CONFIG_MACH_CRANEBOARD=y +CONFIG_MACH_DEVKIT8000=y +# CONFIG_MACH_NOKIA_RX51 is not set +CONFIG_MACH_OMAP_3630SDP=y +CONFIG_MACH_OMAP_GENERIC=y +CONFIG_MACH_OMAP_LDP=y +CONFIG_MACH_OMAP3_BEAGLE=y +# CONFIG_MACH_OMAP3EVM is not set +CONFIG_MACH_OMAP_3430SDP=y +CONFIG_MACH_OMAP3530_LV_SOM=y +# CONFIG_MACH_OMAP3517EVM is not set +CONFIG_MACH_OMAP3_PANDORA=y +CONFIG_MACH_OMAP3_TORPEDO=y +CONFIG_MACH_OVERO=y +CONFIG_MACH_TOUCHBOOK=y +CONFIG_MACH_CM_T35=y +CONFIG_MACH_CM_T3517=y +CONFIG_MACH_IGEP0030=y +CONFIG_MACH_SBC3530=y +# CONFIG_MACH_TI8168EVM is not set +# CONFIG_MACH_TI8148EVM is not set -# OMAP -# CONFIG_DRM_TILCDC is not set -# CONFIG_SENSORS_LIS3_I2C is not set +CONFIG_SOC_HAS_REALTIME_COUNTER=y +CONFIG_OMAP_RESET_CLOCKS=y +CONFIG_OMAP_MUX=y +CONFIG_OMAP_MUX_WARNINGS=y +CONFIG_OMAP_32K_TIMER=y +CONFIG_OMAP_32K_TIMER_HZ=128 +# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set -# 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_OMAP_MCBSP=y +CONFIG_OMAP2PLUS_MBOX=m +CONFIG_OMAP_MBOX_FWK=m +CONFIG_OMAP_MBOX_KFIFO_SIZE=256 +CONFIG_OMAP_DM_TIMER=y +CONFIG_OMAP_PM_NOOP=y +CONFIG_DMA_OMAP=y +CONFIG_OMAP_IOMMU=y +CONFIG_OMAP_IOVMM=m +CONFIG_HWSPINLOCK_OMAP=m +CONFIG_OMAP3_EMU=y +# CONFIG_OMAP3_SDRC_AC_TIMING is not set + +CONFIG_SERIAL_OMAP=y +CONFIG_SERIAL_OMAP_CONSOLE=y + +CONFIG_GPIO_TWL4030=m +CONFIG_GPIO_TWL6040=m +CONFIG_I2C_OMAP=m +CONFIG_CHARGER_TWL4030=m +CONFIG_OMAP_WATCHDOG=m +CONFIG_TWL4030_CORE=y +CONFIG_TWL4030_MADC=m +CONFIG_TWL4030_POWER=y +CONFIG_TWL4030_WATCHDOG=m +CONFIG_BATTERY_TWL4030_MADC=m +CONFIG_OMAP_USB2=m +CONFIG_OMAP_USB3=m +CONFIG_TWL4030_USB=m +CONFIG_TWL6030_USB=m +CONFIG_TWL6030_PWM=m +CONFIG_TWL6040_CORE=y +CONFIG_CLK_TWL6040=m +CONFIG_OMAP_INTERCONNECT=m +CONFIG_MFD_OMAP_USB_HOST=y +CONFIG_HDQ_MASTER_OMAP=m +CONFIG_REGULATOR_TWL4030=y +CONFIG_BACKLIGHT_PANDORA=m +CONFIG_OMAP_OCP2SCP=m +CONFIG_USB_EHCI_HCD_OMAP=m +CONFIG_USB_OHCI_HCD_PLATFORM=m +CONFIG_USB_OHCI_HCD_OMAP3=m +CONFIG_USB_MUSB_AM35X=m +CONFIG_USB_MUSB_OMAP2PLUS=m +CONFIG_OMAP_CONTROL_USB=m +CONFIG_MMC_OMAP=y +CONFIG_MMC_OMAP_HS=y +CONFIG_RTC_DRV_MAX8907=m +# CONFIG_RTC_DRV_TWL92330 is not set +CONFIG_RTC_DRV_TWL4030=y +CONFIG_RTC_DRV_OMAP=y +CONFIG_SENSORS_TWL4030_MADC=m +CONFIG_TWL6030_GPADC=m + +# OMAP5 (possibly other devices too) +CONFIG_MFD_PALMAS=y +CONFIG_EXTCON_PALMAS=m +CONFIG_GPIO_PALMAS=y +CONFIG_PINCTRL_PALMAS=y +CONFIG_REGULATOR_PALMAS=y +CONFIG_RTC_DRV_PALMAS=m + +CONFIG_WL_TI=y +CONFIG_WLCORE_SDIO=m +CONFIG_WLCORE_SPI=m +CONFIG_WL18XX=m +CONFIG_WILINK_PLATFORM_DATA=y +CONFIG_MFD_WL1273_CORE=m +CONFIG_NFC_WILINK=m + +CONFIG_MTD_ONENAND_OMAP2=m +CONFIG_MTD_NAND_OMAP2=m +CONFIG_MTD_NAND_OMAP_BCH=y +CONFIG_SPI_OMAP24XX=m +CONFIG_MFD_TI_SSP=m +CONFIG_SPI_TI_SSP=m +CONFIG_SPI_TI_QSPI=m + +CONFIG_INPUT_TWL4030_PWRBUTTON=m +CONFIG_INPUT_TWL4030_VIBRA=m +CONFIG_INPUT_TWL6040_VIBRA=m +CONFIG_KEYBOARD_OMAP4=m +CONFIG_KEYBOARD_TWL4030=m +CONFIG_TOUCHSCREEN_TI_TSCADC=m + +# OMAP thermal temp. Can likely be built as module but doesn't autoload so build in to ensure performance on PandaES +CONFIG_OMAP_BANDGAP=y +CONFIG_TI_SOC_THERMAL=y +CONFIG_TI_THERMAL=y +CONFIG_OMAP4_THERMAL=y +CONFIG_OMAP5_THERMAL=y + +# OMAP3 thermal/power +CONFIG_POWER_AVS=y +CONFIG_POWER_AVS_OMAP=y +CONFIG_POWER_AVS_OMAP_CLASS3=y + +CONFIG_ARM_OMAP2PLUS_CPUFREQ=y + +CONFIG_PWM_TIECAP=m +CONFIG_PWM_TIEHRPWM=m +CONFIG_PWM_TWL=m +CONFIG_PWM_TWL_LED=m + +CONFIG_CRYPTO_DEV_OMAP_SHAM=m +CONFIG_CRYPTO_DEV_OMAP_AES=m +CONFIG_HW_RANDOM_OMAP=m +CONFIG_HW_RANDOM_OMAP3_ROM=m + +CONFIG_DRM_OMAP=m +CONFIG_DRM_OMAP_NUM_CRTCS=2 +CONFIG_OMAP2_VRFB=y +# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set +# CONFIG_FB_OMAP_LCD_VGA is not set +# CONFIG_FB_OMAP2 is not set +# CONFIG_FB_DA8XX is not set + +CONFIG_OMAP2_DSS=m +CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y +# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set +CONFIG_OMAP2_DSS_DPI=y +CONFIG_OMAP2_DSS_RFBI=y +CONFIG_OMAP2_DSS_VENC=y +CONFIG_OMAP4_DSS_HDMI=y +CONFIG_OMAP2_DSS_SDI=y +CONFIG_OMAP2_DSS_DSI=y +# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set +CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0 +CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET=y +CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y + +CONFIG_DISPLAY_ENCODER_TFP410=m +CONFIG_DISPLAY_ENCODER_TPD12S015=m +CONFIG_DISPLAY_CONNECTOR_DVI=m +CONFIG_DISPLAY_CONNECTOR_HDMI=m +CONFIG_DISPLAY_CONNECTOR_ANALOG_TV=m +CONFIG_DISPLAY_PANEL_DPI=m +CONFIG_DISPLAY_PANEL_DSI_CM=m +CONFIG_DISPLAY_PANEL_SONY_ACX565AKM=m +CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02=m +CONFIG_DISPLAY_PANEL_SHARP_LS037V7DW01=m +CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1=m +CONFIG_DISPLAY_PANEL_NEC_NL8048HL11=m +CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1=m + +# Enable V4L2 drivers for OMAP2+ +CONFIG_MEDIA_CONTROLLER=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y +CONFIG_V4L_PLATFORM_DRIVERS=y +# CONFIG_VIDEO_OMAP2_VOUT is not set +# CONFIG_VIDEO_OMAP3 is not set +# CONFIG_VIDEO_VPFE_CAPTURE is not set +# The ones below are for TI Davinci +# CONFIG_VIDEO_VPSS_SYSTEM is not set +# CONFIG_VIDEO_DM6446_CCDC is not set +# CONFIG_VIDEO_DM644X_VPBE is not set +# CONFIG_VIDEO_DM355_CCDC is not set +# CONFIG_VIDEO_ISIF is not set +# Also enable vivi driver - useful for testing a full kernelspace V4L2 driver +CONFIG_V4L_TEST_DRIVERS=y +CONFIG_VIDEO_VIVI=m + +CONFIG_SND_OMAP_SOC=m +CONFIG_SND_SOC_I2C_AND_SPI=m +CONFIG_SND_OMAP_SOC_AM3517EVM=m +CONFIG_SND_OMAP_SOC_DMIC=m +CONFIG_SND_OMAP_SOC_HDMI=m +CONFIG_SND_OMAP_SOC_IGEP0020=m +CONFIG_SND_OMAP_SOC_MCBSP=m +CONFIG_SND_OMAP_SOC_MCPDM=m +CONFIG_SND_OMAP_SOC_OMAP_HDMI=m +CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m +CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m +CONFIG_SND_OMAP_SOC_OMAP3EVM=m +CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=m +CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m +CONFIG_SND_OMAP_SOC_OVERO=m +# CONFIG_SND_OMAP_SOC_RX51 is not set +CONFIG_SND_OMAP_SOC_SDP4430=m +CONFIG_SND_SOC_TLV320AIC23=m +CONFIG_SND_SOC_TLV320AIC3X=m +CONFIG_SND_SOC_TWL4030=m +CONFIG_SND_SOC_TWL6040=m +CONFIG_SND_SOC_PCM1792A=m +CONFIG_RADIO_WL128X=m + +CONFIG_OMAP_REMOTEPROC=m + +# CONFIG_TIDSPBRIDGE is not set +# CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000 +# CONFIG_TIDSPBRIDGE_DEBUG is not set +# CONFIG_TIDSPBRIDGE_RECOVERY=y +# CONFIG_TIDSPBRIDGE_CACHE_LINE_CHECK is not set +# CONFIG_TIDSPBRIDGE_WDT3=y +# CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5 +# CONFIG_TIDSPBRIDGE_NTFY_PWRERR is not set +# CONFIG_TIDSPBRIDGE_BACKTRACE is not set + +# CONFIG_OMAP2_DSS_DEBUGFS is not set +# CONFIG_OMAP_IOMMU_DEBUG is not set +# CONFIG_OMAP_MUX_DEBUG is not set +# CONFIG_VIDEO_OMAP3_DEBUG is not set + +# AM33xx +CONFIG_SOC_AM33XX=y +CONFIG_SOC_AM43XX=y +CONFIG_AM335X_CONTROL_USB=m +CONFIG_AM335X_PHY_USB=m +CONFIG_USB_MUSB_AM335X_CHILD=m +CONFIG_TI_CPPI41=m +CONFIG_USB_TI_CPPI41_DMA=y +CONFIG_MFD_TI_AM335X_TSCADC=m +CONFIG_TI_ST=m +CONFIG_TI_DAC7512=m +CONFIG_TI_DAVINCI_CPDMA=m +CONFIG_TI_DAVINCI_EMAC=m +CONFIG_TI_DAVINCI_MDIO=m +CONFIG_TI_CPSW=m +CONFIG_TI_CPSW_PHY_SEL=y +CONFIG_TI_CPTS=y +# Needed for BBone White +CONFIG_REGULATOR_TPS65217=y +CONFIG_TI_EMIF=m +CONFIG_DRM_TILCDC=m +CONFIG_SPI_DAVINCI=m +CONFIG_SND_DAVINCI_SOC=m +CONFIG_SND_DAVINCI_SOC_I2S=m +CONFIG_SND_DAVINCI_SOC_MCASP=m +CONFIG_SND_DAVINCI_SOC_VCIF=m +CONFIG_SND_DAVINCI_SOC_GENERIC_EVM=m +CONFIG_SND_AM33XX_SOC_EVM=m +CONFIG_REGULATOR_TI_ABB=m +CONFIG_TI_ADC081C=m +CONFIG_TI_AM335X_ADC=m +CONFIG_PWM_TIPWMSS=y +# CONFIG_GPIO_DAVINCI is not set +# CONFIG_DAVINCI_WATCHDOG is not set + +# i.MX +CONFIG_MXC_IRQ_PRIOR=y +# CONFIG_MXC_DEBUG_BOARD is not set +CONFIG_SOC_IMX50=y +CONFIG_SOC_IMX53=y +CONFIG_SOC_IMX6Q=y +CONFIG_SOC_IMX6SL=y +CONFIG_MACH_IMX51_DT=y +# CONFIG_MACH_MX51_BABBAGE is not set +# CONFIG_MACH_EUKREA_CPUIMX51SD is not set +CONFIG_ARM_IMX6Q_CPUFREQ=m +CONFIG_IMX_THERMAL=m +CONFIG_PATA_IMX=m +CONFIG_PCI_IMX6=y +# CONFIG_USB_EHCI_MXC is not set +CONFIG_USB_CHIPIDEA=m +CONFIG_USB_CHIPIDEA_UDC=y +CONFIG_USB_CHIPIDEA_HOST=y +# CONFIG_USB_CHIPIDEA_DEBUG is not set +CONFIG_USB_FSL_USB2=m +CONFIG_NET_VENDOR_FREESCALE=y +CONFIG_FEC=m +CONFIG_KEYBOARD_IMX=m +CONFIG_KEYBOARD_STMPE=m +CONFIG_TOUCHSCREEN_STMPE=m +CONFIG_SERIAL_IMX=y +CONFIG_SERIAL_IMX_CONSOLE=y +CONFIG_PINCTRL_IMX6SL=y +CONFIG_I2C_IMX=m +CONFIG_STMPE_I2C=y +CONFIG_SPI_IMX=m +CONFIG_STMPE_SPI=y +CONFIG_MFD_MC13783=m +CONFIG_MFD_MC13XXX_SPI=m +CONFIG_MFD_STMPE=y +CONFIG_W1_MASTER_MXC=m +CONFIG_IMX_WEIM=y +CONFIG_IMX2_WDT=m +CONFIG_HW_RANDOM_MXC_RNGA=m +CONFIG_CRYPTO_DEV_SAHARA=m +CONFIG_RTC_DRV_SNVS=m +# CONFIG_FB_MX3 is not set +# CONFIG_FB_IMX is not set + +CONFIG_SND_IMX_SOC=m +CONFIG_SND_SOC_FSL_SPDIF=m +CONFIG_SND_SOC_FSL_SSI=m +CONFIG_SND_SOC_FSL_UTILS=m +CONFIG_SND_SOC_IMX_SSI=m +CONFIG_SND_SOC_IMX_AUDMUX=m +CONFIG_SND_SOC_IMX_PCM_FIQ=m +CONFIG_SND_SOC_IMX_PCM_DMA=m +CONFIG_SND_SOC_IMX_SGTL5000=m +CONFIG_SND_SOC_IMX_WM8962=m +CONFIG_SND_SOC_IMX_MC13783=m +CONFIG_SND_SOC_IMX_SPDIF=m + +CONFIG_USB_IMX21_HCD=m +CONFIG_USB_MXS_PHY=m +CONFIG_MMC_DW_SOCFPGA=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_AHCI_IMX=m +# CONFIG_MXS_DMA is not set + +CONFIG_PWM_IMX=m +CONFIG_DRM_IMX=m +CONFIG_DRM_IMX_FB_HELPER=m +CONFIG_DRM_IMX_HDMI=m +CONFIG_DRM_IMX_IPUV3_CORE=m +CONFIG_DRM_IMX_IPUV3=m +# CONFIG_DRM_IMX_LDB is not set +CONFIG_DRM_IMX_PARALLEL_DISPLAY=m +CONFIG_DRM_IMX_TVE=m +CONFIG_VIDEO_CODA=m + +CONFIG_MFD_SYSCON=y +CONFIG_SENSORS_MC13783_ADC=m +CONFIG_REGULATOR_ANATOP=m +CONFIG_REGULATOR_MC13783=m +CONFIG_REGULATOR_MC13892=m +CONFIG_LEDS_MC13783=m +CONFIG_RTC_DRV_MC13XXX=m +CONFIG_CAN_FLEXCAN=m CONFIG_INPUT_PWM_BEEPER=m +CONFIG_INPUT_88PM80X_ONKEY=m -# exynos -# CONFIG_DRM_EXYNOS is not set -# CONFIG_PINCTRL_EXYNOS5440 is not set -# CONFIG_PINCTRL_EXYNOS is not set +# i.MX6Q (and likely Samsung among others) +CONFIG_MFD_DA9052_I2C=y +CONFIG_MFD_DA9052_SPI=y +CONFIG_MFD_DA9055=y +CONFIG_TOUCHSCREEN_DA9052=m +CONFIG_INPUT_DA9052_ONKEY=m +CONFIG_INPUT_DA9055_ONKEY=m +CONFIG_GPIO_DA9052=m +CONFIG_GPIO_DA9055=m +CONFIG_GPIO_STMPE=y +CONFIG_BATTERY_DA9052=m +CONFIG_SENSORS_DA9052_ADC=m +CONFIG_SENSORS_DA9055=m +CONFIG_DA9052_WATCHDOG=m +CONFIG_DA9055_WATCHDOG=m +CONFIG_BACKLIGHT_DA9052=m +CONFIG_LEDS_DA9052=m +CONFIG_RTC_DRV_DA9052=m +CONFIG_RTC_DRV_DA9055=m +CONFIG_REGULATOR_DA9052=m +CONFIG_REGULATOR_DA9055=m # picoxcell CONFIG_CRYPTO_DEV_PICOXCELL=m +CONFIG_HW_RANDOM_PICOXCELL=m # ST Ericsson -# CONFIG_I2C_NOMADIK is not set +CONFIG_MACH_HREFV60=y +CONFIG_MACH_SNOWBALL=y +CONFIG_MACH_UX500_DT=y -# ZYNQ -# CONFIG_LATTICE_ECP3_CONFIG is not set +CONFIG_ABX500_CORE=y +CONFIG_ARM_U8500_CPUIDLE=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 -# General ARM drivers -# Device tree -CONFIG_DTC=y -CONFIG_OF=y -CONFIG_USE_OF=y -CONFIG_OF_DEVICE=y -CONFIG_OF_IRQ=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 +CONFIG_IIO_ST_GYRO_I2C_3AXIS=m +CONFIG_IIO_ST_GYRO_SPI_3AXIS=m +CONFIG_IIO_ST_MAGN_I2C_3AXIS=m +CONFIG_IIO_ST_MAGN_SPI_3AXIS=m +CONFIG_IIO_ST_PRESS=m +CONFIG_IIO_ST_PRESS_I2C=m +CONFIG_IIO_ST_PRESS_SPI=m +CONFIG_IIO_ST_SENSORS_I2C=m +CONFIG_IIO_ST_SENSORS_SPI=m +CONFIG_IIO_ST_SENSORS_CORE=m -CONFIG_OF_DISPLAY_TIMING=y -CONFIG_OF_VIDEOMODE=y +# tegra +CONFIG_ARCH_TEGRA_2x_SOC=y +CONFIG_ARCH_TEGRA_3x_SOC=y +CONFIG_ARCH_TEGRA_114_SOC=y +CONFIG_ARCH_TEGRA_124_SOC=y +CONFIG_ARM_TEGRA_CPUFREQ=y +CONFIG_TEGRA20_MC=y +CONFIG_TEGRA30_MC=y +CONFIG_TRUSTED_FOUNDATIONS=y -CONFIG_MDIO_BUS_MUX_GPIO=m -CONFIG_GPIOLIB=y +CONFIG_SERIAL_TEGRA=y -# MMC/SD -CONFIG_MMC=y -CONFIG_MMC_ARMMMCI=y -CONFIG_MMC_SDHCI_PLTFM=m -CONFIG_MMC_SDHCI_OF=m -CONFIG_MMC_SPI=m -CONFIG_MMC_DW=m -CONFIG_MMC_DW_PLTFM=m -CONFIG_MMC_DW_PCI=m -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_IDMAC is not set -CONFIG_MMC_TMIO=m -CONFIG_MMC_SDHCI_PXAV3=m -CONFIG_MMC_SDHCI_PXAV2=m -CONFIG_MMC_MVSDIO=m +CONFIG_PCI_TEGRA=y +CONFIG_TEGRA_IOMMU_GART=y +CONFIG_TEGRA_IOMMU_SMMU=y +CONFIG_MMC_SDHCI_TEGRA=m -# usb -CONFIG_USB_ULPI=y -CONFIG_AX88796=m -CONFIG_AX88796_93CX6=y -CONFIG_SMC91X=m -CONFIG_SMC911X=m -CONFIG_SMSC911X=m -CONFIG_USB_ISP1760_HCD=m +CONFIG_I2C_TEGRA=m +CONFIG_I2C_MUX_PCA954x=m -# HW crypto and rng -CONFIG_CRYPTO_SHA1_ARM=m -CONFIG_CRYPTO_AES_ARM=m -CONFIG_HW_RANDOM_ATMEL=m -CONFIG_HW_RANDOM_EXYNOS=m +CONFIG_TEGRA_SYSTEM_DMA=y +CONFIG_TEGRA_EMC_SCALING_ENABLE=y +CONFIG_TEGRA_AHB=y +CONFIG_TEGRA20_APB_DMA=y +CONFIG_SPI_TEGRA114=m +CONFIG_SPI_TEGRA20_SFLASH=m +CONFIG_SPI_TEGRA20_SLINK=m -# Sound -CONFIG_SND_ARM=y -CONFIG_SND_ARMAACI=m -CONFIG_SND_SOC=m -CONFIG_SND_DESIGNWARE_I2S=m -CONFIG_SND_SIMPLE_CARD=m -CONFIG_SND_SOC_CACHE_LZO=y -CONFIG_SND_SOC_ALL_CODECS=m -# CONFIG_SND_ATMEL_SOC is not set +CONFIG_MFD_MAX8907=m +CONFIG_KEYBOARD_TEGRA=m +CONFIG_PINCTRL_TEGRA=y +CONFIG_PINCTRL_TEGRA20=y +CONFIG_PINCTRL_TEGRA30=y +CONFIG_USB_EHCI_TEGRA=m +CONFIG_RTC_DRV_TEGRA=m -# EDAC -CONFIG_EDAC=y -CONFIG_EDAC_MM_EDAC=m -CONFIG_EDAC_LEGACY_SYSFS=y +CONFIG_SND_SOC_TEGRA=m +CONFIG_SND_SOC_TEGRA_ALC5632=m +CONFIG_SND_SOC_TEGRA_MAX98090=m +CONFIG_SND_SOC_TEGRA_RT5640=m +CONFIG_SND_SOC_TEGRA_TRIMSLICE=m +CONFIG_SND_SOC_TEGRA_WM8753=m +CONFIG_SND_SOC_TEGRA_WM8903=m +CONFIG_SND_SOC_TEGRA_WM9712=m +CONFIG_SND_SOC_TEGRA20_AC97=m +CONFIG_SND_SOC_TEGRA20_DAS=m +CONFIG_SND_SOC_TEGRA20_SPDIF=m +CONFIG_SND_SOC_TEGRA30_AHUB=m +CONFIG_SND_SOC_TEGRA30_I2S=m -# Watchdog -CONFIG_MPCORE_WATCHDOG=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_RTC_DRV_TPS6586X=m + +CONFIG_PWM_TEGRA=m + +CONFIG_TEGRA_HOST1X=m +CONFIG_TEGRA_HOST1X_FIREWALL=y +CONFIG_DRM_TEGRA=m +CONFIG_DRM_TEGRA_FBDEV=y +# CONFIG_DRM_TEGRA_DEBUG is not set +CONFIG_DRM_TEGRA_STAGING=y +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_SIMPLE=m + + +CONFIG_CRYPTO_DEV_TEGRA_AES=m + +CONFIG_GPIO_PCA953X=m + +# OLPC XO +CONFIG_SERIO_OLPC_APSP=m + +# Zynq-7xxx +# likely needs usb/mmc still +CONFIG_SERIAL_UARTLITE=y +CONFIG_SERIAL_UARTLITE_CONSOLE=y +CONFIG_SERIAL_XILINX_PS_UART=y +CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y +CONFIG_COMMON_CLK_AXI_CLKGEN=m +CONFIG_ARM_ZYNQ_CPUIDLE=y +CONFIG_LATTICE_ECP3_CONFIG=m +CONFIG_NET_VENDOR_XILINX=y +CONFIG_XILINX_EMACLITE=m +CONFIG_GPIO_XILINX=y +CONFIG_I2C_XILINX=m +CONFIG_SPI_XILINX=m +CONFIG_MMC_SDHCI_OF_ARASAN=m # Multi function devices -CONFIG_MFD_CORE=m +CONFIG_MFD_88PM800=m +CONFIG_MFD_88PM805=m CONFIG_MFD_T7L66XB=y CONFIG_MFD_TC6387XB=y -CONFIG_MFD_SYSCON=y -CONFIG_MFD_MAX8907=m -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_SMSC is not set -# RTC -CONFIG_RTC_DRV_SNVS=m - -# Pin stuff -CONFIG_PINMUX=y -CONFIG_PINCONF=y -CONFIG_PINCTRL_SINGLE=m -# CONFIG_PINCTRL_SAMSUNG is not set -# CONFIG_PINCTRL_EXYNOS4 is not set - -# GPIO -CONFIG_GPIO_GENERIC_PLATFORM=m -# CONFIG_GPIO_EM is not set -CONFIG_GPIO_ADNP=m -CONFIG_GPIO_MCP23S08=m -CONFIG_POWER_RESET_GPIO=y -CONFIG_RFKILL_GPIO=m -CONFIG_SERIAL_8250_EM=m -CONFIG_INPUT_GP2A=m -CONFIG_INPUT_GPIO_TILT_POLLED=m -CONFIG_MDIO_BUS_MUX_MMIOREG=m - -# MTD -CONFIG_MTD_OF_PARTS=y -# CONFIG_MG_DISK is not set - -# Framebuffers -CONFIG_FB_SSD1307=m +# Generic drivers +CONFIG_REMOTEPROC=m # Regulator drivers CONFIG_REGULATOR_FAN53555=m -# CONFIG_CHARGER_MANAGER is not set -# 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_88PM800 is not set CONFIG_REGULATOR_AD5398=m CONFIG_REGULATOR_ISL6271A=m +CONFIG_REGULATOR_LP3971=m +CONFIG_REGULATOR_LP3972=m +CONFIG_REGULATOR_LP872X=y +CONFIG_REGULATOR_LP8755=m CONFIG_REGULATOR_MAX1586=m CONFIG_REGULATOR_MAX8649=m CONFIG_REGULATOR_MAX8660=m +CONFIG_REGULATOR_MAX8907=m CONFIG_REGULATOR_MAX8952=m CONFIG_REGULATOR_MAX8973=m -CONFIG_REGULATOR_LP3971=m -CONFIG_REGULATOR_LP3972=m -CONFIG_REGULATOR_TPS51632=m -CONFIG_REGULATOR_TPS62360=m -CONFIG_REGULATOR_TPS65023=m -CONFIG_REGULATOR_TPS6507X=m # Needs work/investigation - -# CONFIG_ARM_CHARLCD is not set # CONFIG_MTD_AFS_PARTS is not set # CONFIG_IP_PNP_RARP is not set -# CONFIG_BPF_JIT 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_IRQ_DOMAIN_DEBUG is not set -# CONFIG_COMMON_CLK_DEBUG is not set -# CONFIG_DEBUG_USER is not set -# CONFIG_DEBUG_LL is not set -# CONFIG_DEBUG_PINCTRL is not set - -# CONFIG_CS89x0 is not set -# CONFIG_DM9000 is not set - -# CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set # CONFIG_ARM_KPROBES_TEST is not set -# CONFIG_LEDS_RENESAS_TPU is not set -# CONFIG_LEDS_PWM is not set - -CONFIG_ETHERNET=y -# CONFIG_NET_VENDOR_BROADCOM is not set -# CONFIG_NET_VENDOR_CIRRUS is not set -CONFIG_THERMAL=y -# CONFIG_PATA_PLATFORM is not set -CONFIG_PERF_EVENTS=y # Defined config options we don't use yet # CONFIG_PINCTRL_IMX35 is not set -# CONFIG_DRM_IMX_FB_HELPER is not set -# CONFIG_DRM_IMX_PARALLEL_DISPLAY is not set -# CONFIG_DRM_IMX_IPUV3_CORE is not set -# CONFIG_DRM_IMX_IPUV3 is not set -# CONFIG_REGULATOR_ANATOP is not set -# CONFIG_GPIO_TWL6040 is not set -# CONFIG_SND_OMAP_SOC_OMAP_TWL4030 is not set -# CONFIG_VIDEO_DM6446_CCDC is not set -# CONFIG_PANEL_TAAL is not set +# CONFIG_BATTERY_RX51 is not set # CONFIG_IR_RX51 is not set -# CONFIG_DRM_OMAP is not set - -# CONFIG_GENERIC_CPUFREQ_CPU0 is not set -# CONFIG_GPIO_TWL6040 is not set # CONFIG_MFD_SMSC is not set -# CONFIG_MFD_DA9055 is not set +# CONFIG_MFD_SEC_CORE is not set # CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_IR_RX51 is not set -# CONFIG_VIDEO_DM6446_CCDC is not set -# CONFIG_PANEL_TAAL is not set -# CONFIG_SND_OMAP_SOC_OMAP_TWL4030 is not set +# CONFIG_MFD_MAX77686 is not set +# CONFIG_MFD_MAX77693 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX14577 is not set +# CONFIG_MFD_AAT2870_CORE is not set +# CONFIG_MFD_RC5T583 is not set +# CONFIG_MFD_SMSC is not set +# CONFIG_MFD_AS3711 is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PMIC_ADP5520 is not set # CONFIG_DVB_USB_PCTV452E is not set # We need to fix these as they should be either generic includes or kconfig fixes @@ -468,12 +651,13 @@ CONFIG_PERF_EVENTS=y # CONFIG_TOUCHSCREEN_EETI is not set # CONFIG_TOUCHSCREEN_EGALAX is not set # CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set -CONFIG_VIRTUALIZATION=y -# CONFIG_CHARGER_MANAGER is not set -# CONFIG_POWER_RESET_QNAP is not set -# CONFIG_POWER_RESET_RESTART is not set -# CONFIG_ARM_PSCI is not set -# CONFIG_ARM_HIGHBANK_CPUFREQ is not set -# CONFIG_RFKILL_REGULATOR is not set -CONFIG_XZ_DEC_ARM=y +# CONFIG_VIRTUALIZATION is not set +# CONFIG_POWER_RESET_QNAP is not set +# CONFIG_OMAP2_DSS_DEBUG is not set +# CONFIG_CRYPTO_DEV_UX500_DEBUG is not set +# CONFIG_AB8500_DEBUG is not set + +# CONFIG_SOC_VF610 is not set +# CONFIG_MMC_TMIO is not set +# CONFIG_SND_SOC_ADI is not set diff --git a/config-armv7-generic b/config-armv7-generic new file mode 100644 index 000000000..26e90fe82 --- /dev/null +++ b/config-armv7-generic @@ -0,0 +1,621 @@ +# arm configs for sharing between armv7 and armv7-lpae +# 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_CMDLINE_FROM_BOOTLOADER=y +CONFIG_HAVE_ARM_ARCH_TIMER=y +CONFIG_HAVE_ARM_TWD=y +CONFIG_AEABI=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_NEON=y +CONFIG_KERNEL_MODE_NEON=y + +CONFIG_ARM_UNWIND=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_ASM_UNIFIED=y +CONFIG_ARM_CPU_TOPOLOGY=y +CONFIG_ARM_DMA_MEM_BUFFERABLE=y +CONFIG_SWP_EMULATE=y +CONFIG_CACHE_L2X0=y +CONFIG_CACHE_PL310=y +CONFIG_HIGHPTE=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_ATAGS=y +CONFIG_ATAGS_PROC=y +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_XZ_DEC_ARMTHUMB=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_APM_EMULATION is not set +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_BPREDICT_DISABLE is not set +# CONFIG_DMA_CACHE_RWFO is not set +# CONFIG_THUMB2_KERNEL is not set +# CONFIG_HVC_DCC is not set +# CONFIG_XIP_KERNEL is not set +# CONFIG_ARM_VIRT_EXT is not set + +# Platforms enabled/disabled globally on ARMv7 +CONFIG_ARCH_HIGHBANK=y +CONFIG_ARCH_SUNXI=y +CONFIG_ARCH_VEXPRESS_CA9X4=y +CONFIG_ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA=y +# CONFIG_ARCH_VEXPRESS_SPC is not set +# CONFIG_ARCH_BCM is not set +# CONFIG_PLAT_SPEAR is not set +# CONFIG_ARCH_STI is not set +# CONFIG_ARCH_SIRF is not set +# CONFIG_ARCH_U8500 is not set +# CONFIG_ARCH_WM8850 is not set +# CONFIG_ARCH_SHMOBILE_MULTI is not set +# CONFIG_ARCH_BERLIN is not set +# CONFIG_ARCH_HI3xxx is not set +# CONFIG_ARCH_MSM_DT is not set + +# errata +# v5/v6 +# CONFIG_ARM_ERRATA_326103 is not set +# CONFIG_ARM_ERRATA_411920 is not set +# Cortex-A8 +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 +CONFIG_ARM_ERRATA_743622=y +CONFIG_ARM_ERRATA_751472=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_754327=y +CONFIG_ARM_ERRATA_764369=y +CONFIG_ARM_ERRATA_775420=y +# Disabled due to causing highbank to crash +# CONFIG_PL310_ERRATA_588369 is not set +# 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 is not set +# CONFIG_ARM_ERRATA_773022 is not set + +# generic that deviates from or should be merged into config-generic +CONFIG_SMP_ON_UP=y +CONFIG_HIGHMEM=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y + +CONFIG_SCHED_MC=y +CONFIG_SCHED_SMT=y + +CONFIG_RCU_FANOUT=32 + +CONFIG_CPU_IDLE=y +# CONFIG_CPU_IDLE_GOV_LADDER is not set +CONFIG_CPU_IDLE_GOV_MENU=y +# 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_XZ_DEC_ARM=y + +CONFIG_LOCAL_TIMERS=y +CONFIG_UACCESS_WITH_MEMCPY=y +CONFIG_CC_STACKPROTECTOR=y + +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y + +# Root as NFS, different from mainline +CONFIG_ROOT_NFS=y + +CONFIG_LBDAF=y + +# Device tree +CONFIG_USE_OF=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_APPENDED_DTB=y + +# General vexpress ARM drivers +CONFIG_ARM_TIMER_SP804=y + +CONFIG_SERIO_AMBAKMI=m +CONFIG_SERIAL_AMBA_PL010=y +CONFIG_SERIAL_AMBA_PL010_CONSOLE=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_MRST_MAX3110=m + +CONFIG_RTC_DRV_PL030=y +CONFIG_RTC_DRV_PL031=y + +CONFIG_PL330_DMA=m +CONFIG_AMBA_PL08X=y +CONFIG_GPIO_PL061=y +CONFIG_PL320_MBOX=y + +# highbank +CONFIG_EDAC_HIGHBANK_MC=m +CONFIG_EDAC_HIGHBANK_L2=m +CONFIG_SATA_HIGHBANK=m +CONFIG_ARM_HIGHBANK_CPUFREQ=m +# CONFIG_ARM_HIGHBANK_CPUIDLE is not set + +# Allwinner a1x +CONFIG_PINCTRL_SUNXI=y +CONFIG_SUNXI_WATCHDOG=m +CONFIG_MDIO_SUN4I=m +CONFIG_NET_VENDOR_ALLWINNER=y +CONFIG_SUN4I_EMAC=m +CONFIG_STMMAC_PLATFORM=y +CONFIG_DWMAC_SUNXI=y +CONFIG_EEPROM_SUNXI_SID=m +CONFIG_RTC_DRV_SUNXI=m + +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=m +CONFIG_REGMAP_SPI=m +CONFIG_REGMAP_SPMI=m +CONFIG_REGMAP_MMIO=m +CONFIG_REGMAP_IRQ=y + +# Power management +CONFIG_PM_OPP=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_GENERIC_CPUFREQ_CPU0=m + +# usb +CONFIG_USB_OTG=y +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +CONFIG_USB_ULPI=y +CONFIG_AX88796=m +CONFIG_AX88796_93CX6=y +CONFIG_USB_ISP1760_HCD=m +# CONFIG_USB_EHCI_HCD_ORION is not set + +# usb gadget +CONFIG_USB_GADGET=m +CONFIG_USB_GADGET_MUSB_HDRC=m +CONFIG_USB_GADGET_VBUS_DRAW=100 +CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +CONFIG_USB_MUSB_HDRC=m +CONFIG_USB_MUSB_DUAL_ROLE=y +CONFIG_USB_MUSB_DSPS=m +CONFIG_USB_GPIO_VBUS=m +CONFIG_USB_G_ACM_MS=m +CONFIG_USB_G_DBGP=m +CONFIG_USB_G_DBGP_PRINTK=y +CONFIG_USB_G_DBGP_SERIAL=y +CONFIG_USB_G_MULTI=m +CONFIG_USB_G_MULTI_CDC=y +# CONFIG_USB_G_MULTI_RNDIS is not set +CONFIG_USB_G_NCM=m +CONFIG_USB_G_SERIAL=m +CONFIG_USB_ETH_EEM=y +# CONFIG_USB_ETH_RNDIS is not set +CONFIG_USB_CDC_COMPOSITE=m +CONFIG_USB_GADGET_TARGET=m +CONFIG_USB_MASS_STORAGE=m +CONFIG_USB_CONFIGFS=m +CONFIG_USB_CONFIGFS_ACM=y +CONFIG_USB_CONFIGFS_ECM=y +CONFIG_USB_CONFIGFS_ECM_SUBSET=y +CONFIG_USB_CONFIGFS_EEM=y +CONFIG_USB_CONFIGFS_MASS_STORAGE=y +CONFIG_USB_CONFIGFS_NCM=y +CONFIG_USB_CONFIGFS_OBEX=y +# CONFIG_USB_CONFIGFS_RNDIS is not set +CONFIG_USB_CONFIGFS_SERIAL=y +CONFIG_USB_CONFIGFS_STORAGE=y +# CONFIG_USB_CONFIGFS_F_LB_SS is not set +# CONFIG_USB_CONFIGFS_F_FS is not set + +# CONFIG_MUSB_PIO_ONLY is not set +# CONFIG_USB_MUSB_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +# CONFIG_USB_FUSB300 is not set +# CONFIG_USB_RENESAS_USBHS is not set +# CONFIG_USB_FOTG210_UDC is not set +# CONFIG_USB_R8A66597 is not set +# CONFIG_USB_PXA27X is not set +# CONFIG_USB_MV_UDC is not set +# CONFIG_USB_MV_U3D is not set +# CONFIG_USB_M66592 is not set +# CONFIG_USB_AMD5536UDC is not set +# CONFIG_USB_NET2272 is not set +# CONFIG_USB_NET2280 is not set +# CONFIG_USB_GOKU is not set +# CONFIG_USB_EG20T is not set +# CONFIG_USB_DUMMY_HCD is not set +# CONFIG_USB_ZERO_HNPTEST is not set + +# Multifunction Devices +CONFIG_MFD_TPS65090=y +CONFIG_MFD_TPS65217=y +CONFIG_MFD_TPS65910=y +CONFIG_MFD_TPS65912=y +CONFIG_MFD_TPS65912_I2C=y +CONFIG_MFD_TPS65912_SPI=y +# CONFIG_MFD_DA9052_SPI is not set +# CONFIG_MFD_ARIZONA_SPI is not set +# CONFIG_MFD_WM831X_SPI is not set +# CONFIG_MFD_MC13XXX_SPI is not set + +# Pin stuff +CONFIG_PINMUX=y +CONFIG_PINCONF=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_SINGLE=y +CONFIG_GENERIC_PINCONF=y +# CONFIG_PINCTRL_SAMSUNG is not set +# CONFIG_PINCTRL_EXYNOS4 is not set +# CONFIG_PINCTRL_CAPRI is not set +# CONFIG_PINCTRL_MSM8X74 is not set + +# GPIO +# CONFIG_GPIO_EM is not set +CONFIG_GPIO_74X164=m +CONFIG_GPIO_ADNP=m +CONFIG_GPIO_MCP23S08=m +CONFIG_GPIO_MAX7301=m +CONFIG_GPIO_MC33880=m +CONFIG_GPIO_TPS65910=y +CONFIG_GPIO_TPS65912=m +CONFIG_LEDS_GPIO=m +CONFIG_MDIO_BUS_MUX=m +CONFIG_MDIO_BUS_MUX_GPIO=m +CONFIG_MDIO_BUS_MUX_MMIOREG=m +CONFIG_INPUT_GPIO=m +CONFIG_INPUT_GPIO_BEEPER=m +CONFIG_INPUT_GPIO_TILT_POLLED=m +CONFIG_INPUT_MATRIXKMAP=m +CONFIG_KEYBOARD_GPIO=m +CONFIG_KEYBOARD_MATRIX=m +# CONFIG_GPIO_RCAR is not set +CONFIG_W1_MASTER_GPIO=m + +# SPI +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_GPIO=m +CONFIG_SPI_BITBANG=m +CONFIG_SPI_PL022=m +CONFIG_SPI_SPIDEV=m +CONFIG_SPI_ALTERA=m +CONFIG_SPI_BUTTERFLY=m +CONFIG_SPI_LM70_LLP=m +CONFIG_SPI_OC_TINY=m +CONFIG_SPI_S3C64XX=m +CONFIG_SPI_SC18IS602=m +CONFIG_SPI_XCOMM=m +CONFIG_SPI_XILINX=m +CONFIG_SPI_DESIGNWARE=m +CONFIG_SPI_TLE62X0=m +# CONFIG_SPI_FSL_SPI is not set + +CONFIG_NFC_NCI_SPI=y + +# i2c +CONFIG_I2C_DESIGNWARE_CORE=m +CONFIG_I2C_DESIGNWARE_PLATFORM=m +CONFIG_I2C_MV64XXX=m + +# HW crypto and rng +CONFIG_CRYPTO_SHA1_ARM=m +CONFIG_CRYPTO_AES_ARM=m +# CONFIG_CRYPTO_AES_ARM_BS is not set + +# DMA +CONFIG_TI_PRIV_EDMA=y +CONFIG_TI_EDMA=y + +# EDAC +CONFIG_EDAC=y +CONFIG_EDAC_MM_EDAC=m +CONFIG_EDAC_LEGACY_SYSFS=y + +# Watchdog +CONFIG_MPCORE_WATCHDOG=m + +# Thermal / powersaving +CONFIG_THERMAL=y +CONFIG_ARM_PSCI=y + +# Mailbox +CONFIG_MAILBOX=y + +# MTD +# CONFIG_MG_DISK is not set +CONFIG_MTD_DATAFLASH=m +CONFIG_MTD_DATAFLASH_WRITE_VERIFY=y +CONFIG_MTD_DATAFLASH_OTP=y +CONFIG_MTD_M25P80=m +CONFIG_MTD_NAND=m +CONFIG_MTD_NAND_CAFE=m +# CONFIG_MTD_NAND_DENALI is not set +CONFIG_MTD_NAND_DOCG4=m +CONFIG_MTD_NAND_ECC_SMC=y +CONFIG_MTD_NAND_FSMC=m +CONFIG_MTD_NAND_GPIO=m +CONFIG_MTD_NAND_MXC=m +CONFIG_MTD_NAND_NANDSIM=m +CONFIG_MTD_NAND_ORION=m +CONFIG_MTD_NAND_PLATFORM=m +CONFIG_MTD_NAND_PXA3xx=m +CONFIG_MTD_NAND_RICOH=m +CONFIG_MTD_NAND_TMIO=m +CONFIG_MTD_SPINAND_MT29F=m +CONFIG_MTD_SPINAND_ONDIEECC=y +CONFIG_MTD_SST25L=m +CONFIG_EEPROM_AT25=m +CONFIG_EEPROM_93XX46=m + +# MMC/SD +CONFIG_MMC_SPI=m + +# Designware (used by numerous devices) +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_SOCFPGA is not set +# CONFIG_MMC_DW_EXYNOS is not set +# CONFIG_MMC_DW_IDMAC is not set +# CONFIG_MMC_DW_K3 is not set +CONFIG_USB_DWC2=m +# CONFIG_USB_DWC2_DEBUG is not set +# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set +CONFIG_USB_DWC3=m +CONFIG_USB_DWC3_OMAP=m +CONFIG_USB_DWC3_EXYNOS=m +CONFIG_USB_DWC3_PCI=m +# CONFIG_USB_DWC3_DEBUG is not set +# CONFIG_USB_DWC3_KEYSTONE is not set +CONFIG_DW_WATCHDOG=m +CONFIG_PCIE_DW=y +CONFIG_PCI_EXYNOS=y + +# Sound +CONFIG_SND_SOC=m +CONFIG_SND_SPI=y +CONFIG_SND_ARM=y +CONFIG_SND_ARMAACI=m +CONFIG_SND_COMPRESS_OFFLOAD=m +CONFIG_SND_DESIGNWARE_I2S=m +CONFIG_SND_DMAENGINE_PCM=m +CONFIG_SND_JACK=y +CONFIG_SND_SIMPLE_CARD=m +CONFIG_SND_SOC_ALL_CODECS=m +CONFIG_SND_SOC_CACHE_LZO=y +CONFIG_SND_SOC_DMIC=m +CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y +# CONFIG_SND_ATMEL_SOC is not set + +# Displays +CONFIG_BACKLIGHT_TPS65217=m + +# RTC +CONFIG_RTC_DRV_DS1305=m +CONFIG_RTC_DRV_DS1390=m +CONFIG_RTC_DRV_DS3234=m +CONFIG_RTC_DRV_M41T93=m +CONFIG_RTC_DRV_M41T94=m +CONFIG_RTC_DRV_MAX6902=m +CONFIG_RTC_DRV_PCF2123=m +CONFIG_RTC_DRV_R9701=m +CONFIG_RTC_DRV_RS5C348=m +CONFIG_RTC_DRV_RX4581=m +CONFIG_RTC_DRV_TPS65910=m +CONFIG_RTC_DRV_TPS80031=m + +# Regulators +CONFIG_REGULATOR=y +CONFIG_RFKILL_REGULATOR=m +CONFIG_REGULATOR_DUMMY=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_VIRTUAL_CONSUMER=m +CONFIG_REGULATOR_USERSPACE_CONSUMER=m +CONFIG_REGULATOR_GPIO=m +# CONFIG_REGULATOR_ACT8865 is not set +CONFIG_REGULATOR_AD5398=m +CONFIG_REGULATOR_DA9210=m +CONFIG_REGULATOR_FAN53555=m +CONFIG_REGULATOR_ISL6271A=m +CONFIG_REGULATOR_LP3971=m +CONFIG_REGULATOR_LP3972=m +CONFIG_REGULATOR_LP872X=m +CONFIG_REGULATOR_LP8755=m +CONFIG_REGULATOR_MAX1586=m +CONFIG_REGULATOR_MAX8649=m +CONFIG_REGULATOR_MAX8660=m +CONFIG_REGULATOR_MAX8952=m +CONFIG_REGULATOR_MAX8973=m +CONFIG_REGULATOR_PFUZE100=m +CONFIG_REGULATOR_TPS51632=m +CONFIG_REGULATOR_TPS62360=m +CONFIG_REGULATOR_TPS65023=m +CONFIG_REGULATOR_TPS6507X=m +CONFIG_REGULATOR_TPS65090=m +CONFIG_REGULATOR_TPS65217=m +CONFIG_REGULATOR_TPS6524X=m +CONFIG_REGULATOR_TPS6586X=m +CONFIG_REGULATOR_TPS65910=m +CONFIG_REGULATOR_TPS65912=m +CONFIG_REGULATOR_TPS80031=m + +CONFIG_CHARGER_MANAGER=y +CONFIG_CHARGER_BQ2415X=m +CONFIG_CHARGER_BQ24190=m +CONFIG_CHARGER_BQ24735=m +CONFIG_CHARGER_GPIO=m +CONFIG_CHARGER_TPS65090=m +CONFIG_PDA_POWER=m +CONFIG_GENERIC_ADC_BATTERY=m + +# Sensors +CONFIG_TMP006=m +CONFIG_BMP085=y +CONFIG_BMP085_I2C=m +CONFIG_BMP085_SPI=m +CONFIG_SENSORS_AD7314=m +CONFIG_SENSORS_ADCXX=m +CONFIG_SENSORS_ADS7871=m +CONFIG_SENSORS_GPIO_FAN=m +CONFIG_SENSORS_HTU21=m +CONFIG_SENSORS_LIS3_SPI=m +CONFIG_SENSORS_LM70=m +CONFIG_SENSORS_MAX1111=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 +CONFIG_LCD_S6E63M0=m +CONFIG_LCD_LD9040=m +CONFIG_LCD_AMS369FG06=m +CONFIG_LCD_LMS501KF03=m +CONFIG_LCD_HX8357=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 +CONFIG_TOUCHSCREEN_TSC2005=m + +CONFIG_LEDS_DAC124S085=m +CONFIG_LEDS_PWM=m +CONFIG_BMP085_SPI=m + +CONFIG_SRAM=y + +# Ethernet +CONFIG_KS8851=m +CONFIG_KS8851_MLL=m +CONFIG_ENC28J60=m +CONFIG_LIBERTAS_SPI=m +CONFIG_P54_SPI=m +CONFIG_P54_SPI_DEFAULT_EEPROM=n +CONFIG_MICREL_KS8995MA=m +CONFIG_IEEE802154_AT86RF230=m +CONFIG_IEEE802154_MRF24J40=m + +CONFIG_ARM_KPROBES_TEST=m + +# jffs2 +CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_POSIX_ACL=y +CONFIG_JFFS2_FS_SECURITY=y +CONFIG_JFFS2_FS_WRITEBUFFER=y +CONFIG_JFFS2_FS_XATTR=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RTIME=y +CONFIG_JFFS2_RUBIN=y +CONFIG_JFFS2_SUMMARY=y +CONFIG_JFFS2_ZLIB=y + +CONFIG_UBIFS_FS=m +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +# CONFIG_UBIFS_FS_DEBUG is not set + +# Sensors +CONFIG_SENSORS_HTU21=m + +# Chromebook +CONFIG_MFD_CROS_EC=m +CONFIG_MFD_CROS_EC_I2C=m +CONFIG_MFD_CROS_EC_SPI=m +CONFIG_KEYBOARD_CROS_EC=m + +# Should be in generic +CONFIG_BPF_JIT=y + +# CONFIG_NET_VENDOR_CIRRUS is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_DRM_EXYNOS is not set +# CONFIG_DRM_TILCDC is not set +# CONFIG_DRM_IMX is not set +# CONFIG_AHCI_IMX 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_MFD_T7L66XB is not set +# CONFIG_MFD_TC6387XB is not set +# CONFIG_TI_DAC7512 is not set +# CONFIG_EZX_PCAP is not set + +# Needs work/investigation +# CONFIG_ARM_CHARLCD is not set +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_IP_PNP_RARP 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_8250_EM is not set +# CONFIG_SERIAL_MAX3100 is not set +# CONFIG_SERIAL_MAX310X is not set +# CONFIG_SERIAL_IFX6X60 is not set +# CONFIG_COMMON_CLK_AXI_CLKGEN is not set +# CONFIG_SPI_TOPCLIFF_PCH is not set +# CONFIG_SPI_PXA2XX is not set +# CONFIG_SPI_FSL_DSPI is not set +# CONFIG_FB_XILINX is not set +# CONFIG_USB_S3C_HSOTG is not set + +# these modules all fail with missing __bad_udelay +# http://www.spinics.net/lists/arm/msg15615.html provides some background +# CONFIG_SUNGEM is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_RADEON is not set +# CONFIG_DRM_RADEON is not set +# CONFIG_ATM_HE is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SFC is not set + +# these all currently fail due to missing symbols __bad_udelay or +# error: implicit declaration of function ‘iowrite32be’ +# CONFIG_SND_ALI5451 is not set +# CONFIG_DRM_NOUVEAU is not set +# CONFIG_MLX4_EN is not set + +# Debug options. We need to deal with them at some point like x86 +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_LL is not set +# CONFIG_DEBUG_PINCTRL is not set +# CONFIG_DMADEVICES_VDEBUG is not set +# CONFIG_DMADEVICES_DEBUG is not set diff --git a/config-armv7-lpae b/config-armv7-lpae new file mode 100644 index 000000000..25fe122d5 --- /dev/null +++ b/config-armv7-lpae @@ -0,0 +1,135 @@ +# ARM A15 lpae unified arch kernel +CONFIG_ARCH_KEYSTONE=y +CONFIG_ARCH_VIRT=y + +# CONFIG_ARCH_MVEBU is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_OMAP3 is not set +# CONFIG_ARCH_OMAP4 is not set +# CONFIG_SOC_OMAP5 is not set +# CONFIG_SOC_AM33XX is not set +# CONFIG_SND_AM33XX_SOC_EVM is not set +# CONFIG_SOC_AM43XX is not set +# CONFIG_SOC_DRA7XX is not set +# CONFIG_ARCH_ROCKCHIP is not set +# CONFIG_ARCH_SOCFPGA is not set +# CONFIG_ARCH_TEGRA is not set +# CONFIG_ARCH_ZYNQ is not set + +CONFIG_ARM_LPAE=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_VIRTUALIZATION=y +CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8 + +# Cortex-A15 +CONFIG_ARM_ERRATA_798181=y +CONFIG_ARM_ERRATA_773022=y + +CONFIG_KVM=y +CONFIG_KVM_ARM_HOST=y +CONFIG_KVM_ARM_MAX_VCPUS=8 +CONFIG_KVM_ARM_VGIC=y +CONFIG_KVM_ARM_TIMER=y + +# CONFIG_XEN is not set +CONFIG_XEN_FBDEV_FRONTEND=y +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m +CONFIG_XEN_BLKDEV_FRONTEND=m +CONFIG_XEN_BLKDEV_BACKEND=m +CONFIG_XEN_NETDEV_FRONTEND=m +CONFIG_XEN_NETDEV_BACKEND=m +CONFIG_HVC_XEN=y +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_XEN_DEV_EVTCHN=m +CONFIG_XEN_BACKEND=y +CONFIG_XENFS=m +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_SYS_HYPERVISOR=y +CONFIG_XEN_GNTDEV=y +CONFIG_XEN_GRANT_DEV_ALLOC=m +CONFIG_XEN_WDT=m +# CONFIG_XEN_BALLOON is not set + +CONFIG_SERIAL_SAMSUNG=y +CONFIG_SERIAL_SAMSUNG_CONSOLE=y +# CONFIG_SAMSUNG_PM_DEBUG is not set +# CONFIG_SAMSUNG_PM_CHECK is not set +CONFIG_SOC_EXYNOS5250=y +CONFIG_SOC_EXYNOS5420=y +CONFIG_SOC_EXYNOS5440=y +# CONFIG_ARM_EXYNOS5250_CPUFREQ is not set +# CONFIG_ARM_EXYNOS5440_CPUFREQ is not set +# CONFIG_ARM_EXYNOS_CPUFREQ is not set +CONFIG_EXYNOS_THERMAL=m +CONFIG_PCI_EXYNOS=y + +CONFIG_TCG_TIS_I2C_INFINEON=m + +# CONFIG_EXYNOS_ATAGS is not set +CONFIG_PINCTRL_EXYNOS=y +CONFIG_PINCTRL_EXYNOS5440=y +CONFIG_EXYNOS_IOMMU=y +CONFIG_VIDEO_SAMSUNG_S5P_G2D=m +CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m +CONFIG_VIDEO_SAMSUNG_S5P_MFC=m +CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m +CONFIG_EXYNOS_VIDEO=y +CONFIG_EXYNOS_MIPI_DSI=y +CONFIG_EXYNOS_DP=y +# CONFIG_EXYNOS_LCD_S6E8AX0 is not set +CONFIG_DRM_EXYNOS=m +CONFIG_DRM_EXYNOS_IOMMU=y +CONFIG_DRM_EXYNOS_DMABUF=y +CONFIG_DRM_EXYNOS_FIMD=y +CONFIG_DRM_EXYNOS_HDMI=y +CONFIG_DRM_EXYNOS_VIDI=y +CONFIG_DRM_EXYNOS_G2D=y +CONFIG_DRM_EXYNOS_IPP=y +CONFIG_DRM_EXYNOS_FIMC=y +CONFIG_DRM_EXYNOS_ROTATOR=y +CONFIG_DRM_EXYNOS_GSC=y +# CONFIG_FB_S3C is not set +CONFIG_SND_SOC_SAMSUNG=m +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_S5P=m +CONFIG_USB_OHCI_EXYNOS=y +CONFIG_PWM_SAMSUNG=m +CONFIG_SAMSUNG_GPIO_EXTRA=8 +CONFIG_SERIAL_SAMSUNG_CONSOLE=y +CONFIG_SND_SOC_SAMSUNG_SMDK_SPDIF=m +CONFIG_USB_EHCI_S5P=y +CONFIG_SAMSUNG_USBPHY=m +CONFIG_SAMSUNG_USB2PHY=m +CONFIG_SAMSUNG_USB3PHY=m +CONFIG_MMC_DW_EXYNOS=m +CONFIG_RTC_DRV_S3C=m + +# TI Keystone +CONFIG_KEYSTONE_USB_PHY=m +CONFIG_USB_DWC3_KEYSTONE=m +CONFIG_GPIO_DAVINCI=y +CONFIG_I2C_DAVINCI=m +# CONFIG_DAVINCI_WATCHDOG is not set +# CONFIG_SPI_DAVINCI is not set +# CONFIG_SND_DAVINCI_SOC is not set +# CONFIG_TI_SOC_THERMAL is not set + +# 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_S3C_LOWLEVEL_UART_PORT=1 +# CONFIG_EXYNOS4_SDHCI_CH0_8BIT is not set +# CONFIG_EXYNOS4_SDHCI_CH2_8BIT is not set + +# CONFIG_S3C_BOOT_ERROR_RESET is not set +# CONFIG_S3C_BOOT_UART_FORCE_FIFO is not set +# CONFIG_I2C_S3C2410 is not set +# CONFIG_S3C2410_WATCHDOG is not set +# CONFIG_MMC_SDHCI_S3C is not set +# CONFIG_TEGRA_HOST1X is not set diff --git a/config-debug b/config-debug index 43655a1a1..e22532600 100644 --- a/config-debug +++ b/config-debug @@ -5,6 +5,7 @@ CONFIG_SND_PCM_XRUN_DEBUG=y CONFIG_DEBUG_ATOMIC_SLEEP=y CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y CONFIG_DEBUG_RT_MUTEXES=y CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_PROVE_LOCKING=y @@ -25,8 +26,6 @@ CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y CONFIG_FAIL_IO_TIMEOUT=y CONFIG_FAIL_MMC_REQUEST=y -CONFIG_SLUB_DEBUG_ON=y - CONFIG_LOCK_STAT=y CONFIG_DEBUG_STACK_USAGE=y @@ -64,6 +63,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 +83,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 @@ -99,7 +102,9 @@ CONFIG_KDB_KEYBOARD=y CONFIG_KDB_CONTINUE_CATASTROPHIC=0 CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y +CONFIG_PERCPU_TEST=m CONFIG_TEST_LIST_SORT=y +CONFIG_TEST_STRING_HELPERS=m CONFIG_DETECT_HUNG_TASK=y CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 @@ -115,3 +120,7 @@ CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y CONFIG_MAC80211_MESSAGE_TRACING=y CONFIG_EDAC_DEBUG=y + +CONFIG_X86_DEBUG_STATIC_CPU_HAS=y +CONFIG_LATENCYTOP=y +CONFIG_SCHEDSTATS=y diff --git a/config-generic b/config-generic index 52145225f..3ed2e5dbf 100644 --- a/config-generic +++ b/config-generic @@ -35,6 +35,7 @@ CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y +# CONFIG_COMPILE_TEST is not set CONFIG_FHANDLE=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y @@ -60,6 +61,8 @@ CONFIG_PID_NS=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y CONFIG_NET_NS=y +CONFIG_USER_NS=y +# CONFIG_UIDGID_STRICT_TYPE_CHECKS is not set CONFIG_POSIX_MQUEUE=y # CONFIG_PREEMPT_NONE is not set @@ -67,7 +70,9 @@ CONFIG_PREEMPT_VOLUNTARY=y # CONFIG_PREEMPT is not set CONFIG_SLUB=y +CONFIG_SLUB_CPU_PARTIAL=y # CONFIG_SLUB_STATS is not set +# CONFIG_SLUB_DEBUG_ON is not set # CONFIG_AD525X_DPOT is not set # CONFIG_ATMEL_PWM is not set @@ -101,6 +106,8 @@ CONFIG_PCIEAER_INJECT=m CONFIG_HOTPLUG_PCI_PCIE=y CONFIG_HOTPLUG_PCI_FAKE=m +# CONFIG_SGI_IOC4 is not set + # CONFIG_ISA is not set # CONFIG_SCx200 is not set @@ -121,7 +128,8 @@ CONFIG_MMC=m CONFIG_SDIO_UART=m # CONFIG_MMC_TEST is not set # CONFIG_MMC_DEBUG is not set -# CONFIG_MMC_UNSAFE_RESUME is not set +# https://lists.fedoraproject.org/pipermail/kernel/2014-February/004889.html +CONFIG_MMC_UNSAFE_RESUME=y # CONFIG_MMC_CLKGATE is not set CONFIG_MMC_BLOCK=m CONFIG_MMC_BLOCK_MINORS=8 @@ -139,6 +147,10 @@ CONFIG_MMC_RICOH_MMC=y CONFIG_MMC_USHC=m CONFIG_MMC_REALTEK_PCI=m CONFIG_MMC_VUB300=m +# CONFIG_MMC_SDHCI_PXAV2 is not set +# CONFIG_MMC_SDHCI_PXAV3 is not set +# CONFIG_MMC_SDHCI_OF_ARASAN is not set + CONFIG_CB710_CORE=m # CONFIG_CB710_DEBUG is not set @@ -154,8 +166,10 @@ CONFIG_INFINIBAND_SRP=m CONFIG_INFINIBAND_SRPT=m CONFIG_INFINIBAND_USER_MAD=m CONFIG_INFINIBAND_USER_ACCESS=m +# CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING is not set #staging 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 @@ -164,10 +178,13 @@ CONFIG_SCSI_CXGB3_ISCSI=m CONFIG_SCSI_CXGB4_ISCSI=m # CONFIG_INFINIBAND_CXGB3_DEBUG is not set CONFIG_MLX4_INFINIBAND=m +CONFIG_MLX5_INFINIBAND=m CONFIG_INFINIBAND_NES=m # CONFIG_INFINIBAND_NES_DEBUG is not set CONFIG_INFINIBAND_QIB=m +CONFIG_INFINIBAND_QIB_DCA=y # CONFIG_INFINIBAND_OCRDMA is not set +# CONFIG_INFINIBAND_USNIC is not set # # Executable file formats @@ -175,12 +192,15 @@ 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 # # Device Drivers # +# CONFIG_COMMON_CLK_SI5351 is not set + # # Generic Driver Options # @@ -192,6 +212,7 @@ CONFIG_EXTRA_FIRMWARE="" # CONFIG_FW_LOADER_USER_HELPER is not set # CONFIG_CMA is not set +# CONFIG_DMA_CMA is not set # CONFIG_SPI is not set @@ -291,20 +312,26 @@ CONFIG_HOTPLUG_PCI_ACPI_IBM=m # Block devices # CONFIG_BLK_DEV=y +CONFIG_BLK_DEV_NULL_BLK=m CONFIG_BLK_DEV_FD=m # CONFIG_PARIDE is not set +CONFIG_ZRAM=m +# CONFIG_ZRAM_DEBUG is not set CONFIG_BLK_CPQ_DA=m CONFIG_BLK_CPQ_CISS_DA=m CONFIG_CISS_SCSI_TAPE=y CONFIG_BLK_DEV_DAC960=m +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set 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_SKD=m # 64-bit only but easier to put here CONFIG_BLK_DEV_OSD=m CONFIG_BLK_DEV_RAM=m CONFIG_BLK_DEV_RAM_COUNT=16 @@ -316,6 +343,7 @@ CONFIG_BLK_DEV_BSG=y CONFIG_BLK_DEV_BSGLIB=y CONFIG_BLK_DEV_INTEGRITY=y CONFIG_BLK_DEV_THROTTLING=y +# CONFIG_BLK_CMDLINE_PARSER is not set # @@ -328,15 +356,16 @@ CONFIG_BLK_DEV_THROTTLING=y CONFIG_SCSI_VIRTIO=m CONFIG_VIRTIO_BLK=m -CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI=m CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_MMIO=m # CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set CONFIG_VIRTIO_NET=m CONFIG_HW_RANDOM_VIRTIO=m -CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_CONSOLE=m CONFIG_VHOST_NET=m CONFIG_TCM_VHOST=m +CONFIG_VHOST_SCSI=m # # SCSI device support @@ -422,6 +451,7 @@ CONFIG_MEGARAID_MM=m CONFIG_MEGARAID_MAILBOX=m CONFIG_MEGARAID_LEGACY=m CONFIG_MEGARAID_SAS=m +CONFIG_SCSI_ESAS2R=m CONFIG_SCSI_MVSAS=m # CONFIG_SCSI_MVSAS_DEBUG is not set CONFIG_SCSI_MVSAS_TASKLET=y @@ -434,6 +464,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 @@ -457,7 +488,7 @@ CONFIG_SCSI_ARCMSR=m CONFIG_SCSI_BUSLOGIC=m CONFIG_SCSI_INITIO=m CONFIG_SCSI_FLASHPOINT=y -# CONFIG_SCSI_DMX3191D is not set +CONFIG_SCSI_DMX3191D=m # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set @@ -510,6 +541,7 @@ CONFIG_SATA_NV=m CONFIG_SATA_PMP=y CONFIG_SATA_PROMISE=m CONFIG_SATA_QSTOR=m +CONFIG_SATA_RCAR=m CONFIG_SATA_SIL=m CONFIG_SATA_SIL24=m CONFIG_SATA_SIS=m @@ -585,17 +617,25 @@ 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 CONFIG_DM_CRYPT=m CONFIG_DM_DEBUG=y -# CONFIG_DM_DELAY is not set +CONFIG_DM_DELAY=m CONFIG_DM_MIRROR=y CONFIG_DM_MULTIPATH=m CONFIG_DM_SNAPSHOT=y CONFIG_DM_THIN_PROVISIONING=m -# CONFIG_DM_CACHE is not set +CONFIG_DM_CACHE=m +CONFIG_DM_CACHE_MQ=m +CONFIG_DM_CACHE_CLEANER=m # CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set # CONFIG_DM_DEBUG_SPACE_MAPS is not set CONFIG_DM_UEVENT=y @@ -606,6 +646,7 @@ CONFIG_DM_MULTIPATH_ST=m CONFIG_DM_RAID=m CONFIG_DM_FLAKEY=m CONFIG_DM_VERITY=m +CONFIG_DM_SWITCH=m # # Fusion MPT device support @@ -628,7 +669,7 @@ CONFIG_FIREWIRE_SBP2=m CONFIG_FIREWIRE_NET=m CONFIG_FIREWIRE_OHCI_DEBUG=y CONFIG_FIREWIRE_NOSY=m -CONFIG_FIREWIRE_SERIAL=m +# CONFIG_FIREWIRE_SERIAL is not set # CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set # @@ -652,6 +693,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 @@ -672,7 +716,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 @@ -749,6 +793,7 @@ CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_IPV6_MIP6=y +CONFIG_IPV6_VTI=m CONFIG_IPV6_SIT=m CONFIG_IPV6_SIT_6RD=y CONFIG_IPV6_TUNNEL=m @@ -816,6 +861,7 @@ CONFIG_NETFILTER_XT_TARGET_TPROXY=m CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m CONFIG_NETFILTER_XT_MATCH_BPF=m +CONFIG_NETFILTER_XT_MATCH_CGROUP=m CONFIG_NETFILTER_XT_MATCH_CLUSTER=m CONFIG_NETFILTER_XT_MATCH_COMMENT=m CONFIG_NETFILTER_XT_MATCH_CPU=m @@ -832,8 +878,10 @@ CONFIG_NETFILTER_XT_MATCH_ESP=m CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m CONFIG_NETFILTER_XT_MATCH_HELPER=m CONFIG_NETFILTER_XT_MATCH_HL=m +CONFIG_NETFILTER_XT_MATCH_IPCOMP=m CONFIG_NETFILTER_XT_MATCH_IPRANGE=m CONFIG_NETFILTER_XT_MATCH_IPVS=m +CONFIG_NETFILTER_XT_MATCH_L2TP=m CONFIG_NETFILTER_XT_MATCH_LENGTH=m CONFIG_NETFILTER_XT_MATCH_LIMIT=m CONFIG_NETFILTER_XT_MATCH_MAC=m @@ -905,6 +953,7 @@ CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_REJECT=y +CONFIG_IP_NF_TARGET_SYNPROXY=m CONFIG_IP_NF_TARGET_TTL=m CONFIG_NF_NAT_IPV4=m CONFIG_IP_NF_TARGET_MASQUERADE=m @@ -938,11 +987,39 @@ CONFIG_IP6_NF_RAW=m CONFIG_IP6_NF_SECURITY=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_TARGET_REJECT=m +CONFIG_IP6_NF_TARGET_SYNPROXY=m CONFIG_IP6_NF_TARGET_HL=m CONFIG_NF_NAT_IPV6=m CONFIG_IP6_NF_TARGET_MASQUERADE=m # CONFIG_IP6_NF_TARGET_NPT is not set +# nf_tables support +CONFIG_NF_TABLES=m +CONFIG_NF_TABLES_INET=m +CONFIG_NFT_EXTHDR=m +CONFIG_NFT_META=m +CONFIG_NFT_CT=m +CONFIG_NFT_RBTREE=m +CONFIG_NFT_HASH=m +CONFIG_NFT_COUNTER=m +CONFIG_NFT_LOG=m +CONFIG_NFT_LIMIT=m +CONFIG_NFT_NAT=m +CONFIG_NFT_QUEUE=m +CONFIG_NFT_REJECT=m +CONFIG_NFT_COMPAT=m + +CONFIG_NF_TABLES_IPV4=m +CONFIG_NFT_REJECT_IPV4=m +CONFIG_NFT_CHAIN_ROUTE_IPV4=m +CONFIG_NFT_CHAIN_NAT_IPV4=m +CONFIG_NF_TABLES_ARP=m + +CONFIG_NF_TABLES_IPV6=m +CONFIG_NFT_CHAIN_ROUTE_IPV6=m +CONFIG_NFT_CHAIN_NAT_IPV6=m + +CONFIG_NF_TABLES_BRIDGE=m # # Bridge: Netfilter Configuration # @@ -990,7 +1067,9 @@ CONFIG_IP_SET_HASH_IP=m CONFIG_IP_SET_HASH_IPPORT=m CONFIG_IP_SET_HASH_IPPORTIP=m CONFIG_IP_SET_HASH_IPPORTNET=m +CONFIG_IP_SET_HASH_NETPORTNET=m CONFIG_IP_SET_HASH_NET=m +CONFIG_IP_SET_HASH_NETNET=m CONFIG_IP_SET_HASH_NETPORT=m CONFIG_IP_SET_HASH_NETIFACE=m CONFIG_IP_SET_LIST_SET=m @@ -1035,7 +1114,9 @@ CONFIG_IP_DCCP_CCID3=y # # TIPC Configuration (EXPERIMENTAL) # -# CONFIG_TIPC is not set +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 @@ -1065,11 +1146,15 @@ CONFIG_NET_SCH_CHOKE=m CONFIG_NET_SCH_QFQ=m CONFIG_NET_SCH_CODEL=m CONFIG_NET_SCH_FQ_CODEL=m +CONFIG_NET_SCH_FQ=m +CONFIG_NET_SCH_HHF=m +CONFIG_NET_SCH_PIE=m CONFIG_NET_SCH_PLUG=m CONFIG_NET_CLS=y CONFIG_NET_CLS_ACT=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_CGROUP=y +CONFIG_NET_CLS_BPF=m CONFIG_NET_CLS_FLOW=m CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_IND=y @@ -1106,10 +1191,13 @@ 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_OPENVSWITCH_GRE=y +CONFIG_OPENVSWITCH_VXLAN=y CONFIG_VSOCKETS=m -CONFIG_NETPRIO_CGROUP=m # @@ -1132,6 +1220,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 @@ -1140,6 +1229,7 @@ CONFIG_VXLAN=m CONFIG_EQUALIZER=m CONFIG_TUN=m CONFIG_VETH=m +CONFIG_NLMON=m # # ATM @@ -1194,8 +1284,11 @@ CONFIG_L2TP_ETH=m # CONFIG_CAIF is not set CONFIG_RFKILL=m +CONFIG_RFKILL_GPIO=m CONFIG_RFKILL_INPUT=y +CONFIG_ETHERNET=y + # # Ethernet (10 or 100Mbit) # @@ -1212,7 +1305,11 @@ CONFIG_PCNET32=m CONFIG_AMD8111_ETH=m CONFIG_PCMCIA_NMCLAN=m +CONFIG_NET_VENDOR_ARC=y +CONFIG_ARC_EMAC=m + CONFIG_NET_VENDOR_ATHEROS=y +CONFIG_ALX=m CONFIG_ATL2=m CONFIG_ATL1=m CONFIG_ATL1C=m @@ -1287,6 +1384,10 @@ CONFIG_IXGBE_DCA=y CONFIG_IXGBE_DCB=y CONFIG_IXGBE_HWMON=y CONFIG_IXGBE_PTP=y +CONFIG_I40E=m +# CONFIG_I40E_VXLAN is not set +# CONFIG_I40E_DCB is not set +# CONFIG_I40EVF is not set # CONFIG_NET_VENDOR_I825XX is not set @@ -1331,6 +1432,8 @@ CONFIG_YELLOWFIN=m CONFIG_NET_VENDOR_QLOGIC=y CONFIG_QLA3XXX=m CONFIG_QLCNIC=m +CONFIG_QLCNIC_SRIOV=y +CONFIG_QLCNIC_DCB=y CONFIG_QLGE=m CONFIG_NETXEN_NIC=m @@ -1344,6 +1447,8 @@ CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set CONFIG_R8169=m +CONFIG_SH_ETH=m + CONFIG_NET_VENDOR_RDC=y CONFIG_R6040=m @@ -1359,6 +1464,7 @@ CONFIG_SIS190=m CONFIG_NET_VENDOR_SMSC=y CONFIG_PCMCIA_SMC91C92=m CONFIG_EPIC100=m +CONFIG_SMSC911X=m CONFIG_SMSC9420=m CONFIG_NET_VENDOR_STMICRO=y @@ -1417,6 +1523,7 @@ CONFIG_VITESSE_PHY=m CONFIG_MICREL_PHY=m CONFIG_MII=m +CONFIG_NET_CORE=y CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=m CONFIG_TYPHOON=m @@ -1445,16 +1552,9 @@ CONFIG_JME=m # # Ethernet (10000 Mbit) # -CONFIG_IP1000=m -CONFIG_MLX4_EN=m -CONFIG_MLX4_EN_DCB=y -# CONFIG_MLX4_DEBUG is not set -CONFIG_SFC=m -CONFIG_SFC_MCDI_MON=y -CONFIG_SFC_SRIOV=y -CONFIG_SFC_PTP=y - -# CONFIG_SFC_MTD is not set +# CONFIG_IP1000 is not set +# CONFIG_MLX4_EN is not set +# CONFIG_SFC is not set # CONFIG_FDDI is not set # CONFIG_DEFXX is not set @@ -1511,12 +1611,7 @@ CONFIG_MAC80211_LEDS=y CONFIG_MAC80211_DEBUGFS=y # CONFIG_MAC80211_DEBUG_MENU is not set -CONFIG_WIMAX=m -CONFIG_WIMAX_DEBUG_LEVEL=8 -CONFIG_WIMAX_I2400M_USB=m -CONFIG_WIMAX_I2400M_SDIO=m -CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8 -# CONFIG_WIMAX_IWMC3200_SDIO is not set +# CONFIG_WIMAX is not set # CONFIG_ADM8211 is not set CONFIG_ATH_COMMON=m @@ -1528,6 +1623,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 @@ -1538,9 +1634,20 @@ 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_ATH9K_STATION_STATISTICS is not set +# CONFIG_ATH9K_WOW is not set +# +CONFIG_ATH10K=m +CONFIG_ATH10K_PCI=m +# CONFIG_ATH10K_DEBUG is not set +# CONFIG_ATH10K_TRACING is not set +CONFIG_ATH10K_DEBUGFS=y +CONFIG_WCN36XX=m +# CONFIG_WCN36XX_DEBUGFS is not set CONFIG_WIL6210=m CONFIG_WIL6210_ISR_COR=y +# CONFIG_WIL6210_TRACING is not set CONFIG_CARL9170=m CONFIG_CARL9170_LEDS=y # CONFIG_CARL9170_HWRNG is not set @@ -1548,6 +1655,7 @@ CONFIG_AT76C50X_USB=m # CONFIG_AIRO is not set # CONFIG_AIRO_CS is not set # CONFIG_ATMEL is not set +CONFIG_NET_VENDOR_BROADCOM=y CONFIG_B43=m CONFIG_B43_PCMCIA=y CONFIG_B43_SDIO=y @@ -1584,6 +1692,9 @@ CONFIG_PCMCIA_HERMES=m CONFIG_ORINOCO_USB=m # CONFIG_TMD_HERMES is not set # CONFIG_PCMCIA_SPECTRUM is not set +CONFIG_CW1200=m +CONFIG_CW1200_WLAN_SDIO=m +CONFIG_CW1200_WLAN_SPI=m # CONFIG_HOSTAP is not set # CONFIG_IPW2100 is not set # CONFIG_IPW2200 is not set @@ -1631,7 +1742,9 @@ CONFIG_RT2500USB=m CONFIG_RT2800USB=m CONFIG_RT2800USB_RT33XX=y CONFIG_RT2800USB_RT35XX=y +CONFIG_RT2800USB_RT3573=y CONFIG_RT2800USB_RT53XX=y +CONFIG_RT2800USB_RT55XX=y CONFIG_RT2800USB_UNKNOWN=y CONFIG_RT2800PCI=m CONFIG_RT2800PCI_RT3290=y @@ -1642,6 +1755,7 @@ CONFIG_RT73USB=m CONFIG_RTL8180=m CONFIG_RTL8187=m # CONFIG_USB_ZD1201 is not set +# CONFIG_USB_NET_SR9800 is not set CONFIG_USB_NET_RNDIS_WLAN=m CONFIG_USB_NET_KALMIA=m CONFIG_USB_NET_QMI_WWAN=m @@ -1650,24 +1764,22 @@ CONFIG_USB_NET_SMSC75XX=m CONFIG_ZD1211RW=m # CONFIG_ZD1211RW_DEBUG is not set -CONFIG_WL12XX_MENU=m CONFIG_WL12XX=m -# CONFIG_WL12XX_HT is not set CONFIG_WL12XX_SPI=m CONFIG_WL12XX_SDIO=m -# CONFIG_WL12XX_SDIO_TEST is not set CONFIG_WL1251=m CONFIG_WL1251_SPI=m CONFIG_WL1251_SDIO=m +CONFIG_RTL_CARDS=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 @@ -1715,14 +1827,19 @@ CONFIG_BAYCOM_EPP=m CONFIG_YAM=m CONFIG_NFC=m +CONFIG_NFC_DIGITAL=m CONFIG_NFC_NCI=m CONFIG_NFC_HCI=m CONFIG_NFC_SHDLC=y CONFIG_NFC_LLCP=y +CONFIG_NFC_SIM=m +CONFIG_NFC_MRVL=m +CONFIG_NFC_MRVL_USB=m # # Near Field Communication (NFC) devices # +CONFIG_NFC_PORT100=m CONFIG_NFC_PN544=m CONFIG_NFC_PN544_I2C=m CONFIG_NFC_PN533=m @@ -1963,8 +2080,10 @@ 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 +CONFIG_INPUT_IDEAPAD_SLIDEBAR=m # # Input I/O drivers @@ -1981,10 +2100,13 @@ 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_OLPC_APSP is not set # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set # # Input Device Drivers @@ -1992,6 +2114,7 @@ CONFIG_SERIO_ARC_PS2=m CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_SH_KEYSC is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_MATRIX is not set # CONFIG_KEYBOARD_NEWTON is not set @@ -2060,6 +2183,7 @@ CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_AD7879_I2C=m # CONFIG_TOUCHSCREEN_CY8CTMG110 is not set # CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set +# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set CONFIG_TOUCHSCREEN_DYNAPRO=m CONFIG_TOUCHSCREEN_EDT_FT5X06=m CONFIG_TOUCHSCREEN_EETI=m @@ -2075,6 +2199,7 @@ CONFIG_TOUCHSCREEN_MTOUCH=m CONFIG_TOUCHSCREEN_MCS5000=m CONFIG_TOUCHSCREEN_MK712=m CONFIG_TOUCHSCREEN_PENMOUNT=m +# CONFIG_TOUCHSCREEN_SUR40 is not set # CONFIG_TOUCHSCREEN_TPS6507X is not set CONFIG_TOUCHSCREEN_TSC_SERIO=m CONFIG_TOUCHSCREEN_TSC2007=m @@ -2095,6 +2220,7 @@ CONFIG_TOUCHSCREEN_ATMEL_MXT=m # CONFIG_TOUCHSCREEN_MAX11801 is not set CONFIG_TOUCHSCREEN_AUO_PIXCIR=m CONFIG_TOUCHSCREEN_TI_AM335X_TSC=m +CONFIG_TOUCHSCREEN_ZFORCE=m CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=m @@ -2134,22 +2260,27 @@ 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 CONFIG_TCG_TPM=m CONFIG_TCG_TIS=m # CONFIG_TCG_TIS_I2C_INFINEON is not set +# CONFIG_TCG_TIS_I2C_ATMEL is not set +# CONFIG_TCG_TIS_I2C_NUVOTON is not set CONFIG_TCG_NSC=m CONFIG_TCG_ATMEL=m # CONFIG_TCG_INFINEON is not set # CONFIG_TCG_ST33_I2C is not set +# CONFIG_TCG_XEN is not set CONFIG_TELCLOCK=m # # Serial drivers # CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CS=m CONFIG_SERIAL_8250_NR_UARTS=32 @@ -2181,6 +2312,13 @@ CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_XILINX_PS_UART is not set # CONFIG_SERIAL_TIMBERDALE is not set +CONFIG_SERIAL_ARC=m +CONFIG_SERIAL_ARC_NR_PORTS=1 +# CONFIG_SERIAL_RP2 is not set +# CONFIG_SERIAL_FSL_LPUART is not set +# CONFIG_SERIAL_ST_ASC is not set +# CONFIG_SERIAL_PCH_UART is not set + CONFIG_UNIX98_PTYS=y CONFIG_DEVPTS_MULTIPLE_INSTANCES=y # CONFIG_LEGACY_PTYS is not set @@ -2195,7 +2333,12 @@ CONFIG_I2C=m CONFIG_I2C_COMPAT=y CONFIG_I2C_CHARDEV=m # CONFIG_I2C_MUX is not set +# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set # CONFIG_I2C_MUX_PCA954x is not set +# CONFIG_I2C_MUX_GPIO is not set +# CONFIG_I2C_MUX_PCA9541 is not set +# CONFIG_I2C_MUX_PINCTRL is not set +# # # I2C Algorithms @@ -2235,6 +2378,7 @@ CONFIG_I2C_NFORCE2=m # CONFIG_I2C_OCORES is not set CONFIG_I2C_PARPORT=m CONFIG_I2C_PARPORT_LIGHT=m +# CONFIG_I2C_ROBOTFUZZ_OSIF is not set CONFIG_I2C_PASEMI=m CONFIG_I2C_PCA_PLATFORM=m # CONFIG_I2C_PIIX4 is not set @@ -2267,6 +2411,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 @@ -2284,14 +2429,17 @@ CONFIG_SENSORS_F71882FG=m CONFIG_SENSORS_F75375S=m CONFIG_SENSORS_FSCHMD=m CONFIG_SENSORS_G760A=m +CONFIG_SENSORS_G762=m CONFIG_SENSORS_GL518SM=m CONFIG_SENSORS_GL520SM=m CONFIG_SENSORS_HDAPS=m # CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_HTU21 is not set # CONFIG_SENSORS_I5K_AMB is not set # FIXME: IBMAEM x86 only? CONFIG_SENSORS_IBMAEM=m CONFIG_SENSORS_IBMPEX=m +# CONFIG_SENSORS_IIO_HWMON is not set CONFIG_SENSORS_IT87=m CONFIG_SENSORS_K8TEMP=m CONFIG_SENSORS_K10TEMP=m @@ -2308,11 +2456,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 @@ -2391,15 +2541,135 @@ CONFIG_SENSORS_MAX8688=m CONFIG_SENSORS_MAX1668=m CONFIG_SENSORS_MAX197=m +# Industrial I/O subsystem configuration +CONFIG_IIO=m +CONFIG_IIO_BUFFER=y +CONFIG_IIO_BUFFER_CB=y +# CONFIG_IIO_KFIFO_BUF is not set +CONFIG_IIO_TRIGGERED_BUFFER=m +CONFIG_IIO_TRIGGER=y +CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 +CONFIG_IIO_INTERRUPT_TRIGGER=m +CONFIG_HID_SENSOR_IIO_COMMON=m +CONFIG_HID_SENSOR_IIO_TRIGGER=m +CONFIG_HID_SENSOR_ENUM_BASE_QUIRKS=y +# CONFIG_IIO_SYSFS_TRIGGER is not set +# CONFIG_AD5446 is not set +# CONFIG_AD5380 is not set +# CONFIG_AD5064 is not set +# CONFIG_BMA180 is not set +# CONFIG_MAX1363 is not set +# CONFIG_MAX517 is not set +# CONFIG_MCP4725 is not set +# CONFIG_ITG3200 is not set +# CONFIG_APDS9300 is not set +# CONFIG_CM32181 is not set +# CONFIG_CM36651 is not set +# CONFIG_GP2AP020A00F is not set +# CONFIG_TSL2583 is not set +# CONFIG_TSL2x7x is not set +# CONFIG_TCS3472 is not set +# CONFIG_TSL4531 is not set +# CONFIG_NAU7802 is not set +# CONFIG_TI_ADC081C is not set +# CONFIG_EXYNOS_ADC is not set +# CONFIG_VIPERBOARD_ADC is not set +# CONFIG_INV_MPU6050_IIO is not set +CONFIG_IIO_ST_GYRO_3AXIS=m +CONFIG_IIO_ST_MAGN_3AXIS=m +CONFIG_IIO_ST_ACCEL_3AXIS=m +CONFIG_HID_SENSOR_INCLINOMETER_3D=m +# CONFIG_ADJD_S311 is not set +# CONFIG_SENSORS_TSL2563 is not set +# CONFIG_VCNL4000 is not set +# CONFIG_AK8975 is not set +# CONFIG_MAG3110 is not set +# CONFIG_TMP006 is not set +# CONFIG_IIO_ST_PRESS is not set +# CONFIG_KXSD9 is not set +# CONFIG_AD7266 is not set +# CONFIG_AD7298 is not set +# CONFIG_AD7476 is not set +# CONFIG_AD7791 is not set +# CONFIG_AD7793 is not set +# CONFIG_AD7887 is not set +# CONFIG_AD7923 is not set +# CONFIG_MCP320X is not set +# CONFIG_MCP3422 is not set +# CONFIG_AD8366 is not set +# CONFIG_AD5360 is not set +# CONFIG_AD5421 is not set +# CONFIG_AD5449 is not set +# CONFIG_AD5504 is not set +# CONFIG_AD5624R_SPI is not set +# CONFIG_AD5686 is not set +# CONFIG_AD5755 is not set +# CONFIG_AD5764 is not set +# CONFIG_AD5791 is not set +# CONFIG_AD7303 is not set +# CONFIG_AD9523 is not set +# CONFIG_ADF4350 is not set +# CONFIG_ADIS16080 is not set +# CONFIG_ADIS16130 is not set +# CONFIG_ADIS16136 is not set +# CONFIG_ADIS16260 is not set +# CONFIG_ADXRS450 is not set +# CONFIG_ADIS16400 is not set +# CONFIG_ADIS16480 is not set +# CONFIG_DHT11 is not set +# CONFIG_MPL3115 is not set + +# staging IIO drivers +# CONFIG_AD7291 is not set +# CONFIG_AD7606 is not set +# CONFIG_AD799X is not set +# CONFIG_ADT7316 is not set +# CONFIG_AD7150 is not set +# CONFIG_AD7152 is not set +# CONFIG_AD7746 is not set +# CONFIG_AD5933 is not set +# CONFIG_ADE7854 is not set +# CONFIG_SENSORS_ISL29018 is not set +# CONFIG_SENSORS_ISL29028 is not set +# CONFIG_SENSORS_HMC5843 is not set +# CONFIG_IIO_PERIODIC_RTC_TRIGGER is not set +# CONFIG_IIO_SIMPLE_DUMMY is not set +# CONFIG_ADIS16201 is not set +# CONFIG_ADIS16203 is not set +# CONFIG_ADIS16204 is not set +# CONFIG_ADIS16209 is not set +# CONFIG_ADIS16220 is not set +# CONFIG_ADIS16240 is not set +# CONFIG_LIS3L02DQ is not set +# CONFIG_SCA3000 is not set +# CONFIG_AD7780 is not set +# CONFIG_AD7816 is not set +# CONFIG_AD7192 is not set +# CONFIG_AD7280 is not set +# CONFIG_AD5930 is not set +# CONFIG_AD9832 is not set +# CONFIG_AD9834 is not set +# CONFIG_AD9850 is not set +# CONFIG_AD9852 is not set +# CONFIG_AD9910 is not set +# CONFIG_AD9951 is not set +# CONFIG_ADIS16060 is not set +# CONFIG_ADE7753 is not set +# CONFIG_ADE7754 is not set +# CONFIG_ADE7758 is not set +# CONFIG_ADE7759 is not set +# CONFIG_AD2S90 is not set +# CONFIG_AD2S1200 is not set +# CONFIG_AD2S1210 is not set + + + # CONFIG_HMC6352 is not set # CONFIG_BMP085 is not set # CONFIG_BMP085_I2C is not set # CONFIG_PCH_PHUB is not set -# CONFIG_SERIAL_PCH_UART is not set # CONFIG_USB_SWITCH_FSA9480 is not set -CONFIG_SERIAL_ARC=m -CONFIG_SERIAL_ARC_NR_PORTS=1 -# CONFIG_SERIAL_RP2 is not set +# CONFIG_SRAM is not set CONFIG_W1=m CONFIG_W1_CON=y @@ -2411,6 +2681,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 @@ -2477,10 +2748,14 @@ CONFIG_WM831X_WATCHDOG=m # CONFIG_MAX63XX_WATCHDOG is not set # CONFIG_DW_WATCHDOG is not set CONFIG_W83697UG_WDT=m +# CONFIG_MEN_A21_WDT is not set +# CONFIG_GPIO_WATCHDOG is not set CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_TIMERIOMEM=m CONFIG_HW_RANDOM_TPM=m +# CONFIG_HW_RANDOM_ATMEL is not set +# CONFIG_HW_RANDOM_EXYNOS is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set # CONFIG_RTC_DEBUG is not set @@ -2508,6 +2783,7 @@ CONFIG_RTC_DRV_M41T80_WDT=y CONFIG_RTC_DRV_M48T59=m CONFIG_RTC_DRV_MAX6900=m # CONFIG_RTC_DRV_M48T86 is not set +CONFIG_RTC_DRV_PCF2127=m CONFIG_RTC_DRV_PCF8563=m CONFIG_RTC_DRV_PCF8583=m CONFIG_RTC_DRV_RS5C372=m @@ -2536,6 +2812,8 @@ CONFIG_RTC_DRV_PCF50633=m CONFIG_RTC_DRV_DS3232=m CONFIG_RTC_DRV_ISL12022=m # CONFIG_RTC_DRV_HID_SENSOR_TIME is not set +# CONFIG_RTC_DRV_MOXART is not set +# CONFIG_RTC_DRV_ISL12057 is not set CONFIG_R3964=m # CONFIG_APPLICOM is not set @@ -2577,6 +2855,9 @@ CONFIG_DRM_MGAG200=m # do not enable on f17 or older # CONFIG_DRM_SAVAGE is not set CONFIG_DRM_I915=m CONFIG_DRM_I915_KMS=y +CONFIG_DRM_I915_FBDEV=y +# CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set +# CONFIG_DRM_I915_UMS is not set CONFIG_DRM_VIA=m CONFIG_DRM_NOUVEAU=m CONFIG_NOUVEAU_DEBUG=5 @@ -2590,8 +2871,8 @@ CONFIG_DRM_I2C_NXP_TDA998X=m CONFIG_DRM_UDL=m CONFIG_DRM_VMWGFX=m CONFIG_DRM_VMWGFX_FBCON=y -CONFIG_DRM_VGEM=m CONFIG_DRM_QXL=m +CONFIG_DRM_BOCHS=m # # PCMCIA character devices @@ -2625,6 +2906,10 @@ CONFIG_VIDEO_V4L2=y # CONFIG_VIDEO_V4L2_INT_DEVICE is not set CONFIG_VIDEO_V4L2_SUBDEV_API=y # CONFIG_VIDEO_VIVI is not set +# CONFIG_USB_SI4713 is not set +# CONFIG_PLATFORM_SI4713 is not set +# CONFIG_I2C_SI4713 is not set +# CONFIG_USB_RAREMONO is not set # # Video For Linux @@ -2655,8 +2940,10 @@ CONFIG_VIDEO_CX88=m CONFIG_VIDEO_CX88_DVB=m CONFIG_VIDEO_CX88_ALSA=m CONFIG_VIDEO_CX88_BLACKBIRD=m +CONFIG_VIDEO_CX88_ENABLE_VP3054=y CONFIG_VIDEO_CX88_VP3054=m CONFIG_VIDEO_EM28XX=m +CONFIG_VIDEO_EM28XX_V4L2=m CONFIG_VIDEO_EM28XX_ALSA=m CONFIG_VIDEO_EM28XX_DVB=m CONFIG_VIDEO_EM28XX_RC=y @@ -2679,6 +2966,7 @@ CONFIG_VIDEO_SAA7134_ALSA=m CONFIG_VIDEO_SAA7134_DVB=m CONFIG_VIDEO_SAA7134_RC=y CONFIG_VIDEO_USBVISION=m +CONFIG_VIDEO_STK1160_COMMON=m CONFIG_VIDEO_STK1160=m CONFIG_VIDEO_STK1160_AC97=y CONFIG_VIDEO_W9966=m @@ -2701,6 +2989,7 @@ CONFIG_VIDEO_TLG2300=m # CONFIG_VIDEO_TIMBERDALE is not set # CONFIG_VIDEO_M5MOLS is not set # CONFIG_EXYNOS_VIDEO is not set +CONFIG_VIDEO_USBTV=m CONFIG_USB_VIDEO_CLASS=m CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y @@ -2745,6 +3034,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 @@ -2857,6 +3147,7 @@ CONFIG_IR_GPIO_CIR=m CONFIG_V4L_MEM2MEM_DRIVERS=y # CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set # CONFIG_VIDEO_SH_VEU is not set +# CONFIG_VIDEO_RENESAS_VSP1 is not set # CONFIG_V4L_TEST_DRIVERS is not set # CONFIG_VIDEO_MEM2MEM_TESTDEV is not set @@ -2921,6 +3212,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 @@ -2931,7 +3223,7 @@ CONFIG_FB_TILEBLITTING=y CONFIG_FB_VESA=y CONFIG_FB_VGA16=m CONFIG_FB_VIRTUAL=m -CONFIG_FB_VOODOO1=m +# CONFIG_FB_VOODOO1 is not set # CONFIG_FB_VT8623 is not set CONFIG_FB_EFI=y # CONFIG_FB_VIA is not set @@ -2943,6 +3235,7 @@ CONFIG_FB_EFI=y # CONFIG_FB_BROADSHEET is not set # CONFIG_FB_UDL is not set # CONFIG_FB_GOLDFISH is not set +# CONFIG_FB_OPENCORES is not set # CONFIG_FIRMWARE_EDID is not set @@ -2990,6 +3283,7 @@ CONFIG_SND_PCM_OSS=y CONFIG_SND_PCM_OSS_PLUGINS=y CONFIG_SND_RTCTIMER=y CONFIG_SND_DYNAMIC_MINORS=y +CONFIG_SND_MAX_CARDS=32 # CONFIG_SND_SUPPORT_OLD_API is not set # @@ -3065,6 +3359,7 @@ CONFIG_SND_HDA_CODEC_CONEXANT=y CONFIG_SND_HDA_CODEC_CMEDIA=y CONFIG_SND_HDA_CODEC_SI3054=y CONFIG_SND_HDA_CODEC_HDMI=y +CONFIG_SND_HDA_I915=y CONFIG_SND_HDA_CODEC_CA0132=y CONFIG_SND_HDA_CODEC_CA0132_DSP=y CONFIG_SND_HDA_GENERIC=y @@ -3112,6 +3407,7 @@ CONFIG_SND_USB_USX2Y=m CONFIG_SND_USB_US122L=m CONFIG_SND_USB_UA101=m CONFIG_SND_USB_6FIRE=m +CONFIG_SND_USB_HIFACE=m # # PCMCIA devices @@ -3122,6 +3418,7 @@ CONFIG_SND_FIREWIRE=y CONFIG_SND_FIREWIRE_SPEAKERS=m CONFIG_SND_ISIGHT=m CONFIG_SND_SCS1X=m +CONFIG_SND_DICE=m # # Open Sound System @@ -3146,6 +3443,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 @@ -3157,8 +3455,16 @@ CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_EHCI_TT_NEWSCHED=y # CONFIG_USB_EHCI_MV is not set # CONFIG_USB_EHCI_HCD_PLATFORM is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1760_HCD is not set +CONFIG_USB_ISP1362_HCD=m +CONFIG_USB_FUSBH200_HCD=m +# CONFIG_USB_FOTG210_HCD is not set +# CONFIG_USB_GR_UDC is not set CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PCI=y # CONFIG_USB_OHCI_HCD_SSB is not set +# CONFIG_USB_HCD_TEST_MODE is not set # CONFIG_USB_OHCI_HCD_PLATFORM is not set CONFIG_USB_UHCI_HCD=y CONFIG_USB_SL811_HCD=m @@ -3167,7 +3473,6 @@ CONFIG_USB_SL811_HCD_ISO=y # CONFIG_USB_R8A66597_HCD is not set CONFIG_USB_XHCI_HCD=y # CONFIG_USB_XHCI_HCD_DEBUGGING is not set -CONFIG_USB_ISP1362_HCD=m # # USB Device Class drivers @@ -3246,10 +3551,12 @@ CONFIG_HID_ORTEK=m CONFIG_HID_PANTHERLORD=m CONFIG_HID_PETALYNX=m CONFIG_HID_PICOLCD=m +CONFIG_HID_RMI=m CONFIG_HID_ROCCAT=m CONFIG_HID_ROCCAT_KONE=m CONFIG_HID_SAMSUNG=m CONFIG_HID_SONY=m +CONFIG_SONY_FF=y CONFIG_HID_SUNPLUS=m CONFIG_HID_STEELSERIES=m CONFIG_HID_GREENASIA=m @@ -3257,11 +3564,17 @@ CONFIG_HID_SMARTJOYPLUS=m CONFIG_HID_TOPSEED=m CONFIG_HID_THINGM=m CONFIG_HID_THRUSTMASTER=m +CONFIG_HID_XINMO=m CONFIG_HID_ZEROPLUS=m CONFIG_HID_ZYDACRON=m -# CONFIG_HID_SENSOR_HUB is not set +CONFIG_HID_SENSOR_HUB=m +CONFIG_HID_SENSOR_GYRO_3D=m +CONFIG_HID_SENSOR_MAGNETOMETER_3D=m +CONFIG_HID_SENSOR_ALS=m +CONFIG_HID_SENSOR_ACCEL_3D=m CONFIG_HID_EMS_FF=m CONFIG_HID_ELECOM=m +CONFIG_HID_ELO=m CONFIG_HID_UCLOGIC=m CONFIG_HID_WALTOP=m CONFIG_HID_ROCCAT_PYRA=m @@ -3276,6 +3589,7 @@ CONFIG_HID_ROCCAT_ISKU=m CONFIG_HID_ROCCAT_KOVAPLUS=m CONFIG_HID_HOLTEK=m CONFIG_HOLTEK_FF=y +CONFIG_HID_HUION=m CONFIG_HID_SPEEDLINK=m CONFIG_HID_WIIMOTE=m CONFIG_HID_WIIMOTE_EXT=y @@ -3284,6 +3598,7 @@ CONFIG_HID_SAITEK=m CONFIG_HID_TIVO=m CONFIG_HID_GENERIC=y CONFIG_HID_AUREAL=m +CONFIG_HID_APPLEIR=m # @@ -3324,6 +3639,7 @@ CONFIG_USB_GSPCA_SPCA506=m CONFIG_USB_GSPCA_SPCA508=m CONFIG_USB_GSPCA_SPCA561=m CONFIG_USB_GSPCA_STK014=m +CONFIG_USB_GSPCA_STK1135=m CONFIG_USB_GSPCA_SUNPLUS=m CONFIG_USB_GSPCA_T613=m CONFIG_USB_GSPCA_TOPRO=m @@ -3361,11 +3677,13 @@ 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 CONFIG_USB_NET_AX88179_178A=m CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_SR9700=m CONFIG_USB_NET_SMSC95XX=m CONFIG_USB_NET_GL620A=m CONFIG_USB_NET_NET1080=m @@ -3375,6 +3693,7 @@ CONFIG_USB_NET_RNDIS_HOST=m CONFIG_USB_NET_CDC_SUBSET=m CONFIG_USB_NET_CDC_EEM=m CONFIG_USB_NET_CDC_NCM=m +CONFIG_USB_NET_HUAWEI_CDC_NCM=m CONFIG_USB_NET_CDC_MBIM=m CONFIG_USB_NET_ZAURUS=m CONFIG_USB_NET_CX82310_ETH=m @@ -3410,6 +3729,7 @@ CONFIG_USB_USS720=m # CONFIG_USB_SERIAL=y CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_SIMPLE=m CONFIG_USB_SERIAL_AIRCABLE=m CONFIG_USB_SERIAL_ARK3116=m CONFIG_USB_SERIAL_BELKIN=m @@ -3453,9 +3773,11 @@ 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 +# CONFIG_USB_SERIAL_MXUPORT is not set CONFIG_USB_SERIAL_NAVMAN=m CONFIG_USB_SERIAL_OPTION=m CONFIG_USB_SERIAL_OTI6858=m @@ -3478,7 +3800,8 @@ CONFIG_USB_SERIAL_XSENS_MT=m CONFIG_USB_SERIAL_DEBUG=m CONFIG_USB_SERIAL_SSU100=m CONFIG_USB_SERIAL_QT2=m - +CONFIG_USB_SERIAL_FLASHLOADER=m +CONFIG_USB_SERIAL_SUUNTO=m CONFIG_USB_SERIAL_CONSOLE=y CONFIG_USB_EZUSB=y @@ -3495,9 +3818,22 @@ 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_USB_OTG_FSM is not set + +# CONFIG_GENERIC_PHY is not set +# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set +# CONFIG_PHY_EXYNOS_DP_VIDEO is not set # CONFIG_OMAP_USB2 is not set # CONFIG_OMAP_USB3 is not set # CONFIG_OMAP_CONTROL_USB is not set +# CONFIG_AM335X_PHY_USB is not set +# CONFIG_SAMSUNG_USBPHY is not set +# CONFIG_SAMSUNG_USB2PHY is not set +# CONFIG_SAMSUNG_USB3PHY is not set +# CONFIG_BCM_KONA_USB2_PHY is not set CONFIG_USB_RCAR_PHY=m CONFIG_USB_ATM=m CONFIG_USB_CXACRU=m @@ -3511,8 +3847,6 @@ CONFIG_USB_FILE_STORAGE=m # CONFIG_USB_GADGET is not set # CONFIG_USB_DWC3 is not set # CONFIG_USB_GADGETFS is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1760_HCD is not set # CONFIG_USB_OXU210HP_HCD is not set CONFIG_USB_IOWARRIOR=m CONFIG_USB_ISIGHTFW=m @@ -3539,12 +3873,15 @@ CONFIG_RADIO_SI4713=m CONFIG_USB_MR800=m CONFIG_USB_STKWEBCAM=m # CONFIG_USB_TEST is not set +# CONFIG_USB_EHSET_TEST_FIXTURE is not set CONFIG_USB_TRANCEVIBRATOR=m CONFIG_USB_U132_HCD=m 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 @@ -3593,11 +3930,13 @@ CONFIG_MFD_VIPERBOARD=m # CONFIG_HTC_I2CPLD is not set # CONFIG_MFD_MAX8925 is not set # CONFIG_MFD_ASIC3 is not set +# CONFIG_MFD_AS3722 is not set # CONFIG_HTC_EGPIO is not set # CONFIG_TPS6507X is not set # CONFIG_ABX500_CORE is not set # CONFIG_MFD_RDC321X is not set # CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_KEMPLD is not set # CONFIG_MFD_WM831X_I2C is not set # CONFIG_MFD_CS5535 is not set # CONFIG_MFD_STMPE is not set @@ -3610,6 +3949,12 @@ 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 +# CONFIG_MFD_DA9063 is not set +# CONFIG_MFD_LP3943 is not set # # File systems @@ -3659,8 +4004,10 @@ CONFIG_AUTOFS4_FS=y CONFIG_NILFS2_FS=m # CONFIG_LOGFS is not set CONFIG_CEPH_FS=m +CONFIG_CEPH_FSCACHE=y CONFIG_BLK_DEV_RBD=m CONFIG_CEPH_LIB=m +CONFIG_CEPH_FS_POSIX_ACL=y # CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set CONFIG_FSCACHE=m @@ -3713,6 +4060,7 @@ CONFIG_ECRYPT_FS=m # CONFIG_ECRYPT_FS_MESSAGING is not set CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m +# CONFIG_HFSPLUS_FS_POSIX_ACL is not set CONFIG_BEFS_FS=m # CONFIG_BEFS_DEBUG is not set # CONFIG_BFS_FS is not set @@ -3738,6 +4086,7 @@ CONFIG_UFS_FS=m CONFIG_9P_FS=m CONFIG_9P_FSCACHE=y CONFIG_9P_FS_POSIX_ACL=y +CONFIG_9P_FS_SECURITY=y CONFIG_FUSE_FS=m # CONFIG_OMFS_FS is not set CONFIG_CUSE=m @@ -3748,17 +4097,20 @@ CONFIG_CUSE=m # CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=m -CONFIG_NFS_V2=y +# CONFIG_NFS_V2 is not set CONFIG_NFS_V3=y CONFIG_NFS_V3_ACL=y CONFIG_NFS_V4=y -# CONFIG_NFS_SWAP is not set +CONFIG_NFS_SWAP=y CONFIG_NFS_V4_1=y CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" +# CONFIG_NFS_V4_1_MIGRATION is not set +CONFIG_NFS_V4_2=y CONFIG_NFSD=m CONFIG_NFSD_V3=y CONFIG_NFSD_V3_ACL=y CONFIG_NFSD_V4=y +CONFIG_NFSD_V4_SECURITY_LABEL=y CONFIG_NFS_FSCACHE=y # CONFIG_NFS_USE_LEGACY_DNS is not set CONFIG_PNFS_OBJLAYOUT=m @@ -3809,6 +4161,9 @@ 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_BTRFS_ASSERT is not set CONFIG_CONFIGFS_FS=y @@ -3828,12 +4183,14 @@ CONFIG_UBIFS_FS_XATTR=y # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set +CONFIG_AIX_PARTITION=y CONFIG_AMIGA_PARTITION=y # CONFIG_ATARI_PARTITION is not set CONFIG_BSD_DISKLABEL=y CONFIG_EFI_PARTITION=y CONFIG_KARMA_PARTITION=y -# CONFIG_LDM_PARTITION is not set +CONFIG_LDM_PARTITION=y +# CONFIG_LDM_DEBUG is not set CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y CONFIG_MINIX_SUBPARTITION=y @@ -3844,6 +4201,7 @@ CONFIG_SUN_PARTITION=y # CONFIG_SYSV68_PARTITION is not set CONFIG_UNIXWARE_DISKLABEL=y # CONFIG_ULTRIX_PARTITION is not set +# CONFIG_CMDLINE_PARTITION is not set CONFIG_NLS=y @@ -3914,6 +4272,7 @@ CONFIG_OPROFILE_EVENT_MULTIPLEX=y CONFIG_DEBUG_KERNEL=y CONFIG_FRAME_WARN=1024 CONFIG_MAGIC_SYSRQ=y +CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0 CONFIG_DEBUG_INFO=y CONFIG_FRAME_POINTER=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set @@ -3932,6 +4291,9 @@ CONFIG_HEADERS_CHECK=y # This generates a huge amount of dmesg spew # CONFIG_DEBUG_KOBJECT is not set # +# This breaks booting until the module patches are in-tree +# CONFIG_DEBUG_KOBJECT_RELEASE is not set +# # # These debug options are deliberatly left on (even in 'make release' kernels). # They aren't that much of a performance impact, and the value @@ -3954,13 +4316,13 @@ CONFIG_LOCKUP_DETECTOR=y # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set # CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_TIMEOUT=0 CONFIG_ATOMIC64_SELFTEST=y CONFIG_MEMORY_FAILURE=y CONFIG_HWPOISON_INJECT=m CONFIG_CROSS_MEMORY_ATTACH=y # CONFIG_DEBUG_SECTION_MISMATCH is not set # CONFIG_BACKTRACE_SELF_TEST is not set -CONFIG_LATENCYTOP=y CONFIG_RESOURCE_COUNTERS=y # CONFIG_COMPAT_BRK is not set # CONFIG_DEBUG_VIRTUAL is not set @@ -4005,6 +4367,11 @@ CONFIG_AUDITSYSCALL=y # http://lists.fedoraproject.org/pipermail/kernel/2013-February/004125.html CONFIG_AUDIT_LOGINUID_IMMUTABLE=y +CONFIG_SECCOMP=y +CONFIG_STRICT_DEVMEM=y + +# CONFIG_SSBI is not set + # # Cryptographic options # @@ -4038,10 +4405,13 @@ 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 CONFIG_CRYPTO_LZO=m +CONFIG_CRYPTO_LZ4=m +CONFIG_CRYPTO_LZ4HC=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_MICHAEL_MIC=m @@ -4090,6 +4460,7 @@ CONFIG_CRC_CCITT=m CONFIG_CRC_ITU_T=m CONFIG_CRC_T10DIF=m CONFIG_CRC8=m +# CONFIG_RANDOM32_SELFTEST is not set # CONFIG_CRC7 is not set CONFIG_CORDIC=m # CONFIG_DDR is not set @@ -4100,6 +4471,8 @@ CONFIG_ZLIB_DEFLATE=m CONFIG_INITRAMFS_SOURCE="" CONFIG_KEYS=y +CONFIG_PERSISTENT_KEYRINGS=y +CONFIG_BIG_KEYS=y CONFIG_TRUSTED_KEYS=m CONFIG_ENCRYPTED_KEYS=m CONFIG_KEYS_DEBUG_PROC_KEYS=y @@ -4115,6 +4488,7 @@ CONFIG_BACKLIGHT_PROGEAR=m # CONFIG_BACKLIGHT_ADP8860 is not set # CONFIG_BACKLIGHT_ADP8870 is not set # CONFIG_BACKLIGHT_LM3630 is not set +# CONFIG_BACKLIGHT_LM3630A is not set # CONFIG_BACKLIGHT_LM3639 is not set CONFIG_FB_NVIDIA_BACKLIGHT=y CONFIG_FB_RIVA_BACKLIGHT=y @@ -4124,11 +4498,13 @@ CONFIG_FB_ATY_BACKLIGHT=y # CONFIG_BACKLIGHT_SAHARA is not set CONFIG_BACKLIGHT_WM831X=m CONFIG_BACKLIGHT_LP855X=m +# CONFIG_BACKLIGHT_GPIO is not set +# CONFIG_BACKLIGHT_LV5207LP is not set +# CONFIG_BACKLIGHT_BD6107 is not set CONFIG_LCD_CLASS_DEVICE=m CONFIG_LCD_PLATFORM=m -CONFIG_SCHEDSTATS=y CONFIG_SCHED_DEBUG=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_CFS_BANDWIDTH=y @@ -4146,11 +4522,13 @@ 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 +CONFIG_CGROUP_NET_PRIO=m +# CONFIG_CGROUP_NET_CLASSID is not set CONFIG_BLK_CGROUP=y # CONFIG_SYSFS_DEPRECATED is not set @@ -4173,6 +4551,7 @@ CONFIG_THERMAL_GOV_FAIR_SHARE=y # CONFIG_THERMAL_GOV_USER_SPACE is not set CONFIG_THERMAL_GOV_STEP_WISE=y # CONFIG_THERMAL_EMULATION is not set +# CONFIG_THERMAL_OF is not set # CONFIG_CPU_THERMAL is not set CONFIG_INOTIFY=y @@ -4187,7 +4566,10 @@ CONFIG_PROC_EVENTS=y CONFIG_IBMASR=m +CONFIG_PM=y +CONFIG_PM_STD_PARTITION="" CONFIG_PM_DEBUG=y +# CONFIG_DPM_WATCHDOG is not set # revisit this in debug CONFIG_PM_TRACE=y CONFIG_PM_TRACE_RTC=y # CONFIG_PM_TEST_SUSPEND is not set @@ -4195,6 +4577,9 @@ CONFIG_PM_RUNTIME=y # CONFIG_PM_OPP is not set # CONFIG_PM_AUTOSLEEP is not set # CONFIG_PM_WAKELOCKS is not set +CONFIG_HIBERNATION=y +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +CONFIG_SUSPEND=y CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y @@ -4252,6 +4637,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 @@ -4268,6 +4654,9 @@ CONFIG_LEDS_DELL_NETBOOKS=m # CONFIG_LEDS_LM355x is not set # CONFIG_LEDS_OT200 is not set # CONFIG_LEDS_PWM is not set +# CONFIG_LEDS_LP8501 is not set +# CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_PCA9685 is not set CONFIG_LEDS_TRIGGERS=y CONFIG_LEDS_TRIGGER_TIMER=m CONFIG_LEDS_TRIGGER_ONESHOT=m @@ -4277,6 +4666,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 @@ -4287,6 +4677,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 @@ -4295,7 +4686,9 @@ CONFIG_LEDS_WM831X_STATUS=m CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y +CONFIG_DW_DMAC_CORE=m CONFIG_DW_DMAC=m +CONFIG_DW_DMAC_PCI=m # CONFIG_DW_DMAC_BIG_ENDIAN_IO is not set # CONFIG_TIMB_DMA is not set # CONFIG_DMATEST is not set @@ -4311,12 +4704,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 @@ -4330,8 +4725,12 @@ CONFIG_JUMP_LABEL=y CONFIG_OPTPROBES=y CONFIG_HZ_1000=y +CONFIG_NO_HZ=y CONFIG_TIMER_STATS=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_PERF_EVENTS=y +CONFIG_PERF_COUNTERS=y # Auxillary displays CONFIG_KS0108=m @@ -4347,6 +4746,7 @@ CONFIG_POWER_SUPPLY=y # CONFIG_TEST_POWER is not set CONFIG_APM_POWER=m +# CONFIG_GENERIC_ADC_BATTERY is not set # CONFIG_WM831X_POWER is not set # CONFIG_BATTERY_DS2760 is not set @@ -4366,6 +4766,8 @@ CONFIG_APM_POWER=m # CONFIG_CHARGER_GPIO is not set # CONFIG_CHARGER_PCF50633 is not set # CONFIG_CHARGER_BQ2415X is not set +# CONFIG_CHARGER_BQ24190 is not set +# CONFIG_CHARGER_BQ24735 is not set CONFIG_POWER_RESET=y # CONFIG_PDA_POWER is not set @@ -4381,6 +4783,7 @@ CONFIG_UIO_AEC=m CONFIG_UIO_SERCOS3=m CONFIG_UIO_PCI_GENERIC=m # CONFIG_UIO_NETX is not set +# CONFIG_UIO_MF624 is not set CONFIG_VFIO=m CONFIG_VFIO_IOMMU_TYPE1=m @@ -4410,6 +4813,7 @@ CONFIG_NOZOMI=m CONFIG_INPUT_APANEL=m CONFIG_INPUT_GP2A=m # CONFIG_INPUT_GPIO_TILT_POLLED is not set +# CONFIG_INPUT_GPIO_BEEPER is not set # CONFIG_INTEL_MENLOW is not set CONFIG_ENCLOSURE_SERVICES=m @@ -4420,6 +4824,7 @@ CONFIG_MEMSTICK=m # CONFIG_MEMSTICK_DEBUG is not set # CONFIG_MEMSTICK_UNSAFE_RESUME is not set CONFIG_MSPRO_BLOCK=m +# CONFIG_MS_BLOCK is not set CONFIG_MEMSTICK_TIFM_MS=m CONFIG_MEMSTICK_JMICRON_38X=m CONFIG_MEMSTICK_R592=m @@ -4437,8 +4842,11 @@ CONFIG_OPTIMIZE_INLINING=y # FIXME: This should be x86/ia64 only # CONFIG_HP_ILO is not set -# CONFIG_GPIOLIB is not set +CONFIG_GPIOLIB=y # CONFIG_PINCTRL is not set +# CONFIG_DEBUG_PINCTRL is not set +# CONFIG_PINMUX is not set +# CONFIG_PINCONF is not set CONFIG_NET_DSA=m CONFIG_NET_DSA_MV88E6060=m @@ -4463,7 +4871,7 @@ CONFIG_WM8350_POWER=m CONFIG_USB_WUSB=m CONFIG_USB_WUSB_CBAF=m # CONFIG_USB_WUSB_CBAF_DEBUG is not set -CONFIG_USB_WHCI_HCD=m +# CONFIG_USB_WHCI_HCD is not set CONFIG_USB_HWA_HCD=m # CONFIG_USB_HCD_BCMA is not set # CONFIG_USB_HCD_SSB is not set @@ -4485,6 +4893,10 @@ CONFIG_STAGING_MEDIA=y # CONFIG_TI_ST is not set # CONFIG_FB_XGI is not set # CONFIG_VIDEO_GO7007 is not set +# CONFIG_I2C_BCM2048 is not set +# CONFIG_VIDEO_TCM825X is not set +# CONFIG_VIDEO_OMAP4 is not set +# CONFIG_USB_MSI3101 is not set # CONFIG_DT3155 is not set # CONFIG_W35UND is not set # CONFIG_PRISM2_USB is not set @@ -4497,7 +4909,6 @@ CONFIG_USB_ATMEL=m # CONFIG_POHMELFS is not set # CONFIG_IDE_PHISON is not set # CONFIG_LINE6_USB is not set -# CONFIG_IIO is not set # CONFIG_VME_BUS is not set # CONFIG_RAR_REGISTER is not set # CONFIG_VT6656 is not set @@ -4511,18 +4922,21 @@ CONFIG_RTL8192E=m # CONFIG_INPUT_GPIO is not set # CONFIG_VIDEO_CX25821 is not set # CONFIG_R8187SE is not set +# CONFIG_R8188EU is not set +# CONFIG_R8821AE is not set # CONFIG_RTL8192U is not set # CONFIG_FB_SM7XX is not set # CONFIG_SPECTRA is not set -# CONFIG_ZRAM is not set # CONFIG_EASYCAP is not set # CONFIG_SOLO6X10 is not set # CONFIG_ACPI_QUICKSTART is not set +# CONFIG_LTE_GDM724X is not set CONFIG_R8712U=m # Larry Finger maintains this (rhbz 699618) # CONFIG_R8712_AP is not set # CONFIG_ATH6K_LEGACY is not set # CONFIG_USB_ENESTORAGE is not set # CONFIG_BCM_WIMAX is not set +# CONFIG_USB_BTMTK is not set # CONFIG_FT1000 is not set # CONFIG_SPEAKUP is not set # CONFIG_DX_SEP is not set @@ -4537,7 +4951,6 @@ CONFIG_ALTERA_STAPL=m # CONFIG_RTS5139 is not set # CONFIG_NVEC_LEDS is not set # CONFIG_VT6655 is not set -# CONFIG_ZSMALLOC is not set # CONFIG_RAMSTER is not set # CONFIG_USB_WPAN_HCD is not set # CONFIG_WIMAX_GDM72XX is not set @@ -4550,6 +4963,11 @@ CONFIG_ALTERA_STAPL=m # CONFIG_CED1401 is not set # CONFIG_DGRP is not set # CONFIG_SB105X is not set +# CONFIG_LUSTRE_FS is not set +# CONFIG_XILLYBUS is not set +# CONFIG_DGAP is not set +# CONFIG_DGNC is not set +# CONFIG_RTS5208 is not set # END OF STAGING # @@ -4571,6 +4989,7 @@ CONFIG_IMA_LSM_RULES=y # CONFIG_EVM is not set # CONFIG_PWM is not set +# CONFIG_PWM_PCA9685 is not set CONFIG_LSM_MMAP_MIN_ADDR=65536 @@ -4584,6 +5003,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 @@ -4600,8 +5020,12 @@ CONFIG_IEEE802154_FAKEHARD=m CONFIG_IEEE802154_FAKELB=m CONFIG_MAC802154=m +CONFIG_NET_MPLS_GSO=m + +# CONFIG_HSR is not set # CONFIG_EXTCON is not set +# CONFIG_EXTCON_ADC_JACK is not set # CONFIG_MEMORY is not set CONFIG_PPS=m @@ -4618,6 +5042,9 @@ CONFIG_PTP_1588_CLOCK_PCH=m CONFIG_CLEANCACHE=y CONFIG_FRONTSWAP=y +CONFIG_ZSWAP=y +CONFIG_ZSMALLOC=y +# CONFIG_PGTABLE_MAPPING is not set # CONFIG_MDIO_GPIO is not set # CONFIG_KEYBOARD_GPIO is not set @@ -4630,6 +5057,7 @@ CONFIG_FRONTSWAP=y # CONFIG_W1_MASTER_GPIO is not set # CONFIG_LEDS_GPIO is not set CONFIG_GPIO_SYSFS=y +# CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_MAX732X is not set # CONFIG_GPIO_PCA953X is not set # CONFIG_GPIO_PCF857X is not set @@ -4653,16 +5081,20 @@ 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 +# CONFIG_GPIO_PL061 is not set +# CONFIG_GPIO_BCM_KONA is not set +# CONFIG_GPIO_SCH311X is not set # FIXME: Why? CONFIG_EVENT_POWER_TRACING_DEPRECATED=y CONFIG_TEST_KSTRTOX=y CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_XZ_DEC_POWERPC is not set +CONFIG_XZ_DEC_X86=y +CONFIG_XZ_DEC_POWERPC=y # CONFIG_XZ_DEC_IA64 is not set -# CONFIG_XZ_DEC_ARM is not set +CONFIG_XZ_DEC_ARM=y # CONFIG_XZ_DEC_ARMTHUMB is not set # CONFIG_XZ_DEC_SPARC is not set # CONFIG_XZ_DEC_TEST is not set @@ -4685,6 +5117,8 @@ CONFIG_PSTORE_RAM=m # CONFIG_PSTORE_CONSOLE is not set # CONFIG_PSTORE_FTRACE is not set +# CONFIG_TEST_MODULE is not set +# CONFIG_TEST_USER_COPY is not set # CONFIG_AVERAGE is not set # CONFIG_VMXNET3 is not set @@ -4697,6 +5131,7 @@ CONFIG_BCMA=m CONFIG_BCMA_BLOCKIO=y CONFIG_BCMA_HOST_PCI_POSSIBLE=y CONFIG_BCMA_HOST_PCI=y +# CONFIG_BCMA_HOST_SOC is not set CONFIG_BCMA_DRIVER_GMAC_CMN=y CONFIG_BCMA_DRIVER_GPIO=y # CONFIG_BCMA_DEBUG is not set @@ -4707,8 +5142,24 @@ CONFIG_IOMMU_SUPPORT=y # CONFIG_MAILBOX is not set +# CONFIG_RESET_CONTROLLER is not set + +CONFIG_FMC=m +CONFIG_FMC_FAKEDEV=m +CONFIG_FMC_TRIVIAL=m +CONFIG_FMC_WRITE_EEPROM=m +CONFIG_FMC_CHARDEV=m + +# CONFIG_GENWQE is not set + +# CONFIG_POWERCAP is not set + # CONFIG_HSI is not set +# CONFIG_CPU_IDLE is not set + +# CONFIG_ARM_ARCH_TIMER_EVTSTREAM is not set + # CONFIG_PM_DEVFREQ is not set # CONFIG_MODULE_SIG is not set # CONFIG_SYSTEM_TRUSTED_KEYRING is not set diff --git a/config-nodebug b/config-nodebug index aa7568c82..ee4842bfc 100644 --- a/config-nodebug +++ b/config-nodebug @@ -5,6 +5,7 @@ CONFIG_SND_PCM_XRUN_DEBUG=y # CONFIG_DEBUG_ATOMIC_SLEEP is not set # CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set # CONFIG_DEBUG_RT_MUTEXES is not set # CONFIG_DEBUG_LOCK_ALLOC is not set # CONFIG_PROVE_LOCKING is not set @@ -25,8 +26,6 @@ CONFIG_CPUMASK_OFFSTACK=y # CONFIG_FAIL_IO_TIMEOUT is not set # CONFIG_FAIL_MMC_REQUEST is not set -# CONFIG_SLUB_DEBUG_ON is not set - # CONFIG_LOCK_STAT is not set # CONFIG_DEBUG_STACK_USAGE is not set @@ -68,6 +67,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 +83,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 @@ -99,7 +102,9 @@ CONFIG_KDB_KEYBOARD=y CONFIG_KDB_CONTINUE_CATASTROPHIC=0 # CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set +# CONFIG_PERCPU_TEST 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 @@ -117,3 +122,9 @@ CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y # CONFIG_EDAC_DEBUG is not set # CONFIG_SPI_DEBUG is not set + +# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set + +# CONFIG_SCHEDSTATS is not set +# CONFIG_LATENCYTOP is not set + diff --git a/config-powerpc-generic b/config-powerpc-generic index 2ef1da559..9c0ad6011 100644 --- a/config-powerpc-generic +++ b/config-powerpc-generic @@ -1,5 +1,4 @@ # Most PowerPC kernels we build are SMP -CONFIG_SMP=y CONFIG_IRQ_ALL_CPUS=y CONFIG_PPC=y CONFIG_WATCHDOG_RTAS=m @@ -11,14 +10,6 @@ CONFIG_TAU=y # CONFIG_TAU_INT is not set CONFIG_TAU_AVERAGE=y -CONFIG_SECCOMP=y - -CONFIG_PM=y - -CONFIG_PM_STD_PARTITION="" - -CONFIG_SUSPEND=y -CONFIG_HIBERNATION=y # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set # CONFIG_GEN_RTC_X is not set @@ -39,6 +30,7 @@ CONFIG_FB_OF=y # CONFIG_FB_CONTROL is not set CONFIG_FB_IBM_GXT4500=y CONFIG_FB_MATROX=y +CONFIG_FB_MATROX_G=y # CONFIG_FB_VGA16 is not set CONFIG_FB_ATY128_BACKLIGHT=y CONFIG_FB_ATY_BACKLIGHT=y @@ -99,9 +91,6 @@ CONFIG_LEDS_TRIGGER_TIMER=m CONFIG_LEDS_TRIGGER_HEARTBEAT=m CONFIG_LEDS_TRIGGER_GPIO=m -# FIXME: Should depend on IA64/x86 -# CONFIG_SGI_IOC4 is not set - CONFIG_PPC_EFIKA=y CONFIG_PPC_MEDIA5200=y @@ -332,6 +321,7 @@ CONFIG_SERIAL_GRLIB_GAISLER_APBUART=m # CONFIG_PPC_MPC512x is not set # CONFIG_RTC_DRV_MPC5121 is not set +# CONFIG_RTC_DRV_HYM8563 is not set # CONFIG_MPC512X_DMA is not set @@ -342,12 +332,9 @@ CONFIG_I2C_MPC=m # CONFIG_IMA is not set # CONFIG_TCG_TPM is not set -CONFIG_RFKILL_GPIO=m - # CONFIG_CRYPTO_DEV_FSL_CAAM is not set # CONFIG_CRYPTO_SHA1_PPC is not set -# CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_MCP23S08 is not set # CONFIG_CAN_FLEXCAN is not set @@ -362,7 +349,6 @@ CONFIG_RFKILL_GPIO=m # CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set # CONFIG_INPUT_GP2A is not set # CONFIG_INPUT_GPIO_TILT_POLLED is not set -CONFIG_STRICT_DEVMEM=y CONFIG_RCU_FANOUT_LEAF=16 @@ -370,11 +356,12 @@ CONFIG_RCU_FANOUT_LEAF=16 # CONFIG_MPIC_MSGR is not set # CONFIG_FA_DUMP is not set # CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set # CONFIG_FAIL_IOMMU is not set +# CONFIG_SPAPR_TCE_IOMMU is not set +# CONFIG_TRANSPARENT_HUGEPAGE is not set -# CONFIG_PPC_DENORMALISATION is not set +CONFIG_PPC_DENORMALISATION=y # CONFIG_MDIO_BUS_MUX_MMIOREG is not set # CONFIG_GPIO_ADNP is not set # CONFIG_MFD_SYSCON is not set @@ -384,6 +371,9 @@ 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_CPU_LITTLE_ENDIAN is not set + CONFIG_POWER_RESET_GPIO=y CONFIG_FB_SSD1307=m CONFIG_INPUT_PWM_BEEPER=m @@ -391,3 +381,5 @@ CONFIG_BACKLIGHT_PWM=m CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=n CONFIG_XZ_DEC_POWERPC=y + +CONFIG_CRASH=m diff --git a/config-powerpc32-generic b/config-powerpc32-generic index 935aab420..61e3236b1 100644 --- a/config-powerpc32-generic +++ b/config-powerpc32-generic @@ -95,8 +95,6 @@ CONFIG_SERIAL_OF_PLATFORM=y CONFIG_DEBUG_STACKOVERFLOW=y # CONFIG_EMBEDDED6xx is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y # CONFIG_BLK_DEV_PLATFORM is not set # CONFIG_BLK_DEV_4DRIVES is not set @@ -175,10 +173,6 @@ CONFIG_CRYPTO_DEV_TALITOS=m CONFIG_RCU_FANOUT=32 -CONFIG_PERF_COUNTERS=y -CONFIG_PERF_EVENTS=y -CONFIG_EVENT_PROFILE=y - CONFIG_KVM_BOOK3S_32=m # CONFIG_SCSI_QLA_ISCSI is not set diff --git a/config-powerpc32-smp b/config-powerpc32-smp index e60f59cdf..5dbe87f7f 100644 --- a/config-powerpc32-smp +++ b/config-powerpc32-smp @@ -1,4 +1,3 @@ -CONFIG_SMP=y # CONFIG_HOTPLUG_CPU is not set CONFIG_NR_CPUS=4 # CONFIG_BATTERY_PMU is not set diff --git a/config-powerpc64 b/config-powerpc64 index 2a587a6fd..4b8ba84aa 100644 --- a/config-powerpc64 +++ b/config-powerpc64 @@ -12,7 +12,10 @@ 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_HW_RANDOM_POWERNV=m +CONFIG_SCOM_DEBUGFS=y # CONFIG_PPC_PASEMI is not set # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set # CONFIG_PPC_PS3 is not set @@ -86,6 +89,8 @@ CONFIG_NR_CPUS=1024 CONFIG_RTAS_PROC=y CONFIG_IOMMU_VMERGE=y CONFIG_NUMA=y +CONFIG_NUMA_BALANCING=y +CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_PPC_64K_PAGES=y CONFIG_PPC_SUBPAGE_PROT=y CONFIG_SCHED_SMT=y @@ -96,6 +101,10 @@ CONFIG_HZ_100=y CONFIG_MEMORY_HOTREMOVE=y +CONFIG_PPC64_SUPPORTS_MEMORY_FAILURE=y + +CONFIG_CGROUP_HUGETLB=y + # CONFIG_MV643XX_ETH is not set CONFIG_IRQSTACKS=y CONFIG_DEBUG_STACKOVERFLOW=y @@ -110,11 +119,7 @@ CONFIG_XMON_DISASSEMBLY=y CONFIG_SCSI_IBMVSCSIS=m -CONFIG_SECCOMP=y - # CONFIG_TUNE_CELL is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y # CONFIG_BLK_DEV_PLATFORM is not set # CONFIG_VIRQ_DEBUG is not set @@ -137,13 +142,13 @@ CONFIG_RELOCATABLE=y CONFIG_RCU_FANOUT=64 -CONFIG_PERF_COUNTERS=y -CONFIG_PERF_EVENTS=y -CONFIG_EVENT_PROFILE=y - +CONFIG_CMA=y +# CONFIG_CMA_DEBUG is not set CONFIG_KVM_BOOK3S_64=m -CONFIG_KVM_BOOK3S_64_HV=y +CONFIG_KVM_BOOK3S_64_HV=m +CONFIG_KVM_BOOK3S_64_PR=m # CONFIG_KVM_EXIT_TIMING is not set +CONFIG_KVM_XICS=y #-- bz#607175 #-- active memory sharing @@ -158,7 +163,8 @@ CONFIG_PSERIES_ENERGY=m CONFIG_CPU_IDLE=y # CONFIG_CPU_IDLE_GOV_LADDER is not set -CONFIG_PSERIES_IDLE=y +CONFIG_PSERIES_CPUIDLE=y +CONFIG_POWERNV_CPUIDLE=y CONFIG_PPC_ICSWX=y CONFIG_IO_EVENT_IRQ=y @@ -176,6 +182,7 @@ CONFIG_CRYPTO_DEV_NX_COMPRESS=m CONFIG_BPF_JIT=y # CONFIG_PPC_ICSWX_PID is not set # CONFIG_PPC_ICSWX_USE_SIGILL is not set -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set # CONFIG_PCIEPORTBUS is not set # CONFIG_PPC_TRANSACTIONAL_MEM is not set +# CONFIG_SND_HDA_INTEL is not set +CONFIG_BLK_DEV_RSXX=m diff --git a/config-powerpc64p7 b/config-powerpc64p7 index 9a8289588..4fe09eee2 100644 --- a/config-powerpc64p7 +++ b/config-powerpc64p7 @@ -8,7 +8,10 @@ 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_HW_RANDOM_POWERNV=m +CONFIG_SCOM_DEBUGFS=y # CONFIG_PPC_PASEMI is not set # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set # CONFIG_PPC_PS3 is not set @@ -77,6 +80,8 @@ CONFIG_NR_CPUS=1024 CONFIG_RTAS_PROC=y CONFIG_IOMMU_VMERGE=y CONFIG_NUMA=y +CONFIG_NUMA_BALANCING=y +CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_PPC_64K_PAGES=y CONFIG_PPC_SUBPAGE_PROT=y CONFIG_SCHED_SMT=y @@ -87,6 +92,10 @@ CONFIG_HZ_100=y CONFIG_MEMORY_HOTREMOVE=y +CONFIG_PPC64_SUPPORTS_MEMORY_FAILURE=y + +CONFIG_CGROUP_HUGETLB=y + # CONFIG_MV643XX_ETH is not set CONFIG_IRQSTACKS=y CONFIG_DEBUG_STACKOVERFLOW=y @@ -101,11 +110,7 @@ CONFIG_XMON_DISASSEMBLY=y CONFIG_SCSI_IBMVSCSIS=m -CONFIG_SECCOMP=y - # CONFIG_TUNE_CELL is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y # CONFIG_BLK_DEV_PLATFORM is not set # CONFIG_VIRQ_DEBUG is not set @@ -128,13 +133,13 @@ CONFIG_RELOCATABLE=y CONFIG_RCU_FANOUT=64 -CONFIG_PERF_COUNTERS=y -CONFIG_PERF_EVENTS=y -CONFIG_EVENT_PROFILE=y - +CONFIG_CMA=y +# CONFIG_CMA_DEBUG is not set CONFIG_KVM_BOOK3S_64=m -CONFIG_KVM_BOOK3S_64_HV=y +CONFIG_KVM_BOOK3S_64_HV=m +CONFIG_KVM_BOOK3S_64_PR=m # CONFIG_KVM_EXIT_TIMING is not set +CONFIG_KVM_XICS=y #-- bz#607175 #-- active memory sharing @@ -149,7 +154,8 @@ CONFIG_PSERIES_ENERGY=m CONFIG_CPU_IDLE=y # CONFIG_CPU_IDLE_GOV_LADDER is not set -CONFIG_PSERIES_IDLE=y +CONFIG_PSERIES_CPUIDLE=y +CONFIG_POWERNV_CPUIDLE=y CONFIG_PPC_ICSWX=y CONFIG_IO_EVENT_IRQ=y @@ -167,6 +173,6 @@ CONFIG_CRYPTO_DEV_NX_COMPRESS=m CONFIG_BPF_JIT=y # CONFIG_PPC_ICSWX_PID is not set # CONFIG_PPC_ICSWX_USE_SIGILL is not set -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set # CONFIG_PCIEPORTBUS is not set - +# CONFIG_SND_HDA_INTEL is not set +CONFIG_BLK_DEV_RSXX=m diff --git a/config-s390x b/config-s390x index c0ae0aa0a..6f3d3253e 100644 --- a/config-s390x +++ b/config-s390x @@ -13,13 +13,9 @@ CONFIG_HZ_100=y # See bug 496605 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_MMU=y - CONFIG_LOG_BUF_SHIFT=16 CONFIG_NO_IDLE_HZ=y -CONFIG_SMP=y - # # I/O subsystem configuration # @@ -38,6 +34,7 @@ CONFIG_CMM=m CONFIG_CMM_PROC=y # CONFIG_NETIUCV is not set CONFIG_SMSGIUCV=m +CONFIG_CRASH_DUMP=y # # SCSI low-level drivers @@ -189,8 +186,6 @@ CONFIG_S390_VMUR=m # CONFIG_THERMAL is not set -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y CONFIG_CTCM=m CONFIG_QETH_L2=m CONFIG_QETH_L3=m @@ -199,6 +194,7 @@ CONFIG_VIRTUALIZATION=y CONFIG_KVM=m # CONFIG_KVM_S390_UCONTROL is not set CONFIG_S390_GUEST=y +CONFIG_VIRTIO_CONSOLE=y CONFIG_MEMORY_HOTPLUG=y @@ -213,15 +209,7 @@ CONFIG_HVC_IUCV=y CONFIG_RCU_FANOUT=64 CONFIG_RCU_FANOUT_LEAF=16 -CONFIG_SECCOMP=y - -CONFIG_PM=y -CONFIG_HIBERNATION=y -CONFIG_PM_STD_PARTITION="/dev/jokes" - -CONFIG_PERF_COUNTERS=y -CONFIG_PERF_EVENTS=y -CONFIG_EVENT_PROFILE=y +# CONFIG_SUSPEND is not set CONFIG_SMSGIUCV_EVENT=m @@ -234,13 +222,9 @@ CONFIG_ZFCP_DIF=y CONFIG_SCHED_MC=y CONFIG_SCHED_BOOK=y -CONFIG_STRICT_DEVMEM=y - # CONFIG_WARN_DYNAMIC_STACK is not set CONFIG_CRYPTO_GHASH_S390=m -CONFIG_NET_CORE=y -CONFIG_ETHERNET=y CONFIG_BPF_JIT=y # CONFIG_TRANSPARENT_HUGEPAGE is not set @@ -250,16 +234,51 @@ CONFIG_SCM_BLOCK=m CONFIG_SCM_BLOCK_CLUSTER_WRITE=y # CONFIG_S390_PTDUMP is not set # CONFIG_ASYMMETRIC_KEY_TYPE is not set -CONFIG_PCI_NR_FUNCTIONS=64 -CONFIG_HOTPLUG_PCI=m -# CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_SHPC is not set -CONFIG_HOTPLUG_PCI_S390=m -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_MCP23S08 is not set - # CONFIG_PCI is not set + +# CONFIG_NEW_LEDS is not set +# CONFIG_HID is not set + +# CONFIG_INPUT is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set +# CONFIG_SERIO is not set + +# CONFIG_ACCESSIBILITY is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_STAGING is not set +# CONFIG_MEMSTICK is not set +# CONFIG_MEDIA_SUPPORT is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_DRM is not set +# CONFIG_SOUND is not set +# CONFIG_DW_DMAC is not set +# CONFIG_I2C is not set +# CONFIG_I2C_SMBUS is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_PARPORT is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_PTP_1588_CLOCK is not set +# CONFIG_PPS is not set + +# CONFIG_PHYLIB is not set +# CONFIG_ATM_DRIVERS is not set +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_INTEL is not set # CONFIG_NET_VENDOR_MARVELL is not set -# CONFIG_PTP_1588_CLOCK_PCH is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_SH_ETH is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_IEEE802154_DRIVERS is not set + +# CONFIG_FMC is not set + +CONFIG_CRASH=m diff --git a/config-x86-32-generic b/config-x86-32-generic index 6b6c60d30..21fe6fe75 100644 --- a/config-x86-32-generic +++ b/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 @@ -73,8 +73,6 @@ CONFIG_APM_CPU_IDLE=y # CONFIG_APM_DISPLAY_BLANK is not set # CONFIG_APM_ALLOW_INTS is not set -CONFIG_ACPI_BLACKLIST_YEAR=1999 - # CONFIG_X86_POWERNOW_K6 is not set CONFIG_X86_POWERNOW_K7=y @@ -122,8 +120,6 @@ CONFIG_SND_ES18XX=m CONFIG_HW_RANDOM_GEODE=m -# CONFIG_SGI_IOC4 is not set - CONFIG_TC1100_WMI=m CONFIG_IB700_WDT=m @@ -228,5 +224,13 @@ CONFIG_BACKLIGHT_PWM=m # CONFIG_GPIO_ADNP is not set # CONFIG_BACKLIGHT_OT200 is not set # CONFIG_RTC_DRV_SNVS is not set +# CONFIG_RTC_DRV_HYM8563 is not set # CONFIG_OF_DISPLAY_TIMING is not set # CONFIG_OF_VIDEOMODE is not set + +# CONFIG_MLX5_INFINIBAND is not set +# CONFIG_PINCTRL_SINGLE is not set +# CONFIG_PINCTRL_CAPRI is not set +# CONFIG_PINCTRL_MSM8X74 is not set +# CONFIG_COMMON_CLK_SI570 is not set +# CONFIG_COMMON_CLK_QCOM is not set diff --git a/config-x86-generic b/config-x86-generic index 226859b4e..f6b3fa8c5 100644 --- a/config-x86-generic +++ b/config-x86-generic @@ -2,8 +2,6 @@ CONFIG_UID16=y CONFIG_X86_EXTENDED_PLATFORM=y -CONFIG_SMP=y - CONFIG_X86_GENERIC=y CONFIG_HPET=y @@ -29,7 +27,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,8 +35,15 @@ 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 CONFIG_FB_EFI=y +CONFIG_EARLY_PRINTK_EFI=y +CONFIG_EFI_RUNTIME_MAP=y +# needs FB_SIMPLE to work correctly +# CONFIG_X86_SYSFB is not set # FIXME: 32bit only? # CONFIG_FB_N411 is not set @@ -49,8 +54,6 @@ CONFIG_INTEL_IOMMU_FLOPPY_WA=y # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set CONFIG_SCSI_ADVANSYS=m -CONFIG_SECCOMP=y - CONFIG_CAPI_EICON=y # @@ -94,13 +97,15 @@ CONFIG_ACPI_APEI_MEMORY_FAILURE=y CONFIG_ACPI_IPMI=m CONFIG_ACPI_CUSTOM_METHOD=m CONFIG_ACPI_BGRT=y +# CONFIG_ACPI_EXTLOG is not set CONFIG_X86_INTEL_PSTATE=y -CONFIG_X86_ACPI_CPUFREQ=y -CONFIG_X86_PCC_CPUFREQ=y +CONFIG_X86_ACPI_CPUFREQ=m CONFIG_X86_ACPI_CPUFREQ_CPB=y -CONFIG_X86_POWERNOW_K8=y -CONFIG_X86_P4_CLOCKMOD=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 # @@ -110,13 +115,12 @@ CONFIG_NVRAM=y CONFIG_CRYPTO_DEV_PADLOCK=m CONFIG_CRYPTO_DEV_PADLOCK_AES=m CONFIG_CRYPTO_DEV_PADLOCK_SHA=m +CONFIG_CRYPTO_DEV_CCP=y +CONFIG_CRYPTO_DEV_CCP_DD=m +CONFIG_CRYPTO_DEV_CCP_CRYPTO=m CONFIG_GENERIC_ISA_DMA=y -CONFIG_SUSPEND=y -CONFIG_HIBERNATION=y -CONFIG_PM_STD_PARTITION="" - CONFIG_PCI_MMCONFIG=y CONFIG_PCI_BIOS=y CONFIG_PCI_IOAPIC=y @@ -127,8 +131,6 @@ CONFIG_HOTPLUG_PCI_COMPAQ=m CONFIG_HOTPLUG_PCI_IBM=m # CONFIG_HOTPLUG_PCI_CPCI is not set -CONFIG_PM=y - CONFIG_IPW2100=m CONFIG_IPW2100_MONITOR=y CONFIG_IPW2200=m @@ -151,8 +153,11 @@ CONFIG_I2C_PIIX4=m CONFIG_I2C_SIS96X=m CONFIG_I2C_VIA=m CONFIG_I2C_VIAPRO=m +CONFIG_I2C_DESIGNWARE_CORE=m +CONFIG_I2C_DESIGNWARE_PLATFORM=m -CONFIG_DELL_RBU=m +#rhbz 997149 +# CONFIG_DELL_RBU is not set CONFIG_DCDBAS=m CONFIG_EDAC=y @@ -197,7 +202,9 @@ CONFIG_AMILO_RFKILL=m CONFIG_ASUS_LAPTOP=m CONFIG_COMPAL_LAPTOP=m CONFIG_DELL_LAPTOP=m +CONFIG_CHROME_PLATFORMS=y CONFIG_CHROMEOS_LAPTOP=m +CONFIG_CHROMEOS_PSTORE=m CONFIG_EEEPC_LAPTOP=m CONFIG_FUJITSU_TABLET=m CONFIG_FUJITSU_LAPTOP=m @@ -209,12 +216,12 @@ CONFIG_SAMSUNG_LAPTOP=m CONFIG_SONY_LAPTOP=m CONFIG_TOPSTAR_LAPTOP=m - CONFIG_ACPI_WMI=m CONFIG_ACER_WMI=m CONFIG_ACERHDF=m CONFIG_ASUS_WMI=m CONFIG_ASUS_NB_WMI=m +CONFIG_HP_WIRELESS=m CONFIG_HP_WMI=m # CONFIG_INTEL_SCU_IPC is not set CONFIG_DELL_WMI=m @@ -224,6 +231,9 @@ CONFIG_INTEL_OAKTRAIL=m CONFIG_SAMSUNG_Q10=m CONFIG_APPLE_GMUX=m CONFIG_XO15_EBOOK=m +CONFIG_INTEL_RST=m +CONFIG_INTEL_SMARTCONNECT=y +CONFIG_PVPANIC=m # CONFIG_TOUCHSCREEN_INTEL_MID is not set @@ -240,10 +250,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 @@ -254,6 +265,7 @@ CONFIG_PARAVIRT_TIME_ACCOUNTING=y CONFIG_KVM_CLOCK=y CONFIG_KVM_GUEST=y CONFIG_KVM_MMU_AUDIT=y # default $x would be nice... +# CONFIG_KVM_DEBUG_FS is not set CONFIG_XEN=y # CONFIG_XEN_DEBUG is not set @@ -284,8 +296,6 @@ CONFIG_XEN_ACPI_PROCESSOR=m CONFIG_MTD_ESB2ROM=m CONFIG_MTD_CK804XROM=m -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y CONFIG_CPU_IDLE=y # CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set # CONFIG_CPU_IDLE_GOV_LADDER is not set @@ -320,8 +330,6 @@ CONFIG_HP_WATCHDOG=m CONFIG_NV_TCO=m CONFIG_SP5100_TCO=m -CONFIG_STRICT_DEVMEM=y - # CONFIG_NO_BOOTMEM is not set # CONFIG_MEMTEST is not set @@ -344,13 +352,10 @@ CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y # CONFIG_IOMMU_STRESS is not set -CONFIG_PERF_COUNTERS=y -CONFIG_PERF_EVENTS=y - CONFIG_X86_MCE=y CONFIG_X86_MCE_INTEL=y CONFIG_X86_MCE_AMD=y -# CONFIG_X86_MCE_INJECT is not set +CONFIG_X86_MCE_INJECT=m CONFIG_SFI=y @@ -369,6 +374,9 @@ CONFIG_LPC_ICH=m CONFIG_GPIO_ICH=m # CONFIG_GPIO_LYNXPOINT is not set +# CONFIG_GPIO_MCP23S08 is not set +# CONFIG_GPIO_F7188X is not set + CONFIG_PCI_CNB20LE_QUIRK=y @@ -383,6 +391,7 @@ CONFIG_F71808E_WDT=m CONFIG_HPWDT_NMI_DECODING=y # CONFIG_MFD_TPS6586X is not set # CONFIG_INTEL_MID_DMAC is not set +# CONFIG_GPIO_INTEL_MID is not set CONFIG_PCH_DMA=m CONFIG_INTEL_IPS=m # CONFIG_IBM_RTL is not set @@ -405,11 +414,9 @@ CONFIG_HP_ACCEL=m # CONFIG_RAPIDIO is not set -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_MCP23S08 is not set - CONFIG_SCHED_SMT=y CONFIG_CC_STACKPROTECTOR=y +CONFIG_CC_STACKPROTECTOR_STRONG=y CONFIG_RELOCATABLE=y CONFIG_HYPERV=m @@ -418,6 +425,8 @@ CONFIG_HID_HYPERV_MOUSE=m CONFIG_HYPERV_NET=m CONFIG_HYPERV_STORAGE=m CONFIG_HYPERV_BALLOON=m +CONFIG_FB_HYPERV=m +CONFIG_HYPERV_KEYBOARD=m # Depends on HOTPLUG_PCI_PCIE CONFIG_BLK_DEV_PCIESSD_MTIP32XX=m @@ -429,14 +438,22 @@ CONFIG_DRM_GMA3600=y CONFIG_RCU_FANOUT_LEAF=16 CONFIG_INTEL_MEI=m -CONFIG_INTEL_MEI_ME=y +CONFIG_INTEL_MEI_ME=m + +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 -# CONFIG_X86_INTEL_LPSS is not set +CONFIG_X86_INTEL_LPSS=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_BAYTRAIL=y # CONFIG_INTEL_POWERCLAMP is not set +CONFIG_X86_PKG_TEMP_THERMAL=m +CONFIG_ACPI_INT3403_THERMAL=m CONFIG_VMWARE_VMCI=m CONFIG_VMWARE_VMCI_VSOCKETS=m @@ -444,16 +461,19 @@ CONFIG_VMWARE_VMCI_VSOCKETS=m CONFIG_XZ_DEC_X86=y CONFIG_MPILIB=y -CONFIG_PKCS7_MESSAGE_PARSER=y -CONFIG_PE_FILE_PARSER=y +CONFIG_SYSTEM_TRUSTED_KEYRING=y +CONFIG_SYSTEM_BLACKLIST_KEYRING=y CONFIG_MODULE_SIG=y CONFIG_MODULE_SIG_ALL=y # CONFIG_MODULE_SIG_SHA1 is not set CONFIG_MODULE_SIG_SHA256=y # CONFIG_MODULE_SIG_FORCE is not set -CONFIG_SYSTEM_BLACKLIST_KEYRING=y +CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE=y +CONFIG_EFI_SIGNATURE_LIST_PARSER=y CONFIG_MODULE_SIG_UEFI=y CONFIG_VMXNET3=m CONFIG_VFIO_PCI_VGA=y + +# CONFIG_NTB is not set diff --git a/config-x86_64-generic b/config-x86_64-generic index 64e5c332a..02883b84b 100644 --- a/config-x86_64-generic +++ b/config-x86_64-generic @@ -6,7 +6,8 @@ CONFIG_64BIT=y CONFIG_GENERIC_CPU=y # CONFIG_X86_VSMP is not set -# CONFIG_X86_UV is not set +CONFIG_X86_UV=y +CONFIG_UV_MMTIMER=m CONFIG_NUMA=y CONFIG_K8_NUMA=y CONFIG_AMD_NUMA=y @@ -16,8 +17,13 @@ CONFIG_X86_64_ACPI_NUMA=y CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_NUMA_BALANCING=y -CONFIG_NR_CPUS=128 +# https://lists.fedoraproject.org/pipermail/kernel/2013-November/004601.html +CONFIG_NR_CPUS=1024 CONFIG_PHYSICAL_START=0x1000000 +CONFIG_PHYSICAL_ALIGN=0x1000000 + +# https://lists.fedoraproject.org/pipermail/kernel/2013-December/004753.html +CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 CONFIG_IA32_EMULATION=y # CONFIG_IA32_AOUT is not set @@ -28,16 +34,22 @@ CONFIG_AMD_IOMMU_V2=m # CONFIG_IOMMU_DEBUG is not set CONFIG_SWIOTLB=y # CONFIG_CALGARY_IOMMU is not set +# CONFIG_GART_IOMMU is not set CONFIG_TRANSPARENT_HUGEPAGE=y +CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y +CONFIG_CGROUP_HUGETLB=y +CONFIG_MEM_SOFT_DIRTY=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 +CONFIG_INTEL_MIC_HOST=m +CONFIG_INTEL_MIC_CARD=m + # SHPC has half-arsed PCI probing, which makes it load on too many systems CONFIG_HOTPLUG_PCI_SHPC=m @@ -47,14 +59,21 @@ 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_CRCT10DIF_PCLMUL=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 @@ -75,7 +94,8 @@ CONFIG_HAVE_MEMORY_PRESENT=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPARSEMEM_VMEMMAP=y # CONFIG_MOVABLE_NODE is not set -# CONFIG_MEMORY_HOTPLUG is not set +CONFIG_MEMORY_HOTPLUG=y +# CONFIG_ARCH_MEMORY_PROBE is not set # CONFIG_MEMORY_HOTREMOVE is not set # CONFIG_BLK_DEV_CMD640 is not set @@ -98,6 +118,7 @@ CONFIG_XEN_DEV_EVTCHN=m CONFIG_XEN_SYS_HYPERVISOR=y # CONFIG_XEN_MCE_LOG is not set # CONFIG_XEN_STUB is not set +# CONFIG_XEN_PVH is not set CONFIG_PROVIDE_OHCI1394_DMA_INIT=y @@ -136,3 +157,19 @@ CONFIG_CHECKPOINT_RESTORE=y CONFIG_NTB=m CONFIG_NTB_NETDEV=m + +# 10GigE +# +CONFIG_IP1000=m +CONFIG_MLX4_EN=m +CONFIG_MLX4_EN_DCB=y +# CONFIG_MLX4_DEBUG is not set +CONFIG_SFC=m +CONFIG_SFC_MCDI_MON=y +CONFIG_SFC_SRIOV=y +CONFIG_SFC_PTP=y +CONFIG_SFC_MTD=y +# Override MTD stuff because SFC_MTD needs it +CONFIG_MTD_CHAR=m +CONFIG_MTD_BLOCK=m + diff --git a/crash-driver.patch b/crash-driver.patch index 239f0f6a0..31e2b329c 100644 --- a/crash-driver.patch +++ b/crash-driver.patch @@ -1,24 +1,58 @@ -From f72d640713d01b3b704c6e84ab49b62f19fc9c22 Mon Sep 17 00:00:00 2001 -From: Kyle McMartin -Date: Tue, 30 Mar 2010 00:16:25 -0400 -Subject: [PATCH] dev-crash-driver.patch +From 1786bc697d34af944e29437ce44337b0eb8b6799 Mon Sep 17 00:00:00 2001 +From: Kyle McMartin +Date: Tue, 26 Nov 2013 12:42:46 -0500 +Subject: [PATCH] crash-driver --- - arch/ia64/include/asm/crash.h | 90 +++++++++++++++++++++++++++++ - arch/ia64/kernel/ia64_ksyms.c | 3 + - arch/x86/include/asm/crash.h | 75 ++++++++++++++++++++++++ - arch/x86/mm/ioremap.c | 2 + - drivers/char/Kconfig | 3 + - drivers/char/Makefile | 2 + - drivers/char/crash.c | 128 +++++++++++++++++++++++++++++++++++++++++ - 7 files changed, 303 insertions(+), 0 deletions(-) + arch/arm/include/asm/crash.h | 6 ++ + arch/arm64/include/asm/crash.h | 6 ++ + arch/ia64/include/asm/crash.h | 90 +++++++++++++++++++++++++++ + arch/ia64/kernel/ia64_ksyms.c | 3 + + arch/powerpc/include/asm/crash.h | 6 ++ + arch/s390/include/asm/crash.h | 60 ++++++++++++++++++ + arch/s390/mm/maccess.c | 2 + + arch/x86/include/asm/crash.h | 6 ++ + drivers/char/Kconfig | 3 + + drivers/char/Makefile | 2 + + drivers/char/crash.c | 128 +++++++++++++++++++++++++++++++++++++++ + include/asm-generic/crash.h | 72 ++++++++++++++++++++++ + 12 files changed, 384 insertions(+) + create mode 100644 arch/arm/include/asm/crash.h + create mode 100644 arch/arm64/include/asm/crash.h create mode 100644 arch/ia64/include/asm/crash.h + create mode 100644 arch/powerpc/include/asm/crash.h + create mode 100644 arch/s390/include/asm/crash.h create mode 100644 arch/x86/include/asm/crash.h create mode 100644 drivers/char/crash.c + create mode 100644 include/asm-generic/crash.h +diff --git a/arch/arm/include/asm/crash.h b/arch/arm/include/asm/crash.h +new file mode 100644 +index 0000000..1d2e537 +--- /dev/null ++++ b/arch/arm/include/asm/crash.h +@@ -0,0 +1,6 @@ ++#ifndef _ARM_CRASH_H ++#define _ARM_CRASH_H ++ ++#include ++ ++#endif /* _ARM_CRASH_H */ +diff --git a/arch/arm64/include/asm/crash.h b/arch/arm64/include/asm/crash.h +new file mode 100644 +index 0000000..a7fcc28 +--- /dev/null ++++ b/arch/arm64/include/asm/crash.h +@@ -0,0 +1,6 @@ ++#ifndef _ARM64_CRASH_H ++#define _ARM64_CRASH_H ++ ++#include ++ ++#endif /* _ARM64_CRASH_H */ diff --git a/arch/ia64/include/asm/crash.h b/arch/ia64/include/asm/crash.h new file mode 100644 -index 0000000..541af84 +index 0000000..28bd955 --- /dev/null +++ b/arch/ia64/include/asm/crash.h @@ -0,0 +1,90 @@ @@ -68,7 +102,7 @@ index 0000000..541af84 + return NULL; + } + -+ switch (type = efi_mem_type(offset)) ++ switch (type = efi_mem_type(offset)) + { + case EFI_LOADER_CODE: + case EFI_LOADER_DATA: @@ -79,7 +113,7 @@ index 0000000..541af84 + + default: + printk(KERN_INFO -+ "crash memory driver: invalid memory type for %lx: %d\n", ++ "crash memory driver: invalid memory type for %lx: %d\n", + offset, type); + return NULL; + } @@ -96,7 +130,7 @@ index 0000000..541af84 + + if (!page->virtual) { + printk(KERN_INFO -+ "crash memory driver: offset: %lx page: %lx page->virtual: NULL\n", ++ "crash memory driver: offset: %lx page: %lx page->virtual: NULL\n", + offset, (unsigned long)page); + return NULL; + } @@ -104,8 +138,8 @@ index 0000000..541af84 + return (page->virtual + (offset & (PAGE_SIZE-1))); +} + -+static inline void unmap_virtual(struct page *page) -+{ ++static inline void unmap_virtual(struct page *page) ++{ + return; +} + @@ -113,7 +147,7 @@ index 0000000..541af84 + +#endif /* _ASM_IA64_CRASH_H */ diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c -index 7f4a0ed..552fe24 100644 +index 5b7791d..aee4b87 100644 --- a/arch/ia64/kernel/ia64_ksyms.c +++ b/arch/ia64/kernel/ia64_ksyms.c @@ -84,6 +84,9 @@ EXPORT_SYMBOL(ia64_save_scratch_fpregs); @@ -126,52 +160,47 @@ index 7f4a0ed..552fe24 100644 #if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE) extern void esi_call_phys (void); EXPORT_SYMBOL_GPL(esi_call_phys); -diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h +diff --git a/arch/powerpc/include/asm/crash.h b/arch/powerpc/include/asm/crash.h new file mode 100644 -index 0000000..dfcc006 +index 0000000..daa8c4d --- /dev/null -+++ b/arch/x86/include/asm/crash.h -@@ -0,0 +1,75 @@ -+#ifndef _ASM_I386_CRASH_H -+#define _ASM_I386_CRASH_H ++++ b/arch/powerpc/include/asm/crash.h +@@ -0,0 +1,6 @@ ++#ifndef _PPC64_CRASH_H ++#define _PPC64_CRASH_H + -+/* -+ * linux/include/asm-i386/crash.h -+ * -+ * Copyright (c) 2004 Red Hat, Inc. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ ++#include ++ ++#endif /* _PPC64_CRASH_H */ +diff --git a/arch/s390/include/asm/crash.h b/arch/s390/include/asm/crash.h +new file mode 100644 +index 0000000..552be5e +--- /dev/null ++++ b/arch/s390/include/asm/crash.h +@@ -0,0 +1,60 @@ ++#ifndef _S390_CRASH_H ++#define _S390_CRASH_H + +#ifdef __KERNEL__ + +#include +#include -+#include + -+extern int page_is_ram(unsigned long); -+ -+static inline void * -+map_virtual(u64 offset, struct page **pp) ++/* ++ * For swapped prefix pages get bounce buffer using xlate_dev_mem_ptr() ++ */ ++static inline void *map_virtual(u64 offset, struct page **pp) +{ + struct page *page; + unsigned long pfn; + void *vaddr; + -+ pfn = (unsigned long)(offset >> PAGE_SHIFT); ++ vaddr = xlate_dev_mem_ptr(offset); ++ pfn = ((unsigned long) vaddr) >> PAGE_SHIFT; ++ if ((unsigned long) vaddr != offset) ++ page = pfn_to_page(pfn); ++ else ++ page = NULL; + + if (!page_is_ram(pfn)) { + printk(KERN_INFO @@ -185,43 +214,61 @@ index 0000000..dfcc006 + return NULL; + } + -+ page = pfn_to_page(pfn); -+ -+ vaddr = kmap(page); -+ if (!vaddr) { -+ printk(KERN_INFO -+ "crash memory driver: pfn: %lx kmap(page: %lx) failed\n", -+ pfn, (unsigned long)page); -+ return NULL; -+ } -+ + *pp = page; -+ return (vaddr + (offset & (PAGE_SIZE-1))); ++ return vaddr; +} + -+static inline void unmap_virtual(struct page *page) -+{ -+ kunmap(page); ++/* ++ * Free bounce buffer if necessary ++ */ ++static inline void unmap_virtual(struct page *page) ++{ ++ void *vaddr; ++ ++ if (page) { ++ /* ++ * Because for bounce buffers vaddr will never be 0 ++ * unxlate_dev_mem_ptr() will always free the bounce buffer. ++ */ ++ vaddr = (void *)(page_to_pfn(page) << PAGE_SHIFT); ++ unxlate_dev_mem_ptr(0, vaddr); ++ } +} + +#endif /* __KERNEL__ */ + -+#endif /* _ASM_I386_CRASH_H */ -diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c -index be1ef57..ac659f7 100644 ---- a/arch/x86/mm/ioremap.c -+++ b/arch/x86/mm/ioremap.c -@@ -24,6 +24,8 @@ ++#endif /* _S390_CRASH_H */ +diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c +index d1e0e0c..a2be459 100644 +--- a/arch/s390/mm/maccess.c ++++ b/arch/s390/mm/maccess.c +@@ -219,6 +219,7 @@ void *xlate_dev_mem_ptr(unsigned long addr) + put_online_cpus(); + return bounce; + } ++EXPORT_SYMBOL_GPL(xlate_dev_mem_ptr); - #include "physaddr.h" - -+EXPORT_SYMBOL_GPL(page_is_ram); -+ /* - * Fix up the linear direct mapping of the kernel to avoid cache attribute - * conflicts. + * Free converted buffer for /dev/mem access (if necessary) +@@ -228,3 +229,4 @@ void unxlate_dev_mem_ptr(unsigned long addr, void *buf) + if ((void *) addr != buf) + free_page((unsigned long) buf); + } ++EXPORT_SYMBOL_GPL(unxlate_dev_mem_ptr); +diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h +new file mode 100644 +index 0000000..27a4156 +--- /dev/null ++++ b/arch/x86/include/asm/crash.h +@@ -0,0 +1,6 @@ ++#ifndef _X86_CRASH_H ++#define _X86_CRASH_H ++ ++#include ++ ++#endif /* _X86_CRASH_H */ diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index 423fd56..e04a561 100644 +index fa3243d..83643e5b 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -4,6 +4,9 @@ @@ -235,10 +282,10 @@ index 423fd56..e04a561 100644 config DEVKMEM diff --git a/drivers/char/Makefile b/drivers/char/Makefile -index 32762ba..3d5d525 100644 +index 7ff1d0d..3ed67af 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile -@@ -65,3 +65,5 @@ obj-$(CONFIG_JS_RTC) += js-rtc.o +@@ -62,3 +62,5 @@ obj-$(CONFIG_JS_RTC) += js-rtc.o js-rtc-y = rtc.o obj-$(CONFIG_TILE_SROM) += tile-srom.o @@ -246,7 +293,7 @@ index 32762ba..3d5d525 100644 +obj-$(CONFIG_CRASH) += crash.o diff --git a/drivers/char/crash.c b/drivers/char/crash.c new file mode 100644 -index 0000000..e5437de +index 0000000..a142bb3 --- /dev/null +++ b/drivers/char/crash.c @@ -0,0 +1,128 @@ @@ -291,7 +338,7 @@ index 0000000..e5437de + * access to physical memory. + */ + -+static loff_t ++static loff_t +crash_llseek(struct file * file, loff_t offset, int orig) +{ + switch (orig) { @@ -307,7 +354,7 @@ index 0000000..e5437de +} + +/* -+ * Determine the page address for an address offset value, ++ * Determine the page address for an address offset value, + * get a virtual address for it, and copy it out. + * Accesses must fit within a page. + */ @@ -320,7 +367,7 @@ index 0000000..e5437de + ssize_t read; + + offset = *poff; -+ if (offset >> PAGE_SHIFT != (offset+count-1) >> PAGE_SHIFT) ++ if (offset >> PAGE_SHIFT != (offset+count-1) >> PAGE_SHIFT) + return -EINVAL; + + vaddr = map_virtual(offset, &page); @@ -357,11 +404,11 @@ index 0000000..e5437de + + ret = misc_register(&crash_dev); + if (ret) { -+ printk(KERN_ERR ++ printk(KERN_ERR + "crash memory driver: cannot misc_register (MISC_DYNAMIC_MINOR)\n"); + goto out; + } -+ ++ + ret = 0; + printk(KERN_INFO "crash memory driver: version %s\n", CRASH_VERSION); +out: @@ -378,6 +425,84 @@ index 0000000..e5437de +module_exit(crash_cleanup_module); + +MODULE_LICENSE("GPL"); +diff --git a/include/asm-generic/crash.h b/include/asm-generic/crash.h +new file mode 100644 +index 0000000..8a0a69a +--- /dev/null ++++ b/include/asm-generic/crash.h +@@ -0,0 +1,72 @@ ++#ifndef __CRASH_H__ ++#define __CRASH_H__ ++ ++/* ++ * include/linux/crash.h ++ * ++ * Copyright (c) 2013 Red Hat, Inc. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ */ ++ ++#ifdef __KERNEL__ ++ ++#include ++#include ++ ++static inline void * ++map_virtual(u64 offset, struct page **pp) ++{ ++ struct page *page; ++ unsigned long pfn; ++ void *vaddr; ++ ++ pfn = (unsigned long)(offset >> PAGE_SHIFT); ++ ++ if (!page_is_ram(pfn)) { ++ printk(KERN_INFO ++ "crash memory driver: !page_is_ram(pfn: %lx)\n", pfn); ++ return NULL; ++ } ++ ++ if (!pfn_valid(pfn)) { ++ printk(KERN_INFO ++ "crash memory driver: invalid pfn: %lx )\n", pfn); ++ return NULL; ++ } ++ ++ page = pfn_to_page(pfn); ++ ++ vaddr = kmap(page); ++ if (!vaddr) { ++ printk(KERN_INFO ++ "crash memory driver: pfn: %lx kmap(page: %lx) failed\n", ++ pfn, (unsigned long)page); ++ return NULL; ++ } ++ ++ *pp = page; ++ return (vaddr + (offset & (PAGE_SIZE-1))); ++} ++ ++static inline void unmap_virtual(struct page *page) ++{ ++ kunmap(page); ++} ++ ++#endif /* __KERNEL__ */ ++ ++#endif /* __CRASH_H__ */ -- -1.7.6 +1.8.3.1 diff --git a/devel-pekey-secure-boot-20130306.patch b/devel-pekey-secure-boot-20130502.patch similarity index 95% rename from devel-pekey-secure-boot-20130306.patch rename to devel-pekey-secure-boot-20130502.patch index 85bcec738..5641902f7 100644 --- a/devel-pekey-secure-boot-20130306.patch +++ b/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 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 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 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 @@ -249,14 +249,14 @@ index 2b6e699..0000000 - -struct key *modsign_keyring; - --extern __initdata const u8 modsign_certificate_list[]; --extern __initdata const u8 modsign_certificate_list_end[]; +-extern __initconst const u8 modsign_certificate_list[]; +-extern __initconst const u8 modsign_certificate_list_end[]; - -/* - * We need to make sure ccache doesn't cache the .o file as it doesn't notice - * if modsign.pub changes. - */ --static __initdata const char annoy_ccache[] = __TIME__ "foo"; +-static __initconst const char annoy_ccache[] = __TIME__ "foo"; - -/* - * Load the compiled-in keys @@ -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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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,15 +4664,15 @@ 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) - memset(&boot_params->olpc_ofw_header, 0, +@@ -38,9 +38,13 @@ static void sanitize_boot_params(struct boot_params *boot_params) + memset(&boot_params->ext_ramdisk_image, 0, (char *)&boot_params->efi_info - - (char *)&boot_params->olpc_ofw_header); + (char *)&boot_params->ext_ramdisk_image); - memset(&boot_params->kbd_status, 0, + memset(&boot_params->kbd_status, 0, sizeof(boot_params->kbd_status)); + /* don't clear boot_params->secure_boot. we set that ourselves @@ -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 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 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 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 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 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 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 +#include +#include +#include +#include ++#include +#include +#include +#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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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/drm-fix-qxl-mode-flags-backport.patch b/drm-fix-qxl-mode-flags-backport.patch new file mode 100644 index 000000000..e8885ff6a --- /dev/null +++ b/drm-fix-qxl-mode-flags-backport.patch @@ -0,0 +1,119 @@ +Bugzilla: 1060327 +Upstream-status: Queued for 3.16 + +diff -up linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_crtc_helper.c.dma linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_crtc_helper.c +--- linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_crtc_helper.c.dma 2014-03-31 13:40:15.000000000 +1000 ++++ linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_crtc_helper.c 2014-05-01 10:27:07.410210002 +1000 +@@ -120,8 +120,8 @@ static void drm_mode_validate_flag(struc + * RETURNS: + * Number of modes found on @connector. + */ +-int drm_helper_probe_single_connector_modes(struct drm_connector *connector, +- uint32_t maxX, uint32_t maxY) ++static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connector *connector, ++ uint32_t maxX, uint32_t maxY, bool merge_type_bits) + { + struct drm_device *dev = connector->dev; + struct drm_display_mode *mode; +@@ -173,7 +173,7 @@ int drm_helper_probe_single_connector_mo + if (count == 0) + goto prune; + +- drm_mode_connector_list_update(connector); ++ drm_mode_connector_list_update(connector, merge_type_bits); + + if (maxX && maxY) + drm_mode_validate_size(dev, &connector->modes, maxX, +@@ -213,8 +213,21 @@ prune: + + return count; + } ++ ++int drm_helper_probe_single_connector_modes(struct drm_connector *connector, ++ uint32_t maxX, uint32_t maxY) ++{ ++ return drm_helper_probe_single_connector_modes_merge_bits(connector, maxX, maxY, true); ++} + EXPORT_SYMBOL(drm_helper_probe_single_connector_modes); + ++int drm_helper_probe_single_connector_modes_nomerge(struct drm_connector *connector, ++ uint32_t maxX, uint32_t maxY) ++{ ++ return drm_helper_probe_single_connector_modes_merge_bits(connector, maxX, maxY, false); ++} ++EXPORT_SYMBOL(drm_helper_probe_single_connector_modes_nomerge); ++ + /** + * drm_helper_encoder_in_use - check if a given encoder is in use + * @encoder: encoder to check +diff -up linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_modes.c.dma linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_modes.c +--- linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_modes.c.dma 2014-03-31 13:40:15.000000000 +1000 ++++ linux-3.14.2-200.fc20.i686/drivers/gpu/drm/drm_modes.c 2014-05-01 10:27:59.015207267 +1000 +@@ -1025,7 +1025,7 @@ EXPORT_SYMBOL(drm_mode_sort); + * list and only adds different modes. All modes unverified after this point + * will be removed by the prune invalid modes. + */ +-void drm_mode_connector_list_update(struct drm_connector *connector) ++void drm_mode_connector_list_update(struct drm_connector *connector, bool merge_type_bits) + { + struct drm_display_mode *mode; + struct drm_display_mode *pmode, *pt; +@@ -1041,7 +1041,10 @@ void drm_mode_connector_list_update(stru + /* if equal delete the probed mode */ + mode->status = pmode->status; + /* Merge type bits together */ +- mode->type |= pmode->type; ++ if (merge_type_bits) ++ mode->type |= pmode->type; ++ else ++ mode->type = pmode->type; + list_del(&pmode->head); + drm_mode_destroy(connector->dev, pmode); + break; +diff -up linux-3.14.2-200.fc20.i686/drivers/gpu/drm/qxl/qxl_display.c.dma linux-3.14.2-200.fc20.i686/drivers/gpu/drm/qxl/qxl_display.c +--- linux-3.14.2-200.fc20.i686/drivers/gpu/drm/qxl/qxl_display.c.dma 2014-03-31 13:40:15.000000000 +1000 ++++ linux-3.14.2-200.fc20.i686/drivers/gpu/drm/qxl/qxl_display.c 2014-05-01 10:27:07.411210001 +1000 +@@ -841,7 +841,7 @@ static const struct drm_connector_funcs + .save = qxl_conn_save, + .restore = qxl_conn_restore, + .detect = qxl_conn_detect, +- .fill_modes = drm_helper_probe_single_connector_modes, ++ .fill_modes = drm_helper_probe_single_connector_modes_nomerge, + .set_property = qxl_conn_set_property, + .destroy = qxl_conn_destroy, + }; +diff -up linux-3.14.2-200.fc20.i686/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c.dma linux-3.14.2-200.fc20.i686/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +--- linux-3.14.2-200.fc20.i686/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c.dma 2014-03-31 13:40:15.000000000 +1000 ++++ linux-3.14.2-200.fc20.i686/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c 2014-05-01 10:27:07.411210001 +1000 +@@ -2003,7 +2003,7 @@ int vmw_du_connector_fill_modes(struct d + if (du->pref_mode) + list_move(&du->pref_mode->head, &connector->probed_modes); + +- drm_mode_connector_list_update(connector); ++ drm_mode_connector_list_update(connector, true); + + return 1; + } +diff -up linux-3.14.2-200.fc20.i686/include/drm/drm_crtc.h.dma linux-3.14.2-200.fc20.i686/include/drm/drm_crtc.h +--- linux-3.14.2-200.fc20.i686/include/drm/drm_crtc.h.dma 2014-03-31 13:40:15.000000000 +1000 ++++ linux-3.14.2-200.fc20.i686/include/drm/drm_crtc.h 2014-05-01 10:27:07.412210001 +1000 +@@ -1033,7 +1033,7 @@ extern int drm_mode_hsync(const struct d + extern int drm_mode_vrefresh(const struct drm_display_mode *mode); + extern void drm_mode_set_crtcinfo(struct drm_display_mode *p, + int adjust_flags); +-extern void drm_mode_connector_list_update(struct drm_connector *connector); ++extern void drm_mode_connector_list_update(struct drm_connector *connector, bool merge_type_bits); + extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, + struct edid *edid); + extern int drm_object_property_set_value(struct drm_mode_object *obj, +diff -up linux-3.14.2-200.fc20.i686/include/drm/drm_crtc_helper.h.dma linux-3.14.2-200.fc20.i686/include/drm/drm_crtc_helper.h +--- linux-3.14.2-200.fc20.i686/include/drm/drm_crtc_helper.h.dma 2014-03-31 13:40:15.000000000 +1000 ++++ linux-3.14.2-200.fc20.i686/include/drm/drm_crtc_helper.h 2014-05-01 10:27:07.412210001 +1000 +@@ -126,6 +126,7 @@ struct drm_connector_helper_funcs { + }; + + extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY); ++extern int drm_helper_probe_single_connector_modes_nomerge(struct drm_connector *connector, uint32_t maxX, uint32_t maxY); + extern void drm_helper_disable_unused_functions(struct drm_device *dev); + extern int drm_crtc_helper_set_config(struct drm_mode_set *set); + extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, diff --git a/drm-i915-dp-stfu.patch b/drm-i915-dp-stfu.patch deleted file mode 100644 index 78fb5fe60..000000000 --- a/drm-i915-dp-stfu.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c -index f61cb79..64a24c0 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; - 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, - } - - if (try == 3) { -- WARN(1, "dp_aux_ch not started status 0x%08x\n", -+ DRM_ERROR("dp_aux_ch not started status 0x%08x\n", - I915_READ(ch_ctl)); - ret = -EBUSY; - goto out; -@@ -1083,8 +1083,8 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp) - return; - DRM_DEBUG_KMS("Turn eDP VDD on\n"); - -- WARN(intel_dp->want_panel_vdd, -- "eDP VDD already requested on\n"); -+ if (intel_dp->want_panel_vdd) -+ DRM_ERROR("eDP VDD already requested on\n"); - - intel_dp->want_panel_vdd = true; - -@@ -1151,7 +1151,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); -- WARN(!intel_dp->want_panel_vdd, "eDP VDD not forced on"); -+ if (!intel_dp->want_panel_vdd) -+ DRM_ERROR("eDP VDD not forced on"); - - intel_dp->want_panel_vdd = false; - -@@ -1221,7 +1222,8 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp) - - DRM_DEBUG_KMS("Turn eDP power off\n"); - -- WARN(!intel_dp->want_panel_vdd, "Need VDD to turn off panel\n"); -+ if (!intel_dp->want_panel_vdd) -+ DRM_ERROR("Need VDD to turn off panel\n"); - - pp = ironlake_get_pp_control(dev_priv); - /* We need to switch off panel power _and_ force vdd, for otherwise some diff --git a/drm-i915-hush-check-crtc-state.patch b/drm-i915-hush-check-crtc-state.patch new file mode 100644 index 000000000..295cad7b7 --- /dev/null +++ b/drm-i915-hush-check-crtc-state.patch @@ -0,0 +1,20 @@ +Bugzilla: 1027037 1028785 +Upstream-status: http://lists.freedesktop.org/archives/intel-gfx/2013-November/035948.html + +This is _by far_ the most common backtrace for i915 on retrace.fp.o, and +it's mostly useless noise. There's not enough context when it's generated +to know if something actually went wrong. Downgrade the message to +KMS debugging so we can still get it if we want it. + +diff -up linux-3.13.0-0.rc0.git2.1.fc21.x86_64/drivers/gpu/drm/i915/intel_display.c.jx linux-3.13.0-0.rc0.git2.1.fc21.x86_64/drivers/gpu/drm/i915/intel_display.c +--- linux-3.13.0-0.rc0.git2.1.fc21.x86_64/drivers/gpu/drm/i915/intel_display.c.jx 2013-11-03 18:41:51.000000000 -0500 ++++ linux-3.13.0-0.rc0.git2.1.fc21.x86_64/drivers/gpu/drm/i915/intel_display.c 2013-11-13 10:12:05.781301624 -0500 +@@ -8803,7 +8803,7 @@ check_crtc_state(struct drm_device *dev) + + if (active && + !intel_pipe_config_compare(dev, &crtc->config, &pipe_config)) { +- WARN(1, "pipe state doesn't match!\n"); ++ DRM_DEBUG_KMS("pipe state doesn't match!\n"); + intel_dump_pipe_config(crtc, &pipe_config, + "[hw state]"); + intel_dump_pipe_config(crtc, &crtc->config, diff --git a/drm-qxl-driver.patch b/drm-qxl-driver.patch deleted file mode 100644 index 7514234b9..000000000 --- a/drm-qxl-driver.patch +++ /dev/null @@ -1,7411 +0,0 @@ -From 4a4f7a19b0145c28b4d62339433c733c00de3558 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Mon, 25 Feb 2013 14:47:55 +1000 -Subject: [PATCH 2/2] drm: add new QXL driver. (v1.2) - -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 - -Signed-off-by: Alon Levy -Signed-off-by: Dave Airlie ---- - 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 | 711 +++++++++++++++++++++++++++ - 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 | 378 +++++++++++++++ - drivers/gpu/drm/qxl/qxl_drv.c | 132 +++++ - drivers/gpu/drm/qxl/qxl_drv.h | 566 ++++++++++++++++++++++ - drivers/gpu/drm/qxl/qxl_dumb.c | 76 +++ - 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 | 300 ++++++++++++ - 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 | 580 ++++++++++++++++++++++ - include/uapi/drm/Kbuild | 1 + - include/uapi/drm/qxl_drm.h | 152 ++++++ - 25 files changed, 7167 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..a860d71 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_cmd.c -@@ -0,0 +1,711 @@ -+/* -+ * 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, -+ 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; -+ -+ 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) { -+ 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); -+} -+ -+void qxl_release_ring_flush(struct qxl_device *qdev) -+{ -+ if (!qxl_check_header(qdev->release_ring)) -+ return; -+ qxl_io_flush_release(qdev); -+} -+ -+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 -+ * -+ * 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 -+ */ -+ -+#include -+ -+#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 -+ -+/* -+ * 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..c35c715 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_draw.c -@@ -0,0 +1,378 @@ -+/* -+ * 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_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 = bo->kptr; -+ 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_image_create(qdev, release, &image_bo, surface_base, -+ left, top, width, height, depth, stride); -+ 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..2aad724 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_drv.c -@@ -0,0 +1,132 @@ -+/* 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 -+ * Alon Levy -+ */ -+ -+#include -+ -+#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); -+ -+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) -+{ -+ 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..4eb4638 ---- /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 -+#include -+#include -+ -+#include "drmP.h" -+#include "drm_crtc.h" -+#include -+#include -+#include -+#include -+ -+#include -+#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, -+ 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); -+void qxl_release_ring_flush(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..6b653d3 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_dumb.c -@@ -0,0 +1,76 @@ -+/* -+ * 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; -+ -+ args->pitch = args->width * ((args->bpp + 1) / 8); -+ args->size = args->pitch * args->height; -+ args->size = ALIGN(args->size, PAGE_SIZE); -+ -+ r = qxl_gem_object_create_with_handle(qdev, file_priv, -+ QXL_GEM_DOMAIN_VRAM, -+ args->size, NULL, &qobj, -+ &handle); -+ if (r) -+ return r; -+ 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 -+#include -+ -+#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 -+#include -+ -+#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..a7bd677 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_kms.c -@@ -0,0 +1,300 @@ -+/* -+ * 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 -+ -+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, -+ &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, -+ &qdev->cursor_event); -+ -+ qdev->release_ring = qxl_ring_create( -+ &(qdev->ram_header->release_ring_hdr), -+ sizeof(uint64_t), -+ QXL_RELEASE_RING_SIZE, 0, -+ 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 -+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..5a6e772 ---- /dev/null -+++ b/drivers/gpu/drm/qxl/qxl_ttm.c -@@ -0,0 +1,580 @@ -+/* -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "qxl_drv.h" -+#include "qxl_object.h" -+ -+#include -+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); -+ } -+ -+ qxl_release_ring_flush(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; -+ -+ qxl_release_ring_flush(qfence->qdev); -+ } -+ -+ 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 -+#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/drm-ttm-exports-for-qxl.patch b/drm-ttm-exports-for-qxl.patch deleted file mode 100644 index 6134b5119..000000000 --- a/drm-ttm-exports-for-qxl.patch +++ /dev/null @@ -1,86 +0,0 @@ -From b538d2921b8aaaa1d7abf1bf0ba3ab9330b0b0c8 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -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 ---- - 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/e1000e-Failure-to-write-SHRA-turns-on-PROMISC-mode.patch b/e1000e-Failure-to-write-SHRA-turns-on-PROMISC-mode.patch new file mode 100644 index 000000000..1e51db493 --- /dev/null +++ b/e1000e-Failure-to-write-SHRA-turns-on-PROMISC-mode.patch @@ -0,0 +1,287 @@ +Bugzilla: 1064516 +Upstream-status: Sent for 3.16 + +From b3e5bf1ff32cbc58c56675498565020460c683cd Mon Sep 17 00:00:00 2001 +From: David Ertman +Date: Tue, 6 May 2014 03:50:17 +0000 +Subject: e1000e: Failure to write SHRA turns on PROMISC mode + +Previously, the check to turn on promiscuous mode only took into account +the total number of SHared Receive Address (SHRA) registers and if the +request was for a register within that range. It is possible that the +Management Engine might have locked a number of SHRA and not allowed a +new address to be written to the requested register. + +Add a function to determine the number of unlocked SHRA registers. Then +determine if the number of registers available is sufficient for our needs, +if not then return -ENOMEM so that UNICAST PROMISC mode is activated. + +Since the method by which ME claims SHRA registers is non-deterministic, +also add a return value to the function attempting to write an address +to a SHRA, and return a -E1000_ERR_CONFIG if the write fails. The error +will be passed up the function chain and allow the driver to also set +UNICAST PROMISC when this happens. + +Cc: Vlad Yasevich +Signed-off-by: Dave Ertman +Tested-by: Aaron Brown +Signed-off-by: Jeff Kirsher + +diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c +index a5f6b11..08f22f3 100644 +--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c ++++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c +@@ -1365,6 +1365,7 @@ static const struct e1000_mac_operations es2_mac_ops = { + .setup_led = e1000e_setup_led_generic, + .config_collision_dist = e1000e_config_collision_dist_generic, + .rar_set = e1000e_rar_set_generic, ++ .rar_get_count = e1000e_rar_get_count_generic, + }; + + static const struct e1000_phy_operations es2_phy_ops = { +diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c +index e0aa7f1..218481e 100644 +--- a/drivers/net/ethernet/intel/e1000e/82571.c ++++ b/drivers/net/ethernet/intel/e1000e/82571.c +@@ -1896,6 +1896,7 @@ static const struct e1000_mac_operations e82571_mac_ops = { + .config_collision_dist = e1000e_config_collision_dist_generic, + .read_mac_addr = e1000_read_mac_addr_82571, + .rar_set = e1000e_rar_set_generic, ++ .rar_get_count = e1000e_rar_get_count_generic, + }; + + static const struct e1000_phy_operations e82_phy_ops_igp = { +diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h +index 6b3de5f..72f5475 100644 +--- a/drivers/net/ethernet/intel/e1000e/hw.h ++++ b/drivers/net/ethernet/intel/e1000e/hw.h +@@ -469,8 +469,9 @@ struct e1000_mac_operations { + s32 (*setup_led)(struct e1000_hw *); + void (*write_vfta)(struct e1000_hw *, u32, u32); + void (*config_collision_dist)(struct e1000_hw *); +- void (*rar_set)(struct e1000_hw *, u8 *, u32); ++ int (*rar_set)(struct e1000_hw *, u8 *, u32); + s32 (*read_mac_addr)(struct e1000_hw *); ++ u32 (*rar_get_count)(struct e1000_hw *); + }; + + /* When to use various PHY register access functions: +diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c +index 5f55395..b75862d 100644 +--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c ++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c +@@ -139,8 +139,9 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); + static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); + static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); + static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); +-static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index); +-static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index); ++static int e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index); ++static int e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index); ++static u32 e1000_rar_get_count_pch_lpt(struct e1000_hw *hw); + static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); + static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); + static s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force); +@@ -704,6 +705,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) + mac->ops.rar_set = e1000_rar_set_pch_lpt; + mac->ops.setup_physical_interface = + e1000_setup_copper_link_pch_lpt; ++ mac->ops.rar_get_count = e1000_rar_get_count_pch_lpt; + } + + /* Enable PCS Lock-loss workaround for ICH8 */ +@@ -1668,7 +1670,7 @@ static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw) + * contain the MAC address but RAR[1-6] are reserved for manageability (ME). + * Use SHRA[0-3] in place of those reserved for ME. + **/ +-static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index) ++static int e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index) + { + u32 rar_low, rar_high; + +@@ -1690,7 +1692,7 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index) + e1e_flush(); + ew32(RAH(index), rar_high); + e1e_flush(); +- return; ++ return 0; + } + + /* RAR[1-6] are owned by manageability. Skip those and program the +@@ -1713,7 +1715,7 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index) + /* verify the register updates */ + if ((er32(SHRAL(index - 1)) == rar_low) && + (er32(SHRAH(index - 1)) == rar_high)) +- return; ++ return 0; + + e_dbg("SHRA[%d] might be locked by ME - FWSM=0x%8.8x\n", + (index - 1), er32(FWSM)); +@@ -1721,6 +1723,43 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index) + + out: + e_dbg("Failed to write receive address at index %d\n", index); ++ return -E1000_ERR_CONFIG; ++} ++ ++/** ++ * e1000_rar_get_count_pch_lpt - Get the number of available SHRA ++ * @hw: pointer to the HW structure ++ * ++ * Get the number of available receive registers that the Host can ++ * program. SHRA[0-10] are the shared receive address registers ++ * that are shared between the Host and manageability engine (ME). ++ * ME can reserve any number of addresses and the host needs to be ++ * able to tell how many available registers it has access to. ++ **/ ++static u32 e1000_rar_get_count_pch_lpt(struct e1000_hw *hw) ++{ ++ u32 wlock_mac; ++ u32 num_entries; ++ ++ wlock_mac = er32(FWSM) & E1000_FWSM_WLOCK_MAC_MASK; ++ wlock_mac >>= E1000_FWSM_WLOCK_MAC_SHIFT; ++ ++ switch (wlock_mac) { ++ case 0: ++ /* All SHRA[0..10] and RAR[0] available */ ++ num_entries = hw->mac.rar_entry_count; ++ break; ++ case 1: ++ /* Only RAR[0] available */ ++ num_entries = 1; ++ break; ++ default: ++ /* SHRA[0..(wlock_mac - 1)] available + RAR[0] */ ++ num_entries = wlock_mac + 1; ++ break; ++ } ++ ++ return num_entries; + } + + /** +@@ -1734,7 +1773,7 @@ out: + * contain the MAC address. SHRA[0-10] are the shared receive address + * registers that are shared between the Host and manageability engine (ME). + **/ +-static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index) ++static int e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index) + { + u32 rar_low, rar_high; + u32 wlock_mac; +@@ -1756,7 +1795,7 @@ static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index) + e1e_flush(); + ew32(RAH(index), rar_high); + e1e_flush(); +- return; ++ return 0; + } + + /* The manageability engine (ME) can lock certain SHRAR registers that +@@ -1788,12 +1827,13 @@ static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index) + /* verify the register updates */ + if ((er32(SHRAL_PCH_LPT(index - 1)) == rar_low) && + (er32(SHRAH_PCH_LPT(index - 1)) == rar_high)) +- return; ++ return 0; + } + } + + out: + e_dbg("Failed to write receive address at index %d\n", index); ++ return -E1000_ERR_CONFIG; + } + + /** +@@ -4977,6 +5017,7 @@ static const struct e1000_mac_operations ich8_mac_ops = { + /* id_led_init dependent on mac type */ + .config_collision_dist = e1000e_config_collision_dist_generic, + .rar_set = e1000e_rar_set_generic, ++ .rar_get_count = e1000e_rar_get_count_generic, + }; + + static const struct e1000_phy_operations ich8_phy_ops = { +diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c +index baa0a46..8c386f3a 100644 +--- a/drivers/net/ethernet/intel/e1000e/mac.c ++++ b/drivers/net/ethernet/intel/e1000e/mac.c +@@ -211,6 +211,11 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) + return 0; + } + ++u32 e1000e_rar_get_count_generic(struct e1000_hw *hw) ++{ ++ return hw->mac.rar_entry_count; ++} ++ + /** + * e1000e_rar_set_generic - Set receive address register + * @hw: pointer to the HW structure +@@ -220,7 +225,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) + * Sets the receive address array register at index to the address passed + * in by addr. + **/ +-void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) ++int e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) + { + u32 rar_low, rar_high; + +@@ -244,6 +249,8 @@ void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) + e1e_flush(); + ew32(RAH(index), rar_high); + e1e_flush(); ++ ++ return 0; + } + + /** +diff --git a/drivers/net/ethernet/intel/e1000e/mac.h b/drivers/net/ethernet/intel/e1000e/mac.h +index 4e81c28..0513d90 100644 +--- a/drivers/net/ethernet/intel/e1000e/mac.h ++++ b/drivers/net/ethernet/intel/e1000e/mac.h +@@ -61,7 +61,8 @@ void e1000e_update_adaptive(struct e1000_hw *hw); + void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value); + + void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); +-void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); ++u32 e1000e_rar_get_count_generic(struct e1000_hw *hw); ++int e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); + void e1000e_config_collision_dist_generic(struct e1000_hw *hw); + + #endif +diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c +index e4207ef..6084e6b 100644 +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -3311,9 +3311,11 @@ static int e1000e_write_uc_addr_list(struct net_device *netdev) + { + struct e1000_adapter *adapter = netdev_priv(netdev); + struct e1000_hw *hw = &adapter->hw; +- unsigned int rar_entries = hw->mac.rar_entry_count; ++ unsigned int rar_entries; + int count = 0; + ++ rar_entries = hw->mac.ops.rar_get_count(hw); ++ + /* save a rar entry for our hardware address */ + rar_entries--; + +@@ -3332,9 +3334,13 @@ static int e1000e_write_uc_addr_list(struct net_device *netdev) + * combining + */ + netdev_for_each_uc_addr(ha, netdev) { ++ int rval; ++ + if (!rar_entries) + break; +- hw->mac.ops.rar_set(hw, ha->addr, rar_entries--); ++ rval = hw->mac.ops.rar_set(hw, ha->addr, rar_entries--); ++ if (rval < 0) ++ return -ENOMEM; + count++; + } + } +-- +cgit v0.10.1 + diff --git a/efi-dont-map-boot-services-on-32bit.patch b/efi-dont-map-boot-services-on-32bit.patch deleted file mode 100644 index 7cc614992..000000000 --- a/efi-dont-map-boot-services-on-32bit.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c -index 3ae4128..ff7dc70 100644 ---- a/arch/x86/platform/efi/efi.c -+++ b/arch/x86/platform/efi/efi.c -@@ -659,10 +659,13 @@ void __init efi_enter_virtual_mode(void) - - for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { - md = p; -- if (!(md->attribute & EFI_MEMORY_RUNTIME) && -- md->type != EFI_BOOT_SERVICES_CODE && -- md->type != EFI_BOOT_SERVICES_DATA) -- continue; -+ if (!(md->attribute & EFI_MEMORY_RUNTIME)) { -+#ifdef CONFIG_X86_64 -+ if (md->type != EFI_BOOT_SERVICES_CODE && -+ md->type != EFI_BOOT_SERVICES_DATA) -+#endif -+ continue; -+ } - - size = md->num_pages << EFI_PAGE_SHIFT; - end = md->phys_addr + size; diff --git a/fanotify-fix-EOVERFLOW-on-64-bit.patch b/fanotify-fix-EOVERFLOW-on-64-bit.patch new file mode 100644 index 000000000..11ba4e1cd --- /dev/null +++ b/fanotify-fix-EOVERFLOW-on-64-bit.patch @@ -0,0 +1,32 @@ +Bugzilla: 696821 +Upstream-status: Sent http://marc.info/?l=linux-kernel&m=139835974112096&w=2 + +On 64-bit systems, O_LARGEFILE is automatically added to flags inside +the open() syscall (also openat(), blkdev_open(), etc). +Userspace therefore defines O_LARGEFILE to be 0 - you can use it, +but it's a no-op. Everything should be O_LARGEFILE by default. + +But: when fanotify does create_fd() it uses dentry_open(), which skips +all that. And userspace can't set O_LARGEFILE in fanotify_init() because +it's defined to 0. So if fanotify gets an event regarding a large file, +the read() will just fail with -EOVERFLOW. + +This patch adds O_LARGEFILE to fanotify_init()'s event_f_flags on 64-bit +systems, using the same test as open()/openat()/etc. + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=696821 + +Acked-by: Eric Paris +Signed-off-by: Will Woods + +--- linux-3.14.1-200.fc20.x86_64/fs/notify/fanotify/fanotify_user.c.orig 2014-04-23 18:15:29.347644932 -0400 ++++ linux-3.14.1-200.fc20.x86_64/fs/notify/fanotify/fanotify_user.c 2014-04-23 18:17:44.249438484 -0400 +@@ -742,6 +742,8 @@ + oevent->path.mnt = NULL; + oevent->path.dentry = NULL; + ++ if (force_o_largefile()) ++ event_f_flags |= O_LARGEFILE; + group->fanotify_data.f_flags = event_f_flags; + #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS + oevent->response = 0; diff --git a/floppy-don-t-write-kernel-only-members-to-fdrawcmd-ioctl-output.patch b/floppy-don-t-write-kernel-only-members-to-fdrawcmd-ioctl-output.patch new file mode 100644 index 000000000..93fce3d43 --- /dev/null +++ b/floppy-don-t-write-kernel-only-members-to-fdrawcmd-ioctl-output.patch @@ -0,0 +1,38 @@ +Bugzilla: 1096195 +Upstream-status: 3.15 and queued for stable + +From 2145e15e0557a01b9195d1c7199a1b92cb9be81f Mon Sep 17 00:00:00 2001 +From: Matthew Daley +Date: Mon, 28 Apr 2014 19:05:21 +1200 +Subject: floppy: don't write kernel-only members to FDRAWCMD ioctl output + +From: Matthew Daley + +commit 2145e15e0557a01b9195d1c7199a1b92cb9be81f upstream. + +Do not leak kernel-only floppy_raw_cmd structure members to userspace. +This includes the linked-list pointer and the pointer to the allocated +DMA space. + +Signed-off-by: Matthew Daley +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/floppy.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/block/floppy.c ++++ b/drivers/block/floppy.c +@@ -3053,7 +3053,10 @@ static int raw_cmd_copyout(int cmd, void + int ret; + + while (ptr) { +- ret = copy_to_user(param, ptr, sizeof(*ptr)); ++ struct floppy_raw_cmd cmd = *ptr; ++ cmd.next = NULL; ++ cmd.kernel_data = NULL; ++ ret = copy_to_user(param, &cmd, sizeof(cmd)); + if (ret) + return -EFAULT; + param += sizeof(struct floppy_raw_cmd); diff --git a/floppy-ignore-kernel-only-members-in-fdrawcmd-ioctl-input.patch b/floppy-ignore-kernel-only-members-in-fdrawcmd-ioctl-input.patch new file mode 100644 index 000000000..712a9e069 --- /dev/null +++ b/floppy-ignore-kernel-only-members-in-fdrawcmd-ioctl-input.patch @@ -0,0 +1,48 @@ +Bugzilla: 1096195 +Upstream-status: 3.15 and queued for stable + +From ef87dbe7614341c2e7bfe8d32fcb7028cc97442c Mon Sep 17 00:00:00 2001 +From: Matthew Daley +Date: Mon, 28 Apr 2014 19:05:20 +1200 +Subject: floppy: ignore kernel-only members in FDRAWCMD ioctl input + +From: Matthew Daley + +commit ef87dbe7614341c2e7bfe8d32fcb7028cc97442c upstream. + +Always clear out these floppy_raw_cmd struct members after copying the +entire structure from userspace so that the in-kernel version is always +valid and never left in an interdeterminate state. + +Signed-off-by: Matthew Daley +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/floppy.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/block/floppy.c ++++ b/drivers/block/floppy.c +@@ -3107,10 +3107,11 @@ loop: + return -ENOMEM; + *rcmd = ptr; + ret = copy_from_user(ptr, param, sizeof(*ptr)); +- if (ret) +- return -EFAULT; + ptr->next = NULL; + ptr->buffer_length = 0; ++ ptr->kernel_data = NULL; ++ if (ret) ++ return -EFAULT; + param += sizeof(struct floppy_raw_cmd); + if (ptr->cmd_count > 33) + /* the command may now also take up the space +@@ -3126,7 +3127,6 @@ loop: + for (i = 0; i < 16; i++) + ptr->reply[i] = 0; + ptr->resultcode = 0; +- ptr->kernel_data = NULL; + + if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) { + if (ptr->length <= 0) diff --git a/fs-proc-devtree-remove_proc_entry.patch b/fs-proc-devtree-remove_proc_entry.patch deleted file mode 100644 index c32e79e6e..000000000 --- a/fs-proc-devtree-remove_proc_entry.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c -index 927cbd1..f060f28 100644 ---- a/fs/proc/proc_devtree.c -+++ b/fs/proc/proc_devtree.c -@@ -233,6 +233,7 @@ void __init proc_device_tree_init(void) - return; - root = of_find_node_by_path("/"); - if (root == NULL) { -+ remove_proc_entry("device-tree", NULL); - pr_debug("/proc/device-tree: can't find root\n"); - return; - } diff --git a/hamradio-yam-fix-info-leak-in-ioctl.patch b/hamradio-yam-fix-info-leak-in-ioctl.patch new file mode 100644 index 000000000..057acc5e9 --- /dev/null +++ b/hamradio-yam-fix-info-leak-in-ioctl.patch @@ -0,0 +1,36 @@ +Bugzilla: 1053647 +Upstream-status: 3.13 and 3.12.8 + +From foo@baz Mon Jan 13 09:44:41 PST 2014 +From: =?UTF-8?q?Salva=20Peir=C3=B3?= +Date: Tue, 17 Dec 2013 10:06:30 +0100 +Subject: hamradio/yam: fix info leak in ioctl +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Salva Peiró + +[ Upstream commit 8e3fbf870481eb53b2d3a322d1fc395ad8b367ed ] + +The yam_ioctl() code fails to initialise the cmd field +of the struct yamdrv_ioctl_cfg. Add an explicit memset(0) +before filling the structure to avoid the 4-byte info leak. + +Signed-off-by: Salva Peiró +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/hamradio/yam.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/hamradio/yam.c ++++ b/drivers/net/hamradio/yam.c +@@ -1057,6 +1057,7 @@ static int yam_ioctl(struct net_device * + break; + + case SIOCYAMGCFG: ++ memset(&yi, 0, sizeof(yi)); + yi.cfg.mask = 0xffffffff; + yi.cfg.iobase = yp->iobase; + yi.cfg.irq = yp->irq; diff --git a/ipv6-route-cache-expiration.patch b/ipv6-route-cache-expiration.patch new file mode 100644 index 000000000..edae92821 --- /dev/null +++ b/ipv6-route-cache-expiration.patch @@ -0,0 +1,35 @@ +commit 24f5b855e17df7e355eacd6c4a12cc4d6a6c9ff0 +Author: Li RongQing +Date: Thu Dec 19 12:40:26 2013 +0800 + + ipv6: always set the new created dst's from in ip6_rt_copy + + ip6_rt_copy only sets dst.from if ort has flag RTF_ADDRCONF and RTF_DEFAULT. + but the prefix routes which did get installed by hand locally can have an + expiration, and no any flag combination which can ensure a potential from + does never expire, so we should always set the new created dst's from. + + This also fixes the new created dst is always expired since the ort, which + is created by RA, maybe has RTF_EXPIRES and RTF_ADDRCONF, but no RTF_DEFAULT. + + Suggested-by: Hannes Frederic Sowa + CC: Gao feng + Signed-off-by: Li RongQing + Acked-by: Hannes Frederic Sowa + Signed-off-by: David S. Miller + +diff --git a/net/ipv6/route.c b/net/ipv6/route.c +index a0a48ac..4b4944c 100644 +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -1905,9 +1905,7 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort, + else + rt->rt6i_gateway = *dest; + rt->rt6i_flags = ort->rt6i_flags; +- if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) == +- (RTF_DEFAULT | RTF_ADDRCONF)) +- rt6_set_from(rt, ort); ++ rt6_set_from(rt, ort); + rt->rt6i_metric = 0; + + #ifdef CONFIG_IPV6_SUBTREES diff --git a/iwlwifi-dvm-take-mutex-when-sending-SYNC-BT-config-command.patch b/iwlwifi-dvm-take-mutex-when-sending-SYNC-BT-config-command.patch new file mode 100644 index 000000000..ee06d9f09 --- /dev/null +++ b/iwlwifi-dvm-take-mutex-when-sending-SYNC-BT-config-command.patch @@ -0,0 +1,48 @@ +Bugzilla: 1046495 +Upstream-status: Sent for 3.14 http://marc.info/?l=linux-wireless&m=139453882510796&w=2 + +From: Emmanuel Grumbach + +There is a flow in which we send the host command in SYNC +mode, but we don't take priv->mutex. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1046495 + +Cc: +Reviewed-by: Johannes Berg +Signed-off-by: Emmanuel Grumbach +--- + drivers/net/wireless/iwlwifi/dvm/main.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c +index ba1b1ea..ea7e70c 100644 +--- a/drivers/net/wireless/iwlwifi/dvm/main.c ++++ b/drivers/net/wireless/iwlwifi/dvm/main.c +@@ -252,13 +252,17 @@ static void iwl_bg_bt_runtime_config(struct work_struct *work) + struct iwl_priv *priv = + container_of(work, struct iwl_priv, bt_runtime_config); + ++ mutex_lock(&priv->mutex); + if (test_bit(STATUS_EXIT_PENDING, &priv->status)) +- return; ++ goto out; + + /* dont send host command if rf-kill is on */ + if (!iwl_is_ready_rf(priv)) +- return; ++ goto out; ++ + iwlagn_send_advance_bt_config(priv); ++out: ++ mutex_unlock(&priv->mutex); + } + + static void iwl_bg_bt_full_concurrency(struct work_struct *work) +-- +1.8.3.2 + +-- +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 diff --git a/jme-fix-dma-unmap-error.patch b/jme-fix-dma-unmap-error.patch new file mode 100644 index 000000000..208447289 --- /dev/null +++ b/jme-fix-dma-unmap-error.patch @@ -0,0 +1,124 @@ +diff -up ./drivers/net/ethernet/jme.c.orig ./drivers/net/ethernet/jme.c +--- ./drivers/net/ethernet/jme.c.orig 2014-03-30 23:40:15.000000000 -0400 ++++ ./drivers/net/ethernet/jme.c 2014-05-08 12:16:52.701746091 -0400 +@@ -1988,7 +1988,7 @@ jme_alloc_txdesc(struct jme_adapter *jme + return idx; + } + +-static void ++static int + jme_fill_tx_map(struct pci_dev *pdev, + struct txdesc *txdesc, + struct jme_buffer_info *txbi, +@@ -2005,6 +2005,9 @@ jme_fill_tx_map(struct pci_dev *pdev, + len, + PCI_DMA_TODEVICE); + ++ if (unlikely(pci_dma_mapping_error(pdev, dmaaddr))) ++ return -EINVAL; ++ + pci_dma_sync_single_for_device(pdev, + dmaaddr, + len, +@@ -2021,9 +2024,30 @@ jme_fill_tx_map(struct pci_dev *pdev, + + txbi->mapping = dmaaddr; + txbi->len = len; ++ return 0; + } + +-static void ++static void jme_drop_tx_map(struct jme_adapter *jme, int startidx, int endidx) ++{ ++ struct jme_ring *txring = &(jme->txring[0]); ++ struct jme_buffer_info *txbi = txring->bufinf, *ctxbi; ++ int mask = jme->tx_ring_mask; ++ int j; ++ ++ for (j = startidx ; j < endidx ; ++j) { ++ ctxbi = txbi + ((startidx + j + 2) & (mask)); ++ pci_unmap_page(jme->pdev, ++ ctxbi->mapping, ++ ctxbi->len, ++ PCI_DMA_TODEVICE); ++ ++ ctxbi->mapping = 0; ++ ctxbi->len = 0; ++ } ++ ++} ++ ++static int + jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx) + { + struct jme_ring *txring = &(jme->txring[0]); +@@ -2034,25 +2058,37 @@ jme_map_tx_skb(struct jme_adapter *jme, + int mask = jme->tx_ring_mask; + const struct skb_frag_struct *frag; + u32 len; ++ int ret = 0; + + for (i = 0 ; i < nr_frags ; ++i) { + frag = &skb_shinfo(skb)->frags[i]; + ctxdesc = txdesc + ((idx + i + 2) & (mask)); + ctxbi = txbi + ((idx + i + 2) & (mask)); + +- jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, ++ ret = jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, + skb_frag_page(frag), + frag->page_offset, skb_frag_size(frag), hidma); ++ if (ret) { ++ jme_drop_tx_map(jme, idx, idx+i); ++ goto out; ++ } ++ + } + + len = skb_is_nonlinear(skb) ? skb_headlen(skb) : skb->len; + ctxdesc = txdesc + ((idx + 1) & (mask)); + ctxbi = txbi + ((idx + 1) & (mask)); +- jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, virt_to_page(skb->data), ++ ret = jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi, virt_to_page(skb->data), + offset_in_page(skb->data), len, hidma); ++ if (ret) ++ jme_drop_tx_map(jme, idx, idx+i); ++ ++out: ++ return ret; + + } + ++ + static int + jme_expand_header(struct jme_adapter *jme, struct sk_buff *skb) + { +@@ -2144,6 +2180,7 @@ jme_fill_tx_desc(struct jme_adapter *jme + struct txdesc *txdesc; + struct jme_buffer_info *txbi; + u8 flags; ++ int ret = 0; + + txdesc = (struct txdesc *)txring->desc + idx; + txbi = txring->bufinf + idx; +@@ -2168,7 +2205,10 @@ jme_fill_tx_desc(struct jme_adapter *jme + if (jme_tx_tso(skb, &txdesc->desc1.mss, &flags)) + jme_tx_csum(jme, skb, &flags); + jme_tx_vlan(skb, &txdesc->desc1.vlan, &flags); +- jme_map_tx_skb(jme, skb, idx); ++ ret = jme_map_tx_skb(jme, skb, idx); ++ if (ret) ++ return ret; ++ + txdesc->desc1.flags = flags; + /* + * Set tx buffer info after telling NIC to send +@@ -2240,7 +2280,8 @@ jme_start_xmit(struct sk_buff *skb, stru + return NETDEV_TX_BUSY; + } + +- jme_fill_tx_desc(jme, skb, idx); ++ if (jme_fill_tx_desc(jme, skb, idx)) ++ return NETDEV_TX_BUSY; + + jwrite32(jme, JME_TXCS, jme->reg_txcs | + TXCS_SELECT_QUEUE0 | diff --git a/kernel.spec b/kernel.spec index 330920411..be07ca91e 100644 --- a/kernel.spec +++ b/kernel.spec @@ -6,7 +6,7 @@ Summary: The Linux kernel # For a stable, released kernel, released_kernel should be 1. For rawhide # and/or a kernel built from an rc or git snapshot, released_kernel should # be 0. -%global released_kernel 0 +%global released_kernel 1 # Sign modules on x86. Make sure the config files match this setting if more # architectures are added. @@ -31,7 +31,7 @@ Summary: The Linux kernel # # (Uncomment the '#' and both spaces below to set the buildid.) # -# % define buildid .local +%define buildid .eol ################################################################### # The buildid can also be specified on the rpmbuild command line @@ -62,19 +62,19 @@ Summary: The Linux kernel # For non-released -rc kernels, this will be appended after the rcX and # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3" # -%global baserelease 2 +%global baserelease 100 %global fedora_build %{baserelease} # 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 8 +%define base_sublevel 14 ## If this is a released kernel ## %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 0 +%define stable_update 34 # Is it a -stable RC? %define stable_rc 0 # Set rpm version accordingly @@ -93,7 +93,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 2 +%define rcrev 0 # The git snapshot level %define gitrev 0 # Set rpm version accordingly @@ -114,7 +114,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} @@ -132,10 +132,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 OMAP (Beagle/Panda Board) -%define with_omap %{?_without_omap: 0} %{?!_without_omap: 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: # @@ -244,17 +240,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), tegra and omap are only built on armv7 hfp/sfp -%ifnarch armv7hl armv7l -%define with_omap 0 -%endif -%define with_tegra 0 - # if requested, only build base kernel %if %{with_baseonly} %define with_smp 0 @@ -336,6 +326,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 @@ -383,14 +374,14 @@ 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 -%ifarch armv5tel -%define with_up 0 -%endif -%ifnarch armv5tel armv7hl +%ifnarch armv7hl %define with_headers 0 %define with_perf 0 %define with_tools 0 @@ -475,9 +466,16 @@ Provides: kernel-drm = 4.3.0\ Provides: kernel-drm-nouveau = 16\ Provides: kernel-modeset = 1\ Provides: kernel-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-highbank\ +Provides: kernel-highbank-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-omap\ +Provides: kernel-omap-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-tegra\ +Provides: kernel-tegra-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel-omap\ Requires(pre): %{kernel_prereq}\ Requires(pre): %{initrd_prereq}\ -Requires(pre): linux-firmware >= 20120206-0.1.git06c8f81\ +Requires(pre): linux-firmware >= 20130724-29.git31f6b30\ Requires(post): /sbin/new-kernel-pkg\ Requires(preun): /sbin/new-kernel-pkg\ Conflicts: %{kernel_dot_org_conflicts}\ @@ -508,28 +506,24 @@ ExclusiveOS: Linux # # List the packages used during the kernel build # -BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar -BuildRequires: bzip2, xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk -BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config, hmaccalc +BuildRequires: kmod, patch, bash, sh-utils, tar +BuildRequires: bzip2, xz, findutils, gzip, m4, perl, perl-Carp, make, diffutils, gawk +BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc BuildRequires: net-tools, hostname, bc BuildRequires: xmlto, asciidoc %if %{with_sparse} -BuildRequires: sparse >= 0.4.1 +BuildRequires: sparse %endif %if %{with_perf} -BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed) bison +BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed) bison flex BuildRequires: audit-libs-devel %endif %if %{with_tools} -BuildRequires: pciutils-devel gettext +BuildRequires: pciutils-devel gettext ncurses-devel %endif BuildConflicts: rhbuildsys(DiskFree) < 500Mb %if %{with_debuginfo} -# Fancy new debuginfo generation introduced in Fedora 8/RHEL 6. -# The -r flag to find-debuginfo.sh invokes eu-strip --reloc-debug-sections -# which reduces the number of relocations in kernel module .ko.debug files and -# was introduced with rpm 4.9 and elfutils 0.153. -BuildRequires: rpm-build >= 4.9.0-1, elfutils >= elfutils-0.153-1 +BuildRequires: rpm-build, elfutils %define debuginfo_args --strict-build-id -r %endif @@ -571,12 +565,10 @@ Source54: config-powerpc64p7 Source70: config-s390x # Unified ARM kernels -Source100: config-armv7 - -# Legacy ARM kernels -Source105: config-arm-generic -Source110: config-arm-omap -Source111: config-arm-tegra +Source100: config-arm-generic +Source101: config-armv7-generic +Source102: config-armv7 +Source103: config-armv7-lpae # 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. @@ -635,117 +627,131 @@ Patch09: upstream-reverts.patch # Standalone patches -Patch100: taint-vbox.patch - -Patch110: vmbugon-warnon.patch - Patch390: defaults-acpi-video.patch -Patch391: acpi-video-dos.patch -Patch396: acpi-sony-nonvs-blacklist.patch Patch450: input-kill-stupid-messages.patch Patch452: no-pcspkr-modalias.patch -Patch460: serial-460800.patch - Patch470: die-floppy-die.patch Patch510: silence-noise.patch Patch530: silence-fbcon-logo.patch +Patch600: 0001-lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch + +#rhbz 917708 +Patch700: Revert-userns-Allow-unprivileged-users-to-create-use.patch + Patch800: crash-driver.patch # crypto/ # secure boot -Patch1000: devel-pekey-secure-boot-20130306.patch +Patch1000: secure-modules.patch +Patch1001: modsign-uefi.patch +Patch1002: sb-hibernate.patch +Patch1003: sysrq-secure-boot.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 -Patch1825: drm-i915-dp-stfu.patch +Patch1826: drm-i915-hush-check-crtc-state.patch # Quiet boot fixes -# silence the ACPI blacklist code -Patch2802: silence-acpi-blacklist.patch - -# media patches -Patch2899: v4l-dvb-fixes.patch -Patch2900: v4l-dvb-update.patch -Patch2901: v4l-dvb-experimental.patch # fs fixes # NFSv4 # patches headed upstream -Patch10000: fs-proc-devtree-remove_proc_entry.patch - Patch12016: disable-i8042-check-on-apple-mac.patch -Patch13003: efi-dont-map-boot-services-on-32bit.patch - Patch14000: hibernate-freeze-filesystems.patch Patch14010: lis3-improve-handling-of-null-rate.patch +Patch15000: nowatchdog-on-virt.patch + +# ARM64 # ARM -Patch21000: arm-export-read_current_timer.patch -# IMX +# lpae +Patch21001: arm-lpae-ax88796.patch +Patch21004: arm-sound-soc-samsung-dma-avoid-another-64bit-division.patch + +# ARM omap +Patch21010: arm-omap-load-tfp410.patch # ARM tegra -Patch21004: arm-tegra-nvec-kconfig.patch -Patch21005: arm-tegra-usb-no-reset-linux33.patch -# https://patchwork.kernel.org/patch/2106061/ +Patch21020: arm-tegra-usb-no-reset-linux33.patch -# versatile +# Add panel support for tegra paz00 +# Backported from linux-next scheduled for 3.15 +Patch21021: arm-tegra-paz00-panel-dts.patch + +# ARM i.MX6 +# http://www.spinics.net/lists/devicetree/msg08276.html +Patch21025: arm-imx6-utilite.patch #rhbz 754518 Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch -#rhbz 859485 -Patch21226: vt-Drop-K_OFF-for-VC_MUTE.patch - # https://fedoraproject.org/wiki/Features/Checkpoint_Restore Patch21242: criu-no-expert.patch #rhbz 892811 Patch21247: ath9k_rx_dma_stop_check.patch -#rhbz 844750 -Patch21250: 0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch - -#rhbz 812111 -Patch21260: alps-v2.patch - -#rhbz 903192 -Patch21261: 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch - -#rhbz 914737 -Patch21262: x86-mm-Fix-vmalloc_fault-oops-during-lazy-MMU-updates.patch - -# CVE-2013-1792 rhbz 916646,919021 -Patch21267: keys-fix-race-with-concurrent-install_user_keyrings.patch - -#rhbz 857954 -Patch21268: w1-fix-oops-when-w1_search-is-called-from.patch - -#rhbz 911771 -Patch21269: serial-8250-Keep-8250.-xxxx-module-options-functiona.patch - Patch22000: weird-root-dentry-name-debug.patch -#selinux ptrace child permissions -Patch22001: selinux-apply-different-permission-to-ptrace-child.patch +#rhbz 1051748 +Patch25035: Bluetooth-allocate-static-minor-for-vhci.patch + +#rhbz 1074710 +Patch25061: mm-page_alloc.c-change-mm-debug-routines-back-to-EXP.patch + +#rhbz 1048314 +Patch25062: 0001-HID-rmi-introduce-RMI-driver-for-Synaptics-touchpads.patch + +#rhbz 1089583 +Patch25064: 0001-HID-rmi-do-not-handle-touchscreens-through-hid-rmi.patch + +#rhbz 1090161 +Patch25072: HID-rmi-do-not-fetch-more-than-16-bytes-in-a-query.patch + +#rhbz 1013466 +Patch25065: selinux-put-the-mmap-DAC-controls-before-the-MAC-controls.patch + +#rhbz 696821 +Patch25068: fanotify-fix-EOVERFLOW-on-64-bit.patch + +#rhbz 983342 1093120 +Patch25070: 0001-acpi-video-Add-4-new-models-to-the-use_native_backli.patch + +#rhbz 1060327 +Patch25071: drm-fix-qxl-mode-flags-backport.patch + +#rhbz 861573 +Patch25079: 0003-samsung-laptop-Add-broken-acpi-video-quirk-for-NC210.patch + +#rhbz 1082266 +Patch25087: jme-fix-dma-unmap-error.patch + +#rhbz 1051668 +Patch25092: Input-elantech-add-support-for-newer-elantech-touchpads.patch + +#rhbz 1064516 +Patch25098: e1000e-Failure-to-write-SHRA-turns-on-PROMISC-mode.patch + +Patch25109: revert-input-wacom-testing-result-shows-get_report-is-unnecessary.patch + +#rhbz 1021036 +Patch25110: 0001-ideapad-laptop-Blacklist-rfkill-control-on-the-Lenov.patch +Patch25111: 0002-ideapad-laptop-Change-Lenovo-Yoga-2-series-rfkill-ha.patch # END OF PATCH DEFINITIONS @@ -940,17 +946,17 @@ against the %{?2:%{2} }kernel package.\ # # This macro creates a kernel--modules-extra package. -# %%kernel_modules-extra_package +# %%kernel_modules_extra_package # -%define kernel_modules-extra_package() \ +%define kernel_modules_extra_package() \ %package %{?1:%{1}-}modules-extra\ Summary: Extra kernel modules to match the %{?2:%{2} }kernel\ Group: System Environment/Kernel\ Provides: kernel%{?1:-%{1}}-modules-extra-%{_target_cpu} = %{version}-%{release}\ -Provides: kernel-modules-extra-%{_target_cpu} = %{version}-%{release}%{?1:.%{1}}\ -Provides: kernel-modules-extra = %{version}-%{release}%{?1:.%{1}}\ +Provides: kernel%{?1:-%{1}}-modules-extra-%{_target_cpu} = %{version}-%{release}%{?1:.%{1}}\ +Provides: kernel%{?1:-%{1}}-modules-extra = %{version}-%{release}%{?1:.%{1}}\ Provides: installonlypkg(kernel-module)\ -Provides: kernel-modules-extra-uname-r = %{KVERREL}%{?1:.%{1}}\ +Provides: kernel%{?1:-%{1}}-modules-extra-uname-r = %{KVERREL}%{?1:.%{1}}\ Requires: kernel-uname-r = %{KVERREL}%{?1:.%{1}}\ AutoReqProv: no\ %description -n kernel%{?variant}%{?1:-%{1}}-modules-extra\ @@ -968,14 +974,14 @@ Summary: %{variant_summary}\ Group: System Environment/Kernel\ %kernel_reqprovconf\ %{expand:%%kernel_devel_package %1 %{!?-n:%1}%{?-n:%{-n*}}}\ -%{expand:%%kernel_modules-extra_package %1 %{!?-n:%1}%{?-n:%{-n*}}}\ +%{expand:%%kernel_modules_extra_package %1 %{!?-n:%1}%{?-n:%{-n*}}}\ %{expand:%%kernel_debuginfo_package %1}\ %{nil} # First the auxiliary packages of the main kernel package. %kernel_devel_package -%kernel_modules-extra_package +%kernel_modules_extra_package %kernel_debuginfo_package @@ -991,19 +997,27 @@ hyperthreading technology. Install the kernel-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 %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. @@ -1026,18 +1040,6 @@ This variant of the kernel has numerous debugging options enabled. It should only be installed when trying to gather additional information on kernel bugs, as some of these options impact performance noticably. -%define variant_summary The Linux kernel compiled for TI-OMAP boards -%kernel_variant_package omap -%description omap -This package includes a version of the Linux kernel with support for -TI-OMAP based systems, i.e., BeagleBoard-xM. - -%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 @@ -1268,14 +1270,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 @@ -1289,19 +1289,22 @@ ApplyOptionalPatch compile-fixes.patch # revert patches from upstream that conflict or that we get via other means ApplyOptionalPatch upstream-reverts.patch -R -ApplyPatch taint-vbox.patch - -ApplyPatch vmbugon-warnon.patch - # Architecture patches # x86(-64) +ApplyPatch 0001-lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch + +# ARM64 # # ARM # -ApplyPatch arm-export-read_current_timer.patch -# ApplyPatch arm-tegra-nvec-kconfig.patch +ApplyPatch arm-lpae-ax88796.patch +ApplyPatch arm-sound-soc-samsung-dma-avoid-another-64bit-division.patch +ApplyPatch arm-omap-load-tfp410.patch ApplyPatch arm-tegra-usb-no-reset-linux33.patch +ApplyPatch arm-tegra-paz00-panel-dts.patch +ApplyPatch arm-imx6-utilite.patch + # # bugfixes to drivers and filesystems @@ -1323,8 +1326,6 @@ ApplyPatch arm-tegra-usb-no-reset-linux33.patch # ACPI ApplyPatch defaults-acpi-video.patch -ApplyPatch acpi-video-dos.patch -ApplyPatch acpi-sony-nonvs-blacklist.patch # # PCI @@ -1349,9 +1350,6 @@ ApplyPatch die-floppy-die.patch ApplyPatch no-pcspkr-modalias.patch -# Allow to use 480600 baud on 16C950 UARTs -ApplyPatch serial-460800.patch - # Silence some useless messages that still get printed with 'quiet' ApplyPatch silence-noise.patch @@ -1360,6 +1358,8 @@ ApplyPatch silence-fbcon-logo.patch # Changes to upstream defaults. +#rhbz 917708 +ApplyPatch Revert-userns-Allow-unprivileged-users-to-create-use.patch # /dev/crash driver. ApplyPatch crash-driver.patch @@ -1367,53 +1367,37 @@ ApplyPatch crash-driver.patch # crypto/ # secure boot -ApplyPatch devel-pekey-secure-boot-20130306.patch +ApplyPatch secure-modules.patch +ApplyPatch modsign-uefi.patch +ApplyPatch sb-hibernate.patch +ApplyPatch sysrq-secure-boot.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 # Nouveau DRM # Intel DRM -ApplyOptionalPatch drm-intel-next.patch -ApplyPatch drm-i915-dp-stfu.patch +ApplyPatch drm-i915-hush-check-crtc-state.patch -# silence the ACPI blacklist code -ApplyPatch silence-acpi-blacklist.patch - -# V4L/DVB updates/fixes/experimental drivers -# apply if non-empty -ApplyOptionalPatch v4l-dvb-fixes.patch -ApplyOptionalPatch v4l-dvb-update.patch -ApplyOptionalPatch v4l-dvb-experimental.patch +# Radeon DRM # Patches headed upstream -ApplyPatch fs-proc-devtree-remove_proc_entry.patch - ApplyPatch disable-i8042-check-on-apple-mac.patch -ApplyPatch efi-dont-map-boot-services-on-32bit.patch - # FIXME: REBASE #ApplyPatch hibernate-freeze-filesystems.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 -ApplyPatch weird-root-dentry-name-debug.patch - -#selinux ptrace child permissions -ApplyPatch selinux-apply-different-permission-to-ptrace-child.patch - -#rhbz 859485 -ApplyPatch vt-Drop-K_OFF-for-VC_MUTE.patch +#pplyPatch weird-root-dentry-name-debug.patch # https://fedoraproject.org/wiki/Features/Checkpoint_Restore ApplyPatch criu-no-expert.patch @@ -1421,26 +1405,48 @@ ApplyPatch criu-no-expert.patch #rhbz 892811 ApplyPatch ath9k_rx_dma_stop_check.patch -#rhbz 844750 -ApplyPatch 0001-bluetooth-Add-support-for-atheros-04ca-3004-device-t.patch +#rhbz 1051748 +ApplyPatch Bluetooth-allocate-static-minor-for-vhci.patch -#rhbz 812111 -ApplyPatch alps-v2.patch +#rhbz 1048314 +ApplyPatch 0001-HID-rmi-introduce-RMI-driver-for-Synaptics-touchpads.patch +#rhbz 1089583 +ApplyPatch 0001-HID-rmi-do-not-handle-touchscreens-through-hid-rmi.patch +#rhbz 1090161 +ApplyPatch HID-rmi-do-not-fetch-more-than-16-bytes-in-a-query.patch -#rhbz 903192 -ApplyPatch 0001-kmsg-Honor-dmesg_restrict-sysctl-on-dev-kmsg.patch +#rhbz 1074710 +ApplyPatch mm-page_alloc.c-change-mm-debug-routines-back-to-EXP.patch -#rhbz 914737 -ApplyPatch x86-mm-Fix-vmalloc_fault-oops-during-lazy-MMU-updates.patch +#rhbz 1013466 +ApplyPatch selinux-put-the-mmap-DAC-controls-before-the-MAC-controls.patch -# CVE-2013-1792 rhbz 916646,919021 -ApplyPatch keys-fix-race-with-concurrent-install_user_keyrings.patch +#rhbz 696821 +ApplyPatch fanotify-fix-EOVERFLOW-on-64-bit.patch -#rhbz 857954 -ApplyPatch w1-fix-oops-when-w1_search-is-called-from.patch +#rhbz 983342 1093120 +ApplyPatch 0001-acpi-video-Add-4-new-models-to-the-use_native_backli.patch -#rhbz 911771 -ApplyPatch serial-8250-Keep-8250.-xxxx-module-options-functiona.patch +#rhbz 1060327 +ApplyPatch drm-fix-qxl-mode-flags-backport.patch + +#rhbz 861573 +ApplyPatch 0003-samsung-laptop-Add-broken-acpi-video-quirk-for-NC210.patch + +#rhbz 1082266 +ApplyPatch jme-fix-dma-unmap-error.patch + +#rhbz 1051668 +ApplyPatch Input-elantech-add-support-for-newer-elantech-touchpads.patch + +#rhbz 1064516 +ApplyPatch e1000e-Failure-to-write-SHRA-turns-on-PROMISC-mode.patch + +ApplyPatch revert-input-wacom-testing-result-shows-get_report-is-unnecessary.patch + +#rhbz 1021036 +ApplyPatch 0001-ideapad-laptop-Blacklist-rfkill-control-on-the-Lenov.patch +ApplyPatch 0002-ideapad-laptop-Change-Lenovo-Yoga-2-series-rfkill-ha.patch # END OF PATCH APPLICATIONS @@ -1568,18 +1574,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 +%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} @@ -1600,6 +1603,10 @@ BuildKernel() { %if %{signmodules} # Sign the image if we're using EFI %pesign -s -i $KernelImage -o vmlinuz.signed + if [ ! -s vmlinuz.signed ]; then + echo "pesigning failed" + exit 1 + fi mv vmlinuz.signed $KernelImage %endif $CopyKernel $KernelImage \ @@ -1781,19 +1788,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_omap} -BuildKernel %make_target %kernel_image omap -%endif - -%if %{with_tegra} -BuildKernel %make_target %kernel_image tegra +BuildKernel %make_target %kernel_image %{pae} %endif %if %{with_up} @@ -1837,6 +1836,8 @@ make %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false popd %endif #turbostat/x86_energy_perf_policy %endif +pushd tools/thermal/tmon/ +make %endif %if %{with_doc} @@ -1860,26 +1861,18 @@ find Documentation -type d | xargs chmod u+w # that will strip the signature off of the modules. %define __modsign_install_post \ - if [ "%{signmodules}" == "1" ]; then \ - if [ "%{with_pae}" != "0" ]; then \ - mv signing_key.priv.sign.PAE signing_key.priv \ - mv signing_key.x509.sign.PAE signing_key.x509 \ - %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAE/ \ + 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}/ \ fi \ - if [ "%{with_debug}" != "0" ]; then \ - mv signing_key.priv.sign.debug signing_key.priv \ - mv signing_key.x509.sign.debug signing_key.x509 \ - %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.debug/ \ + 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}" != "0" ]; then \ - mv signing_key.priv.sign.PAEdebug signing_key.priv \ - mv signing_key.x509.sign.PAEdebug signing_key.x509 \ - %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}.PAEdebug/ \ + if [ "%{with_pae_debug}" -ne "0" ]; then \ + %{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}" != "0" ]; then \ - mv signing_key.priv.sign signing_key.priv \ - mv signing_key.x509.sign signing_key.x509 \ - %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \ + if [ "%{with_up}" -ne "0" ]; then \ + %{modsign_cmd} signing_key.priv.sign signing_key.x509.sign $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/ \ fi \ fi \ %{nil} @@ -1960,22 +1953,19 @@ 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} # perf tool binary and supporting scripts/binaries -%{perf_make} DESTDIR=$RPM_BUILD_ROOT install +%{perf_make} DESTDIR=$RPM_BUILD_ROOT install-bin +# remove the 'trace' symlink. +rm -f %{buildroot}%{_bindir}/trace # python-perf extension %{perf_make} DESTDIR=$RPM_BUILD_ROOT install-python_ext # perf man pages (note: implicit rpm magic compresses them later) -%{perf_make} DESTDIR=$RPM_BUILD_ROOT install-man || %{doc_build_fail} +%{perf_make} DESTDIR=$RPM_BUILD_ROOT try-install-man || %{doc_build_fail} %endif %if %{with_tools} @@ -2010,6 +2000,9 @@ install -m644 %{SOURCE2001} %{buildroot}%{_sysconfdir}/sysconfig/cpupower make DESTDIR=%{buildroot} install popd %endif #turbostat/x86_energy_perf_policy +pushd tools/thermal/tmon +make INSTALL_ROOT=%{buildroot} install +popd %endif %if %{with_bootwrapper} @@ -2057,7 +2050,7 @@ fi\ # # This macro defines a %%post script for a kernel*-modules-extra package. -# %%kernel_modules-extra_post [] +# %%kernel_modules_extra_post [] # %define kernel_modules_extra_post() \ %{expand:%%post %{?1:%{1}-}modules-extra}\ @@ -2109,21 +2102,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 omap -%kernel_variant_post -v omap - -%kernel_variant_preun tegra -%kernel_variant_post -v tegra - if [ -x /sbin/ldconfig ] then /sbin/ldconfig -X || exit $? @@ -2197,6 +2184,7 @@ fi %{_bindir}/turbostat %{_mandir}/man8/turbostat* %endif +%{_bindir}/tmon %endif %if %{with_debuginfo} @@ -2265,24 +2253,1090 @@ 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_omap} omap -%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. -# ___________________________________________________________ -# / This branch is for Fedora 19. You probably want to commit \ -# \ to the F-18 branch instead, or in addition to this one. / -# ----------------------------------------------------------- -# \ ^__^ -# \ (@@)\_______ -# (__)\ )\/\ -# ||----w | -# || || %changelog +* Fri Feb 27 2015 Josh Boyer - 3.14.34-100 +- Linux v3.14.34 + +* Fri Feb 06 2015 Josh Boyer - 3.14.32-100 +- Linux v3.14.32 + +* Tue Jan 27 2015 Josh Boyer - 3.14.30-100 +- Linux v3.14.30 + +* Fri Jan 16 2015 Josh Boyer - 3.14.29-100 +- Linux v3.14.29 + +* Wed Dec 17 2014 Justin M. Forbes - 3.14.27-100 +- Linux v3.14.27 + +* Wed Dec 10 2014 Josh Boyer +- CVE-2014-8134 fix espfix for 32-bit KVM paravirt guests (rhbz 1172765 1172769) + +* Mon Dec 08 2014 Justin M. Forbes - 3.14.26-100 +- Linux v3.14.26 + +* Thu Dec 04 2014 Josh Boyer +- CVE-2014-9090 local DoS via do_double_fault due to improper SS faults (rhbz 1170691) + +* Fri Nov 21 2014 Justin M. Forbes - 3.14.25-100 +- Linux v3.14.25 + +* Fri Nov 14 2014 Justin M. Forbes - 3.14.24-100 +- Linux v3.14.24 + +* Thu Nov 13 2014 Josh Boyer +- CVE-2014-7842 kvm: reporting emulation failures to userspace (rhbz 1163762 1163767) + +* Wed Nov 12 2014 Josh Boyer +- CVE-2014-7841 sctp: NULL ptr deref on malformed packet (rhbz 1163087 1163095) + +* Fri Nov 07 2014 Josh Boyer +- CVE-2014-7826 CVE-2014-7825 insufficient syscall number validation in perf and ftrace subsystems (rhbz 1161565 1161572) + +* Thu Oct 30 2014 Justin M. Forbes - 3.14.23-100 +- Linux v3.14.23 + +* Fri Oct 24 2014 Josh Boyer +- CVE-2014-3610 kvm: noncanonical MSR writes (rhbz 1144883 1156543) +- CVE-2014-3611 kvm: PIT timer race condition (rhbz 1144878 1156537) +- CVE-2014-3646 kvm: vmx: invvpid vm exit not handled (rhbz 1144825 1156534) +- CVE-2014-8369 kvm: excessive pages un-pinning in kvm_iommu_map error path (rhbz 1156518 1156522) + +* Wed Oct 22 2014 Josh Boyer - 3.14.22-101 +- CVE-2014-3688 sctp: remote memory pressure from excessive queuing (rhbz 1155745 1155751) +- CVE-2014-3687 sctp: panic on duplicate ASCONF chunks (rhbz 1155731 1155738) +- CVE-2014-3673 sctp: panic with malformed ASCONF chunks (rhbz 1147850 1155727) +- CVE-2014-3690 kvm: invalid host cr4 handling (rhbz 1153322 1155372) + +* Wed Oct 15 2014 Justin M. Forbes - 3.14.22-100 +- Linux v3.14.22 + +* Mon Oct 13 2014 Josh Boyer +- CVE-2014-7975 fs: umount DoS (rhbz 1151108 1152025) + +* Fri Oct 10 2014 Josh Boyer +- CVE-2014-7970 VFS: DoS with USER_NS (rhbz 1151095 1151484) + +* Thu Oct 09 2014 Justin M. Forbes - 3.14.21-100 +- Linux v3.14.21 + +* Mon Oct 06 2014 Justin M. Forbes - 3.14.20-100 +- Linux v3.14.20 + +* Thu Sep 18 2014 Justin M. Forbes - 3.14.19-100 +- Linux v3.14.19 + +* Mon Sep 15 2014 Josh Boyer +- CVE-2014-6410 udf: avoid infinite loop on indirect ICBs (rhbz 1141809 1141810) +- CVE-2014-3186 HID: memory corruption via OOB write (rhbz 1141407 1141410) + +* Fri Sep 12 2014 Josh Boyer +- CVE-2014-3181 HID: OOB write in magicmouse driver (rhbz 1141173 1141179) + +* Wed Sep 10 2014 Josh Boyer +- CVE-2014-3631 Add patch to fix oops on keyring gc (rhbz 1116347) + +* Tue Sep 09 2014 Justin M. Forbes - 3.14.18-100 +- Linux v3.14.18 + +* Thu Aug 28 2014 Josh Boyer +- Fix NFSv3 ACL regression (rhbz 1132786) + +* Wed Aug 27 2014 Justin M. Forbes +- CVE-2014-{5471,5472} isofs: Fix unbounded recursion when processing relocated + directories (rhbz 1134099 1134101) + +* Tue Aug 19 2014 Josh Boyer +- Fix NFSv3 oops (rhbz 1131551) + +* Thu Aug 14 2014 Josh Boyer - 3.14.17-100 +- Linux v3.14.17 + +* Wed Aug 13 2014 Justin M. Forbes - 3.14.16-101 +- Bump for build + +* Wed Aug 13 2014 Josh Boyer +- CVE-2014-{5206,5207} ro bind mount bypass with namespaces (rhbz 1129662 1129669) + +* Mon Aug 11 2014 Justin M. Forbes - 3.14.16-100 +- Linux v3.14.16 + +* Thu Jul 31 2014 Justin M. Forbes - 3.14.15-100 +- Linux v3.14.15 + +* Mon Jul 28 2014 Justin M. Forbes - 3.14.14-100 +- Linux v3.14.14 + +* Mon Jul 28 2014 Josh Boyer +- CVE-2014-5077 sctp: fix NULL ptr dereference (rhbz 1122982 1123696) + +* Thu Jul 24 2014 Josh Boyer +- CVE-2014-4171 shmem: denial of service (rhbz 1111180 1118247) +- CVE-2014-5045 vfs: refcount issues during lazy umount on symlink (rhbz 1122471 1122482) +- Fix regression in sched_setparam (rhbz 1117942) +- CVE-2014-3534 s390: ptrace: insufficient sanitization with psw mask (rhbz 1114089 1122612) + +* Thu Jul 17 2014 Josh Boyer - 3.14.13-100 +- Linux v3.14.13 +- CVE-2014-4943 pppol2tp level handling (rhbz 1119458 1120542) + +* Mon Jul 14 2014 Josh Boyer - 3.14.12-100 +- Linux v3.14.12 + +* Mon Jul 7 2014 Justin M. Forbes - 3.14.11-100 +- Linux v3.14.11 +- Fixes CVE-2014-4715 (rhbz 1115767 1116362) +- Fixes CVE-2014-4699 (rhbz 1115927 1116477) + +* Fri Jun 27 2014 Hans de Goede +- Add patch to fix wifi on lenove yoga 2 series (rhbz#1021036) + +* Thu Jun 26 2014 Justin M. Forbes - 3.14.9-100 +- Linux v3.14.9 + +* Wed Jun 25 2014 Josh Boyer +- Revert commit that breaks Wacom Intuos4 from Benjamin Tissoires +- CVE-2014-0206 aio: insufficient head sanitization in aio_read_events_ring (rhbz 1094602 1112975) + +* Mon Jun 23 2014 Josh Boyer +- CVE-2014-4508 BUG in x86_32 syscall auditing (rhbz 1111590 1112073) + +* Fri Jun 20 2014 Josh Boyer +- Bring in intel_pstate regression fixes for BayTrail (rhbz 1111920) + +* Mon Jun 16 2014 Justin M. Forbes - 3.14.8-100 +- Linux v3.14.8 + +* Mon Jun 16 2014 Josh Boyer +- CVE-2014-4014 possible priv escalation in userns (rhbz 1107966 1109836) + +* Wed Jun 11 2014 Josh Boyer - 3.14.7-100 +- Fix elantech right click on Dell vostro 5470 (rhbz 1103528) +- Fix fstrim on dm-thin volume data (rhbz 1106856) +- Fix NFS NULL pointer deref with ipv6 (rhbz 1099761) +- Fix promisc mode on certain e1000e cards (rhbz 1064516) +- Fix i915 backlight issue on gen4 (rhbz 1094066) +- Linux v3.14.7 + +* Sat Jun 07 2014 Justin M. Forbes - 3.14.6-100 +- Linux v3.14.6 + +* Fri Jun 06 2014 Josh Boyer +- CVE-2014-3153 futex: pi futexes requeue issue (rhbz 1103626 1105609) +- CVE-2014-3940 missing check during hugepage migration (rhbz 1104097 1105042) + +* Tue Jun 03 2014 Josh Boyer +- Add fix for team MTU settings from Jiri Pirko (rhbz 1099857) +- Backport fix for issues with Quagga introduced by CVE fixes (rhbz 1097684) + +* Mon Jun 02 2014 Justin M. Forbes - 3.14.5-100 +- Linux v3.14.5 + +* Thu May 29 2014 Josh Boyer +- CVE-2014-3917 DoS with syscall auditing (rhbz 1102571 1102715) + +* Tue May 20 2014 Josh Boyer +- Backport patch to add new elantech touchpad support (rhbz 1051668) + +* Wed May 14 2014 Hans de Goede +- Add synaptics min/max quirk patch for the ThinkPad W540 (rhbz 1096436) + +* Tue May 13 2014 Justin M. Forbes - 3.14.4-100 +- Linux v3.14.4 + +* Mon May 12 2014 Josh Boyer +- CVE-2014-3144/CVE-2014-3145 filter: prevent nla from peeking beyond eom (rhbz 1096775, 1096784) + +* Fri May 09 2014 Josh Boyer +- CVE-2014-1738 CVE-2014-1737 floppy: priv esclation (rhbz 1094299 1096195) + +* Thu May 08 2014 Neil Horman - 3.14.3-101 +- Fix dma unmap error in jme driver (rhbz 1082266) + +* Thu May 08 2014 Justin M. Forbes - 3.14.3-100 +- Linux v3.14.3 + +* Sat May 03 2014 Josh Boyer +- Add patch to fix HID rmi driver from Benjamin Tissoires (rhbz 1090161) + +* Wed Apr 30 2014 Josh Boyer +- CVE-2014-3122: mm: fix locking DoS issue (rhbz 1093084 1093076) +- Enable CONFIG_MEMORY_HOTPLUG (rhbz 1092948) + +* Fri Apr 25 2014 Hans de Goede +- Add synaptics min-max quirk for ThinkPad Edge E431 (rhbz#1089689) + +* Wed Apr 23 2014 Justin M. Forbes - 3.13.11-100 +- Linux v3.13.11 + +* Tue Apr 22 2014 Josh Boyer +- Add patch to fix Synaptics touchscreens and HID rmi driver (rhbz 1089583) + +* Mon Apr 21 2014 Josh Boyer +- Fix Brainboxes Express Cards (rhbz 1071914) + +* Thu Apr 17 2014 Hans de Goede +- Update min/max quirk patch to add a quirk for the ThinkPad L540 (rhbz1088588) + +* Mon Apr 14 2014 Justin M. Forbes - 3.13.10-100 +- Linux v3.13.10 + +* Mon Apr 14 2014 Hans de Goede +- Add min/max quirks for various new Thinkpad touchpads (rhbz 1085582 1085697) + +* Mon Apr 14 2014 Josh Boyer +- CVE-2014-2851 net ipv4 ping refcount issue in ping_init_sock (rhbz 1086730 1087420) + +* Thu Apr 10 2014 Josh Boyer +- Backported HID RMI driver for Haswell Dell XPS machines from Benjamin Tissoires (rhbz 1048314) + +* Wed Apr 09 2014 Josh Boyer +- CVE-2014-0155 KVM: BUG caused by invalid guest ioapic redirect table (rhbz 1081589 1085016) +- Add patch to fix SELinux lables on /proc files (rhbz 1084829) +- Add patch to fix S3 in KVM guests (rhbz 1074235) + +* Thu Apr 03 2014 Justin M. Forbes - 3.13.9-100 +- Linux v3.13.9 + +* Tue Apr 01 2014 Josh Boyer +- CVE-2014-2678 net: rds: deref of NULL dev in rds_iw_laddr_check (rhbz 1083274 1083280) + +* Mon Mar 31 2014 Justin M. Forbes - 3.13.8-100 +- Linux v3.13.8 + +* Mon Mar 31 2014 Hans de Goede +- Fix clicks getting lost with cypress_ps2 touchpads with recent + xorg-x11-drv-synaptics versions (bfdo#76341) + +* Fri Mar 28 2014 Josh Boyer +- CVE-2014-2580 xen: netback crash trying to disable due to malformed packet (rhbz 1080084 1080086) +- CVE-2014-0077 vhost-net: insufficent big packet handling in handle_rx (rhbz 1064440 1081504) +- CVE-2014-0055 vhost-net: insufficent error handling in get_rx_bufs (rhbz 1062577 1081503) +- CVE-2014-2568 net: potential info leak when ubuf backed skbs are zero copied (rhbz 1079012 1079013) + +* Mon Mar 24 2014 Justin M. Forbes - 3.13.7-100 +- Linux v3.13.7 + +* Thu Mar 20 2014 Josh Boyer +- CVE-2014-0131: skbuff: use-after-free during segmentation with zerocopy (rhbz 1074589 1079006) +- Fix readahead semantics on pipes and sockets (rhbz 1078894) + +* Mon Mar 17 2014 Josh Boyer +- CVE-2014-2523 netfilter: nf_conntrack_dccp: incorrect skb_header_pointer API usages (rhbz 1077343 1077350) + +* Wed Mar 12 2014 Josh Boyer +- Fix locking issue in iwldvm (rhbz 1046495) + +* Tue Mar 11 2014 Josh Boyer +- CVE-2014-2309 ipv6: crash due to router advertisment flooding (rhbz 1074471 1075064) + +* Fri Mar 07 2014 Justin M. Forbes - 3.13.6-100 +- Linux v3.13.6 + +* Fri Mar 07 2014 Josh Boyer +- Add patch to fix iwldvm WARN (rhbz 1065663) +- Revert two xhci fixes that break USB mass storage (rhbz 1073180) + +* Thu Mar 06 2014 Josh Boyer +- Fix stale EC events on Samsung systems (rhbz 1003602) +- Fix depmod error message from hci_vhci module (rhbz 1051748) +- Fix bogus WARN in iwlwifi (rhbz 1071998) + +* Tue Mar 04 2014 Josh Boyer +- Fix MAC-before-DAC check for mmap_zero (rhbz 1013466) +- Fix hidp crash with apple bluetooth trackpads (rhbz 1027465) + +* Mon Mar 03 2014 Josh Boyer - 3.13.5-103 +- CVE-2014-0100 net: inet frag race condition use-after-free (rhbz 1072026 1070618) +- CVE-2014-0101 sctp: null ptr deref when processing auth cookie_echo chunk (rhbz 1070209 1070705) +- Fix overly verbose audit logs (rhbz 1066064) + +* Mon Mar 03 2014 Josh Boyer - 3.13.5-102 +- CVE-2014-0049 kvm: mmio_fragments out-of-bounds access (rhbz 1062368 1071837) +- Fix atomic sched BUG in tty low_latency (rhbz 1065087) + +* Fri Feb 28 2014 Josh Boyer +- CVE-2014-0102 keyctl_link can be used to cause an oops (rhbz 1071396) + +* Fri Feb 28 2014 Josh Boyer +- Drop alx phy reset patch that is already in 3.13 + +* Tue Feb 25 2014 Justin M. Forbes - 3.13.5-101 +* Fix module signing so secure boot works again + +* Tue Feb 25 2014 Josh Boyer +- Fix mounting issues on cifs (rhbz 1068862) + +* Mon Feb 24 2014 Josh Boyer 3.13.5-100 +- CVE-2014-2039 s390: crash due to linkage stack instructions (rhbz 1067558 1068758) +- Fix lockdep issue in EHCI when using threaded IRQs (rhbz 1056170) + +* Mon Feb 24 2014 Justin M. Forbes +- Linux v3.13.5 + +* Fri Feb 21 2014 Josh Boyer +- Fix WARN from e100 from Michele Baldessari (rhbz 994438) + +* Thu Feb 20 2014 Justin M. Forbes - 3.13.4-100 +- Linux v3.13.4 + +* Tue Feb 18 2014 Justin M. Forbes +- Linux v3.13.3 + +* Tue Feb 18 2014 Josh Boyer +- Fix r8169 ethernet after suspend (rhbz 1054408) + +* Fri Feb 14 2014 Josh Boyer - 3.12.11-201 +- CVE-2014-0069 cifs: incorrect handling of bogus user pointers (rhbz 1064253 1062585) + +* Thu Feb 13 2014 Justin M. Forbes - 3.12.11-200 +- Linux v3.12.11 + +* Wed Feb 12 2014 Josh Boyer +- Add patch to fix list corruption from pinctrl (rhbz 1051918) +- Fix cgroup destroy oops (rhbz 1045755) +- Fix backtrace in amd_e400_idle (rhbz 1031296) +- CVE-2014-1874 SELinux: local denial of service (rhbz 1062356 1062507) + +* Thu Feb 06 2014 Justin M. Forbes - 3.12.10-200 +- Linux v3.12.10 + +* Wed Feb 05 2014 Justin M. Forbes +- fix resume issues on Renesas chips in Samsung laptops (rhbz 950630) + +* Wed Jan 29 2014 Justin M. Forbes - 3.12.9-201 +- ipv6 addrconf: revert /proc/net/if_inet6 ifa_flag format (rhbz 1056711) + +* Tue Jan 28 2014 Josh Boyer +- Add patch from Stanislaw Gruszka to fix ath9k BUG (rhbz 990955) + +* Mon Jan 27 2014 Justin M. Forbes - 3.12.9-200 +- Backport new IPv6 address flag IFA_F_NOPREFIXROUTE and IFA_F_MANAGETEMPADDR (rhbz 1056711) +- Linux v3.12.9 +- i915: remove pm_qos request on error (rhbz 1057533) + +* Wed Jan 15 2014 Justin M. Forbes - 3.12.8-200 +- Linux v3.12.8 + +* Wed Jan 15 2014 Josh Boyer +- CVE-2014-1446 hamradio/yam: information leak in ioctl (rhbz 1053620 1053647) +- CVE-2014-1438 x86: exceptions are not cleared in AMD FXSAVE workaround (rhbz 1053599 1052914) + +* Tue Jan 14 2014 Josh Boyer +- Fix k-m-e Provides to be explicit to only the package flavor (rhbz 1046246) + +* Tue Jan 14 2014 Neil Horman +- Backport ipv6 route cache expiration fix (rhbz 1040128) + +* Fri Jan 10 2014 Justin M. Forbes +- Backport support for ALPS Dolphin devices (rhbz 953211) +- Enable BCMA_DRIVER_GPIO by turning on GPIOLIB everywhere (rhbz 1021098) + +* Mon Jan 06 2014 Josh Boyer +- Add support for BCM57786 devices to tg3 (rhbz 1044471) +- Fix use after free crash in KVM (rhbz 1047892) +- Fix oops in KVM with invalid root_hpa (rhbz 924916) +- CVE-2013-4579: ath9k_htc improper MAC update (rhbz 1032753 1033072) + +* Mon Dec 23 2013 Justin M. Forbes +- Add patches to fix dummy gssd entry (rhbz 1037793) + +* Wed Dec 18 2013 Josh Boyer +- Fix nowatchdog-on-virt.patch to actually work in KVM guests + +* Tue Dec 17 2013 Justin M. Forbes +- Fix host lockup in bridge code when starting from virt guest (rhbz 1025770) + +* Thu Dec 12 2013 Josh Boyer +- CVE-2013-4587 kvm: out-of-bounds access (rhbz 1030986 1042071) +- CVE-2013-6376 kvm: BUG_ON in apic_cluster_id (rhbz 1033106 1042099) +- CVE-2013-6368 kvm: cross page vapic_addr access (rhbz 1032210 1042090) +- CVE-2013-6367 kvm: division by 0 in apic_get_tmcct (rhbz 1032207 1042081) + +* Wed Dec 11 2013 Josh Boyer +- Add patches to support ETPS/2 Elantech touchpads (rhbz 1030802) + +* Tue Dec 10 2013 Josh Boyer +- CVE-2013-XXXX net: memory leak in recvmsg (rhbz 1039845 1039874) + +* Tue Dec 03 2013 Josh Boyer +- Add patches to fix rfkill switch on Dell machines (rhbz 958826) + +* Sat Nov 30 2013 Josh Boyer +- CVE-2013-6405 net: leak of uninited mem to userspace via recv syscalls (rhbz 1035875 1035887) + +* Fri Nov 29 2013 Josh Boyer - 3.11.10-200 +- Linux v3.11.10 +- Fix memory leak in qxl (from Dave Airlie) + +* Tue Nov 26 2013 Josh Boyer +- Add patch to fix usbnet URB handling (rhbz 998342) +- Fix crash in via-velocity driver (rhbz 1022733) +- CVE-2013-6382 xfs: missing check for ZERO_SIZE_PTR (rhbz 1033603 1034670) + +* Mon Nov 25 2013 Josh Boyer +- CVE-2013-6380 aacraid: invalid pointer dereference (rhbz 1033593 1034304) +- CVE-2013-6378 libertas: potential oops in debugfs (rhbz 1033578 1034183) + +* Fri Nov 22 2013 Josh Boyer +- Add patches from Jeff Layton to fix 15sec NFS mount hang + +* Wed Nov 20 2013 Josh Boyer - 3.11.9-200 +- Linux v3.11.9 + +* Mon Nov 18 2013 Josh Boyer +- Add patch to fix rhel5.9 KVM guests (rhbz 967652) +- Add patch to fix crash from slab when using md-raid mirrors (rhbz 1031086) +- Add patches from Pierre Ossman to fix 24Hz/24p radeon audio (rhbz 1010679) +- Add patch to fix ALX phy issues after resume (rhbz 1011362) +- Fix ipv6 sit panic with packet size > mtu (from Michele Baldessari) (rbhz 1015905) + +* Thu Nov 14 2013 Josh Boyer +- CVE-2013-4563: net: large udp packet over IPv6 over UFO-enabled device with TBF qdisc panic (rhbz 1030015 1030017) + +* Wed Nov 13 2013 Justin M. Forbes - 3.11.8-200 +- Linux v3.11.8 + +* Sat Nov 09 2013 Josh Boyer +- Add patch from Daniel Stone to avoid high order allocations in evdev +- Add qxl backport fixes from Dave Airlie + +* Mon Nov 04 2013 Josh Boyer - 3.11.7-200 +- Add patch to fix iwlwifi queue settings backtrace (rhbz 1025769) + +* Mon Nov 04 2013 Justin M. Forbes +- Linux v3.11.7 + +* Fri Nov 01 2013 Josh Boyer - 3.11.6-201 +- Revert blocking patches causing systemd to crash on resume (rhbz 1010603) +- CVE-2013-4348 net: deadloop path in skb_flow_dissect (rhbz 1007939 1025647) + +* Thu Oct 31 2013 Josh Boyer +- Fix display regression on Dell XPS 13 machines (rhbz 995782) + +* Tue Oct 29 2013 Josh Boyer +- Fix plaintext auth regression in cifs (rhbz 1011621) + +* Fri Oct 25 2013 Josh Boyer +- CVE-2013-4470 net: memory corruption with UDP_CORK and UFO (rhbz 1023477 1023495) +- Add touchpad support for Dell XT2 (rhbz 1023413) + +* Tue Oct 22 2013 Josh Boyer +- Add patch to fix warning in tcp_fastretrans_alert (rhbz 989251) + +* Fri Oct 18 2013 Justin M. Forbes - 3.11.6-200 +- Linux v3.11.6 + +* Thu Oct 17 2013 Josh Boyer +- Add patch to fix BusLogic error (rhbz 1015558) +- Fix rt2800usb polling timeouts and throughput issues (rhbz 984696) + +* Wed Oct 16 2013 Josh Boyer +- Fix btrfs balance/scrub issue (rhbz 1011714) + +* Tue Oct 15 2013 Josh Boyer +- Fix regression in radeon sound (rhbz 1010679) + +* Mon Oct 14 2013 Justin M. Forbes - 3.11.5-200 +- Linux v3.11.5 + +* Fri Oct 11 2013 Josh Boyer +- Fix segfault in cpupower set (rhbz 1000439) + +* Thu Oct 10 2013 Justin M. Forbes - 3.11.4-201 +- Tag for build + +* Thu Oct 10 2013 Josh Boyer +- USB OHCI accept very late isochronous URBs (in 3.11.4) (rhbz 975158) +- Fix large order allocation in dm mq policy (rhbz 993744) + +* Wed Oct 09 2013 Josh Boyer +- Don't trigger a stack trace on crashing iwlwifi firmware (rhbz 896695) +- Add patch to fix VFIO IOMMU crash (rhbz 998732) + +* Tue Oct 08 2013 Josh Boyer +- Add patch to fix nouveau crash (rhbz 1015920) +- Quiet irq remapping stack trace (rhbz 982153) +- Use RCU safe kfree for conntrack (rhbz 1015989) + +* Mon Oct 7 2013 Justin M. Forbes +- Linux v3.11.4 + +* Thu Oct 3 2013 Josh Boyer +- CVE-2013-4387 ipv6: panic when UFO=On for an interface (rhbz 1011927 1015166) + +* Wed Oct 2 2013 Justin M. Forbes +- drm/radeon: don't set default clocks for SI when DPM is disabled (rhbz 1013814) + +* Wed Oct 2 2013 Justin M. Forbes - 3.11.3-200 +- Linux v3.11.3 + +* Wed Oct 02 2013 Neil Horman +- Add promiscuity fix for vlans plus bonding (rhbz 1005567) + +* Mon Sep 30 2013 Josh Boyer +- Add support for rf3070 devices from Stanislaw Gruszka (rhbz 974072) +- Drop VC_MUTE patch (rhbz 859485) + +* Fri Sep 27 2013 Justin M. Forbes - 3.11.2-201 +- Bump and tag for build + +* Fri Sep 27 2013 Josh Boyer +- Add patch to fix oops from applesmc (rhbz 1011719) +- Add patches to fix soft lockup from elevator changes (rhbz 902012) + +* Fri Sep 27 2013 Justin M. Forbes - 3.11.2-200 +- Linux v3.11.2 + +* Wed Sep 25 2013 Justin M. Forbes +- Bump baserelease for test build + +* Wed Sep 25 2013 Josh Boyer +- Add another fix for skge (rhbz 1008323) + +* Mon Sep 23 2013 Neil Horman +- Add alb learning packet config knob (rhbz 971893) + +* Mon Sep 23 2013 Josh Boyer +- Revert rt2x00 commit that breaks connectivity (rhbz 1010431) + +* Fri Sep 20 2013 Josh Boyer +- Fix RTC updates from ntp (rhbz 985522) +- Fix broken skge driver (rhbz 1008328) +- Fix large order rpc allocations (rhbz 997705) +- Fix multimedia keys on Genius GX keyboard (rhbz 928561) + +* Tue Sep 17 2013 Josh Boyer +- CVE-2013-4345 ansi_cprng: off by one error in non-block size request (rhbz 1007690 1009136) + +* Sat Sep 14 2013 Josh Boyer - 3.11.1-200 +- Linux v3.11.1 + +* Fri Sep 13 2013 Kyle McMartin +- Fix crash-driver.patch to properly use page_is_ram. + +* Fri Sep 13 2013 Josh Boyer +- CVE-2013-4350 net: sctp: ipv6 ipsec encryption bug in sctp_v6_xmit (rhbz 1007872 1007903) +- CVE-2013-4343 net: use-after-free TUNSETIFF (rhbz 1007733 1007741) + +* Thu Sep 12 2013 Josh Boyer +- Update HID CVE fixes to fix crash from lenovo-tpkbd driver (rhbz 1003998) + +* Wed Sep 11 2013 Neil Horman +- Fix pcie/acpi hotplug conflict (rhbz 963991) +- Fix race in crypto larval lookup + +* Wed Sep 11 2013 Justin M. Forbes +- Linux v3.11 rebase + +* Mon Sep 09 2013 Josh Boyer 3.10.11-200 +- Fix system freeze due to incorrect rt2800 initialization (rhbz 1000679) + +* Mon Sep 09 2013 Justin M. Forbes +- Linux v3.10.11 + +* Fri Aug 30 2013 Josh Boyer +- Fix HID CVEs. Absurd. +- CVE-2013-2888 rhbz 1000451 1002543 CVE-2013-2889 rhbz 999890 1002548 +- CVE-2013-2891 rhbz 999960 1002555 CVE-2013-2892 rhbz 1000429 1002570 +- CVE-2013-2893 rhbz 1000414 1002575 CVE-2013-2894 rhbz 1000137 1002579 +- CVE-2013-2895 rhbz 1000360 1002581 CVE-2013-2896 rhbz 1000494 1002594 +- CVE-2013-2897 rhbz 1000536 1002600 CVE-2013-2899 rhbz 1000373 1002604 + +* Thu Aug 29 2013 Justin M. Forbes 3.10.10-200 +- Linux v3.10.10 + +* Wed Aug 28 2013 Josh Boyer +- Add mei patches that fix various s/r issues (rhbz 994824 989373) + +* Wed Aug 21 2013 Josh Boyer +- Add patch to fix brcmsmac oops (rhbz 989269) +- CVE-2013-0343 handling of IPv6 temporary addresses (rhbz 914664 999380) + +* Tue Aug 20 2013 Josh Boyer +- Linux v3.10.9 + +* Tue Aug 20 2013 Josh Boyer - 3.10.8-200 +- Linux v3.10.8 +- CVE-2013-4254 ARM: perf: NULL pointer dereference in validate_event (rhbz 998878 998881) + +* Fri Aug 16 2013 Josh Boyer +- Add patch from Nathanael Noblet to fix mic on Gateway LT27 (rhbz 845699) + +* Thu Aug 15 2013 Josh Boyer - 3.10.7-200 +- Enable memory cgroup swap accounting (rhbz 982808) +- Add patch to fix regression on TeVII S471 devices (rhbz 963715) +- Linux v3.10.7 + +* Mon Aug 12 2013 Justin M. Forbes 3.10.6-200 +- Linux v3.10.6 + +* Wed Aug 07 2013 Justin M. Forbes 3.10.5-201 +- Bump for rebuild after koji hiccup + +* Wed Aug 07 2013 Josh Boyer +- Add zero file length check to make sure pesign didn't fail (rhbz 991808) + +* Tue Aug 06 2013 Justin M. Forbes 3.10.5-200 +- update s390x config [Dan Horák] + +* Mon Aug 05 2013 Justin M. Forbes +- Linux v3.10.5 + +* Thu Aug 01 2013 Josh Boyer +- Fix mac80211 connection issues (rhbz 981445) +- Fix firmware issues with iwl4965 and rfkill (rhbz 977053) +- Drop hid-logitech-dj patch that was breaking enumeration (rhbz 989138) + +* Wed Jul 31 2013 Josh Boyer +- update s390x config [Dan Horák] + +* Tue Jul 30 2013 Josh Boyer - 3.10.4-300 +- Revert some changes to make Logitech devices function properly (rhbz 989138) + +* Mon Jul 29 2013 Josh Boyer +- Fix i915 suspend/resume regression in 3.10 (rhbz 989093) +- Linux v3.10.4 +- Add support for elantech v7 devices (rhbz 969473) + +* Fri Jul 26 2013 Josh Boyer +- Add patch to fix NULL deref in iwlwifi (rhbz 979581) + +* Thu Jul 25 2013 Justin M. Forbes 3.10.3-300 +- Linux v3.10.3 + +* Wed Jul 24 2013 Justin M. Forbes +- Net stable queue from davem (rhbz 987639 987656) + +* Mon Jul 22 2013 Justin M. Forbes 3.10.2-301 +- Update secureboot patch for 3.10 + +* Mon Jul 22 2013 Josh Boyer +- Fix timer issue in bridge code (rhbz 980254) + +* Mon Jul 22 2013 Justin M. Forbes 3.10.2-300 +- Linux v3.10.2 + +* Fri Jul 19 2013 Dave Jones +- CVE-2013-4125 ipv6: BUG_ON in fib6_add_rt2node() (rhbz 984664) + +* Wed Jul 17 2013 Peter Robinson +- Re-enable ARM +- Drop tegra subkernel as it's now multi-platform +- Enable i.MX SoC support +- Drop old ARM patches + +* Wed Jul 17 2013 Dave Jones +- Rebase to 3.10.1 + dropped: + debug-bad-pte-dmi.patch + debug-bad-pte-modules.patch + arm-omap-ehci-fix.patch + arm-omap-fixdrm.patch + drm-ttm-exports-for-qxl.patch + drm-qxl-driver.patch + drm-qxl-3.10-rc7-diff.patch + drm-qxl-access-fix.patch + VMX-x86-handle-host-TSC-calibration-failure.patch + forcedeth-dma-error-check.patch + block-do-not-pass-disk-names-as-format-strings.patch + cdrom-use-kzalloc-for-failing-hardware.patch + vfio-Set-container-device-mode.patch + vfio-fix-crash-on-rmmod.patch + tulip-dma-debug-error.patch + af_key-fix-info-leaks-in-notify-messages.patch + ipv6-ip6_sk_dst_check-must-not-assume-ipv6-dst.patch + arm-tegra-fixclk.patch + cfg80211-mac80211-disconnect-on-suspend.patch + mac80211_fixes_for_ieee80211_do_stop_while_suspend_v3.9.patch + gssproxy-backport.patch + ceph-fix.patch + +* Fri Jul 12 2013 Dave Jones - 3.9.9-304 +- Disable LATENCYTOP/SCHEDSTATS in non-debug builds. + +* Fri Jul 12 2013 Josh Boyer +- Fix various overflow issues in ext4 (rhbz 976837) +- Add iwlwifi fix for connection issue (rhbz 885407) + +* Thu Jul 11 2013 Kyle McMartin +- Enable USB on i.MX based boards, patch from Niels de Vos. + +* Fri Jul 05 2013 Josh Boyer +- Add report fixup for Genius Gila mouse from Benjamin Tissoires (rhbz 959721) +- Add vhost-net use-after-free fix (rhbz 976789 980643) +- Add fix for timer issue in bridge code (rhbz 980254) +- CVE-2013-2232 ipv6: using ipv4 vs ipv6 structure during routing lookup in sendmsg (rhbz 981552 981564) + +* Thu Jul 04 2013 Dave Airlie +- qxl: add suspend/resume and hibernate support + +* Wed Jul 03 2013 Josh Boyer 3.9.9-301 +- CVE-2013-1059 libceph: Fix NULL pointer dereference in auth client code (rhbz 977356 980341) +- CVE-2013-2234 net: information leak in AF_KEY notify (rhbz 980995 981007) + +* Wed Jul 03 2013 Justin M. Forbes 3.9.9-300 +- Linux v3.9.9 + +* Wed Jul 03 2013 Josh Boyer +- Add patches to fix iwl skb managment (rhbz 977040) + +* Wed Jul 03 2013 Dave Airlie +- fixup QXL driver patches to make it easier to rebase +- add qxl driver dynamic resize + multiple heads support + +* Mon Jul 01 2013 Dave Airlie +- kernel portion of qxl cursor and dynamic resize fixes. + +* Fri Jun 28 2013 Peter Robinson +- Only enable ARM A15 errata on the LPAE kernel as it breaks A8 + +* Fri Jun 28 2013 Dave Airlie +- add qxl fix for missing access ok macro. + +* Thu Jun 27 2013 Josh Boyer - 3.9.8-300 +- Linux v3.9.8 + +* Thu Jun 27 2013 Josh Boyer +- Fix stack memory usage for DMA in ath3k (rhbz 977558) + +* Wed Jun 26 2013 Josh Boyer +- Add two patches to fix bridge networking issues (rhbz 880035) + +* Tue Jun 25 2013 Kyle McMartin +- Cherry pick fix out of rawhide for %{with_*} tests in module + signing from Jan Stancek. + +* Mon Jun 24 2013 Josh Boyer +- Fix battery issue with bluetooth keyboards (rhbz 903741) + +* Fri Jun 21 2013 Josh Boyer +- Add two patches to fix iwlwifi issues in unmapping +- Add patch to fix carl9170 oops (rhbz 967271) + +* Thu Jun 20 2013 Justin M. Forbes +- Linux v3.9.7 + +* Tue Jun 18 2013 Neil Horman +- Fix dma debug error in tulip driver (rhbz 956732) + +* Tue Jun 18 2013 Dave Jones +- Disable MTRR sanitizer by default. + +* Mon Jun 17 2013 Josh Boyer - 3.9.6-301 +- Add patch to fix radeon issues on powerpc + +* Thu Jun 13 2013 Josh Boyer - 3.9.6-300 +- Linux v3.9.6 +- Drop a bunch of powerpc patches that were includes in 3.9.6. Yay! + +* Wed Jun 12 2013 Kyle McMartin +- 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 +- Update gssproxy patches +- Fix KVM divide by zero error (rhbz 969644) +- Add fix for rt5390/rt3290 regression (rhbz 950735) + +* Tue Jun 11 2013 Dave Jones +- Disable soft lockup detector on virtual machines. (rhbz 971139) + +* Tue Jun 11 2013 Josh Boyer - 3.9.5-301 +- Temporarily disable gssproxy patches +- Add two patches to fix vfio device permissions (rhbz 967230) +- 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) +- CVE-2013-2164 information leak in cdrom driver (rhbz 973100 973109) + +* Mon Jun 10 2013 Josh Boyer - 3.9.5-300 +- Apply scsi lockdep patch for powerpc IPR issues (rhbz 954252) +- Linux v3.9.5 + +* Fri Jun 07 2013 Josh Boyer +- 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 +- 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 +- CVE-2013-2140 xen: blkback: insufficient permission checks for BLKIF_OP_DISCARD (rhbz 971146 971148) + +* Tue Jun 04 2013 Josh Boyer - 3.9.4-302 +- Add gssproxy backport from J. Bruce Fields +- Fix build issue with PowerPC MSI patches (rhbz 962496) + +* Mon Jun 03 2013 Josh Boyer - 3.9.4-301 +- Fix UEFI anti-bricking code (rhbz 964335) +- Add patches to fix PowerPC MSI handling (rhbz 962496) + +* Sat Jun 1 2013 Peter Robinson +- Add patch to fix DRM/X on omap (panda) +- Enable Cortex-A8 errata on multiplatform kernels (omap3) + +* Fri May 31 2013 Josh Boyer +- CVE-2013-2850 iscsi-target: heap buffer overflow on large key error (rhbz 968036 969272) + +* Thu May 30 2013 Peter Robinson +- Update ARM tegra config + +* Fri May 24 2013 Justin M. Forbes - 3.9.3-300 +- Linux v3.9.4 + +* Fri May 24 2013 Josh Boyer +- Add patch to quiet irq remapping failures (rhbz 948262) + +* Thu May 23 2013 Josh Boyer +- Fix oops from incorrect rfkill set in hp-wmi (rhbz 964367) + +* Wed May 22 2013 Josh Boyer +- Fix memcmp error in iwlwifi + +* Tue May 21 2013 Peter Robinson +- Enable OMAP5 on ARM multiplatform + +* Mon May 20 2013 Josh Boyer - 3.9.3-301 +- Linux v3.9.3 + +* Thu May 16 2013 Josh Boyer +- Fix config-local usage (rhbz 950841) + +* Wed May 15 2013 Dave Airlie +- fix nomodeset on radeon (rhbz 924507) + +* Tue May 14 2013 Dave Airlie +- backport upstream qxl fixes, fixes VM crash on X exit or randr. + +* Mon May 13 2013 Josh Boyer +- Add radeon fixes for PCI-e gen2 speed issues (rhbz 961527) + +* Mon May 13 2013 Josh Boyer - 3.9.2-301 +- Linux v3.9.2 + +* Thu May 9 2013 Peter Robinson +- Disable PL330 on ARM as it's broken on highbank + +* Wed May 08 2013 Josh Boyer - 3.9.1-301 +- Linux v3.9.1 + +* Tue May 07 2013 Josh Boyer - 3.9.0-303 +- Fix dmesg_restrict patch to avoid regression (rhbz 952655) + +* Mon May 6 2013 Peter Robinson +- Enable TPS65217 (am33xx) on ARM + +* Mon May 06 2013 Josh Boyer +- Don't remove headers explicitly exported via UAPI (rhbz 959467) + +* Fri May 03 2013 Josh Boyer +- Add two more patches for POWER + +* Wed May 01 2013 Josh Boyer +- Add some powerpc fixes for POWER8 + +* Tue Apr 30 2013 Peter Robinson +- Enable CONFIG_SERIAL_8250_DW on ARM + +* Mon Apr 29 2013 Neil Horman +- Enabled CONFIG_PACKET_DIAG (rhbz 956870) + +* Mon Apr 29 2013 Josh Boyer - 3.9.0-301 +- Linux v3.9 + +* Fri Apr 26 2013 Josh Boyer +- Add patch to prevent scheduling while atomic error in blkcg + +* Wed Apr 24 2013 Josh Boyer - 3.9.0-0.rc8.git0.2 +- Add patch to fix EFI boot on Macs (rhbz 953447) + +* Mon Apr 22 2013 Justin M. Forbes - 3.9.0-0.rc8.git0.1 +- Linux v3.9-rc8 + +* Mon Apr 22 2013 Peter Robinson +- Minor ARM updates + +* Fri Apr 19 2013 Josh Boyer +- Add patch to fix RCU splat from perf events + +* Fri Apr 19 2013 Peter Robinson +- Temporaily disable cpu idle on ARM as it appears to be causing stability issues +- Minor ARM config updates +- Add patch for DT DMA issues that affect at least highbank/tegra ARM devices + +* Fri Apr 19 2013 Josh Boyer +- Disable Intel HDA and enable RSXX block dev on ppc64/ppc64p7 + +* Thu Apr 18 2013 Justin M. Forbes - 3.9.0-0.rc7.git3.1 +- Linux v3.9-rc7-70-gd202f05 +- Disable debugging options. + +* Tue Apr 16 2013 Josh Boyer +- Fix uninitialized variable free in iwlwifi (rhbz 951241) +- Fix race in regulatory code (rhbz 919176) + +* Mon Apr 15 2013 Josh Boyer +- Fix debug patches to build on s390x/ppc + +* Mon Apr 15 2013 Josh Boyer +- Grab fixes for UEFI space issues (rhbz 947142) + +* Fri Apr 12 2013 Josh Boyer +- Enable CONFIG_LDM_PARTITION (rhbz 948636) + +* Thu Apr 11 2013 Justin M. Forbes - 3.9.0-0.rc6.git2 +- Linux v3.9-rc6-115-g7ee32a6 +- libsas: use right function to alloc smp response (rhbz 949875) +- Reenable debugging options. + +* Thu Apr 11 2013 Dave Jones +- Print out some extra debug information when we hit bad page tables. + +* Tue Apr 9 2013 Peter Robinson +- Add patch to fix building some ARM tegra modules +- Some minor ARM OMAP updates + +* Mon Apr 08 2013 Justin M. Forbes - 3.9.0-0.rc6.git0.1 +- Disable debugging options. +- Linux v3.9-rc6 + +* Fri Apr 05 2013 Justin M. Forbes +- Move cpufreq drivers to be modular (rhbz 746372) + +* Wed Apr 03 2013 Dave Jones +- Enable MTD_CHAR/MTD_BLOCK (Needed for SFC) + Enable 10gigE on 64-bit only. + +* Wed Apr 03 2013 Justin M. Forbes - 3.9.0-0.rc5.git2.1 +- Linux v3.9-rc5-146-gda241ef +- Drop basrelease back to 1 until 3.9 is out of rc + +* Wed Apr 3 2013 Peter Robinson +- Add upstream usb-next OMAP patch to fix usb on omap/mvebu + +* Tue Apr 02 2013 Justin M. Forbes - 3.9.0-0.rc5.git1.301 +- Linux v3.9-rc5-108-g118c9a4 +- Reenable debugging options. + +* Tue Apr 02 2013 Josh Boyer +- Enable CONFIG_FB_MATROX_G on powerpc + +* Tue Apr 02 2013 Neil Horman +- Fix dma debug error on unmap (rhbz 928024) + +* Tue Apr 02 2013 Josh Boyer +- Enable CONFIG_SCSI_DMX3191D (rhbz 919874) + +* Tue Apr 02 2013 Justin M. Forbes - 3.9.0-0.rc5.git0.1 +- Linux v3.9-rc5 + +* Mon Apr 01 2013 Josh Boyer +- Enable CONFIG_MCE_INJECT (rhbz 927353) + +* Mon Apr 1 2013 Peter Robinson +- Minor ARM LPAE updates + +* Sun Mar 31 2013 Peter Robinson +- Make tegra inherit armv7-generic, fix and re-enable tegra +- Enable SPI on ARM +- Drop config-arm-generic +- ARM config updates + +* Thu Mar 28 2013 Peter Robinson +- Update ARM unified config for OMAP + +* Tue Mar 26 2013 Justin M. Forbes +- Fix child thread introspection of of /proc/self/exe (rhbz 927469) + +* Tue Mar 26 2013 Dave Jones +- Enable CONFIG_DM_CACHE (rhbz 924325) + +* Tue Mar 26 2013 Josh Boyer +- Add quirk for Realtek card reader to avoid 10 sec boot delay (rhbz 806587) +- Add quirk for MSI keyboard backlight to avoid 10 sec boot delay (rhbz 907221) + +* Mon Mar 25 2013 Justin M. Forbes +- disable whci-hcd since it doesnt seem to have users (rhbz 919289) + +* Sun Mar 24 2013 Dave Jones - 3.9.0-0.rc4.git0.1 +- Linux 3.9-rc4 + merged: drm-i915-bounds-check-execbuffer-relocation-count.patch + +* Sun Mar 24 2013 Peter Robinson +- Update ARM config for OMAP/mvebu/lpae + +* Fri Mar 22 2013 Dave Jones - 3.9.0-0.rc3.git1.4 +- Fix calculation of current frequency in intel_pstate driver. (rhbz 923942) + +* Thu Mar 21 2013 Dave Jones - 3.9.0-0.rc3.git1.2 +- Only print "bad: scheduling from the idle thread" warning once. + +* Thu Mar 21 2013 Josh Boyer +- Fix workqueue crash in mac80211 (rhbz 920218) + +* Thu Mar 21 2013 Josh Boyer - 3.9.0-0.rc3.git1.1 +- Linux v3.9-rc3-148-g2ffdd7e +- Fixes CVE-2013-1796, CVE-2013-1797, CVE-2013-1798 in kvm. + +* Wed Mar 20 2013 Dave Jones +- Enable CONFIG_DM_DELAY (rhbz 923721) + +* Tue Mar 19 2013 Dave Jones - 3.9.0-0.rc3.git0.4 +- Reenable debugging options. + +* Tue Mar 19 2013 Dave Jones +- cpufreq/intel_pstate: Add function to check that all MSR's are valid (rhbz 922923) + +* Mon Mar 18 2013 Dave Jones - 3.9.0-0.rc3.git0.3 +- s390x config option changes from Dan Horák + - enable PCI + - disable few useless drivers + - disable drivers conflicting with s390x + +* Mon Mar 18 2013 Dave Jones - 3.9.0-0.rc3.git0.2 +- Linux 3.9-rc3 + merged: w1-fix-oops-when-w1_search-is-called-from.patch +- Disable debugging options. + +* Sun Mar 17 2013 Peter Robinson +- Merge OMAP support into ARM unified kernel +- Add ARM LPAE kernel for Cortex A-15 devices that support LPAE and HW virtualisation +- Unified ARM kernel provides highbank and OMAP support +- Drop remantents of ARM softfp kernels + +* Fri Mar 15 2013 Josh Boyer +- Fix divide by zero on host TSC calibration failure (rhbz 859282) + +* Fri Mar 15 2013 Josh Boyer - 3.9.0-0.rc2.git1.1 +- Linux v3.9-rc2-292-ga2362d2 +- Fixes CVE-2013-1860 kernel: usb: cdc-wdm buffer overflow triggered by device + +* Wed Mar 13 2013 Dave Jones - 3.9.0-0.rc2.git0.3 +- Reenable debugging options. + +* Tue Mar 12 2013 Josh Boyer +- Add patch to fix ieee80211_do_stop (rhbz 892599) +- Add patches to fix cfg80211 issues with suspend (rhbz 856863) +- CVE-2013-0913 drm/i915: head writing overflow (rhbz 920471 920529) +- CVE-2013-0914 sa_restorer information leak (rhbz 920499 920510) + * Tue Mar 12 2013 Dave Airlie - add QXL driver (f19 only) diff --git a/keys-fix-race-with-concurrent-install_user_keyrings.patch b/keys-fix-race-with-concurrent-install_user_keyrings.patch deleted file mode 100644 index ba7b30a6d..000000000 --- a/keys-fix-race-with-concurrent-install_user_keyrings.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c -index 58dfe08..c5ec083 100644 ---- a/security/keys/process_keys.c -+++ b/security/keys/process_keys.c -@@ -57,7 +57,7 @@ int install_user_keyrings(void) - - kenter("%p{%u}", user, uid); - -- if (user->uid_keyring) { -+ if (user->uid_keyring && user->session_keyring) { - kleave(" = 0 [exist]"); - return 0; - } - - \ No newline at end of file diff --git a/lib-percpu_counter.c-fix-bad-percpu-counter-state-du.patch b/lib-percpu_counter.c-fix-bad-percpu-counter-state-du.patch new file mode 100644 index 000000000..7cc9d9ee3 --- /dev/null +++ b/lib-percpu_counter.c-fix-bad-percpu-counter-state-du.patch @@ -0,0 +1,63 @@ +Bugzilla: 1074235 +Upstream-status: 3.15 and CC'd to stable + +From e39435ce68bb4685288f78b1a7e24311f7ef939f Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Tue, 8 Apr 2014 16:04:12 -0700 +Subject: [PATCH] lib/percpu_counter.c: fix bad percpu counter state during + suspend + +I got a bug report yesterday from Laszlo Ersek in which he states that +his kvm instance fails to suspend. Laszlo bisected it down to this +commit 1cf7e9c68fe8 ("virtio_blk: blk-mq support") where virtio-blk is +converted to use the blk-mq infrastructure. + +After digging a bit, it became clear that the issue was with the queue +drain. blk-mq tracks queue usage in a percpu counter, which is +incremented on request alloc and decremented when the request is freed. +The initial hunt was for an inconsistency in blk-mq, but everything +seemed fine. In fact, the counter only returned crazy values when +suspend was in progress. + +When a CPU is unplugged, the percpu counters merges that CPU state with +the general state. blk-mq takes care to register a hotcpu notifier with +the appropriate priority, so we know it runs after the percpu counter +notifier. However, the percpu counter notifier only merges the state +when the CPU is fully gone. This leaves a state transition where the +CPU going away is no longer in the online mask, yet it still holds +private values. This means that in this state, percpu_counter_sum() +returns invalid results, and the suspend then hangs waiting for +abs(dead-cpu-value) requests to complete which of course will never +happen. + +Fix this by clearing the state earlier, so we never have a case where +the CPU isn't in online mask but still holds private state. This bug +has been there since forever, I guess we don't have a lot of users where +percpu counters needs to be reliable during the suspend cycle. + +Signed-off-by: Jens Axboe +Reported-by: Laszlo Ersek +Tested-by: Laszlo Ersek +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + lib/percpu_counter.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c +index 8280a5dd1727..7dd33577b905 100644 +--- a/lib/percpu_counter.c ++++ b/lib/percpu_counter.c +@@ -169,7 +169,7 @@ static int percpu_counter_hotcpu_callback(struct notifier_block *nb, + struct percpu_counter *fbc; + + compute_batch_value(); +- if (action != CPU_DEAD) ++ if (action != CPU_DEAD && action != CPU_DEAD_FROZEN) + return NOTIFY_OK; + + cpu = (unsigned long)hcpu; +-- +1.8.5.3 + diff --git a/locks-allow-__break_lease-to-sleep-even-when-break_t.patch b/locks-allow-__break_lease-to-sleep-even-when-break_t.patch new file mode 100644 index 000000000..ee893f099 --- /dev/null +++ b/locks-allow-__break_lease-to-sleep-even-when-break_t.patch @@ -0,0 +1,50 @@ +Bugzilla: 1082586 +Upstream-status: 3.15 and sent for stable + +From f1c6bb2cb8b81013e8979806f8e15e3d53efb96d Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Tue, 15 Apr 2014 06:17:49 -0400 +Subject: [PATCH] locks: allow __break_lease to sleep even when break_time is 0 + +A fl->fl_break_time of 0 has a special meaning to the lease break code +that basically means "never break the lease". knfsd uses this to ensure +that leases don't disappear out from under it. + +Unfortunately, the code in __break_lease can end up passing this value +to wait_event_interruptible as a timeout, which prevents it from going +to sleep at all. This makes __break_lease to spin in a tight loop and +causes soft lockups. + +Fix this by ensuring that we pass a minimum value of 1 as a timeout +instead. + +Cc: +Cc: J. Bruce Fields +Reported-by: Terry Barnaby +Signed-off-by: Jeff Layton +--- + fs/locks.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/fs/locks.c b/fs/locks.c +index 13fc7a6d380a..b380f5543614 100644 +--- a/fs/locks.c ++++ b/fs/locks.c +@@ -1391,11 +1391,10 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) + + restart: + break_time = flock->fl_break_time; +- if (break_time != 0) { ++ if (break_time != 0) + break_time -= jiffies; +- if (break_time == 0) +- break_time++; +- } ++ if (break_time == 0) ++ break_time++; + locks_insert_block(flock, new_fl); + spin_unlock(&inode->i_lock); + error = wait_event_interruptible_timeout(new_fl->fl_wait, +-- +1.9.0 + diff --git a/makefile-after_link.patch b/makefile-after_link.patch index b520b1942..82a366351 100644 --- a/makefile-after_link.patch +++ b/makefile-after_link.patch @@ -8,11 +8,25 @@ after each final link. This includes vmlinux itself and vDSO images. Signed-off-by: Roland McGrath +diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile +index d8064af..04dcfe1 100644 +--- a/arch/arm64/kernel/vdso/Makefile ++++ b/arch/arm64/kernel/vdso/Makefile +@@ -48,7 +48,8 @@ $(obj-vdso): %.o: %.S + + # Actual build commands + quiet_cmd_vdsold = VDSOL $@ +- cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@ ++ cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@ \ ++ $(if $(AFTER_LINK),; $(AFTER_LINK)) + quiet_cmd_vdsoas = VDSOA $@ + cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $< + diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile -index 9a7946c..28d6765 100644 +index 53e6c9b..e427844 100644 --- a/arch/powerpc/kernel/vdso32/Makefile +++ b/arch/powerpc/kernel/vdso32/Makefile -@@ -41,7 +41,8 @@ $(obj-vdso32): %.o: %.S +@@ -43,7 +43,8 @@ $(obj-vdso32): %.o: %.S # actual build commands quiet_cmd_vdso32ld = VDSO32L $@ @@ -23,7 +37,7 @@ index 9a7946c..28d6765 100644 cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $< diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile -index 8c500d8..d27737b 100644 +index effca94..713891a 100644 --- a/arch/powerpc/kernel/vdso64/Makefile +++ b/arch/powerpc/kernel/vdso64/Makefile @@ -36,7 +36,8 @@ $(obj-vdso64): %.o: %.S @@ -81,7 +95,7 @@ index fd14be1..1f3eb19 100644 VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) GCOV_PROFILE := n diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh -index cd9c6c6..3edf048 100644 +index 0149949..e307cda 100644 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -65,6 +65,10 @@ vmlinux_link() @@ -95,6 +109,3 @@ index cd9c6c6..3edf048 100644 } --- -1.7.7.6 - diff --git a/mm-page_alloc.c-change-mm-debug-routines-back-to-EXP.patch b/mm-page_alloc.c-change-mm-debug-routines-back-to-EXP.patch new file mode 100644 index 000000000..c0144bad2 --- /dev/null +++ b/mm-page_alloc.c-change-mm-debug-routines-back-to-EXP.patch @@ -0,0 +1,61 @@ +Bugzilla: 1074710 +Upstream-status: 3.15 + +From ed12d845b5f528cc0846023862b9c448a36122ec Mon Sep 17 00:00:00 2001 +From: John Hubbard +Date: Mon, 7 Apr 2014 15:37:59 -0700 +Subject: [PATCH] mm/page_alloc.c: change mm debug routines back to + EXPORT_SYMBOL + +A new dump_page() routine was recently added, and marked +EXPORT_SYMBOL_GPL. dump_page() was also added to the VM_BUG_ON_PAGE() +macro, and so the end result is that non-GPL code can no longer call +get_page() and a few other routines. + +This only happens if the kernel was compiled with CONFIG_DEBUG_VM. + +Change dump_page() to be EXPORT_SYMBOL. + +Longer explanation: + +Prior to commit 309381feaee5 ("mm: dump page when hitting a VM_BUG_ON +using VM_BUG_ON_PAGE") , it was possible to build MIT-licensed (non-GPL) +drivers on Fedora. Fedora is semi-unique, in that it sets +CONFIG_VM_DEBUG. + +Because Fedora sets CONFIG_VM_DEBUG, they end up pulling in dump_page(), +via VM_BUG_ON_PAGE, via get_page(). As one of the authors of NVIDIA's +new, open source, "UVM-Lite" kernel module, I originally choose to use +the kernel's get_page() routine from within nvidia_uvm_page_cache.c, +because get_page() has always seemed to be very clearly intended for use +by non-GPL, driver code. + +So I'm hoping that making get_page() widely accessible again will not be +too controversial. We did check with Fedora first, and they responded +(https://bugzilla.redhat.com/show_bug.cgi?id=1074710#c3) that we should +try to get upstream changed, before asking Fedora to change. Their +reasoning seems beneficial to Linux: leaving CONFIG_DEBUG_VM set allows +Fedora to help catch mm bugs. + +Signed-off-by: John Hubbard +Cc: Sasha Levin +Cc: Josh Boyer +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + mm/page_alloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 48427a7cfb45..5dba2933c9c0 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -6568,4 +6568,4 @@ void dump_page(struct page *page, const char *reason) + { + dump_page_badflags(page, reason, 0); + } +-EXPORT_SYMBOL_GPL(dump_page); ++EXPORT_SYMBOL(dump_page); +-- +1.9.0 + diff --git a/mm-try_to_unmap_cluster-should-lock_page-before-mloc.patch b/mm-try_to_unmap_cluster-should-lock_page-before-mloc.patch new file mode 100644 index 000000000..1c229ce52 --- /dev/null +++ b/mm-try_to_unmap_cluster-should-lock_page-before-mloc.patch @@ -0,0 +1,95 @@ +Bugzilla: 1093084 +Upstream-status: 3.15 and stable CC'd + +From 85cc8301cbedcf3049ce15de6f3c2b9e935d0d76 Mon Sep 17 00:00:00 2001 +From: Vlastimil Babka +Date: Mon, 7 Apr 2014 15:37:50 -0700 +Subject: [PATCH] mm: try_to_unmap_cluster() should lock_page() before mlocking + +A BUG_ON(!PageLocked) was triggered in mlock_vma_page() by Sasha Levin +fuzzing with trinity. The call site try_to_unmap_cluster() does not lock +the pages other than its check_page parameter (which is already locked). + +The BUG_ON in mlock_vma_page() is not documented and its purpose is +somewhat unclear, but apparently it serializes against page migration, +which could otherwise fail to transfer the PG_mlocked flag. This would +not be fatal, as the page would be eventually encountered again, but +NR_MLOCK accounting would become distorted nevertheless. This patch adds +a comment to the BUG_ON in mlock_vma_page() and munlock_vma_page() to that +effect. + +The call site try_to_unmap_cluster() is fixed so that for page != +check_page, trylock_page() is attempted (to avoid possible deadlocks as we +already have check_page locked) and mlock_vma_page() is performed only +upon success. If the page lock cannot be obtained, the page is left +without PG_mlocked, which is again not a problem in the whole unevictable +memory design. + +Signed-off-by: Vlastimil Babka +Signed-off-by: Bob Liu +Reported-by: Sasha Levin +Cc: Wanpeng Li +Cc: Michel Lespinasse +Cc: KOSAKI Motohiro +Acked-by: Rik van Riel +Cc: David Rientjes +Cc: Mel Gorman +Cc: Hugh Dickins +Cc: Joonsoo Kim +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + mm/mlock.c | 2 ++ + mm/rmap.c | 14 ++++++++++++-- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/mm/mlock.c b/mm/mlock.c +index 192e6eebe4f2..1b12dfad0794 100644 +--- a/mm/mlock.c ++++ b/mm/mlock.c +@@ -79,6 +79,7 @@ void clear_page_mlock(struct page *page) + */ + void mlock_vma_page(struct page *page) + { ++ /* Serialize with page migration */ + BUG_ON(!PageLocked(page)); + + if (!TestSetPageMlocked(page)) { +@@ -153,6 +154,7 @@ unsigned int munlock_vma_page(struct page *page) + { + unsigned int nr_pages; + ++ /* For try_to_munlock() and to serialize with page migration */ + BUG_ON(!PageLocked(page)); + + if (TestClearPageMlocked(page)) { +diff --git a/mm/rmap.c b/mm/rmap.c +index 068522d8502a..b99c74271fec 100644 +--- a/mm/rmap.c ++++ b/mm/rmap.c +@@ -1389,9 +1389,19 @@ static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount, + BUG_ON(!page || PageAnon(page)); + + if (locked_vma) { +- mlock_vma_page(page); /* no-op if already mlocked */ +- if (page == check_page) ++ if (page == check_page) { ++ /* we know we have check_page locked */ ++ mlock_vma_page(page); + ret = SWAP_MLOCK; ++ } else if (trylock_page(page)) { ++ /* ++ * If we can lock the page, perform mlock. ++ * Otherwise leave the page alone, it will be ++ * eventually encountered again later. ++ */ ++ mlock_vma_page(page); ++ unlock_page(page); ++ } + continue; /* don't unmap */ + } + +-- +1.9.0 + diff --git a/mod-sign.sh b/mod-sign.sh index 9d95d48a0..5081e77dc 100755 --- a/mod-sign.sh +++ b/mod-sign.sh @@ -9,20 +9,28 @@ # This essentially duplicates the 'modules_sign' Kbuild target and runs the # same commands for those modules. -moddir=$1 +MODSECKEY=$1 +MODPUBKEY=$2 + +moddir=$3 modules=`find $moddir -name *.ko` -MODSECKEY="./signing_key.priv" -MODPUBKEY="./signing_key.x509" - for mod in $modules do dir=`dirname $mod` file=`basename $mod` - ./scripts/sign-file sha256 ${MODSECKEY} ${MODPUBKEY} ${dir}/${file} \ - ${dir}/${file}.signed - mv ${dir}/${file}.signed ${dir}/${file} + ./scripts/sign-file sha256 ${MODSECKEY} ${MODPUBKEY} ${dir}/${file} rm -f ${dir}/${file}.{sig,dig} done + +RANDOMMOD=$(find $moddir -type f -name '*.ko' | sort -R | head -n 1) +if [ "~Module signature appended~" != "$(tail -c 28 $RANDOMMOD)" ]; then + echo "*****************************" + echo "*** Modules are unsigned! ***" + echo "*****************************" + exit 1 +fi + +exit 0 diff --git a/modsign-uefi.patch b/modsign-uefi.patch new file mode 100644 index 000000000..a3f3a56e0 --- /dev/null +++ b/modsign-uefi.patch @@ -0,0 +1,621 @@ +From 0a5e59dd7a921f20d77b13aa4e01392086ddbd12 Mon Sep 17 00:00:00 2001 +From: Dave Howells +Date: Tue, 23 Oct 2012 09:30:54 -0400 +Subject: [PATCH 1/5] Add EFI signature data types + +Add the data types that are used for containing hashes, keys and certificates +for cryptographic verification. + +Signed-off-by: David Howells +--- + include/linux/efi.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/include/linux/efi.h b/include/linux/efi.h +index eed2202..1da1b3c 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -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 ) + ++#define EFI_CERT_SHA256_GUID \ ++ EFI_GUID( 0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 ) ++ ++#define EFI_CERT_X509_GUID \ ++ EFI_GUID( 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 ) ++ + typedef struct { + efi_guid_t guid; + u64 table; +@@ -524,6 +530,20 @@ typedef struct { + + #define EFI_INVALID_TABLE_ADDR (~0UL) + ++typedef struct { ++ efi_guid_t signature_owner; ++ u8 signature_data[]; ++} efi_signature_data_t; ++ ++typedef struct { ++ efi_guid_t signature_type; ++ u32 signature_list_size; ++ u32 signature_header_size; ++ u32 signature_size; ++ u8 signature_header[]; ++ /* efi_signature_data_t signatures[][] */ ++} efi_signature_list_t; ++ + /* + * All runtime access to EFI goes through this structure: + */ +-- +1.8.3.1 + + +From 8b75428a7e1813cd3bc225a959e63d67898e4808 Mon Sep 17 00:00:00 2001 +From: Dave Howells +Date: Tue, 23 Oct 2012 09:36:28 -0400 +Subject: [PATCH 2/5] Add an EFI signature blob parser and key loader. + +X.509 certificates are loaded into the specified keyring as asymmetric type +keys. + +Signed-off-by: David Howells +--- + crypto/asymmetric_keys/Kconfig | 8 +++ + crypto/asymmetric_keys/Makefile | 1 + + crypto/asymmetric_keys/efi_parser.c | 109 ++++++++++++++++++++++++++++++++++++ + include/linux/efi.h | 4 ++ + 4 files changed, 122 insertions(+) + create mode 100644 crypto/asymmetric_keys/efi_parser.c + +diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig +index 6d2c2ea..ace9c30 100644 +--- a/crypto/asymmetric_keys/Kconfig ++++ b/crypto/asymmetric_keys/Kconfig +@@ -35,4 +35,12 @@ config X509_CERTIFICATE_PARSER + data and provides the ability to instantiate a crypto key from a + public key packet found inside the certificate. + ++config EFI_SIGNATURE_LIST_PARSER ++ bool "EFI signature list parser" ++ depends on EFI ++ select X509_CERTIFICATE_PARSER ++ help ++ This option provides support for parsing EFI signature lists for ++ X.509 certificates and turning them into keys. ++ + endif # ASYMMETRIC_KEY_TYPE +diff --git a/crypto/asymmetric_keys/Makefile b/crypto/asymmetric_keys/Makefile +index 0727204..cd8388e 100644 +--- a/crypto/asymmetric_keys/Makefile ++++ b/crypto/asymmetric_keys/Makefile +@@ -8,6 +8,7 @@ asymmetric_keys-y := asymmetric_type.o signature.o + + obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key.o + obj-$(CONFIG_PUBLIC_KEY_ALGO_RSA) += rsa.o ++obj-$(CONFIG_EFI_SIGNATURE_LIST_PARSER) += efi_parser.o + + # + # X.509 Certificate handling +diff --git a/crypto/asymmetric_keys/efi_parser.c b/crypto/asymmetric_keys/efi_parser.c +new file mode 100644 +index 0000000..424896a +--- /dev/null ++++ b/crypto/asymmetric_keys/efi_parser.c +@@ -0,0 +1,109 @@ ++/* EFI signature/key/certificate list parser ++ * ++ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. ++ * Written by David Howells (dhowells@redhat.com) ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public Licence ++ * as published by the Free Software Foundation; either version ++ * 2 of the Licence, or (at your option) any later version. ++ */ ++ ++#define pr_fmt(fmt) "EFI: "fmt ++#include ++#include ++#include ++#include ++#include ++ ++static __initdata efi_guid_t efi_cert_x509_guid = EFI_CERT_X509_GUID; ++ ++/** ++ * parse_efi_signature_list - Parse an EFI signature list for certificates ++ * @data: The data blob to parse ++ * @size: The size of the data blob ++ * @keyring: The keyring to add extracted keys to ++ */ ++int __init parse_efi_signature_list(const void *data, size_t size, struct key *keyring) ++{ ++ unsigned offs = 0; ++ size_t lsize, esize, hsize, elsize; ++ ++ pr_devel("-->%s(,%zu)\n", __func__, size); ++ ++ while (size > 0) { ++ efi_signature_list_t list; ++ const efi_signature_data_t *elem; ++ key_ref_t key; ++ ++ if (size < sizeof(list)) ++ return -EBADMSG; ++ ++ memcpy(&list, data, sizeof(list)); ++ pr_devel("LIST[%04x] guid=%pUl ls=%x hs=%x ss=%x\n", ++ offs, ++ list.signature_type.b, list.signature_list_size, ++ list.signature_header_size, list.signature_size); ++ ++ lsize = list.signature_list_size; ++ hsize = list.signature_header_size; ++ esize = list.signature_size; ++ elsize = lsize - sizeof(list) - hsize; ++ ++ if (lsize > size) { ++ pr_devel("<--%s() = -EBADMSG [overrun @%x]\n", ++ __func__, offs); ++ return -EBADMSG; ++ } ++ if (lsize < sizeof(list) || ++ lsize - sizeof(list) < hsize || ++ esize < sizeof(*elem) || ++ elsize < esize || ++ elsize % esize != 0) { ++ pr_devel("- bad size combo @%x\n", offs); ++ return -EBADMSG; ++ } ++ ++ if (efi_guidcmp(list.signature_type, efi_cert_x509_guid) != 0) { ++ data += lsize; ++ size -= lsize; ++ offs += lsize; ++ continue; ++ } ++ ++ data += sizeof(list) + hsize; ++ size -= sizeof(list) + hsize; ++ offs += sizeof(list) + hsize; ++ ++ for (; elsize > 0; elsize -= esize) { ++ elem = data; ++ ++ pr_devel("ELEM[%04x]\n", offs); ++ ++ key = key_create_or_update( ++ make_key_ref(keyring, 1), ++ "asymmetric", ++ NULL, ++ &elem->signature_data, ++ esize - sizeof(*elem), ++ (KEY_POS_ALL & ~KEY_POS_SETATTR) | ++ KEY_USR_VIEW, ++ KEY_ALLOC_NOT_IN_QUOTA | ++ KEY_ALLOC_TRUSTED); ++ ++ if (IS_ERR(key)) ++ pr_err("Problem loading in-kernel X.509 certificate (%ld)\n", ++ PTR_ERR(key)); ++ else ++ pr_notice("Loaded cert '%s' linked to '%s'\n", ++ key_ref_to_ptr(key)->description, ++ keyring->description); ++ ++ data += esize; ++ size -= esize; ++ offs += esize; ++ } ++ } ++ ++ return 0; ++} +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 1da1b3c..42a1d25 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -619,6 +619,10 @@ extern int efi_set_rtc_mmss(const struct timespec *now); + extern void efi_reserve_boot_services(void); + extern struct efi_memory_map memmap; + ++struct key; ++extern int __init parse_efi_signature_list(const void *data, size_t size, ++ struct key *keyring); ++ + /** + * efi_range_is_wc - check the WC bit on an address range + * @start: starting kvirt address +-- +1.8.3.1 + + +From 920108c0f9cc5854dd329a5dfc904e91d40a4b26 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Fri, 26 Oct 2012 12:36:24 -0400 +Subject: [PATCH 3/5] 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 +and if the module's certificate is found, it will refuse to load. This is +useful in cases where third party certificates are used for module signing. + +Signed-off-by: Josh Boyer +--- + include/keys/system_keyring.h | 4 ++++ + init/Kconfig | 9 +++++++++ + kernel/module_signing.c | 12 ++++++++++++ + kernel/system_keyring.c | 17 +++++++++++++++++ + 4 files changed, 42 insertions(+) + +diff --git a/include/keys/system_keyring.h b/include/keys/system_keyring.h +index 8dabc39..e466de1 100644 +--- a/include/keys/system_keyring.h ++++ b/include/keys/system_keyring.h +@@ -18,6 +18,10 @@ + + extern struct key *system_trusted_keyring; + ++#ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING ++extern struct key *system_blacklist_keyring; ++#endif ++ + #endif + + #endif /* _KEYS_SYSTEM_KEYRING_H */ +diff --git a/init/Kconfig b/init/Kconfig +index 0ff5407..ba76e57 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1680,6 +1680,15 @@ config SYSTEM_TRUSTED_KEYRING + + Keys in this keyring are used by module signature checking. + ++config SYSTEM_BLACKLIST_KEYRING ++ bool "Provide system-wide ring of blacklisted keys" ++ depends on KEYS ++ help ++ Provide a system keyring to which blacklisted keys can be added. Keys ++ in the keyring are considered entirely untrusted. Keys in this keyring ++ are used by the module signature checking to reject loading of modules ++ signed with a blacklisted key. ++ + config PROFILING + bool "Profiling support" + help +diff --git a/kernel/module_signing.c b/kernel/module_signing.c +index 0b6b870..0a29b40 100644 +--- a/kernel/module_signing.c ++++ b/kernel/module_signing.c +@@ -158,6 +158,18 @@ static struct key *request_asymmetric_key(const char *signer, size_t signer_len, + + pr_debug("Look up: \"%s\"\n", id); + ++#ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING ++ key = keyring_search(make_key_ref(system_blacklist_keyring, 1), ++ &key_type_asymmetric, id); ++ if (!IS_ERR(key)) { ++ /* module is signed with a cert in the blacklist. reject */ ++ pr_err("Module key '%s' is in blacklist\n", id); ++ key_ref_put(key); ++ kfree(id); ++ return ERR_PTR(-EKEYREJECTED); ++ } ++#endif ++ + key = keyring_search(make_key_ref(system_trusted_keyring, 1), + &key_type_asymmetric, id); + if (IS_ERR(key)) +diff --git a/kernel/system_keyring.c b/kernel/system_keyring.c +index 564dd93..389b50d 100644 +--- a/kernel/system_keyring.c ++++ b/kernel/system_keyring.c +@@ -20,6 +20,9 @@ + + struct key *system_trusted_keyring; + EXPORT_SYMBOL_GPL(system_trusted_keyring); ++#ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING ++struct key *system_blacklist_keyring; ++#endif + + extern __initconst const u8 system_certificate_list[]; + extern __initconst const u8 system_certificate_list_end[]; +@@ -41,6 +44,20 @@ static __init int system_trusted_keyring_init(void) + panic("Can't allocate system trusted keyring\n"); + + set_bit(KEY_FLAG_TRUSTED_ONLY, &system_trusted_keyring->flags); ++ ++#ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING ++ system_blacklist_keyring = keyring_alloc(".system_blacklist_keyring", ++ KUIDT_INIT(0), KGIDT_INIT(0), ++ current_cred(), ++ (KEY_POS_ALL & ~KEY_POS_SETATTR) | ++ KEY_USR_VIEW | KEY_USR_READ, ++ KEY_ALLOC_NOT_IN_QUOTA, NULL); ++ if (IS_ERR(system_blacklist_keyring)) ++ panic("Can't allocate system blacklist keyring\n"); ++ ++ set_bit(KEY_FLAG_TRUSTED_ONLY, &system_blacklist_keyring->flags); ++#endif ++ + return 0; + } + +-- +1.8.3.1 + + +From 69dca9998380c1931227a01205cdf23c34509753 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Fri, 26 Oct 2012 12:42:16 -0400 +Subject: [PATCH 4/5] 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 +allows for a third party signing certificate to be used in conjunction +with signed modules. By importing the public certificate into the 'db' +variable, a user can allow a module signed with that certificate to +load. The shim UEFI bootloader has a similar certificate list stored +in the 'MokListRT' variable. We import those as well. + +In the opposite case, Secure Boot maintains a list of disallowed +certificates in the 'dbx' variable. We load those certificates into +the newly introduced system blacklist keyring and forbid any module +signed with those from loading. + +Signed-off-by: Josh Boyer +--- + include/linux/efi.h | 6 ++++ + init/Kconfig | 9 +++++ + kernel/Makefile | 3 ++ + 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 42a1d25..d3e6036 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -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 ) + ++#define EFI_IMAGE_SECURITY_DATABASE_GUID \ ++ EFI_GUID( 0xd719b2cb, 0x3d3a, 0x4596, 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f ) ++ ++#define EFI_SHIM_LOCK_GUID \ ++ EFI_GUID( 0x605dab50, 0xe046, 0x4300, 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 ) ++ + typedef struct { + efi_guid_t guid; + u64 table; +diff --git a/init/Kconfig b/init/Kconfig +index ba76e57..b09cd98 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1799,6 +1799,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 + ++config MODULE_SIG_UEFI ++ bool "Allow modules signed with certs stored in UEFI" ++ depends on MODULE_SIG && SYSTEM_BLACKLIST_KEYRING && EFI ++ select EFI_SIGNATURE_LIST_PARSER ++ help ++ This will import certificates stored in UEFI and allow modules ++ signed with those to be loaded. It will also disallow loading ++ of modules stored in the UEFI dbx variable. ++ + choice + prompt "Which hash algorithm should modules be signed with?" + depends on MODULE_SIG +diff --git a/kernel/Makefile b/kernel/Makefile +index 6313698..cb35a89 100644 +--- a/kernel/Makefile ++++ b/kernel/Makefile +@@ -57,6 +57,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 ++obj-$(CONFIG_MODULE_SIG_UEFI) += modsign_uefi.o + obj-$(CONFIG_KALLSYMS) += kallsyms.o + obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o + obj-$(CONFIG_KEXEC) += kexec.o +@@ -115,6 +116,8 @@ obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o + + $(obj)/configs.o: $(obj)/config_data.h + ++$(obj)/modsign_uefi.o: KBUILD_CFLAGS += -fshort-wchar ++ + # config_data.h contains the same information as ikconfig.h but gzipped. + # Info from config_data can be extracted from /proc/config* + targets += config_data.gz +diff --git a/kernel/modsign_uefi.c b/kernel/modsign_uefi.c +new file mode 100644 +index 0000000..94b0eb3 +--- /dev/null ++++ b/kernel/modsign_uefi.c +@@ -0,0 +1,92 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "module-internal.h" ++ ++static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid, unsigned long *size) ++{ ++ efi_status_t status; ++ unsigned long lsize = 4; ++ unsigned long tmpdb[4]; ++ void *db = NULL; ++ ++ status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb); ++ if (status != EFI_BUFFER_TOO_SMALL) { ++ pr_err("Couldn't get size: 0x%lx\n", status); ++ return NULL; ++ } ++ ++ db = kmalloc(lsize, GFP_KERNEL); ++ if (!db) { ++ pr_err("Couldn't allocate memory for uefi cert list\n"); ++ goto out; ++ } ++ ++ status = efi.get_variable(name, guid, NULL, &lsize, db); ++ if (status != EFI_SUCCESS) { ++ kfree(db); ++ db = NULL; ++ pr_err("Error reading db var: 0x%lx\n", status); ++ } ++out: ++ *size = lsize; ++ return db; ++} ++ ++/* ++ * * Load the certs contained in the UEFI databases ++ * */ ++static int __init load_uefi_certs(void) ++{ ++ efi_guid_t secure_var = EFI_IMAGE_SECURITY_DATABASE_GUID; ++ efi_guid_t mok_var = EFI_SHIM_LOCK_GUID; ++ void *db = NULL, *dbx = NULL, *mok = NULL; ++ unsigned long dbsize = 0, dbxsize = 0, moksize = 0; ++ int rc = 0; ++ ++ /* Check if SB is enabled and just return if not */ ++ if (!efi_enabled(EFI_SECURE_BOOT)) ++ return 0; ++ ++ /* Get db, MokListRT, and dbx. They might not exist, so it isn't ++ * an error if we can't get them. ++ */ ++ db = get_cert_list(L"db", &secure_var, &dbsize); ++ if (!db) { ++ pr_err("MODSIGN: Couldn't get UEFI db list\n"); ++ } else { ++ rc = parse_efi_signature_list(db, dbsize, system_trusted_keyring); ++ if (rc) ++ pr_err("Couldn't parse db signatures: %d\n", rc); ++ kfree(db); ++ } ++ ++ mok = get_cert_list(L"MokListRT", &mok_var, &moksize); ++ if (!mok) { ++ pr_info("MODSIGN: Couldn't get UEFI MokListRT\n"); ++ } else { ++ rc = parse_efi_signature_list(mok, moksize, system_trusted_keyring); ++ if (rc) ++ pr_err("Couldn't parse MokListRT signatures: %d\n", rc); ++ kfree(mok); ++ } ++ ++ dbx = get_cert_list(L"dbx", &secure_var, &dbxsize); ++ if (!dbx) { ++ pr_info("MODSIGN: Couldn't get UEFI dbx list\n"); ++ } else { ++ rc = parse_efi_signature_list(dbx, dbxsize, ++ system_blacklist_keyring); ++ if (rc) ++ pr_err("Couldn't parse dbx signatures: %d\n", rc); ++ kfree(dbx); ++ } ++ ++ return rc; ++} ++late_initcall(load_uefi_certs); +-- +1.8.3.1 + + +From c8e6d256ddfa2182d5b011a4ab70f8c5c9b2b590 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Thu, 3 Oct 2013 10:14:23 -0400 +Subject: [PATCH 5/5] MODSIGN: Support not importing certs from db + +If a user tells shim to not use the certs/hashes in the UEFI db variable +for verification purposes, shim will set a UEFI variable called MokIgnoreDB. +Have the uefi import code look for this and not import things from the db +variable. + +Signed-off-by: Josh Boyer +--- + kernel/modsign_uefi.c | 40 +++++++++++++++++++++++++++++++--------- + 1 file changed, 31 insertions(+), 9 deletions(-) + +diff --git a/kernel/modsign_uefi.c b/kernel/modsign_uefi.c +index 94b0eb3..ae28b97 100644 +--- a/kernel/modsign_uefi.c ++++ b/kernel/modsign_uefi.c +@@ -8,6 +8,23 @@ + #include + #include "module-internal.h" + ++static __init int check_ignore_db(void) ++{ ++ efi_status_t status; ++ unsigned int db = 0; ++ unsigned long size = sizeof(db); ++ efi_guid_t guid = EFI_SHIM_LOCK_GUID; ++ ++ /* Check and see if the MokIgnoreDB variable exists. If that fails ++ * then we don't ignore DB. If it succeeds, we do. ++ */ ++ status = efi.get_variable(L"MokIgnoreDB", &guid, NULL, &size, &db); ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ return 1; ++} ++ + static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid, unsigned long *size) + { + efi_status_t status; +@@ -47,23 +64,28 @@ static int __init load_uefi_certs(void) + efi_guid_t mok_var = EFI_SHIM_LOCK_GUID; + void *db = NULL, *dbx = NULL, *mok = NULL; + unsigned long dbsize = 0, dbxsize = 0, moksize = 0; +- int rc = 0; ++ int ignore_db, rc = 0; + + /* Check if SB is enabled and just return if not */ + if (!efi_enabled(EFI_SECURE_BOOT)) + return 0; + ++ /* See if the user has setup Ignore DB mode */ ++ ignore_db = check_ignore_db(); ++ + /* Get db, MokListRT, and dbx. They might not exist, so it isn't + * an error if we can't get them. + */ +- db = get_cert_list(L"db", &secure_var, &dbsize); +- if (!db) { +- pr_err("MODSIGN: Couldn't get UEFI db list\n"); +- } else { +- rc = parse_efi_signature_list(db, dbsize, system_trusted_keyring); +- if (rc) +- pr_err("Couldn't parse db signatures: %d\n", rc); +- kfree(db); ++ if (!ignore_db) { ++ db = get_cert_list(L"db", &secure_var, &dbsize); ++ if (!db) { ++ pr_err("MODSIGN: Couldn't get UEFI db list\n"); ++ } else { ++ rc = parse_efi_signature_list(db, dbsize, system_trusted_keyring); ++ if (rc) ++ pr_err("Couldn't parse db signatures: %d\n", rc); ++ kfree(db); ++ } + } + + mok = get_cert_list(L"MokListRT", &mok_var, &moksize); +-- +1.8.3.1 + diff --git a/n_tty-Fix-n_tty_write-crash-when-echoing-in-raw-mode.patch b/n_tty-Fix-n_tty_write-crash-when-echoing-in-raw-mode.patch new file mode 100644 index 000000000..d5f980c9c --- /dev/null +++ b/n_tty-Fix-n_tty_write-crash-when-echoing-in-raw-mode.patch @@ -0,0 +1,86 @@ +Bugzilla: 1094240 +Upstream-status: 3.15 and CC'd to stable + +From 4291086b1f081b869c6d79e5b7441633dc3ace00 Mon Sep 17 00:00:00 2001 +From: Peter Hurley +Date: Sat, 3 May 2014 14:04:59 +0200 +Subject: [PATCH] n_tty: Fix n_tty_write crash when echoing in raw mode + +The tty atomic_write_lock does not provide an exclusion guarantee for +the tty driver if the termios settings are LECHO & !OPOST. And since +it is unexpected and not allowed to call TTY buffer helpers like +tty_insert_flip_string concurrently, this may lead to crashes when +concurrect writers call pty_write. In that case the following two +writers: +* the ECHOing from a workqueue and +* pty_write from the process +race and can overflow the corresponding TTY buffer like follows. + +If we look into tty_insert_flip_string_fixed_flag, there is: + int space = __tty_buffer_request_room(port, goal, flags); + struct tty_buffer *tb = port->buf.tail; + ... + memcpy(char_buf_ptr(tb, tb->used), chars, space); + ... + tb->used += space; + +so the race of the two can result in something like this: + A B +__tty_buffer_request_room + __tty_buffer_request_room +memcpy(buf(tb->used), ...) +tb->used += space; + memcpy(buf(tb->used), ...) ->BOOM + +B's memcpy is past the tty_buffer due to the previous A's tb->used +increment. + +Since the N_TTY line discipline input processing can output +concurrently with a tty write, obtain the N_TTY ldisc output_lock to +serialize echo output with normal tty writes. This ensures the tty +buffer helper tty_insert_flip_string is not called concurrently and +everything is fine. + +Note that this is nicely reproducible by an ordinary user using +forkpty and some setup around that (raw termios + ECHO). And it is +present in kernels at least after commit +d945cb9cce20ac7143c2de8d88b187f62db99bdc (pty: Rework the pty layer to +use the normal buffering logic) in 2.6.31-rc3. + +js: add more info to the commit log +js: switch to bool +js: lock unconditionally +js: lock only the tty->ops->write call + +References: CVE-2014-0196 +Reported-and-tested-by: Jiri Slaby +Signed-off-by: Peter Hurley +Signed-off-by: Jiri Slaby +Cc: Linus Torvalds +Cc: Alan Cox +Cc: +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/n_tty.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c +index 41fe8a047d37..fe9d129c8735 100644 +--- a/drivers/tty/n_tty.c ++++ b/drivers/tty/n_tty.c +@@ -2353,8 +2353,12 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, + if (tty->ops->flush_chars) + tty->ops->flush_chars(tty); + } else { ++ struct n_tty_data *ldata = tty->disc_data; ++ + while (nr > 0) { ++ mutex_lock(&ldata->output_lock); + c = tty->ops->write(tty, b, nr); ++ mutex_unlock(&ldata->output_lock); + if (c < 0) { + retval = c; + goto break_out; +-- +1.9.0 + diff --git a/nowatchdog-on-virt.patch b/nowatchdog-on-virt.patch new file mode 100644 index 000000000..118233fc0 --- /dev/null +++ b/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 + +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index 1241d8c..b2dc4e4 100644 +--- a/kernel/watchdog.c ++++ b/kernel/watchdog.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -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_user_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"), ++ }, ++ }, ++ {} ++}; ++ ++ + /* + * Hard-lockup warnings should be triggered after just a few seconds. Soft- + * lockups can have false positives under extreme conditions. So we generally +@@ -551,6 +578,8 @@ int proc_dowatchdog(struct ctl_table *table, int write, + + void __init lockup_detector_init(void) + { ++ dmi_check_system(watchdog_virt_dmi_table); ++ + set_sample_period(); + + #ifdef CONFIG_NO_HZ_FULL diff --git a/revert-input-wacom-testing-result-shows-get_report-is-unnecessary.patch b/revert-input-wacom-testing-result-shows-get_report-is-unnecessary.patch new file mode 100644 index 000000000..f9f4a72a0 --- /dev/null +++ b/revert-input-wacom-testing-result-shows-get_report-is-unnecessary.patch @@ -0,0 +1,40 @@ +Bugzilla: N/A +Upstream-status: Sent upstream + +This reverts commit 1b2faaf7e219fc2905d75afcd4c815e5d39eda80. + +The Intuos4 series presents a bug in which it hangs if it receives +a set feature command while switching to the enhanced mode. +This bug is triggered when plugging an Intuos 4 while having +a gnome user session up and running. + +Signed-off-by: Benjamin Tissoires +--- + +Hi Aris, + +actually, you bisected the bug, so can I consider that I have your signed-off-by? + +Cheers, +Benjamin + + drivers/input/tablet/wacom_sys.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c +index 7087b33..319a3ff 100644 +--- a/drivers/input/tablet/wacom_sys.c ++++ b/drivers/input/tablet/wacom_sys.c +@@ -536,6 +536,9 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int + + error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT, + report_id, rep_data, length, 1); ++ if (error >= 0) ++ error = wacom_get_report(intf, WAC_HID_FEATURE_REPORT, ++ report_id, rep_data, length, 1); + } while ((error < 0 || rep_data[1] != mode) && limit++ < WAC_MSG_RETRIES); + + kfree(rep_data); +-- +1.9.0 + diff --git a/sb-hibernate.patch b/sb-hibernate.patch new file mode 100644 index 000000000..447237c60 --- /dev/null +++ b/sb-hibernate.patch @@ -0,0 +1,112 @@ +From ffe1ee94d526900ce1e5191cdd38934477dd209a Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Fri, 26 Oct 2012 14:02:09 -0400 +Subject: [PATCH] hibernate: Disable in a signed modules environment + +There is currently no way to verify the resume image when returning +from hibernate. This might compromise the signed modules trust model, +so until we can work with signed hibernate images we disable it in +a secure modules environment. + +Signed-off-by: Josh Boyer +--- + kernel/power/hibernate.c | 16 +++++++++++++++- + kernel/power/main.c | 7 ++++++- + kernel/power/user.c | 1 + + 3 files changed, 22 insertions(+), 2 deletions(-) + +diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c +index b26f5f1..e65228b 100644 +--- a/kernel/power/hibernate.c ++++ b/kernel/power/hibernate.c +@@ -28,6 +28,8 @@ + #include + #include + #include ++#include ++#include + + #include "power.h" + +@@ -632,6 +634,10 @@ int hibernate(void) + { + int error; + ++ if (secure_modules()) { ++ return -EPERM; ++ } ++ + lock_system_sleep(); + /* The snapshot device should not be opened while we're running */ + if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { +@@ -723,7 +729,7 @@ static int software_resume(void) + /* + * If the user said "noresume".. bail out early. + */ +- if (noresume) ++ if (noresume || secure_modules()) + return 0; + + /* +@@ -889,6 +895,11 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr, + int i; + char *start = buf; + ++ if (efi_enabled(EFI_SECURE_BOOT)) { ++ buf += sprintf(buf, "[%s]\n", "disabled"); ++ return buf-start; ++ } ++ + for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { + if (!hibernation_modes[i]) + continue; +@@ -923,6 +934,9 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, + char *p; + int mode = HIBERNATION_INVALID; + ++ if (secure_modules()) ++ return -EPERM; ++ + p = memchr(buf, '\n', n); + len = p ? p - buf : n; + +diff --git a/kernel/power/main.c b/kernel/power/main.c +index 1d1bf63..300f300 100644 +--- a/kernel/power/main.c ++++ b/kernel/power/main.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include "power.h" + +@@ -301,7 +302,11 @@ static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr, + } + #endif + #ifdef CONFIG_HIBERNATION +- s += sprintf(s, "%s\n", "disk"); ++ if (!efi_enabled(EFI_SECURE_BOOT)) { ++ s += sprintf(s, "%s\n", "disk"); ++ } else { ++ s += sprintf(s, "\n"); ++ } + #else + if (s != buf) + /* convert the last space to a newline */ +diff --git a/kernel/power/user.c b/kernel/power/user.c +index 15cb72f..fa85ed5 100644 +--- a/kernel/power/user.c ++++ b/kernel/power/user.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + +-- +1.8.3.1 + diff --git a/secure-boot-20130218.patch b/secure-boot-20130218.patch deleted file mode 100644 index 29ac46cd9..000000000 --- a/secure-boot-20130218.patch +++ /dev/null @@ -1,1434 +0,0 @@ -From 0c5837031a4e996877930fd023a5877dd1d615ba Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Thu, 20 Sep 2012 10:40:56 -0400 -Subject: [PATCH 01/19] 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. -The simplest way to handle this would seem to be to add a new capability -and gate various functionality on that. We'll then strip it from the initial -capability set if required. - -Signed-off-by: Matthew Garrett ---- - include/uapi/linux/capability.h | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h -index ba478fa..7109e65 100644 ---- a/include/uapi/linux/capability.h -+++ b/include/uapi/linux/capability.h -@@ -343,7 +343,11 @@ struct vfs_cap_data { - - #define CAP_BLOCK_SUSPEND 36 - --#define CAP_LAST_CAP CAP_BLOCK_SUSPEND -+/* Allow things that trivially permit root to modify the running kernel */ -+ -+#define CAP_COMPROMISE_KERNEL 37 -+ -+#define CAP_LAST_CAP CAP_COMPROMISE_KERNEL - - #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) - --- -1.8.1.2 - - -From 87c8fddbcb3042fc4174b53763adbf66045a12be Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Thu, 20 Sep 2012 10:41:05 -0400 -Subject: [PATCH 02/19] 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 -capability class. - -Signed-off-by: Josh Boyer ---- - security/selinux/include/classmap.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h -index 14d04e6..ed99a2d 100644 ---- a/security/selinux/include/classmap.h -+++ b/security/selinux/include/classmap.h -@@ -146,8 +146,8 @@ struct security_class_mapping secclass_map[] = { - { "memprotect", { "mmap_zero", NULL } }, - { "peer", { "recv", NULL } }, - { "capability2", -- { "mac_override", "mac_admin", "syslog", "wake_alarm", "block_suspend", -- NULL } }, -+ { "mac_override", "mac_admin", "syslog", "wake_alarm", -+ "block_suspend", "compromise_kernel", NULL } }, - { "kernel_service", { "use_as_override", "create_files_as", NULL } }, - { "tun_socket", - { COMMON_SOCK_PERMS, "attach_queue", NULL } }, --- -1.8.1.2 - - -From df14b5319bf3ed2110839e233ac61e6136745be8 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Thu, 20 Sep 2012 10:41:02 -0400 -Subject: [PATCH 03/19] 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 -in the init_cred struct, which everything else inherits from. This works on -any machine and can be used to develop even if the box doesn't have UEFI. - -Signed-off-by: Josh Boyer ---- - Documentation/kernel-parameters.txt | 7 +++++++ - kernel/cred.c | 17 +++++++++++++++++ - 2 files changed, 24 insertions(+) - -diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt -index 6c72381..7dffdd5 100644 ---- a/Documentation/kernel-parameters.txt -+++ b/Documentation/kernel-parameters.txt -@@ -2654,6 +2654,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. - -+ secureboot_enable= -+ [KNL] Enables an emulated UEFI Secure Boot mode. This -+ locks down various aspects of the kernel guarded by the -+ CAP_COMPROMISE_KERNEL capability. This includes things -+ like /dev/mem, IO port access, and other areas. It can -+ be used on non-UEFI machines for testing purposes. -+ - security= [SECURITY] Choose a security module to enable at boot. - If this boot parameter is not specified, only the first - security module asking for security registration will be -diff --git a/kernel/cred.c b/kernel/cred.c -index e0573a4..c3f4e3e 100644 ---- a/kernel/cred.c -+++ b/kernel/cred.c -@@ -565,6 +565,23 @@ void __init cred_init(void) - 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); - } - -+void __init secureboot_enable() -+{ -+ pr_info("Secure boot enabled\n"); -+ cap_lower((&init_cred)->cap_bset, CAP_COMPROMISE_KERNEL); -+ cap_lower((&init_cred)->cap_permitted, CAP_COMPROMISE_KERNEL); -+} -+ -+/* Dummy Secure Boot enable option to fake out UEFI SB=1 */ -+static int __init secureboot_enable_opt(char *str) -+{ -+ int sb_enable = !!simple_strtol(str, NULL, 0); -+ if (sb_enable) -+ secureboot_enable(); -+ return 1; -+} -+__setup("secureboot_enable=", secureboot_enable_opt); -+ - /** - * 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 - - -From 49c76a665e8a09da48cbe271ea40266ca1a226c0 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Thu, 20 Sep 2012 10:41:03 -0400 -Subject: [PATCH 04/19] efi: Enable secure boot lockdown automatically when - enabled in firmware - -The firmware has a set of flags that indicate whether secure boot is enabled -and enforcing. Use them to indicate whether the kernel should lock itself -down. We also indicate the machine is in secure boot mode by adding the -EFI_SECURE_BOOT bit for use with efi_enabled. - -Signed-off-by: Matthew Garrett -Signed-off-by: Josh Boyer ---- - Documentation/x86/zero-page.txt | 2 ++ - arch/x86/boot/compressed/eboot.c | 32 ++++++++++++++++++++++++++++++++ - arch/x86/include/uapi/asm/bootparam.h | 3 ++- - arch/x86/kernel/setup.c | 7 +++++++ - include/linux/cred.h | 2 ++ - include/linux/efi.h | 1 + - 6 files changed, 46 insertions(+), 1 deletion(-) - -diff --git a/Documentation/x86/zero-page.txt b/Documentation/x86/zero-page.txt -index 199f453..ff651d3 100644 ---- a/Documentation/x86/zero-page.txt -+++ b/Documentation/x86/zero-page.txt -@@ -30,6 +30,8 @@ Offset Proto Name Meaning - 1E9/001 ALL eddbuf_entries Number of entries in eddbuf (below) - 1EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer - (below) -+1EB/001 ALL kbd_status Numlock is enabled -+1EC/001 ALL secure_boot Kernel should enable secure boot lockdowns - 1EF/001 ALL sentinel Used to detect broken bootloaders - 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 f8fa411..96bd86b 100644 ---- a/arch/x86/boot/compressed/eboot.c -+++ b/arch/x86/boot/compressed/eboot.c -@@ -849,6 +849,36 @@ fail: - return status; - } - -+static int get_secure_boot(efi_system_table_t *_table) -+{ -+ u8 sb, setup; -+ unsigned long datasize = sizeof(sb); -+ efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; -+ efi_status_t status; -+ -+ status = efi_call_phys5(sys_table->runtime->get_variable, -+ L"SecureBoot", &var_guid, NULL, &datasize, &sb); -+ -+ if (status != EFI_SUCCESS) -+ return 0; -+ -+ if (sb == 0) -+ return 0; -+ -+ -+ status = efi_call_phys5(sys_table->runtime->get_variable, -+ L"SetupMode", &var_guid, NULL, &datasize, -+ &setup); -+ -+ if (status != EFI_SUCCESS) -+ return 0; -+ -+ if (setup == 1) -+ return 0; -+ -+ return 1; -+} -+ - /* - * Because the x86 boot code expects to be passed a boot_params we - * need to create one ourselves (usually the bootloader would create -@@ -1143,6 +1173,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, - if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) - goto fail; - -+ boot_params->secure_boot = get_secure_boot(sys_table); -+ - setup_graphics(boot_params); - - setup_efi_pci(boot_params); -diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h -index c15ddaf..85d7685 100644 ---- a/arch/x86/include/uapi/asm/bootparam.h -+++ b/arch/x86/include/uapi/asm/bootparam.h -@@ -131,7 +131,8 @@ struct boot_params { - __u8 eddbuf_entries; /* 0x1e9 */ - __u8 edd_mbr_sig_buf_entries; /* 0x1ea */ - __u8 kbd_status; /* 0x1eb */ -- __u8 _pad5[3]; /* 0x1ec */ -+ __u8 secure_boot; /* 0x1ec */ -+ __u8 _pad5[2]; /* 0x1ed */ - /* - * 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 8b24289..d74b441 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -1042,6 +1042,13 @@ void __init setup_arch(char **cmdline_p) - - io_delay_init(); - -+ if (boot_params.secure_boot) { -+#ifdef CONFIG_EFI -+ set_bit(EFI_SECURE_BOOT, &x86_efi_facility); -+#endif -+ secureboot_enable(); -+ } -+ - /* - * Parse the ACPI tables for possible boot-time SMP configuration. - */ -diff --git a/include/linux/cred.h b/include/linux/cred.h -index 04421e8..9e69542 100644 ---- a/include/linux/cred.h -+++ b/include/linux/cred.h -@@ -156,6 +156,8 @@ extern int set_security_override_from_ctx(struct cred *, const char *); - extern int set_create_files_as(struct cred *, struct inode *); - extern void __init cred_init(void); - -+extern void secureboot_enable(void); -+ - /* - * check for validity of credentials - */ -diff --git a/include/linux/efi.h b/include/linux/efi.h -index 7a9498a..1ae16b6 100644 ---- a/include/linux/efi.h -+++ b/include/linux/efi.h -@@ -627,6 +627,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? */ -+#define EFI_SECURE_BOOT 6 /* Are we in Secure Boot mode? */ - - #ifdef CONFIG_EFI - # ifdef CONFIG_X86 --- -1.8.1.2 - - -From d4d1b3ad3e1a553c807b4ecafcbde4bf816e4db2 Mon Sep 17 00:00:00 2001 -From: Dave Howells -Date: Tue, 23 Oct 2012 09:30:54 -0400 -Subject: [PATCH 05/19] Add EFI signature data types - -Add the data types that are used for containing hashes, keys and certificates -for cryptographic verification. - -Signed-off-by: David Howells ---- - include/linux/efi.h | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/include/linux/efi.h b/include/linux/efi.h -index 1ae16b6..de7021d 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, - #define EFI_FILE_SYSTEM_GUID \ - EFI_GUID( 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b ) - -+#define EFI_CERT_SHA256_GUID \ -+ EFI_GUID( 0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 ) -+ -+#define EFI_CERT_X509_GUID \ -+ EFI_GUID( 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 ) -+ - typedef struct { - efi_guid_t guid; - u64 table; -@@ -523,6 +529,20 @@ typedef struct { - - #define EFI_INVALID_TABLE_ADDR (~0UL) - -+typedef struct { -+ efi_guid_t signature_owner; -+ u8 signature_data[]; -+} efi_signature_data_t; -+ -+typedef struct { -+ efi_guid_t signature_type; -+ u32 signature_list_size; -+ u32 signature_header_size; -+ u32 signature_size; -+ u8 signature_header[]; -+ /* efi_signature_data_t signatures[][] */ -+} efi_signature_list_t; -+ - /* - * All runtime access to EFI goes through this structure: - */ --- -1.8.1.2 - - -From 3cffca89eadf7e0f0a266c370f8034f33723831a Mon Sep 17 00:00:00 2001 -From: Dave Howells -Date: Tue, 23 Oct 2012 09:36:28 -0400 -Subject: [PATCH 06/19] Add an EFI signature blob parser and key loader. - -X.509 certificates are loaded into the specified keyring as asymmetric type -keys. - -Signed-off-by: David Howells ---- - crypto/asymmetric_keys/Kconfig | 8 +++ - crypto/asymmetric_keys/Makefile | 1 + - crypto/asymmetric_keys/efi_parser.c | 108 ++++++++++++++++++++++++++++++++++++ - include/linux/efi.h | 4 ++ - 4 files changed, 121 insertions(+) - create mode 100644 crypto/asymmetric_keys/efi_parser.c - -diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig -index 6d2c2ea..ace9c30 100644 ---- a/crypto/asymmetric_keys/Kconfig -+++ b/crypto/asymmetric_keys/Kconfig -@@ -35,4 +35,12 @@ config X509_CERTIFICATE_PARSER - data and provides the ability to instantiate a crypto key from a - public key packet found inside the certificate. - -+config EFI_SIGNATURE_LIST_PARSER -+ bool "EFI signature list parser" -+ depends on EFI -+ select X509_CERTIFICATE_PARSER -+ help -+ This option provides support for parsing EFI signature lists for -+ X.509 certificates and turning them into keys. -+ - endif # ASYMMETRIC_KEY_TYPE -diff --git a/crypto/asymmetric_keys/Makefile b/crypto/asymmetric_keys/Makefile -index 0727204..cd8388e 100644 ---- a/crypto/asymmetric_keys/Makefile -+++ b/crypto/asymmetric_keys/Makefile -@@ -8,6 +8,7 @@ asymmetric_keys-y := asymmetric_type.o signature.o - - obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key.o - obj-$(CONFIG_PUBLIC_KEY_ALGO_RSA) += rsa.o -+obj-$(CONFIG_EFI_SIGNATURE_LIST_PARSER) += efi_parser.o - - # - # X.509 Certificate handling -diff --git a/crypto/asymmetric_keys/efi_parser.c b/crypto/asymmetric_keys/efi_parser.c -new file mode 100644 -index 0000000..636feb1 ---- /dev/null -+++ b/crypto/asymmetric_keys/efi_parser.c -@@ -0,0 +1,108 @@ -+/* EFI signature/key/certificate list parser -+ * -+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. -+ * Written by David Howells (dhowells@redhat.com) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public Licence -+ * as published by the Free Software Foundation; either version -+ * 2 of the Licence, or (at your option) any later version. -+ */ -+ -+#define pr_fmt(fmt) "EFI: "fmt -+#include -+#include -+#include -+#include -+#include -+ -+static __initdata efi_guid_t efi_cert_x509_guid = EFI_CERT_X509_GUID; -+ -+/** -+ * parse_efi_signature_list - Parse an EFI signature list for certificates -+ * @data: The data blob to parse -+ * @size: The size of the data blob -+ * @keyring: The keyring to add extracted keys to -+ */ -+int __init parse_efi_signature_list(const void *data, size_t size, struct key *keyring) -+{ -+ unsigned offs = 0; -+ size_t lsize, esize, hsize, elsize; -+ -+ pr_devel("-->%s(,%zu)\n", __func__, size); -+ -+ while (size > 0) { -+ efi_signature_list_t list; -+ const efi_signature_data_t *elem; -+ key_ref_t key; -+ -+ if (size < sizeof(list)) -+ return -EBADMSG; -+ -+ memcpy(&list, data, sizeof(list)); -+ pr_devel("LIST[%04x] guid=%pUl ls=%x hs=%x ss=%x\n", -+ offs, -+ list.signature_type.b, list.signature_list_size, -+ list.signature_header_size, list.signature_size); -+ -+ lsize = list.signature_list_size; -+ hsize = list.signature_header_size; -+ esize = list.signature_size; -+ elsize = lsize - sizeof(list) - hsize; -+ -+ if (lsize > size) { -+ pr_devel("<--%s() = -EBADMSG [overrun @%x]\n", -+ __func__, offs); -+ return -EBADMSG; -+ } -+ if (lsize < sizeof(list) || -+ lsize - sizeof(list) < hsize || -+ esize < sizeof(*elem) || -+ elsize < esize || -+ elsize % esize != 0) { -+ pr_devel("- bad size combo @%x\n", offs); -+ return -EBADMSG; -+ } -+ -+ if (efi_guidcmp(list.signature_type, efi_cert_x509_guid) != 0) { -+ data += lsize; -+ size -= lsize; -+ offs += lsize; -+ continue; -+ } -+ -+ data += sizeof(list) + hsize; -+ size -= sizeof(list) + hsize; -+ offs += sizeof(list) + hsize; -+ -+ for (; elsize > 0; elsize -= esize) { -+ elem = data; -+ -+ pr_devel("ELEM[%04x]\n", offs); -+ -+ key = key_create_or_update( -+ make_key_ref(keyring, 1), -+ "asymmetric", -+ NULL, -+ &elem->signature_data, -+ esize - sizeof(*elem), -+ (KEY_POS_ALL & ~KEY_POS_SETATTR) | -+ KEY_USR_VIEW, -+ KEY_ALLOC_NOT_IN_QUOTA); -+ -+ if (IS_ERR(key)) -+ pr_err("Problem loading in-kernel X.509 certificate (%ld)\n", -+ PTR_ERR(key)); -+ else -+ pr_notice("Loaded cert '%s' linked to '%s'\n", -+ key_ref_to_ptr(key)->description, -+ keyring->description); -+ -+ data += esize; -+ size -= esize; -+ offs += esize; -+ } -+ } -+ -+ return 0; -+} -diff --git a/include/linux/efi.h b/include/linux/efi.h -index de7021d..64b3e55 100644 ---- a/include/linux/efi.h -+++ b/include/linux/efi.h -@@ -612,6 +612,10 @@ extern int efi_set_rtc_mmss(unsigned long nowtime); - extern void efi_reserve_boot_services(void); - extern struct efi_memory_map memmap; - -+struct key; -+extern int __init parse_efi_signature_list(const void *data, size_t size, -+ struct key *keyring); -+ - /** - * efi_range_is_wc - check the WC bit on an address range - * @start: starting kvirt address --- -1.8.1.2 - - -From 89ea7424726ae4f7265ab84e703cf2da77acda57 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Fri, 26 Oct 2012 12:36:24 -0400 -Subject: [PATCH 07/19] MODSIGN: Add module certificate 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 -and if the module's certificate is found, it will refuse to load. This is -useful in cases where third party certificates are used for module signing. - -Signed-off-by: Josh Boyer ---- - init/Kconfig | 8 ++++++++ - kernel/modsign_pubkey.c | 14 ++++++++++++++ - kernel/module-internal.h | 3 +++ - kernel/module_signing.c | 12 ++++++++++++ - 4 files changed, 37 insertions(+) - -diff --git a/init/Kconfig b/init/Kconfig -index be8b7f5..d972b77 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -1665,6 +1665,14 @@ config MODULE_SIG_FORCE - Reject unsigned modules or signed modules for which we don't have a - key. Without this, such modules will simply taint the kernel. - -+config MODULE_SIG_BLACKLIST -+ bool "Support for blacklisting module signature certificates" -+ depends on MODULE_SIG -+ help -+ This adds support for keeping a blacklist of certificates that -+ should not pass module signature verification. If a module is -+ signed with something in this keyring, the load will be rejected. -+ - choice - prompt "Which hash algorithm should modules be signed with?" - depends on MODULE_SIG -diff --git a/kernel/modsign_pubkey.c b/kernel/modsign_pubkey.c -index 2b6e699..4cd408d 100644 ---- a/kernel/modsign_pubkey.c -+++ b/kernel/modsign_pubkey.c -@@ -17,6 +17,9 @@ - #include "module-internal.h" - - struct key *modsign_keyring; -+#ifdef CONFIG_MODULE_SIG_BLACKLIST -+struct key *modsign_blacklist; -+#endif - - extern __initdata const u8 modsign_certificate_list[]; - extern __initdata const u8 modsign_certificate_list_end[]; -@@ -43,6 +46,17 @@ static __init int module_verify_init(void) - if (IS_ERR(modsign_keyring)) - panic("Can't allocate module signing keyring\n"); - -+#ifdef CONFIG_MODULE_SIG_BLACKLIST -+ modsign_blacklist = keyring_alloc(".modsign_blacklist", -+ KUIDT_INIT(0), KGIDT_INIT(0), -+ current_cred(), -+ (KEY_POS_ALL & ~KEY_POS_SETATTR) | -+ KEY_USR_VIEW | KEY_USR_READ, -+ KEY_ALLOC_NOT_IN_QUOTA, NULL); -+ if (IS_ERR(modsign_blacklist)) -+ panic("Can't allocate module signing blacklist keyring\n"); -+#endif -+ - return 0; - } - -diff --git a/kernel/module-internal.h b/kernel/module-internal.h -index 24f9247..51a8380 100644 ---- a/kernel/module-internal.h -+++ b/kernel/module-internal.h -@@ -10,5 +10,8 @@ - */ - - extern struct key *modsign_keyring; -+#ifdef CONFIG_MODULE_SIG_BLACKLIST -+extern struct key *modsign_blacklist; -+#endif - - extern int mod_verify_sig(const void *mod, unsigned long *_modlen); -diff --git a/kernel/module_signing.c b/kernel/module_signing.c -index f2970bd..5423195 100644 ---- a/kernel/module_signing.c -+++ b/kernel/module_signing.c -@@ -157,6 +157,18 @@ static struct key *request_asymmetric_key(const char *signer, size_t signer_len, - - pr_debug("Look up: \"%s\"\n", id); - -+#ifdef CONFIG_MODULE_SIG_BLACKLIST -+ key = keyring_search(make_key_ref(modsign_blacklist, 1), -+ &key_type_asymmetric, id); -+ if (!IS_ERR(key)) { -+ /* module is signed with a cert in the blacklist. reject */ -+ pr_err("Module key '%s' is in blacklist\n", id); -+ key_ref_put(key); -+ kfree(id); -+ return ERR_PTR(-EKEYREJECTED); -+ } -+#endif -+ - key = keyring_search(make_key_ref(modsign_keyring, 1), - &key_type_asymmetric, id); - if (IS_ERR(key)) --- -1.8.1.2 - - -From 733a5c25b896d8d5fa0051825a671911b50cb47d Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Fri, 26 Oct 2012 12:42:16 -0400 -Subject: [PATCH 08/19] 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 module signing keyring. This -allows for a third party signing certificate to be used in conjunction -with signed modules. By importing the public certificate into the 'db' -variable, a user can allow a module signed with that certificate to -load. The shim UEFI bootloader has a similar certificate list stored -in the 'MokListRT' variable. We import those as well. - -In the opposite case, Secure Boot maintains a list of disallowed -certificates in the 'dbx' variable. We load those certificates into -the newly introduced module blacklist keyring and forbid any module -signed with those from loading. - -Signed-off-by: Josh Boyer ---- - include/linux/efi.h | 6 ++++ - init/Kconfig | 9 ++++++ - kernel/Makefile | 3 ++ - kernel/modsign_uefi.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 108 insertions(+) - create mode 100644 kernel/modsign_uefi.c - -diff --git a/include/linux/efi.h b/include/linux/efi.h -index 64b3e55..76fe526 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, - #define EFI_CERT_X509_GUID \ - EFI_GUID( 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 ) - -+#define EFI_IMAGE_SECURITY_DATABASE_GUID \ -+ EFI_GUID( 0xd719b2cb, 0x3d3a, 0x4596, 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f ) -+ -+#define EFI_SHIM_LOCK_GUID \ -+ EFI_GUID( 0x605dab50, 0xe046, 0x4300, 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 ) -+ - typedef struct { - efi_guid_t guid; - u64 table; -diff --git a/init/Kconfig b/init/Kconfig -index d972b77..27e3a82 100644 ---- a/init/Kconfig -+++ b/init/Kconfig -@@ -1673,6 +1673,15 @@ config MODULE_SIG_BLACKLIST - should not pass module signature verification. If a module is - signed with something in this keyring, the load will be rejected. - -+config MODULE_SIG_UEFI -+ bool "Allow modules signed with certs stored in UEFI" -+ depends on MODULE_SIG && MODULE_SIG_BLACKLIST && EFI -+ select EFI_SIGNATURE_LIST_PARSER -+ help -+ This will import certificates stored in UEFI and allow modules -+ signed with those to be loaded. It will also disallow loading -+ of modules stored in the UEFI dbx variable. -+ - choice - prompt "Which hash algorithm should modules be signed with?" - depends on MODULE_SIG -diff --git a/kernel/Makefile b/kernel/Makefile -index 6c072b6..8848829 100644 ---- a/kernel/Makefile -+++ b/kernel/Makefile -@@ -55,6 +55,7 @@ obj-$(CONFIG_PROVE_LOCKING) += spinlock.o - obj-$(CONFIG_UID16) += uid16.o - obj-$(CONFIG_MODULES) += module.o - obj-$(CONFIG_MODULE_SIG) += module_signing.o modsign_pubkey.o modsign_certificate.o -+obj-$(CONFIG_MODULE_SIG_UEFI) += modsign_uefi.o - obj-$(CONFIG_KALLSYMS) += kallsyms.o - obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o - obj-$(CONFIG_KEXEC) += kexec.o -@@ -114,6 +115,8 @@ obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o - - $(obj)/configs.o: $(obj)/config_data.h - -+$(obj)/modsign_uefi.o: KBUILD_CFLAGS += -fshort-wchar -+ - # config_data.h contains the same information as ikconfig.h but gzipped. - # Info from config_data can be extracted from /proc/config* - targets += config_data.gz -diff --git a/kernel/modsign_uefi.c b/kernel/modsign_uefi.c -new file mode 100644 -index 0000000..b9237d7 ---- /dev/null -+++ b/kernel/modsign_uefi.c -@@ -0,0 +1,90 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include "module-internal.h" -+ -+static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid, unsigned long *size) -+{ -+ efi_status_t status; -+ unsigned long lsize = 4; -+ unsigned long tmpdb[4]; -+ void *db = NULL; -+ -+ status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb); -+ if (status != EFI_BUFFER_TOO_SMALL) { -+ pr_err("Couldn't get size: 0x%lx\n", status); -+ return NULL; -+ } -+ -+ db = kmalloc(lsize, GFP_KERNEL); -+ if (!db) { -+ pr_err("Couldn't allocate memory for uefi cert list\n"); -+ goto out; -+ } -+ -+ status = efi.get_variable(name, guid, NULL, &lsize, db); -+ if (status != EFI_SUCCESS) { -+ kfree(db); -+ db = NULL; -+ pr_err("Error reading db var: 0x%lx\n", status); -+ } -+out: -+ *size = lsize; -+ return db; -+} -+ -+/* -+ * * Load the certs contained in the UEFI databases -+ * */ -+static int __init load_uefi_certs(void) -+{ -+ efi_guid_t secure_var = EFI_IMAGE_SECURITY_DATABASE_GUID; -+ efi_guid_t mok_var = EFI_SHIM_LOCK_GUID; -+ void *db = NULL, *dbx = NULL, *mok = NULL; -+ unsigned long dbsize = 0, dbxsize = 0, moksize = 0; -+ int rc = 0; -+ -+ /* Check if SB is enabled and just return if not */ -+ if (!efi_enabled(EFI_SECURE_BOOT)) -+ return 0; -+ -+ /* Get db, MokListRT, and dbx. They might not exist, so it isn't -+ * an error if we can't get them. -+ */ -+ db = get_cert_list(L"db", &secure_var, &dbsize); -+ if (!db) { -+ pr_err("MODSIGN: Couldn't get UEFI db list\n"); -+ } else { -+ rc = parse_efi_signature_list(db, dbsize, modsign_keyring); -+ if (rc) -+ pr_err("Couldn't parse db signatures: %d\n", rc); -+ kfree(db); -+ } -+ -+ mok = get_cert_list(L"MokListRT", &mok_var, &moksize); -+ if (!mok) { -+ pr_info("MODSIGN: Couldn't get UEFI MokListRT\n"); -+ } else { -+ rc = parse_efi_signature_list(mok, moksize, modsign_keyring); -+ if (rc) -+ pr_err("Couldn't parse MokListRT signatures: %d\n", rc); -+ kfree(mok); -+ } -+ -+ dbx = get_cert_list(L"dbx", &secure_var, &dbxsize); -+ if (!dbx) { -+ pr_info("MODSIGN: Couldn't get UEFI dbx list\n"); -+ } else { -+ rc = parse_efi_signature_list(dbx, dbxsize, -+ modsign_blacklist); -+ if (rc) -+ pr_err("Couldn't parse dbx signatures: %d\n", rc); -+ kfree(dbx); -+ } -+ -+ return rc; -+} -+late_initcall(load_uefi_certs); --- -1.8.1.2 - - -From 16027d676baed34a9de804dac68d48096a688b39 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Thu, 20 Sep 2012 10:40:57 -0400 -Subject: [PATCH 09/19] 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 -arbitrary kernel behaviour. Default to paranoid - in future we can -potentially relax this for sufficiently IOMMU-isolated devices. - -Signed-off-by: Matthew Garrett ---- - drivers/pci/pci-sysfs.c | 9 +++++++++ - drivers/pci/proc.c | 8 +++++++- - drivers/pci/syscall.c | 2 +- - 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 ---- 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, - loff_t init_off = off; - u8 *data = (u8*) buf; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - if (off > dev->cfg_size) - return 0; - if (off + count > dev->cfg_size) { -@@ -928,6 +931,9 @@ pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, - resource_size_t start, end; - int i; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - for (i = 0; i < PCI_ROM_RESOURCE; i++) - if (res == &pdev->resource[i]) - break; -@@ -1035,6 +1041,9 @@ pci_write_resource_io(struct file *filp, struct kobject *kobj, - struct bin_attribute *attr, char *buf, - loff_t off, size_t count) - { -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - return pci_resource_io(filp, kobj, attr, buf, off, count, true); - } - -diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c -index 9b8505c..35580bc 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; - int cnt; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - if (pos >= size) - return 0; - if (nbytes >= size) -@@ -219,6 +222,9 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, - #endif /* HAVE_PCI_MMAP */ - int ret = 0; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - 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) - struct pci_filp_private *fpriv = file->private_data; - int i, ret; - -- if (!capable(CAP_SYS_RAWIO)) -+ if (!capable(CAP_SYS_RAWIO) || !capable(CAP_COMPROMISE_KERNEL)) - return -EPERM; - - /* Make sure the caller is mapping a real resource for this device */ -diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c -index e1c1ec5..97e785f 100644 ---- a/drivers/pci/syscall.c -+++ b/drivers/pci/syscall.c -@@ -92,7 +92,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, - u32 dword; - int err = 0; - -- if (!capable(CAP_SYS_ADMIN)) -+ if (!capable(CAP_SYS_ADMIN) || !capable(CAP_COMPROMISE_KERNEL)) - return -EPERM; - - dev = pci_get_bus_and_slot(bus, dfn); --- -1.8.1.2 - - -From 9ff1537bbe8c22bbf7f992027da43d4fe8da0860 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Thu, 20 Sep 2012 10:40:58 -0400 -Subject: [PATCH 10/19] x86: Lock down IO port access in secure boot - environments - -IO port access would permit users to gain access to PCI configuration -registers, which in turn (on a lot of hardware) give access to MMIO register -space. This would potentially permit root to trigger arbitrary DMA, so lock -it down by default. - -Signed-off-by: Matthew Garrett ---- - arch/x86/kernel/ioport.c | 4 ++-- - drivers/char/mem.c | 3 +++ - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c -index 8c96897..a2578c4 100644 ---- a/arch/x86/kernel/ioport.c -+++ b/arch/x86/kernel/ioport.c -@@ -28,7 +28,7 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) - - if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) - return -EINVAL; -- if (turn_on && !capable(CAP_SYS_RAWIO)) -+ if (turn_on && (!capable(CAP_SYS_RAWIO) || !capable(CAP_COMPROMISE_KERNEL))) - return -EPERM; - - /* -@@ -102,7 +102,7 @@ long sys_iopl(unsigned int level, struct pt_regs *regs) - return -EINVAL; - /* Trying to gain more privileges? */ - if (level > old) { -- if (!capable(CAP_SYS_RAWIO)) -+ if (!capable(CAP_SYS_RAWIO) || !capable(CAP_COMPROMISE_KERNEL)) - return -EPERM; - } - regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12); -diff --git a/drivers/char/mem.c b/drivers/char/mem.c -index c6fa3bc..fc28099 100644 ---- a/drivers/char/mem.c -+++ b/drivers/char/mem.c -@@ -597,6 +597,9 @@ static ssize_t write_port(struct file *file, const char __user *buf, - unsigned long i = *ppos; - const char __user * tmp = buf; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - if (!access_ok(VERIFY_READ, buf, count)) - return -EFAULT; - while (count-- > 0 && i < 65536) { --- -1.8.1.2 - - -From 3b27408b1ced1ec83a3ce27f9d51161dbf7cea9a Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Thu, 20 Sep 2012 10:40:59 -0400 -Subject: [PATCH 11/19] 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 -access to system memory, so it needs to have a capability check here. - -Signed-off-by: Matthew Garrett ---- - drivers/acpi/custom_method.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c -index 5d42c24..247d58b 100644 ---- a/drivers/acpi/custom_method.c -+++ b/drivers/acpi/custom_method.c -@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, - struct acpi_table_header table; - acpi_status status; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - if (!(*ppos)) { - /* parse the table header to get the table length */ - if (count <= sizeof(struct acpi_table_header)) --- -1.8.1.2 - - -From fb618a04089d454b7ade68c00a2b9c7dbac013f9 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Thu, 20 Sep 2012 10:41:00 -0400 -Subject: [PATCH 12/19] 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 -be manipulated in such a way that arbitrary code can be executed in the -kernel. Add a capability check to prevent that. - -Signed-off-by: Matthew Garrett ---- - drivers/platform/x86/asus-wmi.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c -index f80ae4d..059195f 100644 ---- a/drivers/platform/x86/asus-wmi.c -+++ b/drivers/platform/x86/asus-wmi.c -@@ -1521,6 +1521,9 @@ static int show_dsts(struct seq_file *m, void *data) - int err; - u32 retval = -1; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval); - - if (err < 0) -@@ -1537,6 +1540,9 @@ static int show_devs(struct seq_file *m, void *data) - int err; - u32 retval = -1; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - err = asus_wmi_set_devstate(asus->debug.dev_id, asus->debug.ctrl_param, - &retval); - -@@ -1561,6 +1567,9 @@ static int show_call(struct seq_file *m, void *data) - union acpi_object *obj; - acpi_status status; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, - 1, asus->debug.method_id, - &input, &output); --- -1.8.1.2 - - -From e515bbd5410d00835390fd8981aa9029e7b22b73 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Thu, 20 Sep 2012 10:41:01 -0400 -Subject: [PATCH 13/19] 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. - -Signed-off-by: Matthew Garrett ---- - drivers/char/mem.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/drivers/char/mem.c b/drivers/char/mem.c -index fc28099..b5df7a8 100644 ---- a/drivers/char/mem.c -+++ b/drivers/char/mem.c -@@ -158,6 +158,9 @@ static ssize_t write_mem(struct file *file, const char __user *buf, - unsigned long copied; - void *ptr; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - if (!valid_phys_addr_range(p, count)) - return -EFAULT; - -@@ -530,6 +533,9 @@ static ssize_t write_kmem(struct file *file, const char __user *buf, - char * kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */ - int err = 0; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - if (p < (unsigned long) high_memory) { - unsigned long to_write = min_t(unsigned long, count, - (unsigned long)high_memory - p); --- -1.8.1.2 - - -From fe27dd192ef250abcbaba973a14d43b21d7be497 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Thu, 20 Sep 2012 10:41:04 -0400 -Subject: [PATCH 14/19] acpi: Ignore acpi_rsdp kernel parameter in a secure - boot environment - -This option allows userspace to pass the RSDP address to the kernel. This -could potentially be used to circumvent the secure boot trust model. -We ignore the setting if we don't have the CAP_COMPROMISE_KERNEL capability. - -Signed-off-by: Josh Boyer ---- - drivers/acpi/osl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c -index bd22f86..88251d2 100644 ---- a/drivers/acpi/osl.c -+++ b/drivers/acpi/osl.c -@@ -246,7 +246,7 @@ early_param("acpi_rsdp", setup_acpi_rsdp); - acpi_physical_address __init acpi_os_get_root_pointer(void) - { - #ifdef CONFIG_KEXEC -- if (acpi_rsdp) -+ if (acpi_rsdp && capable(CAP_COMPROMISE_KERNEL)) - return acpi_rsdp; - #endif - --- -1.8.1.2 - - -From c937b2c8e179bfdadb6617c0028f558e4d701e46 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Tue, 4 Sep 2012 11:55:13 -0400 -Subject: [PATCH 15/19] 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 -support signed kexec payloads, but for the moment we should just disable -loading entirely in that situation. - -Signed-off-by: Matthew Garrett ---- - kernel/kexec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/kexec.c b/kernel/kexec.c -index 5e4bd78..dd464e0 100644 ---- a/kernel/kexec.c -+++ b/kernel/kexec.c -@@ -943,7 +943,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, - int result; - - /* We only trust the superuser with rebooting the system. */ -- if (!capable(CAP_SYS_BOOT)) -+ if (!capable(CAP_SYS_BOOT) || !capable(CAP_COMPROMISE_KERNEL)) - return -EPERM; - - /* --- -1.8.1.2 - - -From f08e390045266d53543a55afa16ca4be5a1c6316 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Fri, 5 Oct 2012 10:12:48 -0400 -Subject: [PATCH 16/19] MODSIGN: Always enforce module signing in a Secure Boot - environment - -If a machine is booted into a Secure Boot environment, we need to -protect the trust model. This requires that all modules be signed -with a key that is in the kernel's _modsign keyring. The checks for -this are already done via the 'sig_enforce' module parameter. Make -this visible within the kernel and force it to be true. - -Signed-off-by: Josh Boyer ---- - kernel/cred.c | 8 ++++++++ - kernel/module.c | 4 ++-- - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/kernel/cred.c b/kernel/cred.c -index c3f4e3e..c5554e0 100644 ---- a/kernel/cred.c -+++ b/kernel/cred.c -@@ -565,11 +565,19 @@ void __init cred_init(void) - 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); - } - -+#ifdef CONFIG_MODULE_SIG -+extern bool sig_enforce; -+#endif -+ - void __init secureboot_enable() - { - pr_info("Secure boot enabled\n"); - cap_lower((&init_cred)->cap_bset, CAP_COMPROMISE_KERNEL); - cap_lower((&init_cred)->cap_permitted, CAP_COMPROMISE_KERNEL); -+#ifdef CONFIG_MODULE_SIG -+ /* Enable module signature enforcing */ -+ sig_enforce = true; -+#endif - } - - /* Dummy Secure Boot enable option to fake out UEFI SB=1 */ -diff --git a/kernel/module.c b/kernel/module.c -index eab0827..93a16dc 100644 ---- a/kernel/module.c -+++ b/kernel/module.c -@@ -109,9 +109,9 @@ struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */ - - #ifdef CONFIG_MODULE_SIG - #ifdef CONFIG_MODULE_SIG_FORCE --static bool sig_enforce = true; -+bool sig_enforce = true; - #else --static bool sig_enforce = false; -+bool sig_enforce = false; - - static int param_set_bool_enable_only(const char *val, - const struct kernel_param *kp) --- -1.8.1.2 - - -From 54ba1eec5847d964b1d458a240b50271b9a356a4 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Fri, 26 Oct 2012 14:02:09 -0400 -Subject: [PATCH 17/19] 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, -so until we can work with signed hibernate images we disable it in -a Secure Boot environment. - -Signed-off-by: Josh Boyer ---- - kernel/power/hibernate.c | 15 ++++++++++++++- - kernel/power/main.c | 7 ++++++- - kernel/power/user.c | 3 +++ - 3 files changed, 23 insertions(+), 2 deletions(-) - -diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c -index b26f5f1..7f63cb4 100644 ---- a/kernel/power/hibernate.c -+++ b/kernel/power/hibernate.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - #include "power.h" - -@@ -632,6 +633,10 @@ int hibernate(void) - { - int error; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) { -+ return -EPERM; -+ } -+ - lock_system_sleep(); - /* The snapshot device should not be opened while we're running */ - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { -@@ -723,7 +728,7 @@ static int software_resume(void) - /* - * If the user said "noresume".. bail out early. - */ -- if (noresume) -+ if (noresume || !capable(CAP_COMPROMISE_KERNEL)) - return 0; - - /* -@@ -889,6 +894,11 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr, - int i; - char *start = buf; - -+ if (efi_enabled(EFI_SECURE_BOOT)) { -+ buf += sprintf(buf, "[%s]\n", "disabled"); -+ return buf-start; -+ } -+ - for (i = HIBERNATION_FIRST; i <= HIBERNATION_MAX; i++) { - if (!hibernation_modes[i]) - continue; -@@ -923,6 +933,9 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, - char *p; - int mode = HIBERNATION_INVALID; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - p = memchr(buf, '\n', n); - len = p ? p - buf : n; - -diff --git a/kernel/power/main.c b/kernel/power/main.c -index 1c16f91..4f915fc 100644 ---- a/kernel/power/main.c -+++ b/kernel/power/main.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "power.h" - -@@ -301,7 +302,11 @@ static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr, - } - #endif - #ifdef CONFIG_HIBERNATION -- s += sprintf(s, "%s\n", "disk"); -+ if (!efi_enabled(EFI_SECURE_BOOT)) { -+ s += sprintf(s, "%s\n", "disk"); -+ } else { -+ s += sprintf(s, "\n"); -+ } - #else - if (s != buf) - /* convert the last space to a newline */ -diff --git a/kernel/power/user.c b/kernel/power/user.c -index 4ed81e7..b11a0f4 100644 ---- a/kernel/power/user.c -+++ b/kernel/power/user.c -@@ -48,6 +48,9 @@ static int snapshot_open(struct inode *inode, struct file *filp) - struct snapshot_data *data; - int error; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - lock_system_sleep(); - - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { --- -1.8.1.2 - - -From 686090054f6c3784218b318c7adcc3c1f0ca5069 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Tue, 5 Feb 2013 19:25:05 -0500 -Subject: [PATCH 18/19] 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 -MokSBState that does not have the runtime attribute set. Given that the -user explicitly disabled validation, we can honor that and not enable -secure boot mode if that variable is set. - -Signed-off-by: Josh Boyer ---- - arch/x86/boot/compressed/eboot.c | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c -index 96bd86b..6e1331c 100644 ---- a/arch/x86/boot/compressed/eboot.c -+++ b/arch/x86/boot/compressed/eboot.c -@@ -851,8 +851,9 @@ fail: - - static int get_secure_boot(efi_system_table_t *_table) - { -- u8 sb, setup; -+ u8 sb, setup, moksbstate; - unsigned long datasize = sizeof(sb); -+ u32 attr; - efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; - efi_status_t status; - -@@ -876,6 +877,23 @@ static int get_secure_boot(efi_system_table_t *_table) - if (setup == 1) - return 0; - -+ /* See if a user has put shim into insecure_mode. If so, and the variable -+ * doesn't have the runtime attribute set, we might as well honor that. -+ */ -+ var_guid = EFI_SHIM_LOCK_GUID; -+ status = efi_call_phys5(sys_table->runtime->get_variable, -+ L"MokSBState", &var_guid, &attr, &datasize, -+ &moksbstate); -+ -+ /* If it fails, we don't care why. Default to secure */ -+ if (status != EFI_SUCCESS) -+ return 1; -+ -+ if (!(attr & EFI_VARIABLE_RUNTIME_ACCESS)) { -+ if (moksbstate == 1) -+ return 0; -+ } -+ - return 1; - } - --- -1.8.1.2 - - -From df607d2d5061b04f8a686cd74edd72c1f2836d8c Mon Sep 17 00:00:00 2001 -From: Kees Cook -Date: Fri, 8 Feb 2013 11:12:13 -0800 -Subject: [PATCH 19/19] 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. - -Signed-off-by: Kees Cook ---- - arch/x86/kernel/msr.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c -index 4929502..adaab3d 100644 ---- a/arch/x86/kernel/msr.c -+++ b/arch/x86/kernel/msr.c -@@ -103,6 +103,9 @@ static ssize_t msr_write(struct file *file, const char __user *buf, - int err = 0; - ssize_t bytes = 0; - -+ if (!capable(CAP_COMPROMISE_KERNEL)) -+ return -EPERM; -+ - if (count % 8) - return -EINVAL; /* Invalid chunk size */ - -@@ -150,6 +153,10 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) - err = -EBADF; - break; - } -+ if (!capable(CAP_COMPROMISE_KERNEL)) { -+ err = -EPERM; -+ break; -+ } - if (copy_from_user(®s, uregs, sizeof regs)) { - err = -EFAULT; - break; --- -1.8.1.2 - diff --git a/secure-modules.patch b/secure-modules.patch new file mode 100644 index 000000000..86bf9dc6f --- /dev/null +++ b/secure-modules.patch @@ -0,0 +1,877 @@ +Bugzilla: N/A +Upstream-status: Fedora mustard. Replaced by securelevels, but that was nak'd + +From f212a4d8b8638a3e15e4cd76874d4fab60726752 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Aug 2013 17:58:15 -0400 +Subject: [PATCH 01/14] Add secure_modules() call + +Provide a single call to allow kernel code to determine whether the system +has been configured to either disable module loading entirely or to load +only modules signed with a trusted key. + +Signed-off-by: Matthew Garrett +--- + include/linux/module.h | 7 +++++++ + kernel/module.c | 10 ++++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/include/linux/module.h b/include/linux/module.h +index 15cd6b1..30702eb 100644 +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -512,6 +512,8 @@ int unregister_module_notifier(struct notifier_block * nb); + + extern void print_modules(void); + ++extern bool secure_modules(void); ++ + #else /* !CONFIG_MODULES... */ + + /* Given an address, look for it in the exception tables. */ +@@ -622,6 +624,11 @@ static inline int unregister_module_notifier(struct notifier_block * nb) + static inline void print_modules(void) + { + } ++ ++static inline bool secure_modules(void) ++{ ++ return false; ++} + #endif /* CONFIG_MODULES */ + + #ifdef CONFIG_SYSFS +diff --git a/kernel/module.c b/kernel/module.c +index f5a3b1e..644c33e 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -3831,3 +3831,13 @@ void module_layout(struct module *mod, + } + EXPORT_SYMBOL(module_layout); + #endif ++ ++bool secure_modules(void) ++{ ++#ifdef CONFIG_MODULE_SIG ++ return (sig_enforce || modules_disabled); ++#else ++ return modules_disabled; ++#endif ++} ++EXPORT_SYMBOL(secure_modules); +-- +1.8.4.2 + + +From 394a8259d0b457495dddda8704821ec9e56ea44a Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Thu, 8 Mar 2012 10:10:38 -0500 +Subject: [PATCH 02/14] PCI: Lock down BAR access when module security is + enabled + +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 modify +kernel code, allowing them to circumvent disabled module loading or module +signing. Default to paranoid - in future we can potentially relax this for +sufficiently IOMMU-isolated devices. + +Signed-off-by: Matthew Garrett +--- + drivers/pci/pci-sysfs.c | 10 ++++++++++ + drivers/pci/proc.c | 8 +++++++- + drivers/pci/syscall.c | 3 ++- + 3 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c +index c91e6c1..447742e 100644 +--- a/drivers/pci/pci-sysfs.c ++++ b/drivers/pci/pci-sysfs.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include "pci.h" + + static int sysfs_initialized; /* = 0 */ +@@ -668,6 +669,9 @@ pci_write_config(struct file* filp, struct kobject *kobj, + loff_t init_off = off; + u8 *data = (u8*) buf; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (off > dev->cfg_size) + return 0; + if (off + count > dev->cfg_size) { +@@ -974,6 +978,9 @@ pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, + resource_size_t start, end; + int i; + ++ if (secure_modules()) ++ return -EPERM; ++ + for (i = 0; i < PCI_ROM_RESOURCE; i++) + if (res == &pdev->resource[i]) + break; +@@ -1081,6 +1088,9 @@ pci_write_resource_io(struct file *filp, struct kobject *kobj, + struct bin_attribute *attr, char *buf, + loff_t off, size_t count) + { ++ if (secure_modules()) ++ return -EPERM; ++ + return pci_resource_io(filp, kobj, attr, buf, off, count, true); + } + +diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c +index 46d1378..294fe7b 100644 +--- a/drivers/pci/proc.c ++++ b/drivers/pci/proc.c +@@ -117,6 +117,9 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof + int size = dev->cfg_size; + int cnt; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (pos >= size) + return 0; + if (nbytes >= size) +@@ -196,6 +199,9 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, + #endif /* HAVE_PCI_MMAP */ + int ret = 0; + ++ if (secure_modules()) ++ return -EPERM; ++ + switch (cmd) { + case PCIIOC_CONTROLLER: + ret = pci_domain_nr(dev->bus); +@@ -234,7 +240,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; + +- if (!capable(CAP_SYS_RAWIO)) ++ if (!capable(CAP_SYS_RAWIO) || secure_modules()) + return -EPERM; + + /* Make sure the caller is mapping a real resource for this device */ +diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c +index 24750a1..fa57896 100644 +--- a/drivers/pci/syscall.c ++++ b/drivers/pci/syscall.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include "pci.h" + +@@ -92,7 +93,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, + u32 dword; + int err = 0; + +- if (!capable(CAP_SYS_ADMIN)) ++ if (!capable(CAP_SYS_ADMIN) || secure_modules()) + return -EPERM; + + dev = pci_get_bus_and_slot(bus, dfn); +-- +1.8.4.2 + + +From 69532e626cece8a43c2528246e0421488b468102 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Thu, 8 Mar 2012 10:35:59 -0500 +Subject: [PATCH 03/14] x86: Lock down IO port access when module security is + enabled + +IO port access would permit users to gain access to PCI configuration +registers, which in turn (on a lot of hardware) give access to MMIO register +space. This would potentially permit root to trigger arbitrary DMA, so lock +it down by default. + +Signed-off-by: Matthew Garrett +--- + arch/x86/kernel/ioport.c | 5 +++-- + drivers/char/mem.c | 4 ++++ + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c +index 4ddaf66..00b4403 100644 +--- a/arch/x86/kernel/ioport.c ++++ b/arch/x86/kernel/ioport.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + + /* +@@ -28,7 +29,7 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) + + if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) + return -EINVAL; +- if (turn_on && !capable(CAP_SYS_RAWIO)) ++ if (turn_on && (!capable(CAP_SYS_RAWIO) || secure_modules())) + return -EPERM; + + /* +@@ -103,7 +104,7 @@ SYSCALL_DEFINE1(iopl, unsigned int, level) + return -EINVAL; + /* Trying to gain more privileges? */ + if (level > old) { +- if (!capable(CAP_SYS_RAWIO)) ++ if (!capable(CAP_SYS_RAWIO) || secure_modules()) + return -EPERM; + } + regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12); +diff --git a/drivers/char/mem.c b/drivers/char/mem.c +index f895a8c..1af8664 100644 +--- a/drivers/char/mem.c ++++ b/drivers/char/mem.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #include + +@@ -563,6 +564,9 @@ static ssize_t write_port(struct file *file, const char __user *buf, + unsigned long i = *ppos; + const char __user *tmp = buf; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (!access_ok(VERIFY_READ, buf, count)) + return -EFAULT; + while (count-- > 0 && i < 65536) { +-- +1.8.4.2 + + +From 8771ff55273e964d707b174dd0dbe433783c0254 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Mar 2012 08:39:37 -0500 +Subject: [PATCH 04/14] ACPI: Limit access to custom_method + +custom_method effectively allows arbitrary access to system memory, making +it possible for an attacker to circumvent restrictions on module loading. +Disable it if any such restrictions have been enabled. + +Signed-off-by: Matthew Garrett +--- + drivers/acpi/custom_method.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c +index 12b62f2..50647b3 100644 +--- a/drivers/acpi/custom_method.c ++++ b/drivers/acpi/custom_method.c +@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, + struct acpi_table_header table; + acpi_status status; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (!(*ppos)) { + /* parse the table header to get the table length */ + if (count <= sizeof(struct acpi_table_header)) +-- +1.8.4.2 + + +From 7d3e3db90e1b4cf33ba4a46624ae4a68f787e5fc Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Mar 2012 08:46:50 -0500 +Subject: [PATCH 05/14] asus-wmi: Restrict debugfs interface when module + loading is restricted + +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 +be manipulated in such a way that arbitrary code can be executed in the +kernel, circumventing module loading restrictions. Prevent that if any of +these features are enabled. + +Signed-off-by: Matthew Garrett +--- + drivers/platform/x86/asus-wmi.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c +index 19c313b..db18ef66 100644 +--- a/drivers/platform/x86/asus-wmi.c ++++ b/drivers/platform/x86/asus-wmi.c +@@ -1618,6 +1618,9 @@ static int show_dsts(struct seq_file *m, void *data) + int err; + u32 retval = -1; + ++ if (secure_modules()) ++ return -EPERM; ++ + err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval); + + if (err < 0) +@@ -1634,6 +1637,9 @@ static int show_devs(struct seq_file *m, void *data) + int err; + u32 retval = -1; + ++ if (secure_modules()) ++ return -EPERM; ++ + err = asus_wmi_set_devstate(asus->debug.dev_id, asus->debug.ctrl_param, + &retval); + +@@ -1658,6 +1664,9 @@ static int show_call(struct seq_file *m, void *data) + union acpi_object *obj; + acpi_status status; + ++ if (secure_modules()) ++ return -EPERM; ++ + status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID, + 1, asus->debug.method_id, + &input, &output); +-- +1.8.4.2 + + +From 98ebe083d75333e269730fe374cca42ac7f08a07 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Mar 2012 09:28:15 -0500 +Subject: [PATCH 06/14] Restrict /dev/mem and /dev/kmem when module loading is + restricted + +Allowing users to write to address space makes it possible for the kernel +to be subverted, avoiding module loading restrictions. Prevent this when +any restrictions have been imposed on loading modules. + +Signed-off-by: Matthew Garrett +--- + drivers/char/mem.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/char/mem.c b/drivers/char/mem.c +index 1af8664..61406c8 100644 +--- a/drivers/char/mem.c ++++ b/drivers/char/mem.c +@@ -159,6 +159,9 @@ static ssize_t write_mem(struct file *file, const char __user *buf, + unsigned long copied; + void *ptr; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (!valid_phys_addr_range(p, count)) + return -EFAULT; + +@@ -497,6 +500,9 @@ static ssize_t write_kmem(struct file *file, const char __user *buf, + char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */ + int err = 0; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (p < (unsigned long) high_memory) { + unsigned long to_write = min_t(unsigned long, count, + (unsigned long)high_memory - p); +-- +1.8.4.2 + + +From 71353d491c70b303a07b4e79c896e729a4f74978 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Mon, 25 Jun 2012 19:57:30 -0400 +Subject: [PATCH 07/14] acpi: Ignore acpi_rsdp kernel parameter when module + loading is restricted + +This option allows userspace to pass the RSDP address to the kernel, which +makes it possible for a user to circumvent any restrictions imposed on +loading modules. Disable it in that case. + +Signed-off-by: Josh Boyer +--- + drivers/acpi/osl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c +index 54a20ff..d21d269 100644 +--- a/drivers/acpi/osl.c ++++ b/drivers/acpi/osl.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -248,7 +249,7 @@ early_param("acpi_rsdp", setup_acpi_rsdp); + acpi_physical_address __init acpi_os_get_root_pointer(void) + { + #ifdef CONFIG_KEXEC +- if (acpi_rsdp) ++ if (acpi_rsdp && !secure_modules()) + return acpi_rsdp; + #endif + +-- +1.8.4.2 + + +From e0a6b0dd91460123d71784d531b9df26449940ae Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Aug 2013 03:33:56 -0400 +Subject: [PATCH 08/14] kexec: Disable at runtime if the kernel enforces module + loading restrictions + +kexec permits the loading and execution of arbitrary code in ring 0, which +is something that module signing enforcement is meant to prevent. It makes +sense to disable kexec in this situation. + +Signed-off-by: Matthew Garrett +--- + kernel/kexec.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/kernel/kexec.c b/kernel/kexec.c +index 9c97016..8ad0d38 100644 +--- a/kernel/kexec.c ++++ b/kernel/kexec.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -946,6 +947,13 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, + return -EPERM; + + /* ++ * kexec can be used to circumvent module loading restrictions, so ++ * prevent loading in that case ++ */ ++ if (secure_modules()) ++ return -EPERM; ++ ++ /* + * Verify we have a legal set of flags + * This leaves us room for future extensions. + */ +-- +1.8.4.2 + + +From c340630e68e5ed4d731d60d05ef9e2ae27080b66 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Tue, 3 Sep 2013 11:23:29 -0400 +Subject: [PATCH 09/14] uswsusp: Disable when module loading is restricted + +uswsusp allows a user process to dump and then restore kernel state, which +makes it possible to avoid module loading restrictions. Prevent this when +any restrictions have been imposed on loading modules. + +Signed-off-by: Matthew Garrett +--- + kernel/power/user.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/kernel/power/user.c b/kernel/power/user.c +index 98d3575..efe99de 100644 +--- a/kernel/power/user.c ++++ b/kernel/power/user.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include + +@@ -49,6 +50,9 @@ static int snapshot_open(struct inode *inode, struct file *filp) + struct snapshot_data *data; + int error; + ++ if (secure_modules()) ++ return -EPERM; ++ + lock_system_sleep(); + + if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { +-- +1.8.4.2 + + +From 273deda4ddec360ce67ac256b8cbdabdc5e8c51d Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 8 Feb 2013 11:12:13 -0800 +Subject: [PATCH 10/14] x86: Restrict MSR access when module loading is + restricted + +Writing to MSRs should not be allowed if module loading is restricted, +since it could lead to execution of arbitrary code in kernel mode. Based +on a patch by Kees Cook. + +Cc: Kees Cook +Signed-off-by: Matthew Garrett +--- + arch/x86/kernel/msr.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c +index 05266b5..e2bd647 100644 +--- a/arch/x86/kernel/msr.c ++++ b/arch/x86/kernel/msr.c +@@ -103,6 +103,9 @@ static ssize_t msr_write(struct file *file, const char __user *buf, + int err = 0; + ssize_t bytes = 0; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (count % 8) + return -EINVAL; /* Invalid chunk size */ + +@@ -150,6 +153,10 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg) + err = -EBADF; + break; + } ++ if (secure_modules()) { ++ err = -EPERM; ++ break; ++ } + if (copy_from_user(®s, uregs, sizeof regs)) { + err = -EFAULT; + break; +-- +1.8.4.2 + + +From 089166c0d42f1b82988aad4f23607deb6ee531e7 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Aug 2013 18:36:30 -0400 +Subject: [PATCH 11/14] Add option to automatically enforce module signatures + when in Secure Boot mode + +UEFI Secure Boot provides a mechanism for ensuring that the firmware will +only load signed bootloaders and kernels. Certain use cases may also +require that all kernel modules also be signed. Add a configuration option +that enforces this automatically when enabled. + +Signed-off-by: Matthew Garrett +--- + Documentation/x86/zero-page.txt | 2 ++ + arch/x86/Kconfig | 10 ++++++++++ + arch/x86/boot/compressed/eboot.c | 36 +++++++++++++++++++++++++++++++++++ + arch/x86/include/uapi/asm/bootparam.h | 3 ++- + arch/x86/kernel/setup.c | 6 ++++++ + include/linux/module.h | 6 ++++++ + kernel/module.c | 7 +++++++ + 7 files changed, 69 insertions(+), 1 deletion(-) + +diff --git a/Documentation/x86/zero-page.txt b/Documentation/x86/zero-page.txt +index 199f453..ec38acf 100644 +--- a/Documentation/x86/zero-page.txt ++++ b/Documentation/x86/zero-page.txt +@@ -30,6 +30,8 @@ Offset Proto Name Meaning + 1E9/001 ALL eddbuf_entries Number of entries in eddbuf (below) + 1EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer + (below) ++1EB/001 ALL kbd_status Numlock is enabled ++1EC/001 ALL secure_boot Secure boot is enabled in the firmware + 1EF/001 ALL sentinel Used to detect broken bootloaders + 290/040 ALL edd_mbr_sig_buffer EDD MBR signatures + 2D0/A00 ALL e820_map E820 memory map table +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 5216e28..2a147a3 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -1582,6 +1582,16 @@ config EFI_STUB + + See Documentation/efi-stub.txt for more information. + ++config EFI_SECURE_BOOT_SIG_ENFORCE ++ def_bool n ++ prompt "Force module signing when UEFI Secure Boot is enabled" ++ ---help--- ++ UEFI Secure Boot provides a mechanism for ensuring that the ++ firmware will only load signed bootloaders and kernels. Certain ++ use cases may also require that all kernel modules also be signed. ++ Say Y here to automatically enable module signature enforcement ++ when a system boots with UEFI Secure Boot enabled. ++ + config SECCOMP + def_bool y + prompt "Enable seccomp to safely compute untrusted bytecode" +diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c +index a7677ba..4e172e9 100644 +--- a/arch/x86/boot/compressed/eboot.c ++++ b/arch/x86/boot/compressed/eboot.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + #undef memcpy /* Use memcpy from misc.c */ + +@@ -741,6 +742,37 @@ free_mem_map: + } + + ++static int get_secure_boot(void) ++{ ++ u8 sb, setup; ++ unsigned long datasize = sizeof(sb); ++ efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; ++ efi_status_t status; ++ ++ status = efi_call_phys5(sys_table->runtime->get_variable, ++ L"SecureBoot", &var_guid, NULL, &datasize, &sb); ++ ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ if (sb == 0) ++ return 0; ++ ++ ++ status = efi_call_phys5(sys_table->runtime->get_variable, ++ L"SetupMode", &var_guid, NULL, &datasize, ++ &setup); ++ ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ if (setup == 1) ++ return 0; ++ ++ return 1; ++} ++ ++ + /* + * On success we return a pointer to a boot_params structure, and NULL + * on failure. +@@ -760,6 +792,10 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, + if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) + goto fail; + ++ sanitize_boot_params(boot_params); ++ ++ boot_params->secure_boot = get_secure_boot(); ++ + setup_graphics(boot_params); + + setup_efi_pci(boot_params); +diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h +index 225b098..90dbfb7 100644 +--- a/arch/x86/include/uapi/asm/bootparam.h ++++ b/arch/x86/include/uapi/asm/bootparam.h +@@ -133,7 +133,8 @@ struct boot_params { + __u8 eddbuf_entries; /* 0x1e9 */ + __u8 edd_mbr_sig_buf_entries; /* 0x1ea */ + __u8 kbd_status; /* 0x1eb */ +- __u8 _pad5[3]; /* 0x1ec */ ++ __u8 secure_boot; /* 0x1ec */ ++ __u8 _pad5[2]; /* 0x1ed */ + /* + * 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 182b3f9..ab6cc9e 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -1129,6 +1129,12 @@ void __init setup_arch(char **cmdline_p) + + io_delay_init(); + ++#ifdef CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE ++ if (boot_params.secure_boot) { ++ enforce_signed_modules(); ++ } ++#endif ++ + /* + * Parse the ACPI tables for possible boot-time SMP configuration. + */ +diff --git a/include/linux/module.h b/include/linux/module.h +index 30702eb..3eb0f52 100644 +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -190,6 +190,12 @@ const struct exception_table_entry *search_exception_tables(unsigned long add); + + struct notifier_block; + ++#ifdef CONFIG_MODULE_SIG ++extern void enforce_signed_modules(void); ++#else ++static inline void enforce_signed_modules(void) {}; ++#endif ++ + #ifdef CONFIG_MODULES + + extern int modules_disabled; /* for sysctl */ +diff --git a/kernel/module.c b/kernel/module.c +index 644c33e..92b73b1 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -3832,6 +3832,13 @@ void module_layout(struct module *mod, + EXPORT_SYMBOL(module_layout); + #endif + ++#ifdef CONFIG_MODULE_SIG ++void enforce_signed_modules(void) ++{ ++ sig_enforce = true; ++} ++#endif ++ + bool secure_modules(void) + { + #ifdef CONFIG_MODULE_SIG +-- +1.8.4.2 + + +From e9ad6bd405fa01b7dd52d8c75b9dc91ae52e131d Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Tue, 5 Feb 2013 19:25:05 -0500 +Subject: [PATCH 12/14] 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 +MokSBState that does not have the runtime attribute set. Given that the +user explicitly disabled validation, we can honor that and not enable +secure boot mode if that variable is set. + +Signed-off-by: Josh Boyer +--- + arch/x86/boot/compressed/eboot.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c +index 4e172e9..4905f4d 100644 +--- a/arch/x86/boot/compressed/eboot.c ++++ b/arch/x86/boot/compressed/eboot.c +@@ -744,8 +744,9 @@ free_mem_map: + + static int get_secure_boot(void) + { +- u8 sb, setup; ++ u8 sb, setup, moksbstate; + unsigned long datasize = sizeof(sb); ++ u32 attr; + efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; + efi_status_t status; + +@@ -769,6 +770,23 @@ static int get_secure_boot(void) + if (setup == 1) + return 0; + ++ /* See if a user has put shim into insecure_mode. If so, and the variable ++ * doesn't have the runtime attribute set, we might as well honor that. ++ */ ++ var_guid = EFI_SHIM_LOCK_GUID; ++ status = efi_call_phys5(sys_table->runtime->get_variable, ++ L"MokSBState", &var_guid, &attr, &datasize, ++ &moksbstate); ++ ++ /* If it fails, we don't care why. Default to secure */ ++ if (status != EFI_SUCCESS) ++ return 1; ++ ++ if (!(attr & EFI_VARIABLE_RUNTIME_ACCESS)) { ++ if (moksbstate == 1) ++ return 0; ++ } ++ + return 1; + } + +-- +1.8.4.2 + + +From f9f355d5e58c1503bb7c03d92c9e89267e0f46ad Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Tue, 27 Aug 2013 13:28:43 -0400 +Subject: [PATCH 13/14] efi: Make EFI_SECURE_BOOT_SIG_ENFORCE depend on EFI + +The functionality of the config option is dependent upon the platform being +UEFI based. Reflect this in the config deps. + +Signed-off-by: Josh Boyer +--- + arch/x86/Kconfig | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index 2a147a3..9e644d5 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -1583,7 +1583,8 @@ config EFI_STUB + See Documentation/efi-stub.txt for more information. + + config EFI_SECURE_BOOT_SIG_ENFORCE +- def_bool n ++ def_bool n ++ depends on EFI + prompt "Force module signing when UEFI Secure Boot is enabled" + ---help--- + UEFI Secure Boot provides a mechanism for ensuring that the +-- +1.8.4.2 + + +From a30576a9db583213474b74360c5869e8882e6ed7 Mon Sep 17 00:00:00 2001 +From: Josh Boyer +Date: Tue, 27 Aug 2013 13:33:03 -0400 +Subject: [PATCH 14/14] efi: Add EFI_SECURE_BOOT bit + +UEFI machines can be booted in Secure Boot mode. Add a EFI_SECURE_BOOT bit +for use with efi_enabled. + +Signed-off-by: Josh Boyer +--- + arch/x86/kernel/setup.c | 2 ++ + include/linux/efi.h | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index ab6cc9e..99933cd 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -1131,7 +1131,9 @@ void __init setup_arch(char **cmdline_p) + + #ifdef CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE + if (boot_params.secure_boot) { ++ set_bit(EFI_SECURE_BOOT, &x86_efi_facility); + enforce_signed_modules(); ++ pr_info("Secure boot enabled\n"); + } + #endif + +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 0a819e7..0c1d367 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -657,6 +657,7 @@ extern int __init efi_setup_pcdp_console(char *); + #define EFI_MEMMAP 4 /* Can we use EFI memory map? */ + #define EFI_64BIT 5 /* Is the firmware 64-bit? */ + #define EFI_ARCH_1 6 /* First arch-specific bit */ ++#define EFI_SECURE_BOOT 7 /* Are we in Secure Boot mode? */ + + #ifdef CONFIG_EFI + # ifdef CONFIG_X86 +-- +1.8.4.2 + diff --git a/selinux-apply-different-permission-to-ptrace-child.patch b/selinux-apply-different-permission-to-ptrace-child.patch deleted file mode 100644 index 90baad840..000000000 --- a/selinux-apply-different-permission-to-ptrace-child.patch +++ /dev/null @@ -1,162 +0,0 @@ -Some applications, like gdb, are able to ptrace both children or other -completely unrelated tasks. We would like to be able to discern these two -things and to be able to allow gdb to ptrace it's children, but not to be -able to ptrace unrelated tasks for security reasons. - -Upstream is a bit weary of this patch as it may be incomplete. They are -not fundamentally opposed to the patch, I was just ask to see if I could -flush out any needed refinement in Fedora where we already had the -problem. We may find that we need to emulate the YAMA non-child -registration module in order to completely deal with 'normal' ptrace on -a system. At the moment however, this patch will at least let us get -gdb working for many users in Fedora (See fedora-devel-list for a -discussion of the current issues people are complaining about in F17 -without this) - ---- - - security/selinux/hooks.c | 38 +++++++++++++++++++++++++++++++++++ - security/selinux/include/classmap.h | 2 +- - security/selinux/include/security.h | 2 ++ - security/selinux/selinuxfs.c | 3 ++- - security/selinux/ss/services.c | 3 +++ - 5 files changed, 46 insertions(+), 2 deletions(-) - -diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c -index 1a4acf4..b226f26 100644 ---- a/security/selinux/hooks.c -+++ b/security/selinux/hooks.c -@@ -1805,6 +1805,39 @@ static inline u32 open_file_to_av(struct file *file) - - /* Hook functions begin here. */ - -+/** -+ * task_is_descendant - walk up a process family tree looking for a match -+ * @parent: the process to compare against while walking up from child -+ * @child: the process to start from while looking upwards for parent -+ * -+ * Returns 1 if child is a descendant of parent, 0 if not. -+ */ -+static int task_is_descendant(struct task_struct *parent, -+ struct task_struct *child) -+{ -+ int rc = 0; -+ struct task_struct *walker = child; -+ -+ if (!parent || !child) -+ return 0; -+ -+ rcu_read_lock(); -+ if (!thread_group_leader(parent)) -+ parent = rcu_dereference(parent->group_leader); -+ while (walker->pid > 0) { -+ if (!thread_group_leader(walker)) -+ walker = rcu_dereference(walker->group_leader); -+ if (walker == parent) { -+ rc = 1; -+ break; -+ } -+ walker = rcu_dereference(walker->real_parent); -+ } -+ rcu_read_unlock(); -+ -+ return rc; -+} -+ - static int selinux_ptrace_access_check(struct task_struct *child, - unsigned int mode) - { -@@ -1820,6 +1853,9 @@ static int selinux_ptrace_access_check(struct task_struct *child, - return avc_has_perm(sid, csid, SECCLASS_FILE, FILE__READ, NULL); - } - -+ -+ if (selinux_policycap_ptrace_child && task_is_descendant(current, child)) -+ return current_has_perm(child, PROCESS__PTRACE_CHILD); - return current_has_perm(child, PROCESS__PTRACE); - } - -@@ -1831,6 +1867,8 @@ static int selinux_ptrace_traceme(struct task_struct *parent) - if (rc) - return rc; - -+ if (selinux_policycap_ptrace_child && task_is_descendant(parent, current)) -+ return task_has_perm(parent, current, PROCESS__PTRACE_CHILD); - return task_has_perm(parent, current, PROCESS__PTRACE); - } - -diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h -index 39e678c..72c08b9 100644 ---- a/security/selinux/include/classmap.h -+++ b/security/selinux/include/classmap.h -@@ -29,7 +29,7 @@ struct security_class_mapping secclass_map[] = { - "getattr", "setexec", "setfscreate", "noatsecure", "siginh", - "setrlimit", "rlimitinh", "dyntransition", "setcurrent", - "execmem", "execstack", "execheap", "setkeycreate", -- "setsockcreate", NULL } }, -+ "setsockcreate", "ptrace_child", NULL } }, - { "system", - { "ipc_info", "syslog_read", "syslog_mod", - "syslog_console", "module_request", NULL } }, -diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h -index dde2005..ac14b0a 100644 ---- a/security/selinux/include/security.h -+++ b/security/selinux/include/security.h -@@ -68,12 +68,14 @@ extern int selinux_enabled; - enum { - POLICYDB_CAPABILITY_NETPEER, - POLICYDB_CAPABILITY_OPENPERM, -+ POLICYDB_CAPABILITY_PTRACE_CHILD, - __POLICYDB_CAPABILITY_MAX - }; - #define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1) - - extern int selinux_policycap_netpeer; - extern int selinux_policycap_openperm; -+extern int selinux_policycap_ptrace_child; - - /* - * type_datum properties -diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c -index 4e93f9e..3379765 100644 ---- a/security/selinux/selinuxfs.c -+++ b/security/selinux/selinuxfs.c -@@ -44,7 +44,8 @@ - /* Policy capability filenames */ - static char *policycap_names[] = { - "network_peer_controls", -- "open_perms" -+ "open_perms", -+ "ptrace_child", - }; - - unsigned int selinux_checkreqprot = CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE; -diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c -index 9b7e7ed..4d12a6e 100644 ---- a/security/selinux/ss/services.c -+++ b/security/selinux/ss/services.c -@@ -72,6 +72,7 @@ - - int selinux_policycap_netpeer; - int selinux_policycap_openperm; -+int selinux_policycap_ptrace_child; - - static DEFINE_RWLOCK(policy_rwlock); - -@@ -1812,6 +1813,8 @@ static void security_load_policycaps(void) - POLICYDB_CAPABILITY_NETPEER); - selinux_policycap_openperm = ebitmap_get_bit(&policydb.policycaps, - POLICYDB_CAPABILITY_OPENPERM); -+ selinux_policycap_ptrace_child = ebitmap_get_bit(&policydb.policycaps, -+ POLICYDB_CAPABILITY_PTRACE_CHILD); - } - - static int security_preserve_bools(struct policydb *p); - - - - -_______________________________________________ -kernel mailing list -kernel@lists.fedoraproject.org -https://admin.fedoraproject.org/mailman/listinfo/kernel diff --git a/selinux-put-the-mmap-DAC-controls-before-the-MAC-controls.patch b/selinux-put-the-mmap-DAC-controls-before-the-MAC-controls.patch new file mode 100644 index 000000000..5d9a4ff4a --- /dev/null +++ b/selinux-put-the-mmap-DAC-controls-before-the-MAC-controls.patch @@ -0,0 +1,94 @@ +Bugzilla: 1013466 +Upstream-status: 3.15 (commit 98883bfd9d603a2760f6d53eccfaa3ae2c053e72) + +It turns out that doing the SELinux MAC checks for mmap() before the +DAC checks was causing users and the SELinux policy folks headaches +as users were seeing a lot of SELinux AVC denials for the +memprotect:mmap_zero permission that would have also been denied by +the normal DAC capability checks (CAP_SYS_RAWIO). + +Example: + + # cat mmap_test.c + #include + #include + #include + #include + + int main(int argc, char *argv[]) + { + int rc; + void *mem; + + mem = mmap(0x0, 4096, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); + if (mem == MAP_FAILED) + return errno; + printf("mem = %p\n", mem); + munmap(mem, 4096); + + return 0; + } + # gcc -g -O0 -o mmap_test mmap_test.c + # ./mmap_test + mem = (nil) + # ausearch -m AVC | grep mmap_zero + type=AVC msg=audit(...): avc: denied { mmap_zero } + for pid=1025 comm="mmap_test" + scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 + tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 + tclass=memprotect + +This patch corrects things so that when the above example is run by a +user without CAP_SYS_RAWIO the SELinux AVC is no longer generated as +the DAC capability check fails before the SELinux permission check. + +Signed-off-by: Paul Moore +--- + security/selinux/hooks.c | 20 ++++++++------------ + 1 file changed, 8 insertions(+), 12 deletions(-) + +diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c +index 57b0b49..e3664ae 100644 +--- a/security/selinux/hooks.c ++++ b/security/selinux/hooks.c +@@ -3205,24 +3205,20 @@ error: + + static int selinux_mmap_addr(unsigned long addr) + { +- int rc = 0; +- u32 sid = current_sid(); ++ int rc; ++ ++ /* do DAC check on address space usage */ ++ rc = cap_mmap_addr(addr); ++ if (rc) ++ return rc; + +- /* +- * notice that we are intentionally putting the SELinux check before +- * the secondary cap_file_mmap check. This is such a likely attempt +- * at bad behaviour/exploit that we always want to get the AVC, even +- * if DAC would have also denied the operation. +- */ + if (addr < CONFIG_LSM_MMAP_MIN_ADDR) { ++ u32 sid = current_sid(); + rc = avc_has_perm(sid, sid, SECCLASS_MEMPROTECT, + MEMPROTECT__MMAP_ZERO, NULL); +- if (rc) +- return rc; + } + +- /* do DAC check on address space usage */ +- return cap_mmap_addr(addr); ++ return rc; + } + + static int selinux_mmap_file(struct file *file, unsigned long reqprot, + +_______________________________________________ +Selinux mailing list +Selinux@tycho.nsa.gov +To unsubscribe, send email to Selinux-leave@tycho.nsa.gov. +To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov. diff --git a/serial-460800.patch b/serial-460800.patch deleted file mode 100644 index 0e68378e7..000000000 --- a/serial-460800.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c -index 2209620..659c1bb 100644 ---- a/drivers/tty/serial/8250/8250.c -+++ b/drivers/tty/serial/8250/8250.c -@@ -7,6 +7,9 @@ - * - * Copyright (C) 2001 Russell King. - * -+ * 2005/09/16: Enabled higher baud rates for 16C95x. -+ * (Mathias Adam ) -+ * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or -@@ -2227,6 +2230,14 @@ static unsigned int serial8250_get_divisor(struct uart_port *port, unsigned int - else if ((port->flags & UPF_MAGIC_MULTIPLIER) && - baud == (port->uartclk/8)) - quot = 0x8002; -+ /* -+ * For 16C950s UART_TCR is used in combination with divisor==1 -+ * to achieve baud rates up to baud_base*4. -+ */ -+ else if ((port->type == PORT_16C950) && -+ baud > (port->uartclk/16)) -+ quot = 1; -+ - else - quot = uart_get_divisor(port, baud); - -@@ -2240,7 +2251,7 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, - container_of(port, struct uart_8250_port, port); - unsigned char cval, fcr = 0; - unsigned long flags; -- unsigned int baud, quot; -+ unsigned int baud, quot, max_baud; - int fifo_bug = 0; - - switch (termios->c_cflag & CSIZE) { -@@ -2272,9 +2283,10 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, - /* - * Ask the core to calculate the divisor for us. - */ -+ max_baud = (up->port.type == PORT_16C950 ? port->uartclk/4 : port->uartclk/16); - baud = uart_get_baud_rate(port, termios, old, - port->uartclk / 16 / 0xffff, -- port->uartclk / 16); -+ max_baud); - quot = serial8250_get_divisor(port, baud); - - /* -@@ -2311,6 +2323,19 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, - spin_lock_irqsave(&up->port.lock, flags); - - /* -+ * 16C950 supports additional prescaler ratios between 1:16 and 1:4 -+ * thus increasing max baud rate to uartclk/4. -+ */ -+ if (up->port.type == PORT_16C950) { -+ if (baud == port->uartclk/4) -+ serial_icr_write(up, UART_TCR, 0x4); -+ else if (baud == port->uartclk/8) -+ serial_icr_write(up, UART_TCR, 0x8); -+ else -+ serial_icr_write(up, UART_TCR, 0); -+ } -+ -+ /* - * Update the per-port timeout. - */ - uart_update_timeout(port, termios->c_cflag, baud); diff --git a/serial-8250-Keep-8250.-xxxx-module-options-functiona.patch b/serial-8250-Keep-8250.-xxxx-module-options-functiona.patch deleted file mode 100644 index b16be4417..000000000 --- a/serial-8250-Keep-8250.-xxxx-module-options-functiona.patch +++ /dev/null @@ -1,63 +0,0 @@ -From e94256528a988231ccc7a2a0b6b206a1131cb358 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Fri, 8 Mar 2013 21:13:52 -0500 -Subject: [PATCH] serial: 8250: Keep 8250. module options functional - after driver rename - -With commit 835d844d1 (8250_pnp: do pnp probe before legacy probe), the -8250 driver was renamed to 8250_core. This means any existing usage of -the 8259. module parameters or as a kernel command line switch is -now broken, as the 8250_core driver doesn't parse options belonging to -something called "8250". - -To solve this, we redefine the module options in a dummy function using -a redefined MODULE_PARAM_PREFX when built into the kernel. In the case -where we're building as a module, we provide an alias to the old 8250 -name. The dummy function prevents compiler errors due to global variable -redefinitions that happen as part of the module_param_ macro expansions. - -Signed-off-by: Josh Boyer ---- - drivers/tty/serial/8250/8250.c | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c -index 0efc815..f982633 100644 ---- a/drivers/tty/serial/8250/8250.c -+++ b/drivers/tty/serial/8250/8250.c -@@ -3396,3 +3396,32 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444); - MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); - #endif - MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); -+ -+#ifndef MODULE -+/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name -+ * working as well for the module options so we don't break people. We -+ * need to keep the names identical and the convenient macros will happily -+ * refuse to let us do that by failing the build with redefinition errors -+ * of global variables. So we stick them inside a dummy function to avoid -+ * those conflicts. The options still get parsed, and the redefined -+ * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. -+ * -+ * This is hacky. I'm sorry. -+ */ -+static void __used s8250_options(void) -+{ -+#undef MODULE_PARAM_PREFIX -+#define MODULE_PARAM_PREFIX "8250." -+ -+ module_param_cb(share_irqs, ¶m_ops_uint, &share_irqs, 0644); -+ module_param_cb(nr_uarts, ¶m_ops_uint, &nr_uarts, 0644); -+ module_param_cb(skip_txen_test, ¶m_ops_uint, &skip_txen_test, 0644); -+#ifdef CONFIG_SERIAL_8250_RSA -+ __module_param_call(MODULE_PARAM_PREFIX, probe_rsa, -+ ¶m_array_ops, .arr = &__param_arr_probe_rsa, -+ 0444, -1); -+#endif -+} -+#else -+MODULE_ALIAS("8250"); -+#endif --- -1.8.1.2 - diff --git a/silence-acpi-blacklist.patch b/silence-acpi-blacklist.patch deleted file mode 100644 index c5997bb6e..000000000 --- a/silence-acpi-blacklist.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up linux-2.6.26.noarch/drivers/acpi/blacklist.c.jx linux-2.6.26.noarch/drivers/acpi/blacklist.c ---- linux-2.6.26.noarch/drivers/acpi/blacklist.c.jx 2008-07-13 17:51:29.000000000 -0400 -+++ linux-2.6.26.noarch/drivers/acpi/blacklist.c 2008-08-12 14:21:39.000000000 -0400 -@@ -81,18 +81,18 @@ static int __init blacklist_by_year(void - - /* Doesn't exist? Likely an old system */ - if (!dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL)) { -- printk(KERN_ERR PREFIX "no DMI BIOS year, " -+ printk(KERN_INFO PREFIX "no DMI BIOS year, " - "acpi=force is required to enable ACPI\n" ); - return 1; - } - /* 0? Likely a buggy new BIOS */ - if (year == 0) { -- printk(KERN_ERR PREFIX "DMI BIOS year==0, " -+ printk(KERN_INFO PREFIX "DMI BIOS year==0, " - "assuming ACPI-capable machine\n" ); - return 0; - } - if (year < CONFIG_ACPI_BLACKLIST_YEAR) { -- printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), " -+ printk(KERN_INFO PREFIX "BIOS age (%d) fails cutoff (%d), " - "acpi=force is required to enable ACPI\n", - year, CONFIG_ACPI_BLACKLIST_YEAR); - return 1; diff --git a/silence-noise.patch b/silence-noise.patch index 1e4d7c57f..a8032597e 100644 --- a/silence-noise.patch +++ b/silence-noise.patch @@ -7,28 +7,20 @@ Some systems, such as EFI-based Apple systems, won't necessarily have an i8042 to initialize. We shouldn't be printing an error message in this case, since not detecting the chip is the correct behavior. --- - drivers/input/serio/i8042.c | 4 +--- - 1 files changed, 1 insertions(+), 3 deletions(-) - diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c -index 170f71e..4f3e632 100644 +index 52c9ebf..c374a96 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c -@@ -701,10 +701,8 @@ static int __devinit i8042_check_aux(void) - +@@ -855,7 +855,6 @@ static int __init i8042_check_aux(void) static int i8042_controller_check(void) { -- if (i8042_flush() == I8042_BUFFER_SIZE) { + if (i8042_flush()) { - pr_err("No controller found\n"); -+ if (i8042_flush() == I8042_BUFFER_SIZE) return -ENODEV; -- } - - return 0; - } --- -1.6.0.1 + } +-- + Socket fuzzers like sfuzz will trigger this printk a lot, even though it's ratelimited. It isn't particularly useful, so just remove it. diff --git a/sources b/sources index 64b1211ea..28dd67020 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -1c738edfc54e7c65faeb90c436104e2f linux-3.8.tar.xz -519f8799f8cf9aae2f05ba8fadc43bd1 patch-3.9-rc2.xz +b621207b3f6ecbb67db18b13258f8ea8 linux-3.14.tar.xz +d79fd9ea62b9c9dd3c17ed7651a9e408 patch-3.14.27.xz diff --git a/sysrq-secure-boot.patch b/sysrq-secure-boot.patch new file mode 100644 index 000000000..c73e3d252 --- /dev/null +++ b/sysrq-secure-boot.patch @@ -0,0 +1,250 @@ +Bugzilla: N/A +Upstream-status: Fedora mustard + +From 29c1f71a2d0845a71ea2ebd2fb33542373dc52dd Mon Sep 17 00:00:00 2001 +From: Kyle McMartin +Date: Fri, 30 Aug 2013 09:28:51 -0400 +Subject: [PATCH] Add sysrq option to disable secure boot mode + +--- + arch/x86/kernel/setup.c | 36 ++++++++++++++++++++++++++++++++++++ + drivers/input/misc/uinput.c | 1 + + drivers/tty/sysrq.c | 19 +++++++++++++------ + include/linux/input.h | 5 +++++ + include/linux/sysrq.h | 8 +++++++- + kernel/debug/kdb/kdb_main.c | 2 +- + kernel/module.c | 4 ++-- + 7 files changed, 65 insertions(+), 10 deletions(-) + +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index c773add..92c480c 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -70,6 +70,11 @@ + #include + #include + ++#include ++#include ++#include ++#include ++ + #include