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: <20180419100745.GC3896@pd.tnic>
Date:   Thu, 19 Apr 2018 12:07:45 +0200
From:   Borislav Petkov <bp@...e.de>
To:     Baoquan He <bhe@...hat.com>
Cc:     linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
        robh+dt@...nel.org, dan.j.williams@...el.com,
        nicolas.pitre@...aro.org, josh@...htriplett.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Brijesh Singh <brijesh.singh@....com>,
        Jérôme Glisse <jglisse@...hat.com>,
        Tom Lendacky <thomas.lendacky@....com>,
        Wei Yang <richard.weiyang@...il.com>
Subject: Re: [PATCH v3 2/3] resource: add walk_system_ram_res_rev()

On Thu, Apr 19, 2018 at 08:18:47AM +0800, Baoquan He wrote:
> This function, being a variant of walk_system_ram_res() introduced in
> commit 8c86e70acead ("resource: provide new functions to walk through
> resources"), walks through a list of all the resources of System RAM
> in reversed order, i.e., from higher to lower.
> 
> It will be used in kexec_file code.

Of course, what is missing is the big *WHY* you need this to happen this
way...

>  /*
> + * This function, being a variant of walk_system_ram_res(), calls the @func
> + * callback against all memory ranges of type System RAM which are marked as
> + * IORESOURCE_SYSTEM_RAM and IORESOUCE_BUSY in reversed order, i.e., from
> + * higher to lower.
> + */
> +int walk_system_ram_res_rev(u64 start, u64 end, void *arg,
> +				int (*func)(struct resource *, void *))
> +{
> +	unsigned long flags;
> +	struct resource *res;
> +	int ret = -1;
> +
> +	flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
> +
> +	read_lock(&resource_lock);
> +	list_for_each_entry_reverse(res, &iomem_resource.child, sibling) {

... and the other thing that I'm not clear on is why are you
slapping this function just like that instead of extending
__walk_iomem_res_desc() to do reverse direction too?

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ