direct-io.hg

changeset 13396:e303a2f329ee

Microcode does not need to have the default size of 2000+48 bytes.
A corresponding patch has gone into Linux 2.6.19; this is the
port to Xen.

Signed-off-by: Kurt Garloff <kurt@garloff.de>

Reference: Patch to linux kernel from Sep 27 2006
> # User Shaohua Li <shaohua.li@intel.com>
> # Node ID 45898b908138b5d93c2cc7353f061ce54af145dc
> # Parent f962eab7b82c9bf1a6da69571046e764f5128395
> [PATCH] x86 microcode: don't check the size
>
> 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.
>
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> Cc: Tigran Aivazian <tigran@veritas.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
>
> committer: Linus Torvalds <torvalds@g5.osdl.org> 1159370778 -0700
author kfraser@localhost.localdomain
date Wed Jan 17 14:57:59 2007 +0000 (2007-01-17)
parents 13db896ef324
children 9fa13c7ebf8a
files xen/arch/x86/microcode.c
line diff
     1.1 --- a/xen/arch/x86/microcode.c	Wed Jan 17 14:54:59 2007 +0000
     1.2 +++ b/xen/arch/x86/microcode.c	Wed Jan 17 14:57:59 2007 +0000
     1.3 @@ -249,14 +249,14 @@ static int find_matching_ucodes (void)
     1.4  		}
     1.5  
     1.6  		total_size = get_totalsize(&mc_header);
     1.7 -		if ((cursor + total_size > user_buffer_size) || (total_size < DEFAULT_UCODE_TOTALSIZE)) {
     1.8 +		if (cursor + total_size > user_buffer_size) {
     1.9  			printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
    1.10  			error = -EINVAL;
    1.11  			goto out;
    1.12  		}
    1.13  
    1.14  		data_size = get_datasize(&mc_header);
    1.15 -		if ((data_size + MC_HEADER_SIZE > total_size) || (data_size < DEFAULT_UCODE_DATASIZE)) {
    1.16 +		if (data_size + MC_HEADER_SIZE > total_size) {
    1.17  			printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
    1.18  			error = -EINVAL;
    1.19  			goto out;
    1.20 @@ -459,11 +459,6 @@ int microcode_update(XEN_GUEST_HANDLE(vo
    1.21  {
    1.22  	int ret;
    1.23  
    1.24 -	if (len < DEFAULT_UCODE_TOTALSIZE) {
    1.25 -		printk(KERN_ERR "microcode: not enough data\n");
    1.26 -		return -EINVAL;
    1.27 -	}
    1.28 -
    1.29  	if (len != (typeof(user_buffer_size))len) {
    1.30  		printk(KERN_ERR "microcode: too much data\n");
    1.31  		return -E2BIG;