Skip to contentSkip to conversation

Linux 2.6.11 does not build SMP

DISCUSSION Kip Macy 3 participants 4 messages Mar 13, 2005 – Mar 14, 2005

lore
Share & tools
lore

Kip Macy

author
#0 lore raw

You aren't defining pmd_val_ma for CONFIG_SMP and LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
/* Linux 2.6 isn't using the traditional batched interface. */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define QUEUE_SIZE 2048
#define pte_offset_kernel pte_offset
#define pmd_val_ma(v) (v).pmd;
#define pud_t pgd_t
#define pud_offset(d, va) d
#else
#ifdef CONFIG_SMP
#define QUEUE_SIZE 1
#else
#define QUEUE_SIZE 128
#define pmd_val_ma(v) (v).pud.pgd.pgd;
#endif
#endif

unfortunately this doesn't stop you from using it:
void queue_l2_entry_update(pmd_t *ptr, pmd_t val)

{
    int cpu = smp_processor_id();
    int idx;
    unsigned long flags;
    spin_lock_irqsave(&update_lock, flags);
    idx = per_cpu(mmu_update_queue_idx, cpu);
    per_cpu(update_queue[idx], cpu).ptr = virt_to_machine(ptr);
    per_cpu(update_queue[idx], cpu).val = pmd_val_ma(val);
    increment_index();
    spin_unlock_irqrestore(&update_lock, flags);
}

void xen_l2_entry_update(pmd_t *ptr, pmd_t val)

{
    int cpu = smp_processor_id();
    int idx;
    unsigned long flags;
    spin_lock_irqsave(&update_lock, flags);
    idx = per_cpu(mmu_update_queue_idx, cpu);
    per_cpu(update_queue[idx], cpu).ptr = virt_to_machine(ptr);
    per_cpu(update_queue[idx], cpu).val = pmd_val_ma(val);
    increment_index_and_flush();
    spin_unlock_irqrestore(&update_lock, flags);
}

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#1 lore raw

Hi Kip,

Quoted 6 lines · Kip Macy

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define QUEUE_SIZE 2048
#define pte_offset_kernel pte_offset
#define pmd_val_ma(v) (v).pmd;
#define pud_t pgd_t
#define pud_offset(d, va) d

Quoted 8 lines

#else
#ifdef CONFIG_SMP
#define QUEUE_SIZE 1
#else
#define QUEUE_SIZE 128
#define pmd_val_ma(v) (v).pud.pgd.pgd;
#endif
#endif

I just moved the second #define pmd_val_ma(v) one line down to make it compile. I did not investigate whether it's correct. I guess not, but I also guess it does no harm.

Regards,

Signature · 3 lines
Kurt Garloff                   <[email protected]>             [Koeln, DE]
Physics:Plasma modeling <[email protected]> [TU Eindhoven, NL]
Linux: SUSE Labs (Director)    <[email protected]>            [Novell Inc]
author
#2 lore raw

Yeah, I did the same. I just thought I'd report it.

-Kip

Quoted 22 lines · Kurt Garloff

Hi Kip,

Quoted 6 lines · Kip Macy

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define QUEUE_SIZE 2048
#define pte_offset_kernel pte_offset
#define pmd_val_ma(v) (v).pmd;
#define pud_t pgd_t
#define pud_offset(d, va) d

Quoted 8 lines

#else
#ifdef CONFIG_SMP
#define QUEUE_SIZE 1
#else
#define QUEUE_SIZE 128
#define pmd_val_ma(v) (v).pud.pgd.pgd;
#endif
#endif

I just moved the second #define pmd_val_ma(v) one line down to make it compile. I did not investigate whether it's correct. I guess not, but I also guess it does no harm.

Quoted 8 lines

Regards,
--
Kurt Garloff <[email protected]> [Koeln, DE]
Physics:Plasma modeling <[email protected]> [TU Eindhoven, NL]
Linux: SUSE Labs (Director) <[email protected]> [Novell Inc]

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#3 lore raw
In reply to Kurt Garloff
Quoted 3 lines · Kurt Garloff

I just moved the second #define pmd_val_ma(v) one line down to make it compile. I did not investigate whether it's correct. I guess not, but I also guess it does no harm.

Fixed now. Moving it one line down is correct.

christian

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click