2.4.36-stable kernel tree
Revision | f3f1dfb50d308581859ee001eae7d27dfc2ba0cd (tree) |
---|---|
Zeit | 2006-12-05 17:27:21 |
Autor | Shaohua Li <shaohua.li@inte...> |
Commiter | Willy Tarreau |
[PATCH] x86 microcode: dont check the size
(backported from 2.6)
IA32 manual says if micorcode update's size is 0, then the size is
default size (2048 bytes). But this doesn't suggest all microcode
update's size should be above 2048 bytes to me. We actually had a
microcode update whose size is 1024 bytes. The patch just removed the
check.
Backported to 2.6.18 by Daniel Drake.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Shaohua Li <shaohua.li@intel.com>
@@ -237,14 +237,14 @@ static int find_matching_ucodes (void) | ||
237 | 237 | } |
238 | 238 | |
239 | 239 | total_size = get_totalsize(&mc_header); |
240 | - if ((cursor + total_size > user_buffer_size) || (total_size < DEFAULT_UCODE_TOTALSIZE)) { | |
240 | + if (cursor + total_size > user_buffer_size) { | |
241 | 241 | printk(KERN_ERR "microcode: error! Bad data in microcode data file\n"); |
242 | 242 | error = -EINVAL; |
243 | 243 | goto out; |
244 | 244 | } |
245 | 245 | |
246 | 246 | data_size = get_datasize(&mc_header); |
247 | - if ((data_size + MC_HEADER_SIZE > total_size) || (data_size < DEFAULT_UCODE_DATASIZE)) { | |
247 | + if (data_size + MC_HEADER_SIZE > total_size) { | |
248 | 248 | printk(KERN_ERR "microcode: error! Bad data in microcode data file\n"); |
249 | 249 | error = -EINVAL; |
250 | 250 | goto out; |
@@ -438,11 +438,6 @@ static ssize_t microcode_write (struct file *file, const char *buf, size_t len, | ||
438 | 438 | { |
439 | 439 | ssize_t ret; |
440 | 440 | |
441 | - if (len < DEFAULT_UCODE_TOTALSIZE) { | |
442 | - printk(KERN_ERR "microcode: not enough data\n"); | |
443 | - return -EINVAL; | |
444 | - } | |
445 | - | |
446 | 441 | if ((len >> PAGE_SHIFT) > num_physpages) { |
447 | 442 | printk(KERN_ERR "microcode: too much data (max %ld pages)\n", num_physpages); |
448 | 443 | return -EINVAL; |