Showing error 360

User: Jiri Slaby
Error type: BUG/WARNING
Error type description: An unsatisfied assertion in the code
File location: arch/x86/kernel/cpu/mtrr/generic.c
Line in file: 404
Project: Linux Kernel
Project version: 2.6.28
Tools: Web Crawler (0.1)
URL: https://bugzilla.kernel.org/show_bug.cgi?id=11490
Entered: 2011-09-08 08:47:58 UTC


Source:

374        }
375        return -ENOSPC;
376}
377
378static void generic_get_mtrr(unsigned int reg, unsigned long *base,
379                             unsigned long *size, mtrr_type *type)
380{
381        unsigned int mask_lo, mask_hi, base_lo, base_hi;
382        unsigned int tmp, hi;
383
384        rdmsr(MTRRphysMask_MSR(reg), mask_lo, mask_hi);
385        if ((mask_lo & 0x800) == 0) {
386                /*  Invalid (i.e. free) range  */
387                *base = 0;
388                *size = 0;
389                *type = 0;
390                return;
391        }
392
393        rdmsr(MTRRphysBase_MSR(reg), base_lo, base_hi);
394
395        /* Work out the shifted address mask. */
396        tmp = mask_hi << (32 - PAGE_SHIFT) | mask_lo >> PAGE_SHIFT;
397        mask_lo = size_or_mask | tmp;
398        /* Expand tmp with high bits to all 1s*/
399        hi = fls(tmp);
400        if (hi > 0) {
401                tmp |= ~((1<<(hi - 1)) - 1);
402
403                if (tmp != mask_lo) {
404                        WARN_ONCE(1, KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n");
405                        mask_lo = tmp;
406                }
407        }
408
409        /* This works correctly if size is a power of two, i.e. a
410           contiguous range. */
411        *size = -mask_lo;
412        *base = base_hi << (32 - PAGE_SHIFT) | base_lo >> PAGE_SHIFT;
413        *type = base_lo & 0xff;
414}
Show full sources