diff options
Diffstat (limited to 'arch/x86/kernel/mpparse.c')
| -rw-r--r-- | arch/x86/kernel/mpparse.c | 212 |
1 files changed, 113 insertions, 99 deletions
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index a649a4ccad43..e8192401da47 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * compliant MP-table parsing routines. | 3 | * compliant MP-table parsing routines. |
| 4 | * | 4 | * |
| 5 | * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk> | 5 | * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk> |
| 6 | * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com> | 6 | * (c) 1998, 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com> |
| 7 | * (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de> | 7 | * (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de> |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| @@ -29,12 +29,7 @@ | |||
| 29 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
| 30 | #include <asm/smp.h> | 30 | #include <asm/smp.h> |
| 31 | 31 | ||
| 32 | #include <mach_apic.h> | 32 | #include <asm/apic.h> |
| 33 | #ifdef CONFIG_X86_32 | ||
| 34 | #include <mach_apicdef.h> | ||
| 35 | #include <mach_mpparse.h> | ||
| 36 | #endif | ||
| 37 | |||
| 38 | /* | 33 | /* |
| 39 | * Checksum an MP configuration block. | 34 | * Checksum an MP configuration block. |
| 40 | */ | 35 | */ |
| @@ -144,11 +139,11 @@ static void __init MP_ioapic_info(struct mpc_ioapic *m) | |||
| 144 | if (bad_ioapic(m->apicaddr)) | 139 | if (bad_ioapic(m->apicaddr)) |
| 145 | return; | 140 | return; |
| 146 | 141 | ||
| 147 | mp_ioapics[nr_ioapics].mp_apicaddr = m->apicaddr; | 142 | mp_ioapics[nr_ioapics].apicaddr = m->apicaddr; |
| 148 | mp_ioapics[nr_ioapics].mp_apicid = m->apicid; | 143 | mp_ioapics[nr_ioapics].apicid = m->apicid; |
| 149 | mp_ioapics[nr_ioapics].mp_type = m->type; | 144 | mp_ioapics[nr_ioapics].type = m->type; |
| 150 | mp_ioapics[nr_ioapics].mp_apicver = m->apicver; | 145 | mp_ioapics[nr_ioapics].apicver = m->apicver; |
| 151 | mp_ioapics[nr_ioapics].mp_flags = m->flags; | 146 | mp_ioapics[nr_ioapics].flags = m->flags; |
| 152 | nr_ioapics++; | 147 | nr_ioapics++; |
| 153 | } | 148 | } |
| 154 | 149 | ||
| @@ -160,55 +155,55 @@ static void print_MP_intsrc_info(struct mpc_intsrc *m) | |||
| 160 | m->srcbusirq, m->dstapic, m->dstirq); | 155 | m->srcbusirq, m->dstapic, m->dstirq); |
| 161 | } | 156 | } |
| 162 | 157 | ||
| 163 | static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq) | 158 | static void __init print_mp_irq_info(struct mpc_intsrc *mp_irq) |
| 164 | { | 159 | { |
| 165 | apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x," | 160 | apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x," |
| 166 | " IRQ %02x, APIC ID %x, APIC INT %02x\n", | 161 | " IRQ %02x, APIC ID %x, APIC INT %02x\n", |
| 167 | mp_irq->mp_irqtype, mp_irq->mp_irqflag & 3, | 162 | mp_irq->irqtype, mp_irq->irqflag & 3, |
| 168 | (mp_irq->mp_irqflag >> 2) & 3, mp_irq->mp_srcbus, | 163 | (mp_irq->irqflag >> 2) & 3, mp_irq->srcbus, |
| 169 | mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq); | 164 | mp_irq->srcbusirq, mp_irq->dstapic, mp_irq->dstirq); |
| 170 | } | 165 | } |
| 171 | 166 | ||
| 172 | static void __init assign_to_mp_irq(struct mpc_intsrc *m, | 167 | static void __init assign_to_mp_irq(struct mpc_intsrc *m, |
| 173 | struct mp_config_intsrc *mp_irq) | 168 | struct mpc_intsrc *mp_irq) |
| 174 | { | 169 | { |
| 175 | mp_irq->mp_dstapic = m->dstapic; | 170 | mp_irq->dstapic = m->dstapic; |
| 176 | mp_irq->mp_type = m->type; | 171 | mp_irq->type = m->type; |
| 177 | mp_irq->mp_irqtype = m->irqtype; | 172 | mp_irq->irqtype = m->irqtype; |
| 178 | mp_irq->mp_irqflag = m->irqflag; | 173 | mp_irq->irqflag = m->irqflag; |
| 179 | mp_irq->mp_srcbus = m->srcbus; | 174 | mp_irq->srcbus = m->srcbus; |
| 180 | mp_irq->mp_srcbusirq = m->srcbusirq; | 175 | mp_irq->srcbusirq = m->srcbusirq; |
| 181 | mp_irq->mp_dstirq = m->dstirq; | 176 | mp_irq->dstirq = m->dstirq; |
| 182 | } | 177 | } |
| 183 | 178 | ||
| 184 | static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq, | 179 | static void __init assign_to_mpc_intsrc(struct mpc_intsrc *mp_irq, |
| 185 | struct mpc_intsrc *m) | 180 | struct mpc_intsrc *m) |
| 186 | { | 181 | { |
| 187 | m->dstapic = mp_irq->mp_dstapic; | 182 | m->dstapic = mp_irq->dstapic; |
| 188 | m->type = mp_irq->mp_type; | 183 | m->type = mp_irq->type; |
| 189 | m->irqtype = mp_irq->mp_irqtype; | 184 | m->irqtype = mp_irq->irqtype; |
| 190 | m->irqflag = mp_irq->mp_irqflag; | 185 | m->irqflag = mp_irq->irqflag; |
| 191 | m->srcbus = mp_irq->mp_srcbus; | 186 | m->srcbus = mp_irq->srcbus; |
| 192 | m->srcbusirq = mp_irq->mp_srcbusirq; | 187 | m->srcbusirq = mp_irq->srcbusirq; |
| 193 | m->dstirq = mp_irq->mp_dstirq; | 188 | m->dstirq = mp_irq->dstirq; |
| 194 | } | 189 | } |
| 195 | 190 | ||
| 196 | static int __init mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq, | 191 | static int __init mp_irq_mpc_intsrc_cmp(struct mpc_intsrc *mp_irq, |
| 197 | struct mpc_intsrc *m) | 192 | struct mpc_intsrc *m) |
| 198 | { | 193 | { |
| 199 | if (mp_irq->mp_dstapic != m->dstapic) | 194 | if (mp_irq->dstapic != m->dstapic) |
| 200 | return 1; | 195 | return 1; |
| 201 | if (mp_irq->mp_type != m->type) | 196 | if (mp_irq->type != m->type) |
| 202 | return 2; | 197 | return 2; |
| 203 | if (mp_irq->mp_irqtype != m->irqtype) | 198 | if (mp_irq->irqtype != m->irqtype) |
| 204 | return 3; | 199 | return 3; |
| 205 | if (mp_irq->mp_irqflag != m->irqflag) | 200 | if (mp_irq->irqflag != m->irqflag) |
| 206 | return 4; | 201 | return 4; |
| 207 | if (mp_irq->mp_srcbus != m->srcbus) | 202 | if (mp_irq->srcbus != m->srcbus) |
| 208 | return 5; | 203 | return 5; |
| 209 | if (mp_irq->mp_srcbusirq != m->srcbusirq) | 204 | if (mp_irq->srcbusirq != m->srcbusirq) |
| 210 | return 6; | 205 | return 6; |
| 211 | if (mp_irq->mp_dstirq != m->dstirq) | 206 | if (mp_irq->dstirq != m->dstirq) |
| 212 | return 7; | 207 | return 7; |
| 213 | 208 | ||
| 214 | return 0; | 209 | return 0; |
| @@ -292,16 +287,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) | |||
| 292 | return 0; | 287 | return 0; |
| 293 | 288 | ||
| 294 | #ifdef CONFIG_X86_32 | 289 | #ifdef CONFIG_X86_32 |
| 295 | /* | 290 | generic_mps_oem_check(mpc, oem, str); |
| 296 | * need to make sure summit and es7000's mps_oem_check is safe to be | ||
| 297 | * called early via genericarch 's mps_oem_check | ||
| 298 | */ | ||
| 299 | if (early) { | ||
| 300 | #ifdef CONFIG_X86_NUMAQ | ||
| 301 | numaq_mps_oem_check(mpc, oem, str); | ||
| 302 | #endif | ||
| 303 | } else | ||
| 304 | mps_oem_check(mpc, oem, str); | ||
| 305 | #endif | 291 | #endif |
| 306 | /* save the local APIC address, it might be non-default */ | 292 | /* save the local APIC address, it might be non-default */ |
| 307 | if (!acpi_lapic) | 293 | if (!acpi_lapic) |
| @@ -386,13 +372,13 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) | |||
| 386 | (*x86_quirks->mpc_record)++; | 372 | (*x86_quirks->mpc_record)++; |
| 387 | } | 373 | } |
| 388 | 374 | ||
| 389 | #ifdef CONFIG_X86_GENERICARCH | 375 | #ifdef CONFIG_X86_BIGSMP |
| 390 | generic_bigsmp_probe(); | 376 | generic_bigsmp_probe(); |
| 391 | #endif | 377 | #endif |
| 392 | 378 | ||
| 393 | #ifdef CONFIG_X86_32 | 379 | if (apic->setup_apic_routing) |
| 394 | setup_apic_routing(); | 380 | apic->setup_apic_routing(); |
| 395 | #endif | 381 | |
| 396 | if (!num_processors) | 382 | if (!num_processors) |
| 397 | printk(KERN_ERR "MPTABLE: no processors registered!\n"); | 383 | printk(KERN_ERR "MPTABLE: no processors registered!\n"); |
| 398 | return num_processors; | 384 | return num_processors; |
| @@ -417,7 +403,7 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type) | |||
| 417 | intsrc.type = MP_INTSRC; | 403 | intsrc.type = MP_INTSRC; |
| 418 | intsrc.irqflag = 0; /* conforming */ | 404 | intsrc.irqflag = 0; /* conforming */ |
| 419 | intsrc.srcbus = 0; | 405 | intsrc.srcbus = 0; |
| 420 | intsrc.dstapic = mp_ioapics[0].mp_apicid; | 406 | intsrc.dstapic = mp_ioapics[0].apicid; |
| 421 | 407 | ||
| 422 | intsrc.irqtype = mp_INT; | 408 | intsrc.irqtype = mp_INT; |
| 423 | 409 | ||
| @@ -570,14 +556,27 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) | |||
| 570 | } | 556 | } |
| 571 | } | 557 | } |
| 572 | 558 | ||
| 573 | static struct intel_mp_floating *mpf_found; | 559 | static struct mpf_intel *mpf_found; |
| 560 | |||
| 561 | static unsigned long __init get_mpc_size(unsigned long physptr) | ||
| 562 | { | ||
| 563 | struct mpc_table *mpc; | ||
| 564 | unsigned long size; | ||
| 565 | |||
| 566 | mpc = early_ioremap(physptr, PAGE_SIZE); | ||
| 567 | size = mpc->length; | ||
| 568 | early_iounmap(mpc, PAGE_SIZE); | ||
| 569 | apic_printk(APIC_VERBOSE, " mpc: %lx-%lx\n", physptr, physptr + size); | ||
| 570 | |||
| 571 | return size; | ||
| 572 | } | ||
| 574 | 573 | ||
| 575 | /* | 574 | /* |
| 576 | * Scan the memory blocks for an SMP configuration block. | 575 | * Scan the memory blocks for an SMP configuration block. |
| 577 | */ | 576 | */ |
| 578 | static void __init __get_smp_config(unsigned int early) | 577 | static void __init __get_smp_config(unsigned int early) |
| 579 | { | 578 | { |
| 580 | struct intel_mp_floating *mpf = mpf_found; | 579 | struct mpf_intel *mpf = mpf_found; |
| 581 | 580 | ||
| 582 | if (!mpf) | 581 | if (!mpf) |
| 583 | return; | 582 | return; |
| @@ -598,9 +597,9 @@ static void __init __get_smp_config(unsigned int early) | |||
| 598 | } | 597 | } |
| 599 | 598 | ||
| 600 | printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", | 599 | printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", |
| 601 | mpf->mpf_specification); | 600 | mpf->specification); |
| 602 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) | 601 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) |
| 603 | if (mpf->mpf_feature2 & (1 << 7)) { | 602 | if (mpf->feature2 & (1 << 7)) { |
| 604 | printk(KERN_INFO " IMCR and PIC compatibility mode.\n"); | 603 | printk(KERN_INFO " IMCR and PIC compatibility mode.\n"); |
| 605 | pic_mode = 1; | 604 | pic_mode = 1; |
| 606 | } else { | 605 | } else { |
| @@ -611,7 +610,7 @@ static void __init __get_smp_config(unsigned int early) | |||
| 611 | /* | 610 | /* |
| 612 | * Now see if we need to read further. | 611 | * Now see if we need to read further. |
| 613 | */ | 612 | */ |
| 614 | if (mpf->mpf_feature1 != 0) { | 613 | if (mpf->feature1 != 0) { |
| 615 | if (early) { | 614 | if (early) { |
| 616 | /* | 615 | /* |
| 617 | * local APIC has default address | 616 | * local APIC has default address |
| @@ -621,16 +620,20 @@ static void __init __get_smp_config(unsigned int early) | |||
| 621 | } | 620 | } |
| 622 | 621 | ||
| 623 | printk(KERN_INFO "Default MP configuration #%d\n", | 622 | printk(KERN_INFO "Default MP configuration #%d\n", |
| 624 | mpf->mpf_feature1); | 623 | mpf->feature1); |
| 625 | construct_default_ISA_mptable(mpf->mpf_feature1); | 624 | construct_default_ISA_mptable(mpf->feature1); |
| 626 | 625 | ||
| 627 | } else if (mpf->mpf_physptr) { | 626 | } else if (mpf->physptr) { |
| 627 | struct mpc_table *mpc; | ||
| 628 | unsigned long size; | ||
| 628 | 629 | ||
| 630 | size = get_mpc_size(mpf->physptr); | ||
| 631 | mpc = early_ioremap(mpf->physptr, size); | ||
| 629 | /* | 632 | /* |
| 630 | * Read the physical hardware table. Anything here will | 633 | * Read the physical hardware table. Anything here will |
| 631 | * override the defaults. | 634 | * override the defaults. |
| 632 | */ | 635 | */ |
| 633 | if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr), early)) { | 636 | if (!smp_read_mpc(mpc, early)) { |
| 634 | #ifdef CONFIG_X86_LOCAL_APIC | 637 | #ifdef CONFIG_X86_LOCAL_APIC |
| 635 | smp_found_config = 0; | 638 | smp_found_config = 0; |
| 636 | #endif | 639 | #endif |
| @@ -638,8 +641,10 @@ static void __init __get_smp_config(unsigned int early) | |||
| 638 | "BIOS bug, MP table errors detected!...\n"); | 641 | "BIOS bug, MP table errors detected!...\n"); |
| 639 | printk(KERN_ERR "... disabling SMP support. " | 642 | printk(KERN_ERR "... disabling SMP support. " |
| 640 | "(tell your hw vendor)\n"); | 643 | "(tell your hw vendor)\n"); |
| 644 | early_iounmap(mpc, size); | ||
| 641 | return; | 645 | return; |
| 642 | } | 646 | } |
| 647 | early_iounmap(mpc, size); | ||
| 643 | 648 | ||
| 644 | if (early) | 649 | if (early) |
| 645 | return; | 650 | return; |
| @@ -688,33 +693,33 @@ static int __init smp_scan_config(unsigned long base, unsigned long length, | |||
| 688 | unsigned reserve) | 693 | unsigned reserve) |
| 689 | { | 694 | { |
| 690 | unsigned int *bp = phys_to_virt(base); | 695 | unsigned int *bp = phys_to_virt(base); |
| 691 | struct intel_mp_floating *mpf; | 696 | struct mpf_intel *mpf; |
| 692 | 697 | ||
| 693 | apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n", | 698 | apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n", |
| 694 | bp, length); | 699 | bp, length); |
| 695 | BUILD_BUG_ON(sizeof(*mpf) != 16); | 700 | BUILD_BUG_ON(sizeof(*mpf) != 16); |
| 696 | 701 | ||
| 697 | while (length > 0) { | 702 | while (length > 0) { |
| 698 | mpf = (struct intel_mp_floating *)bp; | 703 | mpf = (struct mpf_intel *)bp; |
| 699 | if ((*bp == SMP_MAGIC_IDENT) && | 704 | if ((*bp == SMP_MAGIC_IDENT) && |
| 700 | (mpf->mpf_length == 1) && | 705 | (mpf->length == 1) && |
| 701 | !mpf_checksum((unsigned char *)bp, 16) && | 706 | !mpf_checksum((unsigned char *)bp, 16) && |
| 702 | ((mpf->mpf_specification == 1) | 707 | ((mpf->specification == 1) |
| 703 | || (mpf->mpf_specification == 4))) { | 708 | || (mpf->specification == 4))) { |
| 704 | #ifdef CONFIG_X86_LOCAL_APIC | 709 | #ifdef CONFIG_X86_LOCAL_APIC |
| 705 | smp_found_config = 1; | 710 | smp_found_config = 1; |
| 706 | #endif | 711 | #endif |
| 707 | mpf_found = mpf; | 712 | mpf_found = mpf; |
| 708 | 713 | ||
| 709 | printk(KERN_INFO "found SMP MP-table at [%p] %08lx\n", | 714 | printk(KERN_INFO "found SMP MP-table at [%p] %llx\n", |
| 710 | mpf, virt_to_phys(mpf)); | 715 | mpf, (u64)virt_to_phys(mpf)); |
| 711 | 716 | ||
| 712 | if (!reserve) | 717 | if (!reserve) |
| 713 | return 1; | 718 | return 1; |
| 714 | reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE, | 719 | reserve_bootmem_generic(virt_to_phys(mpf), sizeof(*mpf), |
| 715 | BOOTMEM_DEFAULT); | 720 | BOOTMEM_DEFAULT); |
| 716 | if (mpf->mpf_physptr) { | 721 | if (mpf->physptr) { |
| 717 | unsigned long size = PAGE_SIZE; | 722 | unsigned long size = get_mpc_size(mpf->physptr); |
| 718 | #ifdef CONFIG_X86_32 | 723 | #ifdef CONFIG_X86_32 |
| 719 | /* | 724 | /* |
| 720 | * We cannot access to MPC table to compute | 725 | * We cannot access to MPC table to compute |
| @@ -722,15 +727,24 @@ static int __init smp_scan_config(unsigned long base, unsigned long length, | |||
| 722 | * the bottom is mapped now. | 727 | * the bottom is mapped now. |
| 723 | * PC-9800's MPC table places on the very last | 728 | * PC-9800's MPC table places on the very last |
| 724 | * of physical memory; so that simply reserving | 729 | * of physical memory; so that simply reserving |
| 725 | * PAGE_SIZE from mpg->mpf_physptr yields BUG() | 730 | * PAGE_SIZE from mpf->physptr yields BUG() |
| 726 | * in reserve_bootmem. | 731 | * in reserve_bootmem. |
| 732 | * also need to make sure physptr is below than | ||
| 733 | * max_low_pfn | ||
| 734 | * we don't need reserve the area above max_low_pfn | ||
| 727 | */ | 735 | */ |
| 728 | unsigned long end = max_low_pfn * PAGE_SIZE; | 736 | unsigned long end = max_low_pfn * PAGE_SIZE; |
| 729 | if (mpf->mpf_physptr + size > end) | 737 | |
| 730 | size = end - mpf->mpf_physptr; | 738 | if (mpf->physptr < end) { |
| 731 | #endif | 739 | if (mpf->physptr + size > end) |
| 732 | reserve_bootmem_generic(mpf->mpf_physptr, size, | 740 | size = end - mpf->physptr; |
| 741 | reserve_bootmem_generic(mpf->physptr, size, | ||
| 742 | BOOTMEM_DEFAULT); | ||
| 743 | } | ||
| 744 | #else | ||
| 745 | reserve_bootmem_generic(mpf->physptr, size, | ||
| 733 | BOOTMEM_DEFAULT); | 746 | BOOTMEM_DEFAULT); |
| 747 | #endif | ||
| 734 | } | 748 | } |
| 735 | 749 | ||
| 736 | return 1; | 750 | return 1; |
| @@ -809,15 +823,15 @@ static int __init get_MP_intsrc_index(struct mpc_intsrc *m) | |||
| 809 | /* not legacy */ | 823 | /* not legacy */ |
| 810 | 824 | ||
| 811 | for (i = 0; i < mp_irq_entries; i++) { | 825 | for (i = 0; i < mp_irq_entries; i++) { |
| 812 | if (mp_irqs[i].mp_irqtype != mp_INT) | 826 | if (mp_irqs[i].irqtype != mp_INT) |
| 813 | continue; | 827 | continue; |
| 814 | 828 | ||
| 815 | if (mp_irqs[i].mp_irqflag != 0x0f) | 829 | if (mp_irqs[i].irqflag != 0x0f) |
| 816 | continue; | 830 | continue; |
| 817 | 831 | ||
| 818 | if (mp_irqs[i].mp_srcbus != m->srcbus) | 832 | if (mp_irqs[i].srcbus != m->srcbus) |
| 819 | continue; | 833 | continue; |
| 820 | if (mp_irqs[i].mp_srcbusirq != m->srcbusirq) | 834 | if (mp_irqs[i].srcbusirq != m->srcbusirq) |
| 821 | continue; | 835 | continue; |
| 822 | if (irq_used[i]) { | 836 | if (irq_used[i]) { |
| 823 | /* already claimed */ | 837 | /* already claimed */ |
| @@ -922,10 +936,10 @@ static int __init replace_intsrc_all(struct mpc_table *mpc, | |||
| 922 | if (irq_used[i]) | 936 | if (irq_used[i]) |
| 923 | continue; | 937 | continue; |
| 924 | 938 | ||
| 925 | if (mp_irqs[i].mp_irqtype != mp_INT) | 939 | if (mp_irqs[i].irqtype != mp_INT) |
| 926 | continue; | 940 | continue; |
| 927 | 941 | ||
| 928 | if (mp_irqs[i].mp_irqflag != 0x0f) | 942 | if (mp_irqs[i].irqflag != 0x0f) |
| 929 | continue; | 943 | continue; |
| 930 | 944 | ||
| 931 | if (nr_m_spare > 0) { | 945 | if (nr_m_spare > 0) { |
| @@ -1001,7 +1015,7 @@ static int __init update_mp_table(void) | |||
| 1001 | { | 1015 | { |
| 1002 | char str[16]; | 1016 | char str[16]; |
| 1003 | char oem[10]; | 1017 | char oem[10]; |
| 1004 | struct intel_mp_floating *mpf; | 1018 | struct mpf_intel *mpf; |
| 1005 | struct mpc_table *mpc, *mpc_new; | 1019 | struct mpc_table *mpc, *mpc_new; |
| 1006 | 1020 | ||
| 1007 | if (!enable_update_mptable) | 1021 | if (!enable_update_mptable) |
| @@ -1014,19 +1028,19 @@ static int __init update_mp_table(void) | |||
| 1014 | /* | 1028 | /* |
| 1015 | * Now see if we need to go further. | 1029 | * Now see if we need to go further. |
| 1016 | */ | 1030 | */ |
| 1017 | if (mpf->mpf_feature1 != 0) | 1031 | if (mpf->feature1 != 0) |
| 1018 | return 0; | 1032 | return 0; |
| 1019 | 1033 | ||
| 1020 | if (!mpf->mpf_physptr) | 1034 | if (!mpf->physptr) |
| 1021 | return 0; | 1035 | return 0; |
| 1022 | 1036 | ||
| 1023 | mpc = phys_to_virt(mpf->mpf_physptr); | 1037 | mpc = phys_to_virt(mpf->physptr); |
| 1024 | 1038 | ||
| 1025 | if (!smp_check_mpc(mpc, oem, str)) | 1039 | if (!smp_check_mpc(mpc, oem, str)) |
| 1026 | return 0; | 1040 | return 0; |
| 1027 | 1041 | ||
| 1028 | printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf)); | 1042 | printk(KERN_INFO "mpf: %llx\n", (u64)virt_to_phys(mpf)); |
| 1029 | printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr); | 1043 | printk(KERN_INFO "physptr: %x\n", mpf->physptr); |
| 1030 | 1044 | ||
| 1031 | if (mpc_new_phys && mpc->length > mpc_new_length) { | 1045 | if (mpc_new_phys && mpc->length > mpc_new_length) { |
| 1032 | mpc_new_phys = 0; | 1046 | mpc_new_phys = 0; |
| @@ -1047,23 +1061,23 @@ static int __init update_mp_table(void) | |||
| 1047 | } | 1061 | } |
| 1048 | printk(KERN_INFO "use in-positon replacing\n"); | 1062 | printk(KERN_INFO "use in-positon replacing\n"); |
| 1049 | } else { | 1063 | } else { |
| 1050 | mpf->mpf_physptr = mpc_new_phys; | 1064 | mpf->physptr = mpc_new_phys; |
| 1051 | mpc_new = phys_to_virt(mpc_new_phys); | 1065 | mpc_new = phys_to_virt(mpc_new_phys); |
| 1052 | memcpy(mpc_new, mpc, mpc->length); | 1066 | memcpy(mpc_new, mpc, mpc->length); |
| 1053 | mpc = mpc_new; | 1067 | mpc = mpc_new; |
| 1054 | /* check if we can modify that */ | 1068 | /* check if we can modify that */ |
| 1055 | if (mpc_new_phys - mpf->mpf_physptr) { | 1069 | if (mpc_new_phys - mpf->physptr) { |
| 1056 | struct intel_mp_floating *mpf_new; | 1070 | struct mpf_intel *mpf_new; |
| 1057 | /* steal 16 bytes from [0, 1k) */ | 1071 | /* steal 16 bytes from [0, 1k) */ |
| 1058 | printk(KERN_INFO "mpf new: %x\n", 0x400 - 16); | 1072 | printk(KERN_INFO "mpf new: %x\n", 0x400 - 16); |
| 1059 | mpf_new = phys_to_virt(0x400 - 16); | 1073 | mpf_new = phys_to_virt(0x400 - 16); |
| 1060 | memcpy(mpf_new, mpf, 16); | 1074 | memcpy(mpf_new, mpf, 16); |
| 1061 | mpf = mpf_new; | 1075 | mpf = mpf_new; |
| 1062 | mpf->mpf_physptr = mpc_new_phys; | 1076 | mpf->physptr = mpc_new_phys; |
| 1063 | } | 1077 | } |
| 1064 | mpf->mpf_checksum = 0; | 1078 | mpf->checksum = 0; |
| 1065 | mpf->mpf_checksum -= mpf_checksum((unsigned char *)mpf, 16); | 1079 | mpf->checksum -= mpf_checksum((unsigned char *)mpf, 16); |
| 1066 | printk(KERN_INFO "mpf_physptr new: %x\n", mpf->mpf_physptr); | 1080 | printk(KERN_INFO "physptr new: %x\n", mpf->physptr); |
| 1067 | } | 1081 | } |
| 1068 | 1082 | ||
| 1069 | /* | 1083 | /* |
