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: <36ca99e90804070657t4435f1a2ldd78ad5bf5978550@mail.gmail.com>
Date:	Mon, 7 Apr 2008 15:57:29 +0200
From:	"Bert Wesarg" <bert.wesarg@...glemail.com>
To:	"Mike Travis" <travis@....com>
Cc:	"Ingo Molnar" <mingo@...e.hu>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] x86: modify show_shared_cpu_map in intel_cacheinfo v2

On Sat, Apr 5, 2008 at 3:24 AM, Mike Travis <travis@....com> wrote:
>  --- linux-2.6.x86.orig/arch/x86/kernel/cpu/intel_cacheinfo.c
>  +++ linux-2.6.x86/arch/x86/kernel/cpu/intel_cacheinfo.c
>  @@ -593,14 +593,17 @@ static ssize_t show_size(struct _cpuid4_
>
>   static ssize_t show_shared_cpu_map(struct _cpuid4_info *this_leaf, char *buf)
>   {
>  +       unsigned long end = ALIGN((unsigned long)buf, PAGE_SIZE);
May I suggest this:

           ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf;

>  +       if (len == 0)
>  +               len = PAGE_SIZE;
Than this is not necessary.

>  +
>  +       if (len >= 2) {
>  +               n = cpus_scnprintf(buf, len-2, this_leaf->shared_cpu_map);
>  +               buf[n++] = '\n';
>  +               buf[n] = '\0';
>         }
>         return n;
>   }
Apart from my suggestion and the use of cpus_scnprintf I think this patch is ok.

Bert

PS: sorry for the long delay.
--
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