lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CABDF3A.2020501@zytor.com>
Date:	Tue, 05 Oct 2010 19:30:18 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Section mismatches in memblock

On 10/05/2010 04:30 PM, Yinghai Lu wrote:
> 
> looks like gcc problem.

What makes you say that?

> | static int memblock_search(struct memblock_type *type, phys_addr_t addr)
> | {
> |	.....
> | }
> |
> |int __init memblock_is_reserved(phys_addr_t addr)
> |{
> |        return memblock_search(&memblock.reserved, addr) != -1;
> |}
> |
> |int __init_memblock memblock_is_memory(phys_addr_t addr)
> |{
> |        return memblock_search(&memblock.memory, addr) != -1;
> |}
> 
> Because We already have __init for those two functions.
> 
> Just make memblock_search to have __init_memblock atribute.
> 

Wrong functions!  Furhtermore, at least the tip tree definitely does not
have __init_memblock here:


static int memblock_search(struct memblock_type *type, phys_addr_t addr)
{
        unsigned int left = 0, right = type->cnt;

        do {
                unsigned int mid = (right + left) / 2;

                if (addr < type->regions[mid].base)
                        right = mid;
                else if (addr >= (type->regions[mid].base +
                                  type->regions[mid].size))
                        left = mid + 1;
                else
                        return mid;
        } while (left < right);
        return -1;
}

int __init memblock_is_reserved(phys_addr_t addr)
{
        return memblock_search(&memblock.reserved, addr) != -1;
}

int memblock_is_memory(phys_addr_t addr)
{
        return memblock_search(&memblock.memory, addr) != -1;
}

int memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
{
        int idx = memblock_search(&memblock.reserved, base);

        if (idx == -1)
                return 0;
        return memblock.reserved.regions[idx].base <= base &&
                (memblock.reserved.regions[idx].base +
                 memblock.reserved.regions[idx].size) >= (base + size);
}


... so I don't know why you're saying that you already have them.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ