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] [day] [month] [year] [list]
Date:	Wed, 13 Apr 2011 17:18:51 +0200
From:	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Nicolas Ferre <nicolas.ferre@...el.com>,
	Patrice VILCHEZ <patrice.vilchez@...el.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] genalloc: add support to specify the physical
 address

> 
> But this documentation is incorrect.  @addr is not "the starting
> address of memory".
> 
> > +unsigned long gen_pool_virt_to_phys(struct gen_pool *pool, unsigned long addr)
> > +{
> > +	struct list_head *_chunk;
> > +	struct gen_pool_chunk *chunk;
> > +
> > +	read_lock(&pool->lock);
> > +	list_for_each(_chunk, &pool->chunks) {
> > +		chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
> > +
> > +		if (addr >= chunk->start_addr && addr < chunk->end_addr)
> > +			return chunk->phys_addr + addr - chunk->start_addr;
> 
> It is in fact "some address within one of the chunks".
yes
do you want a v2 or you fix it in your patch?
> 
> 
> > +	}
> > +	read_unlock(&pool->lock);
> > +
> > +	return ~0UL;
> > +}
> > +EXPORT_SYMBOL(gen_pool_virt_to_phys);
> 
> Was that intentional?  If so, what is the reasoning?
yes as 0 can be a valid physical address
and the export as the drivers can be compiled as module
> 
> 
> Please review...
> 
> Subject: lib/genpool.c: document return values, fix gen_pool_add_virt() return value
> From: Andrew Morton <akpm@...ux-foundation.org>
> 
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
> Cc: Jes Sorensen <jes@...dopensource.com>
> Cc: Nicolas Ferre <nicolas.ferre@...el.com>
> Cc: Patrice VILCHEZ <patrice.vilchez@...el.com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
> 
>  include/linux/genalloc.h |    2 ++
>  lib/genalloc.c           |    6 +++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>

Best Regards,
J.
--
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