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:   Sun, 19 Feb 2023 09:40:43 +0100
From:   Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     Philippe Mathieu-Daudé <philmd@...aro.org>,
        linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>,
        Dengcheng Zhu <dzhu@...ecomp.com>,
        John Crispin <john@...ozen.org>, linux-mips@...r.kernel.org,
        Qais Yousef <qyousef@...alina.io>
Subject: Re: [PATCH] MIPS: vpe-mt: provide a default 'physical_memsize'

On Fri, Feb 17, 2023 at 03:24:04PM -0800, Randy Dunlap wrote:
> 
> 
> On 2/17/23 03:57, Thomas Bogendoerfer wrote:
> > On Wed, Feb 15, 2023 at 10:59:35PM -0800, Randy Dunlap wrote:
> >>> I agree this is where this variable has be be declared / initialized,
> >>> but having this dependent on CONFIG_MIPS_MALTA/CONFIG_LANTIQ machines
> >>> doesn't seem right.
> >>
> >> So far I have been able to consolidate the LANTIQ code into a general
> >> patch, but not MALTA.
> > 
> > if I didn't miss something physical_memory is always 0 for LANTIQ 
> > and something for MALTA depending on command line/DT. Now
> > 
> > arch/mips/kernel/vpe-mt.c contains
> > 
> >         /*
> >          * The sde-kit passes 'memsize' to __start in $a3, so set something
> >          * here...  Or set $a3 to zero and define DFLT_STACK_SIZE and
> >          * DFLT_HEAP_SIZE when you compile your program
> >          */
> >         mttgpr(6, v->ntcs);
> >         mttgpr(7, physical_memsize);
> > 
> > so the 0 for LANTIQ is fine with the correct VPE payload. But for
> > MALTA could cause major problems, if the VPE payload uses the top
> > of memory for it's stack. So I would guess nobody uses this "mode".
> > Therefore let's get rid of physical_memory in vpe.c completly.
> 
> Hi Thomas,
> 
> What is this line doing?
>           mttgpr(6, v->ntcs);

from a quick glance over the code, it's probably the number of thread
contexts (TCs) the VPE is allowed to use.

> Does it need to stay?

yes.

> But the comment and mttgpr(7, physical_memsize); can be deleted?

replace it with

	/*
	 * we don't pass the memsize here, so VPE programs need to be
	 * compiled with DFLT_STACK_SIZE and DFLT_HEAP_SIZE defined
	 */
	mttgpr(7, 0);

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ