diff options
author | Adrian Calianu <adrian.calianu@enea.com> | 2017-09-05 17:22:26 +0200 |
---|---|---|
committer | Adrian Calianu <adrian.calianu@enea.com> | 2017-09-05 17:22:26 +0200 |
commit | c47f2bfcefee5d746dd72af26faec2b44ff553b5 (patch) | |
tree | aa9ac21407f71af2520aec4d1dc4248217e83c11 /patches | |
parent | 85a500385477e07d144fc3fcfa4ec62e6aabc8e8 (diff) | |
download | enea-kernel-cache-c47f2bfcefee5d746dd72af26faec2b44ff553b5.tar.gz |
add new kernel features needed by guest
Signed-off-by: Adrian Calianu <adrian.calianu@enea.com>
Diffstat (limited to 'patches')
17 files changed, 912 insertions, 10 deletions
diff --git a/patches/boot_time_opt/0102-cpuidle-skip-synchronize_rcu-on-single-CPU-systems.patch b/patches/boot_time_opt/0102-cpuidle-skip-synchronize_rcu-on-single-CPU-systems.patch new file mode 100644 index 0000000..1de2a6b --- /dev/null +++ b/patches/boot_time_opt/0102-cpuidle-skip-synchronize_rcu-on-single-CPU-systems.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 6b0fb5b2a7a157c04d8ab6ad71b092034d0048bf Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Wed, 11 Feb 2015 16:19:26 -0600 | ||
4 | Subject: [PATCH 102/114] cpuidle: skip synchronize_rcu() on single CPU systems | ||
5 | |||
6 | synchronize_rcu() is pretty expensive, and on single CPU systems we don't need | ||
7 | it in this specific case, so skip it. | ||
8 | |||
9 | Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> | ||
10 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
11 | --- | ||
12 | drivers/cpuidle/cpuidle.c | 5 ++++- | ||
13 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c | ||
16 | index 62810ff3b00f..f1d110411098 100644 | ||
17 | --- a/drivers/cpuidle/cpuidle.c | ||
18 | +++ b/drivers/cpuidle/cpuidle.c | ||
19 | @@ -324,8 +324,11 @@ void cpuidle_uninstall_idle_handler(void) | ||
20 | /* | ||
21 | * Make sure external observers (such as the scheduler) | ||
22 | * are done looking at pointed idle states. | ||
23 | + * This is only relevant if there is more than one cpu, | ||
24 | + * if there is only one CPU, that is us... and we're | ||
25 | + * coherent to ourselves. | ||
26 | */ | ||
27 | - synchronize_rcu(); | ||
28 | + | ||
29 | } | ||
30 | |||
31 | /** | ||
32 | -- | ||
33 | 2.11.1 | ||
34 | |||
diff --git a/patches/boot_time_opt/0103-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch b/patches/boot_time_opt/0103-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch new file mode 100644 index 0000000..d3a20fb --- /dev/null +++ b/patches/boot_time_opt/0103-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 7be707833bb35c295eb702d13cf73ac9390e4b31 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Wed, 11 Feb 2015 16:25:16 -0600 | ||
4 | Subject: [PATCH 103/114] sysrq: skip synchronize_rcu() if there is no old op | ||
5 | |||
6 | synchronize_rcu() is expensive. Currently it is called as part of the sysrq | ||
7 | registration/unregistration, which happens during boot several times. | ||
8 | Now, the reason for the synchronize_rcu() is to allow an old registered | ||
9 | operation to expire properly... which is pointless if the old operation | ||
10 | is NULL... | ||
11 | So we can save the common case of the old operation being NULL a lot of time | ||
12 | by just checking for non-NULL prior to the synchronize_rcu() | ||
13 | |||
14 | Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> | ||
15 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
16 | --- | ||
17 | drivers/tty/sysrq.c | 4 +++- | ||
18 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c | ||
21 | index 701c085bb19b..c60c7ba57ad9 100644 | ||
22 | --- a/drivers/tty/sysrq.c | ||
23 | +++ b/drivers/tty/sysrq.c | ||
24 | @@ -1065,8 +1065,10 @@ static int __sysrq_swap_key_ops(int key, struct sysrq_key_op *insert_op_p, | ||
25 | * A concurrent __handle_sysrq either got the old op or the new op. | ||
26 | * Wait for it to go away before returning, so the code for an old | ||
27 | * op is not freed (eg. on module unload) while it is in use. | ||
28 | + * This is only relevant if the old op is not NULL of course. | ||
29 | */ | ||
30 | - synchronize_rcu(); | ||
31 | + if (remove_op_p) | ||
32 | + synchronize_rcu(); | ||
33 | |||
34 | return retval; | ||
35 | } | ||
36 | -- | ||
37 | 2.11.1 | ||
38 | |||
diff --git a/patches/boot_time_opt/0104-fbcon-enable-no-blink-by-default.patch b/patches/boot_time_opt/0104-fbcon-enable-no-blink-by-default.patch new file mode 100644 index 0000000..715c195 --- /dev/null +++ b/patches/boot_time_opt/0104-fbcon-enable-no-blink-by-default.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 5899ff79ed4e3514420e1530a3588a922832dae5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jose Carlos Venegas Munoz <jos.c.venegas.munoz@intel.com> | ||
3 | Date: Mon, 13 Apr 2015 11:26:36 -0500 | ||
4 | Subject: [PATCH 104/114] fbcon: enable no blink by default | ||
5 | |||
6 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
7 | --- | ||
8 | drivers/video/console/fbcon.c | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c | ||
12 | index a44f5627b82a..95b73366b86f 100644 | ||
13 | --- a/drivers/video/console/fbcon.c | ||
14 | +++ b/drivers/video/console/fbcon.c | ||
15 | @@ -146,7 +146,7 @@ static const struct consw fb_con; | ||
16 | |||
17 | static int fbcon_set_origin(struct vc_data *); | ||
18 | |||
19 | -static int fbcon_cursor_noblink; | ||
20 | +static int fbcon_cursor_noblink = 1; | ||
21 | |||
22 | #define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1) | ||
23 | |||
24 | -- | ||
25 | 2.11.1 | ||
26 | |||
diff --git a/patches/boot_time_opt/0105-vmstats-wakeups.patch b/patches/boot_time_opt/0105-vmstats-wakeups.patch new file mode 100644 index 0000000..09b109a --- /dev/null +++ b/patches/boot_time_opt/0105-vmstats-wakeups.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From ff47b4e9be8113b4ba05d6f2afee3db6904bc10f Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Wed, 11 Feb 2015 16:47:20 -0600 | ||
4 | Subject: [PATCH 105/114] vmstats: wakeups | ||
5 | |||
6 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
7 | |||
8 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
9 | --- | ||
10 | mm/vmstat.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/mm/vmstat.c b/mm/vmstat.c | ||
14 | index 7c28df36f50f..efe1b6797139 100644 | ||
15 | --- a/mm/vmstat.c | ||
16 | +++ b/mm/vmstat.c | ||
17 | @@ -1549,7 +1549,7 @@ static const struct file_operations proc_vmstat_file_operations = { | ||
18 | #ifdef CONFIG_SMP | ||
19 | static struct workqueue_struct *vmstat_wq; | ||
20 | static DEFINE_PER_CPU(struct delayed_work, vmstat_work); | ||
21 | -int sysctl_stat_interval __read_mostly = HZ; | ||
22 | +int sysctl_stat_interval __read_mostly = 8 * HZ; | ||
23 | |||
24 | #ifdef CONFIG_PROC_FS | ||
25 | static void refresh_vm_stats(struct work_struct *work) | ||
26 | -- | ||
27 | 2.11.1 | ||
28 | |||
diff --git a/patches/boot_time_opt/0106-pci-probe.patch b/patches/boot_time_opt/0106-pci-probe.patch new file mode 100644 index 0000000..5045926 --- /dev/null +++ b/patches/boot_time_opt/0106-pci-probe.patch | |||
@@ -0,0 +1,123 @@ | |||
1 | From b225caf8f743b9f5f9e84d0df711ee0c17e049ae Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Wed, 11 Feb 2015 16:53:08 -0600 | ||
4 | Subject: [PATCH 106/114] pci: probe | ||
5 | |||
6 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
7 | |||
8 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
9 | --- | ||
10 | drivers/pci/probe.c | 43 ++++++++++++++++++++++++++++++++++++++++--- | ||
11 | 1 file changed, 40 insertions(+), 3 deletions(-) | ||
12 | |||
13 | diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c | ||
14 | index 204960e70333..7399a06698da 100644 | ||
15 | --- a/drivers/pci/probe.c | ||
16 | +++ b/drivers/pci/probe.c | ||
17 | @@ -182,6 +182,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | ||
18 | |||
19 | mask = type ? PCI_ROM_ADDRESS_MASK : ~0; | ||
20 | |||
21 | + res->name = pci_name(dev); | ||
22 | + | ||
23 | + printk("clr: Starting probe for %s\n", res->name); | ||
24 | + | ||
25 | /* No printks while decoding is disabled! */ | ||
26 | if (!dev->mmio_always_on) { | ||
27 | pci_read_config_word(dev, PCI_COMMAND, &orig_cmd); | ||
28 | @@ -191,8 +195,6 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | ||
29 | } | ||
30 | } | ||
31 | |||
32 | - res->name = pci_name(dev); | ||
33 | - | ||
34 | pci_read_config_dword(dev, pos, &l); | ||
35 | pci_write_config_dword(dev, pos, l | mask); | ||
36 | pci_read_config_dword(dev, pos, &sz); | ||
37 | @@ -324,6 +326,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) | ||
38 | if (dev->non_compliant_bars) | ||
39 | return; | ||
40 | |||
41 | + printk("clr: pci_read_bases start\n"); | ||
42 | + | ||
43 | for (pos = 0; pos < howmany; pos++) { | ||
44 | struct resource *res = &dev->resource[pos]; | ||
45 | reg = PCI_BASE_ADDRESS_0 + (pos << 2); | ||
46 | @@ -332,11 +336,13 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom) | ||
47 | |||
48 | if (rom) { | ||
49 | struct resource *res = &dev->resource[PCI_ROM_RESOURCE]; | ||
50 | + printk("clr: rom path\n"); | ||
51 | dev->rom_base_reg = rom; | ||
52 | res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH | | ||
53 | IORESOURCE_READONLY | IORESOURCE_SIZEALIGN; | ||
54 | __pci_read_base(dev, pci_bar_mem32, res, rom); | ||
55 | } | ||
56 | + printk("clr: pci_read_bases end\n"); | ||
57 | } | ||
58 | |||
59 | static void pci_read_bridge_io(struct pci_bus *child) | ||
60 | @@ -1311,6 +1317,28 @@ static void pci_msi_setup_pci_dev(struct pci_dev *dev) | ||
61 | pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0); | ||
62 | } | ||
63 | |||
64 | +static int guess_bar_count(int class) | ||
65 | +{ | ||
66 | + if (class == 0x068000) | ||
67 | + return 0; | ||
68 | + if (class == 0x020000) | ||
69 | + return 2; | ||
70 | + if (class == 0x010000) | ||
71 | + return 2; | ||
72 | + if (class == 0x00ff00) | ||
73 | + return 1; | ||
74 | + return 6; | ||
75 | +} | ||
76 | + | ||
77 | +static int has_rom(int class, int rom) | ||
78 | +{ | ||
79 | + if (class == 0x020000) | ||
80 | + return 0; | ||
81 | + if (class == 0x010000 || class == 0x00ff00) | ||
82 | + return 0; | ||
83 | + return rom; | ||
84 | +} | ||
85 | + | ||
86 | /** | ||
87 | * pci_setup_device - fill in class and map information of a device | ||
88 | * @dev: the device structure to fill | ||
89 | @@ -1329,6 +1357,9 @@ int pci_setup_device(struct pci_dev *dev) | ||
90 | int pos = 0; | ||
91 | struct pci_bus_region region; | ||
92 | struct resource *res; | ||
93 | + int maxbar; | ||
94 | + | ||
95 | + printk("clr: pci_setup_device start\n"); | ||
96 | |||
97 | if (pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type)) | ||
98 | return -EIO; | ||
99 | @@ -1383,7 +1414,11 @@ int pci_setup_device(struct pci_dev *dev) | ||
100 | if (class == PCI_CLASS_BRIDGE_PCI) | ||
101 | goto bad; | ||
102 | pci_read_irq(dev); | ||
103 | - pci_read_bases(dev, 6, PCI_ROM_ADDRESS); | ||
104 | + | ||
105 | + maxbar = guess_bar_count(dev->class); | ||
106 | + | ||
107 | + if (class != PCI_CLASS_STORAGE_IDE) | ||
108 | + pci_read_bases(dev, maxbar, has_rom(dev->class, PCI_ROM_ADDRESS)); | ||
109 | pci_read_config_word(dev, PCI_SUBSYSTEM_VENDOR_ID, &dev->subsystem_vendor); | ||
110 | pci_read_config_word(dev, PCI_SUBSYSTEM_ID, &dev->subsystem_device); | ||
111 | |||
112 | @@ -1468,6 +1503,8 @@ int pci_setup_device(struct pci_dev *dev) | ||
113 | dev->class = PCI_CLASS_NOT_DEFINED << 8; | ||
114 | } | ||
115 | |||
116 | + printk("clr: pci_setup_device end\n"); | ||
117 | + | ||
118 | /* We found a fine healthy device, go go go... */ | ||
119 | return 0; | ||
120 | } | ||
121 | -- | ||
122 | 2.11.1 | ||
123 | |||
diff --git a/patches/boot_time_opt/0107-cgroup.patch b/patches/boot_time_opt/0107-cgroup.patch new file mode 100644 index 0000000..d68c686 --- /dev/null +++ b/patches/boot_time_opt/0107-cgroup.patch | |||
@@ -0,0 +1,107 @@ | |||
1 | From 0adc5bfd84939d11d3c172eab0a00bfab4aadb46 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Fri, 28 Aug 2015 11:00:36 -0500 | ||
4 | Subject: [PATCH 107/114] cgroup | ||
5 | |||
6 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
7 | |||
8 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
9 | Signed-off-by: Jose Carlos Venegas Munoz <jos.c.venegas.munoz@intel.com> | ||
10 | --- | ||
11 | include/linux/cgroup-defs.h | 2 +- | ||
12 | kernel/cgroup.c | 24 ++++++++++++++---------- | ||
13 | 2 files changed, 15 insertions(+), 11 deletions(-) | ||
14 | |||
15 | diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h | ||
16 | index 861b4677fc5b..5d3c345ee60c 100644 | ||
17 | --- a/include/linux/cgroup-defs.h | ||
18 | +++ b/include/linux/cgroup-defs.h | ||
19 | @@ -137,7 +137,7 @@ struct cgroup_subsys_state { | ||
20 | |||
21 | /* percpu_ref killing and RCU release */ | ||
22 | struct rcu_head rcu_head; | ||
23 | - struct work_struct destroy_work; | ||
24 | + struct delayed_work destroy_work; | ||
25 | }; | ||
26 | |||
27 | /* | ||
28 | diff --git a/kernel/cgroup.c b/kernel/cgroup.c | ||
29 | index 53bbca7c4859..6de39d8213ed 100644 | ||
30 | --- a/kernel/cgroup.c | ||
31 | +++ b/kernel/cgroup.c | ||
32 | @@ -73,7 +73,7 @@ | ||
33 | * Expiring in the middle is a performance problem not a correctness one. | ||
34 | * 1 sec should be enough. | ||
35 | */ | ||
36 | -#define CGROUP_PIDLIST_DESTROY_DELAY HZ | ||
37 | +#define CGROUP_PIDLIST_DESTROY_DELAY round_jiffies_relative(HZ) | ||
38 | |||
39 | #define CGROUP_FILE_NAME_MAX (MAX_CGROUP_TYPE_NAMELEN + \ | ||
40 | MAX_CFTYPE_NAME + 2) | ||
41 | @@ -4986,8 +4986,9 @@ static struct cftype cgroup_legacy_base_files[] = { | ||
42 | */ | ||
43 | static void css_free_work_fn(struct work_struct *work) | ||
44 | { | ||
45 | + struct delayed_work *dwork = to_delayed_work(work); | ||
46 | struct cgroup_subsys_state *css = | ||
47 | - container_of(work, struct cgroup_subsys_state, destroy_work); | ||
48 | + container_of(dwork, struct cgroup_subsys_state, destroy_work); | ||
49 | struct cgroup_subsys *ss = css->ss; | ||
50 | struct cgroup *cgrp = css->cgroup; | ||
51 | |||
52 | @@ -5036,14 +5037,15 @@ static void css_free_rcu_fn(struct rcu_head *rcu_head) | ||
53 | struct cgroup_subsys_state *css = | ||
54 | container_of(rcu_head, struct cgroup_subsys_state, rcu_head); | ||
55 | |||
56 | - INIT_WORK(&css->destroy_work, css_free_work_fn); | ||
57 | - queue_work(cgroup_destroy_wq, &css->destroy_work); | ||
58 | + INIT_DELAYED_WORK(&css->destroy_work, css_free_work_fn); | ||
59 | + queue_delayed_work(cgroup_destroy_wq, &css->destroy_work, CGROUP_PIDLIST_DESTROY_DELAY); | ||
60 | } | ||
61 | |||
62 | static void css_release_work_fn(struct work_struct *work) | ||
63 | { | ||
64 | + struct delayed_work *dwork = to_delayed_work(work); | ||
65 | struct cgroup_subsys_state *css = | ||
66 | - container_of(work, struct cgroup_subsys_state, destroy_work); | ||
67 | + container_of(dwork, struct cgroup_subsys_state, destroy_work); | ||
68 | struct cgroup_subsys *ss = css->ss; | ||
69 | struct cgroup *cgrp = css->cgroup; | ||
70 | |||
71 | @@ -5088,8 +5090,9 @@ static void css_release(struct percpu_ref *ref) | ||
72 | struct cgroup_subsys_state *css = | ||
73 | container_of(ref, struct cgroup_subsys_state, refcnt); | ||
74 | |||
75 | - INIT_WORK(&css->destroy_work, css_release_work_fn); | ||
76 | - queue_work(cgroup_destroy_wq, &css->destroy_work); | ||
77 | + INIT_DELAYED_WORK(&css->destroy_work, css_release_work_fn); | ||
78 | + queue_delayed_work(cgroup_destroy_wq, &css->destroy_work, CGROUP_PIDLIST_DESTROY_DELAY); | ||
79 | + | ||
80 | } | ||
81 | |||
82 | static void init_and_link_css(struct cgroup_subsys_state *css, | ||
83 | @@ -5371,8 +5374,9 @@ static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name, | ||
84 | */ | ||
85 | static void css_killed_work_fn(struct work_struct *work) | ||
86 | { | ||
87 | + struct delayed_work *dwork = to_delayed_work(work); | ||
88 | struct cgroup_subsys_state *css = | ||
89 | - container_of(work, struct cgroup_subsys_state, destroy_work); | ||
90 | + container_of(dwork, struct cgroup_subsys_state, destroy_work); | ||
91 | |||
92 | mutex_lock(&cgroup_mutex); | ||
93 | |||
94 | @@ -5393,8 +5397,8 @@ static void css_killed_ref_fn(struct percpu_ref *ref) | ||
95 | container_of(ref, struct cgroup_subsys_state, refcnt); | ||
96 | |||
97 | if (atomic_dec_and_test(&css->online_cnt)) { | ||
98 | - INIT_WORK(&css->destroy_work, css_killed_work_fn); | ||
99 | - queue_work(cgroup_destroy_wq, &css->destroy_work); | ||
100 | + INIT_DELAYED_WORK(&css->destroy_work, css_killed_work_fn); | ||
101 | + queue_delayed_work(cgroup_destroy_wq, &css->destroy_work, CGROUP_PIDLIST_DESTROY_DELAY); | ||
102 | } | ||
103 | } | ||
104 | |||
105 | -- | ||
106 | 2.11.1 | ||
107 | |||
diff --git a/patches/boot_time_opt/0108-smpboot-reuse-timer-calibration.patch b/patches/boot_time_opt/0108-smpboot-reuse-timer-calibration.patch new file mode 100644 index 0000000..48be94a --- /dev/null +++ b/patches/boot_time_opt/0108-smpboot-reuse-timer-calibration.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 634947be6c24d844af5f6ecf59453f2ddc09e032 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Wed, 11 Feb 2015 17:28:14 -0600 | ||
4 | Subject: [PATCH 108/114] smpboot: reuse timer calibration | ||
5 | |||
6 | NO point recalibrating for known-constant tsc... saves 200ms+ of boot time. | ||
7 | |||
8 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
9 | |||
10 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
11 | --- | ||
12 | arch/x86/kernel/smpboot.c | 2 +- | ||
13 | arch/x86/kernel/tsc.c | 3 +++ | ||
14 | 2 files changed, 4 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c | ||
17 | index 99b920d0e516..e17bb425bb52 100644 | ||
18 | --- a/arch/x86/kernel/smpboot.c | ||
19 | +++ b/arch/x86/kernel/smpboot.c | ||
20 | @@ -761,7 +761,7 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) | ||
21 | pr_debug("Waiting for send to finish...\n"); | ||
22 | send_status = safe_apic_wait_icr_idle(); | ||
23 | |||
24 | - udelay(init_udelay); | ||
25 | + udelay(100); | ||
26 | |||
27 | pr_debug("Deasserting INIT\n"); | ||
28 | |||
29 | diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c | ||
30 | index 37e7cf544e51..e99be8a6a132 100644 | ||
31 | --- a/arch/x86/kernel/tsc.c | ||
32 | +++ b/arch/x86/kernel/tsc.c | ||
33 | @@ -1413,6 +1413,9 @@ unsigned long calibrate_delay_is_known(void) | ||
34 | if (!mask) | ||
35 | return 0; | ||
36 | |||
37 | + if (cpu !=0) | ||
38 | + return cpu_data(0).loops_per_jiffy; | ||
39 | + | ||
40 | sibling = cpumask_any_but(mask, cpu); | ||
41 | if (sibling < nr_cpu_ids) | ||
42 | return cpu_data(sibling).loops_per_jiffy; | ||
43 | -- | ||
44 | 2.11.1 | ||
45 | |||
diff --git a/patches/boot_time_opt/0109-perf.patch b/patches/boot_time_opt/0109-perf.patch new file mode 100644 index 0000000..75f50f6 --- /dev/null +++ b/patches/boot_time_opt/0109-perf.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From cce700dfbd5fdbf72b96e6479ca539ab4d880ce2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Wed, 4 Nov 2015 15:17:10 -0600 | ||
4 | Subject: [PATCH 109/114] perf | ||
5 | |||
6 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
7 | |||
8 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
9 | --- | ||
10 | arch/x86/events/intel/core.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c | ||
14 | index eb1484c86bb4..c13ea26ac066 100644 | ||
15 | --- a/arch/x86/events/intel/core.c | ||
16 | +++ b/arch/x86/events/intel/core.c | ||
17 | @@ -4040,7 +4040,7 @@ __init int intel_pmu_init(void) | ||
18 | */ | ||
19 | if (x86_pmu.extra_regs) { | ||
20 | for (er = x86_pmu.extra_regs; er->msr; er++) { | ||
21 | - er->extra_msr_access = check_msr(er->msr, 0x11UL); | ||
22 | + er->extra_msr_access = false; | ||
23 | /* Disable LBR select mapping */ | ||
24 | if ((er->idx == EXTRA_REG_LBR) && !er->extra_msr_access) | ||
25 | x86_pmu.lbr_sel_map = NULL; | ||
26 | -- | ||
27 | 2.11.1 | ||
28 | |||
diff --git a/patches/boot_time_opt/0110-pci-probe-identify-known-devices.patch b/patches/boot_time_opt/0110-pci-probe-identify-known-devices.patch new file mode 100644 index 0000000..742a045 --- /dev/null +++ b/patches/boot_time_opt/0110-pci-probe-identify-known-devices.patch | |||
@@ -0,0 +1,190 @@ | |||
1 | From c662d99134b67c58e63ecc17c2531588a3a51596 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Sat, 14 Feb 2015 09:49:41 -0600 | ||
4 | Subject: [PATCH 110/114] pci: probe: identify known devices | ||
5 | |||
6 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
7 | Modify-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
8 | |||
9 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
10 | --- | ||
11 | drivers/pci/probe.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
12 | 1 file changed, 156 insertions(+) | ||
13 | |||
14 | diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c | ||
15 | index 7399a06698da..4fb2d7fed4c5 100644 | ||
16 | --- a/drivers/pci/probe.c | ||
17 | +++ b/drivers/pci/probe.c | ||
18 | @@ -163,6 +163,159 @@ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar) | ||
19 | |||
20 | #define PCI_COMMAND_DECODE_ENABLE (PCI_COMMAND_MEMORY | PCI_COMMAND_IO) | ||
21 | |||
22 | +/* shortcut version of __pci_read_base where we know the sizes already */ | ||
23 | +int __pci_read_base_shortcut(struct pci_dev *dev, enum pci_bar_type type, | ||
24 | + struct resource *res, unsigned int pos, u32 sz_in, u32 sz2_in) | ||
25 | +{ | ||
26 | + u32 l, sz; | ||
27 | + u64 l64, sz64, mask64; | ||
28 | + struct pci_bus_region region, inverted_region; | ||
29 | + | ||
30 | + res->name = pci_name(dev); | ||
31 | + | ||
32 | + pci_read_config_dword(dev, pos, &l); | ||
33 | + | ||
34 | + sz = sz_in; | ||
35 | + | ||
36 | + /* | ||
37 | + * All bits set in sz means the device isn't working properly. | ||
38 | + * If the BAR isn't implemented, all bits must be 0. If it's a | ||
39 | + * memory BAR or a ROM, bit 0 must be clear; if it's an io BAR, bit | ||
40 | + * 1 must be clear. | ||
41 | + * Here we set the size and is not 0xffffffff | ||
42 | + */ | ||
43 | + | ||
44 | + /* | ||
45 | + * I don't know how l can have all bits set. Copied from old code. | ||
46 | + * Maybe it fixes a bug on some ancient platform. | ||
47 | + */ | ||
48 | + if (l == 0xffffffff) | ||
49 | + l = 0; | ||
50 | + | ||
51 | + if (type == pci_bar_unknown) { | ||
52 | + res->flags = decode_bar(dev, l); | ||
53 | + res->flags |= IORESOURCE_SIZEALIGN; | ||
54 | + if (res->flags & IORESOURCE_IO) { | ||
55 | + l64 = l & PCI_BASE_ADDRESS_IO_MASK; | ||
56 | + sz64 = sz & PCI_BASE_ADDRESS_IO_MASK; | ||
57 | + mask64 = PCI_BASE_ADDRESS_IO_MASK & (u32)IO_SPACE_LIMIT; | ||
58 | + } else { | ||
59 | + l64 = l & PCI_BASE_ADDRESS_MEM_MASK; | ||
60 | + sz64 = sz & PCI_BASE_ADDRESS_MEM_MASK; | ||
61 | + mask64 = (u32)PCI_BASE_ADDRESS_MEM_MASK; | ||
62 | + } | ||
63 | + } else { | ||
64 | + res->flags |= (l & IORESOURCE_ROM_ENABLE); | ||
65 | + l64 = l & PCI_ROM_ADDRESS_MASK; | ||
66 | + sz64 = sz & PCI_ROM_ADDRESS_MASK; | ||
67 | + mask64 = (u32)PCI_ROM_ADDRESS_MASK; | ||
68 | + } | ||
69 | + | ||
70 | + if (res->flags & IORESOURCE_MEM_64) { | ||
71 | + pci_read_config_dword(dev, pos + 4, &l); | ||
72 | + sz = sz2_in; | ||
73 | + | ||
74 | + l64 |= ((u64)l << 32); | ||
75 | + sz64 |= ((u64)sz << 32); | ||
76 | + mask64 |= ((u64)~0 << 32); | ||
77 | + } | ||
78 | + | ||
79 | + if (!sz64) | ||
80 | + goto fail; | ||
81 | + | ||
82 | + sz64 = pci_size(l64, sz64, mask64); | ||
83 | + if (!sz64) { | ||
84 | + dev_info(&dev->dev, FW_BUG "reg 0x%x: invalid BAR (can't size)\n", | ||
85 | + pos); | ||
86 | + goto fail; | ||
87 | + } | ||
88 | + | ||
89 | + if (res->flags & IORESOURCE_MEM_64) { | ||
90 | + if ((sizeof(dma_addr_t) < 8 || sizeof(resource_size_t) < 8) && | ||
91 | + sz64 > 0x100000000ULL) { | ||
92 | + res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED; | ||
93 | + res->start = 0; | ||
94 | + res->end = 0; | ||
95 | + dev_err(&dev->dev, "reg 0x%x: can't handle BAR larger than 4GB (size %#010llx)\n", | ||
96 | + pos, (unsigned long long)sz64); | ||
97 | + goto out; | ||
98 | + } | ||
99 | + | ||
100 | + if ((sizeof(dma_addr_t) < 8) && l) { | ||
101 | + /* Above 32-bit boundary; try to reallocate */ | ||
102 | + res->flags |= IORESOURCE_UNSET; | ||
103 | + res->start = 0; | ||
104 | + res->end = sz64; | ||
105 | + dev_info(&dev->dev, "reg 0x%x: can't handle BAR above 4GB (bus address %#010llx)\n", | ||
106 | + pos, (unsigned long long)l64); | ||
107 | + goto out; | ||
108 | + } | ||
109 | + } | ||
110 | + | ||
111 | + region.start = l64; | ||
112 | + region.end = l64 + sz64; | ||
113 | + | ||
114 | + pcibios_bus_to_resource(dev->bus, res, ®ion); | ||
115 | + pcibios_resource_to_bus(dev->bus, &inverted_region, res); | ||
116 | + | ||
117 | + /* | ||
118 | + * If "A" is a BAR value (a bus address), "bus_to_resource(A)" is | ||
119 | + * the corresponding resource address (the physical address used by | ||
120 | + * the CPU. Converting that resource address back to a bus address | ||
121 | + * should yield the original BAR value: | ||
122 | + * | ||
123 | + * resource_to_bus(bus_to_resource(A)) == A | ||
124 | + * | ||
125 | + * If it doesn't, CPU accesses to "bus_to_resource(A)" will not | ||
126 | + * be claimed by the device. | ||
127 | + */ | ||
128 | + if (inverted_region.start != region.start) { | ||
129 | + res->flags |= IORESOURCE_UNSET; | ||
130 | + res->start = 0; | ||
131 | + res->end = region.end - region.start; | ||
132 | + dev_info(&dev->dev, "reg 0x%x: initial BAR value %#010llx invalid\n", | ||
133 | + pos, (unsigned long long)region.start); | ||
134 | + } | ||
135 | + | ||
136 | + goto out; | ||
137 | + | ||
138 | + | ||
139 | +fail: | ||
140 | + res->flags = 0; | ||
141 | +out: | ||
142 | + if (res->flags) | ||
143 | + dev_printk(KERN_DEBUG, &dev->dev, "reg 0x%x: %pR\n", pos, res); | ||
144 | + | ||
145 | + return (res->flags & IORESOURCE_MEM_64) ? 1 : 0; | ||
146 | +} | ||
147 | + | ||
148 | +static int is_known_device(struct pci_dev *dev, int pos, int *sz) | ||
149 | +{ | ||
150 | + /* Red Hat, Inc : Virtio network device */ | ||
151 | + if (dev->vendor == 0x1af4 && dev->device == 0x1000) { | ||
152 | + if (pos == 0x10) { | ||
153 | + *sz = 0xffffffe1; | ||
154 | + return 1; | ||
155 | + } | ||
156 | + if (pos == 0x14) { | ||
157 | + *sz = 0xfffff000; | ||
158 | + return 1; | ||
159 | + } | ||
160 | + } | ||
161 | + /* Red Hat, Inc : Virtio block device */ | ||
162 | + if (dev->vendor == 0x1af4 && dev->device == 0x1001) { | ||
163 | + if (pos == 0x10) { | ||
164 | + *sz = 0xffffffc1; | ||
165 | + return 1; | ||
166 | + } | ||
167 | + if (pos == 0x14) { | ||
168 | + *sz = 0xfffff000; | ||
169 | + return 1; | ||
170 | + } | ||
171 | + } | ||
172 | + return 0; | ||
173 | +} | ||
174 | + | ||
175 | /** | ||
176 | * pci_read_base - read a PCI BAR | ||
177 | * @dev: the PCI device | ||
178 | @@ -182,6 +335,9 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | ||
179 | |||
180 | mask = type ? PCI_ROM_ADDRESS_MASK : ~0; | ||
181 | |||
182 | + if (is_known_device(dev, pos, &sz)) | ||
183 | + return __pci_read_base_shortcut(dev, type, res, pos, sz, 0); | ||
184 | + | ||
185 | res->name = pci_name(dev); | ||
186 | |||
187 | printk("clr: Starting probe for %s\n", res->name); | ||
188 | -- | ||
189 | 2.11.1 | ||
190 | |||
diff --git a/patches/boot_time_opt/0111-init-no-wait-for-the-known-devices.patch b/patches/boot_time_opt/0111-init-no-wait-for-the-known-devices.patch new file mode 100644 index 0000000..701a18d --- /dev/null +++ b/patches/boot_time_opt/0111-init-no-wait-for-the-known-devices.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From be2ab4809c6b5058fbf3cd54c0f59c56416e572c Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Mon, 22 Jun 2015 09:33:33 -0500 | ||
4 | Subject: [PATCH 111/114] init: no wait for the known devices | ||
5 | |||
6 | No wait for the known devices to complete their probing | ||
7 | |||
8 | Author: Arjan van de Ven <arjan@linux.intel.com> | ||
9 | |||
10 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
11 | --- | ||
12 | init/do_mounts.c | 4 +++- | ||
13 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/init/do_mounts.c b/init/do_mounts.c | ||
16 | index c2de5104aad2..40725f0f5fb3 100644 | ||
17 | --- a/init/do_mounts.c | ||
18 | +++ b/init/do_mounts.c | ||
19 | @@ -28,6 +28,7 @@ | ||
20 | #include <linux/slab.h> | ||
21 | #include <linux/ramfs.h> | ||
22 | #include <linux/shmem_fs.h> | ||
23 | +#include <linux/async.h> | ||
24 | |||
25 | #include <linux/nfs_fs.h> | ||
26 | #include <linux/nfs_fs_sb.h> | ||
27 | @@ -563,7 +564,8 @@ void __init prepare_namespace(void) | ||
28 | * For example, it is not atypical to wait 5 seconds here | ||
29 | * for the touchpad of a laptop to initialize. | ||
30 | */ | ||
31 | - wait_for_device_probe(); | ||
32 | + //wait_for_device_probe(); | ||
33 | + async_synchronize_full(); | ||
34 | |||
35 | md_run_setup(); | ||
36 | |||
37 | -- | ||
38 | 2.11.1 | ||
39 | |||
diff --git a/patches/boot_time_opt/0112-ksm-wakeups.patch b/patches/boot_time_opt/0112-ksm-wakeups.patch new file mode 100644 index 0000000..b131e3f --- /dev/null +++ b/patches/boot_time_opt/0112-ksm-wakeups.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 2dc48e4b5c651691b7028991b64c935047b41b19 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arjan van de Ven <arjan@linux.intel.com> | ||
3 | Date: Mon, 14 Mar 2016 11:06:46 -0600 | ||
4 | Subject: [PATCH 112/114] ksm-wakeups | ||
5 | |||
6 | reduce wakeups in ksm | ||
7 | --- | ||
8 | mm/ksm.c | 8 ++++++-- | ||
9 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/mm/ksm.c b/mm/ksm.c | ||
12 | index 9ae6011a41f8..eecd3ff669e2 100644 | ||
13 | --- a/mm/ksm.c | ||
14 | +++ b/mm/ksm.c | ||
15 | @@ -1725,8 +1725,12 @@ static int ksm_scan_thread(void *nothing) | ||
16 | try_to_freeze(); | ||
17 | |||
18 | if (ksmd_should_run()) { | ||
19 | - schedule_timeout_interruptible( | ||
20 | - msecs_to_jiffies(ksm_thread_sleep_millisecs)); | ||
21 | + if (ksm_thread_sleep_millisecs >= 1000) | ||
22 | + schedule_timeout_interruptible( | ||
23 | + msecs_to_jiffies(round_jiffies_relative(ksm_thread_sleep_millisecs))); | ||
24 | + else | ||
25 | + schedule_timeout_interruptible( | ||
26 | + msecs_to_jiffies(ksm_thread_sleep_millisecs)); | ||
27 | } else { | ||
28 | wait_event_freezable(ksm_thread_wait, | ||
29 | ksmd_should_run() || kthread_should_stop()); | ||
30 | -- | ||
31 | 2.11.1 | ||
32 | |||
diff --git a/patches/boot_time_opt/0113-init-do_mounts-recreate-dev-root.patch b/patches/boot_time_opt/0113-init-do_mounts-recreate-dev-root.patch new file mode 100644 index 0000000..047eddb --- /dev/null +++ b/patches/boot_time_opt/0113-init-do_mounts-recreate-dev-root.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 179b7f41d5509f93cd297cc81c5d8da4a3123d9d Mon Sep 17 00:00:00 2001 | ||
2 | From: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
3 | Date: Fri, 20 Nov 2015 14:01:26 -0600 | ||
4 | Subject: [PATCH 113/114] init: do_mounts: recreate /dev/root | ||
5 | |||
6 | Rootfs shows as is mounted in /dev/root, but this devices is not present in | ||
7 | /dev directory. | ||
8 | |||
9 | Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com> | ||
10 | --- | ||
11 | init/do_mounts.c | 8 ++++++++ | ||
12 | 1 file changed, 8 insertions(+) | ||
13 | |||
14 | diff --git a/init/do_mounts.c b/init/do_mounts.c | ||
15 | index 40725f0f5fb3..78b5b1dba8ca 100644 | ||
16 | --- a/init/do_mounts.c | ||
17 | +++ b/init/do_mounts.c | ||
18 | @@ -550,6 +550,7 @@ void __init mount_root(void) | ||
19 | void __init prepare_namespace(void) | ||
20 | { | ||
21 | int is_floppy; | ||
22 | + int err; | ||
23 | |||
24 | if (root_delay) { | ||
25 | printk(KERN_INFO "Waiting %d sec before mounting root device...\n", | ||
26 | @@ -604,6 +605,13 @@ void __init prepare_namespace(void) | ||
27 | devtmpfs_mount("dev"); | ||
28 | sys_mount(".", "/", NULL, MS_MOVE, NULL); | ||
29 | sys_chroot("."); | ||
30 | +#ifdef CONFIG_BLOCK | ||
31 | + /* recreate the /dev/root */ | ||
32 | + err = create_dev("/dev/root", ROOT_DEV); | ||
33 | + | ||
34 | + if (err < 0) | ||
35 | + pr_emerg("Failed to create /dev/root: %d\n", err); | ||
36 | +#endif | ||
37 | } | ||
38 | |||
39 | static bool is_tmpfs; | ||
40 | -- | ||
41 | 2.11.1 | ||
42 | |||
diff --git a/patches/boot_time_opt/0114-xattr-allow-setting-user.-attributes-on-symlinks-by-.patch b/patches/boot_time_opt/0114-xattr-allow-setting-user.-attributes-on-symlinks-by-.patch new file mode 100644 index 0000000..dee9058 --- /dev/null +++ b/patches/boot_time_opt/0114-xattr-allow-setting-user.-attributes-on-symlinks-by-.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 02fd2e6a7c708bf973209f9b238c5c61cbf15239 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alan Cox <alan@linux.intel.com> | ||
3 | Date: Thu, 10 Mar 2016 15:11:28 +0000 | ||
4 | Subject: [PATCH 114/114] xattr: allow setting user.* attributes on symlinks by | ||
5 | owner | ||
6 | |||
7 | Kvmtool and clear containers supports using user attributes to label host | ||
8 | files with the virtual uid/guid of the file in the container. This allows an | ||
9 | end user to manage their files and a complete uid space without all the ugly | ||
10 | namespace stuff. | ||
11 | |||
12 | The one gap in the support is symlinks because an end user can change the | ||
13 | ownership of a symbolic link. We support attributes on these files as you | ||
14 | can already (as root) set security attributes on them. | ||
15 | |||
16 | The current rules seem slightly over-paranoid and as we have a use case this | ||
17 | patch enables updating the attributes on a symbolic link IFF you are the | ||
18 | owner of the synlink (as permissions are not usually meaningful on the link | ||
19 | itself). | ||
20 | |||
21 | Signed-off-by: Alan Cox <alan@linux.intel.com> | ||
22 | --- | ||
23 | fs/xattr.c | 14 ++++++++------ | ||
24 | 1 file changed, 8 insertions(+), 6 deletions(-) | ||
25 | |||
26 | diff --git a/fs/xattr.c b/fs/xattr.c | ||
27 | index 7e3317cf4045..e005c30acb2c 100644 | ||
28 | --- a/fs/xattr.c | ||
29 | +++ b/fs/xattr.c | ||
30 | @@ -118,15 +118,17 @@ xattr_permission(struct inode *inode, const char *name, int mask) | ||
31 | } | ||
32 | |||
33 | /* | ||
34 | - * In the user.* namespace, only regular files and directories can have | ||
35 | - * extended attributes. For sticky directories, only the owner and | ||
36 | - * privileged users can write attributes. | ||
37 | + * In the user.* namespace, only regular files, symbolic links, and | ||
38 | + * directories can have extended attributes. For symbolic links and | ||
39 | + * sticky directories, only the owner and privileged users can write | ||
40 | + * attributes. | ||
41 | */ | ||
42 | if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { | ||
43 | - if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode)) | ||
44 | + if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode) && !S_ISLNK(inode->i_mode)) | ||
45 | return (mask & MAY_WRITE) ? -EPERM : -ENODATA; | ||
46 | - if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) && | ||
47 | - (mask & MAY_WRITE) && !inode_owner_or_capable(inode)) | ||
48 | + if (((S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX)) | ||
49 | + || S_ISLNK(inode->i_mode)) && (mask & MAY_WRITE) | ||
50 | + && !inode_owner_or_capable(inode)) | ||
51 | return -EPERM; | ||
52 | } | ||
53 | |||
54 | -- | ||
55 | 2.11.1 | ||
56 | |||
diff --git a/patches/boot_time_opt/0152-x86-kvm-Notify-host-to-release-pages.patch b/patches/boot_time_opt/0152-x86-kvm-Notify-host-to-release-pages.patch index 5f44930..ff9d8c0 100644 --- a/patches/boot_time_opt/0152-x86-kvm-Notify-host-to-release-pages.patch +++ b/patches/boot_time_opt/0152-x86-kvm-Notify-host-to-release-pages.patch | |||
@@ -132,18 +132,18 @@ index c1095cdc0fe2..d8ae774fa042 100644 | |||
132 | { | 132 | { |
133 | .procname = "compact_memory", | 133 | .procname = "compact_memory", |
134 | diff --git a/mm/Makefile b/mm/Makefile | 134 | diff --git a/mm/Makefile b/mm/Makefile |
135 | index 295bd7a..6455723 100644 | 135 | index 295bd7a9f76b..651ce0aff140 100644 |
136 | --- a/mm/Makefile | 136 | --- a/mm/Makefile |
137 | +++ b/mm/Makefile | 137 | +++ b/mm/Makefile |
138 | @@ -47,6 +47,8 @@ else | 138 | @@ -37,7 +37,7 @@ obj-y := filemap.o mempool.o oom_kill.o \ |
139 | obj-y += bootmem.o | 139 | mm_init.o mmu_context.o percpu.o slab_common.o \ |
140 | endif | 140 | compaction.o vmacache.o \ |
141 | interval_tree.o list_lru.o workingset.o \ | ||
142 | - prfile.o debug.o $(mmu-y) | ||
143 | + prfile.o debug.o kvm.o $(mmu-y) | ||
144 | |||
145 | obj-y += init-mm.o | ||
141 | 146 | ||
142 | +obj-y += kvm.o | ||
143 | + | ||
144 | obj-$(CONFIG_ADVISE_SYSCALLS) += fadvise.o | ||
145 | ifdef CONFIG_MMU | ||
146 | obj-$(CONFIG_ADVISE_SYSCALLS) += madvise.o | ||
147 | diff --git a/mm/kvm.c b/mm/kvm.c | 147 | diff --git a/mm/kvm.c b/mm/kvm.c |
148 | new file mode 100644 | 148 | new file mode 100644 |
149 | index 000000000000..8945f6a311b9 | 149 | index 000000000000..8945f6a311b9 |
diff --git a/patches/boot_time_opt/guest_boot_time_opt.scc b/patches/boot_time_opt/guest_boot_time_opt.scc new file mode 100644 index 0000000..3636c01 --- /dev/null +++ b/patches/boot_time_opt/guest_boot_time_opt.scc | |||
@@ -0,0 +1,19 @@ | |||
1 | define KFEATURE_DESCRIPTION "Boot time optimization changes ported from ClearLinux , https://github.com/clearlinux-pkgs/linux-kvm" | ||
2 | define KFEATURE_COMPATIBILITY all | ||
3 | |||
4 | patch 0103-sysrq-skip-synchronize_rcu-if-there-is-no-old-op.patch | ||
5 | patch 0104-fbcon-enable-no-blink-by-default.patch | ||
6 | patch 0105-vmstats-wakeups.patch | ||
7 | # Remove patch because it causes ixgvbevf to not initialize correctly in the guest | ||
8 | #patch 0106-pci-probe.patch | ||
9 | patch 0107-cgroup.patch | ||
10 | patch 0108-smpboot-reuse-timer-calibration.patch | ||
11 | patch 0109-perf.patch | ||
12 | patch 0110-pci-probe-identify-known-devices.patch | ||
13 | patch 0111-init-no-wait-for-the-known-devices.patch | ||
14 | patch 0112-ksm-wakeups.patch | ||
15 | |||
16 | patch 0151-mm-Export-do_madvise.patch | ||
17 | patch 0152-x86-kvm-Notify-host-to-release-pages.patch | ||
18 | patch 0153-x86-Return-memory-from-guest-to-host-kernel.patch | ||
19 | patch 0154-sysctl-vm-Fine-grained-cache-shrinking.patch | ||
diff --git a/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch b/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch new file mode 100644 index 0000000..ce5fb21 --- /dev/null +++ b/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch | |||
@@ -0,0 +1,95 @@ | |||
1 | From b91730ba705d151577974d5fb9f5371a4569b467 Mon Sep 17 00:00:00 2001 | ||
2 | From: Adrian Calianu <adrian.calianu@enea.com> | ||
3 | Date: Tue, 6 Jun 2017 15:47:54 +0200 | ||
4 | Subject: [PATCH 1/1] printk: add Enea Linux boot start/end messages | ||
5 | |||
6 | Signed-off-by: Adrian Calianu <adrian.calianu@enea.com> | ||
7 | --- | ||
8 | arch/x86/boot/compressed/misc.c | 23 ++++++++++++----------- | ||
9 | init/main.c | 4 +++- | ||
10 | 2 files changed, 15 insertions(+), 12 deletions(-) | ||
11 | |||
12 | diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c | ||
13 | index b3c5a5f0..9fdf3c6 100644 | ||
14 | --- a/arch/x86/boot/compressed/misc.c | ||
15 | +++ b/arch/x86/boot/compressed/misc.c | ||
16 | @@ -202,10 +202,10 @@ static void handle_relocations(void *output, unsigned long output_len, | ||
17 | delta = virt_addr - LOAD_PHYSICAL_ADDR; | ||
18 | |||
19 | if (!delta) { | ||
20 | - debug_putstr("No relocation needed... "); | ||
21 | + /* debug_putstr("No relocation needed... "); */ | ||
22 | return; | ||
23 | } | ||
24 | - debug_putstr("Performing relocations... "); | ||
25 | + /* debug_putstr("Performing relocations... "); */ | ||
26 | |||
27 | /* | ||
28 | * Process relocations: 32 bit relocations first then 64 bit after. | ||
29 | @@ -286,7 +286,7 @@ static void parse_elf(void *output) | ||
30 | return; | ||
31 | } | ||
32 | |||
33 | - debug_putstr("Parsing ELF... "); | ||
34 | + /* debug_putstr("Parsing ELF... ");*/ | ||
35 | |||
36 | phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); | ||
37 | if (!phdrs) | ||
38 | @@ -360,17 +360,18 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, | ||
39 | cols = boot_params->screen_info.orig_video_cols; | ||
40 | |||
41 | console_init(); | ||
42 | - debug_putstr("early console in extract_kernel\n"); | ||
43 | + /* debug_putstr("early console in extract_kernel\n");*/ | ||
44 | + debug_putstr("\n");debug_putstr("\nEnea Linux guest kernel boot start\n"); | ||
45 | |||
46 | free_mem_ptr = heap; /* Heap */ | ||
47 | free_mem_end_ptr = heap + BOOT_HEAP_SIZE; | ||
48 | |||
49 | /* Report initial kernel position details. */ | ||
50 | - debug_putaddr(input_data); | ||
51 | - debug_putaddr(input_len); | ||
52 | - debug_putaddr(output); | ||
53 | - debug_putaddr(output_len); | ||
54 | - debug_putaddr(kernel_total_size); | ||
55 | + /*debug_putaddr(input_data); */ | ||
56 | + /*debug_putaddr(input_len); */ | ||
57 | + /*debug_putaddr(output); */ | ||
58 | + /*debug_putaddr(output_len); */ | ||
59 | + /*debug_putaddr(kernel_total_size);*/ | ||
60 | |||
61 | /* | ||
62 | * The memory hole needed for the kernel is the larger of either | ||
63 | @@ -401,11 +402,11 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, | ||
64 | error("Destination virtual address changed when not relocatable"); | ||
65 | #endif | ||
66 | |||
67 | - debug_putstr("\nDecompressing Linux... "); | ||
68 | + /*debug_putstr("\nDecompressing Linux... ");*/ | ||
69 | __decompress(input_data, input_len, NULL, NULL, output, output_len, | ||
70 | NULL, error); | ||
71 | parse_elf(output); | ||
72 | handle_relocations(output, output_len, virt_addr); | ||
73 | - debug_putstr("done.\nBooting the kernel.\n"); | ||
74 | + /*debug_putstr("done.\nBooting the kernel.\n");*/ | ||
75 | return output; | ||
76 | } | ||
77 | diff --git a/init/main.c b/init/main.c | ||
78 | index 8358cbe..613caa1 100644 | ||
79 | --- a/init/main.c | ||
80 | +++ b/init/main.c | ||
81 | @@ -976,8 +976,10 @@ static int __ref kernel_init(void *unused) | ||
82 | if (!try_to_run_init_process("/sbin/init") || | ||
83 | !try_to_run_init_process("/etc/init") || | ||
84 | !try_to_run_init_process("/bin/init") || | ||
85 | - !try_to_run_init_process("/bin/sh")) | ||
86 | + !try_to_run_init_process("/bin/sh")) { | ||
87 | + printk(KERN_EMERG "Enea Linux guest kernel boot end\n"); | ||
88 | return 0; | ||
89 | + } | ||
90 | |||
91 | panic("No working init found. Try passing init= option to kernel. " | ||
92 | "See Linux Documentation/init.txt for guidance."); | ||
93 | -- | ||
94 | 2.7.4 | ||
95 | |||
diff --git a/patches/kernel_startend_msg/kernel_startend_msg.scc b/patches/kernel_startend_msg/kernel_startend_msg.scc index e6da49c..ae49e89 100644 --- a/patches/kernel_startend_msg/kernel_startend_msg.scc +++ b/patches/kernel_startend_msg/kernel_startend_msg.scc | |||
@@ -1,4 +1,4 @@ | |||
1 | define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting" | 1 | define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting" |
2 | define KFEATURE_COMPATIBILITY all | 2 | define KFEATURE_COMPATIBILITY all |
3 | 3 | ||
4 | patch 0001-printk-add-Enea-Linux-boot-start-end-messages.patch | 4 | patch 0001-printk-add-Enea-Linux-guest-boot-start-end-messages.patch |