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: <1231424025.11687.447.camel@twins>
Date:	Thu, 08 Jan 2009 15:13:45 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Jiri Kosina <jkosina@...e.cz>
Cc:	Adam Osuchowski <adwol@...k.pl>, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...e.hu>, Nick Piggin <npiggin@...e.de>
Subject: Re: Is 386 processor still supported?

On Thu, 2009-01-08 at 14:05 +0100, Jiri Kosina wrote:
> [ CCs added ]
> 
> On Thu, 8 Jan 2009, Adam Osuchowski wrote:
> 
> > Recently, I found such piece of code in kernel 2.6.28 compiled for 386
> > processor:
> > 
> > # grep M386 .config
> > CONFIG_M386=y
> > # objdump -d vmlinux | grep -A11 '<_spin_lock>:'
> > c0321827 <_spin_lock>:
> > c0321827:	89 e2                	mov    %esp,%edx
> > c0321829:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
> > c032182f:	ff 42 14             	incl   0x14(%edx)
> > c0321832:	ba 00 01 00 00       	mov    $0x100,%edx
> > c0321837:	f0 66 0f c1 10       	lock xadd %dx,(%eax)
> > c032183c:	38 f2                	cmp    %dh,%dl
> > c032183e:	74 06                	je     c0321846 <_spin_lock+0x1f>
> > c0321840:	f3 90                	pause  
> > c0321842:	8a 10                	mov    (%eax),%dl
> > c0321844:	eb f6                	jmp    c032183c <_spin_lock+0x15>
> > c0321846:	c3                   	ret    
> > 
> > But there is no xadd instruction on 386 processors. It is available on
> > 486+ only. I have no chance to run this kernel on real 386 box, so I can't
> > check it in practice, but I think it will not run.
> > 
> > It is not compiler problem because it is explicitly written in assembly
> > in __raw_spin_lock() function (include/asm-x86/spinlock.h) and there is
> > no alternative code depending on CONFIG_M386.
> 
> Hmm, this really looks like a bug to me. How about something like this 
> (untested).
> 
> 
> From: Jiri Kosina <jkosina@...e.cz>
> Subject: x86: make spinlocks available on machines without xadd insn
> 
> Current kernel wouldn't compile on ancient x86 machines that don't support 
> xadd instruction, as ticket spinlocks implementation unconditionally uses 
> it.
> 
> On machines without CONFIG_X86_XADD, use old-style byte spinlock 
> implementation instead.

afaik we don't support i386-smp and up spinlocks are trivial
preempt_disable() calls.
--
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