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: <1154930669.7642.12.camel@localhost.localdomain>
Date:	Mon, 07 Aug 2006 16:04:28 +1000
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Andi Kleen <ak@....de>
Cc:	virtualization@...ts.osdl.org, Andrew Morton <akpm@...l.org>,
	Chris Wright <chrisw@...s-sol.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] x86 paravirt_ops: create no_paravirt.h for native
	ops

On Mon, 2006-08-07 at 07:30 +0200, Andi Kleen wrote:
> > ===================================================================
> > --- /dev/null
> > +++ b/include/asm-i386/no_paravirt.h
> 
> I can't say I like the name. After all that should be the normal
> case for a long time now ... native? normal? bareiron?

Yeah, I don't like it much either.  native.h doesn't say what the
alternative is.  native_paravirt.h is kind of contradictory.

> Also I would prefer if you split this file up a bit - the old
> processor/system/irqflags split wasn't too bad.

In the paravirt case, they all come into one ops structure, which has to
be declared in one place.

Of course, those headers can do:

#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
#else
...
#endif

I'll try this and see what happens.  Playing with the x86 headers can be
extremely hairy 8(

> > +
> > +/*
> > + * Set IOPL bits in EFLAGS from given mask
> > + */
> > +static inline void set_iopl_mask(unsigned mask)
> 
> This function can be completely written in C using local_save_flags()/local_restore_flags()
> Please do that. I guess it's still a good idea to keep it separated
> though because it might allow other optimizations.
> 
> e.g. i've been thinking about special casing IF changes in save/restore flags 
> to optimize CPUs which have slow pushf/popf. If you already make sure
> all non IF manipulations of flags are separated that would help.
...
> > +
> > +/*
> > + * Clear and set 'TS' bit respectively
> > + */
> 
> The comment seems out of date (no set TS)
> 
> 
> > +#define clts() __asm__ __volatile__ ("clts")
> > +#define read_cr0() ({ \
> > +	unsigned int __dummy; \
> > +	__asm__ __volatile__( \
> 
> Maybe it's just me, but can't you just drop all these __s around
> asm and volatile? They are completely useless as far I know. 
> 
> Also the assembly will be easier readable if you just keep it on a single 
> line for the simple ones.

I'm just shuffling code here, and if the other approach works, I won't
even be doing that.

But I'm happy to submit a separate patch which cleans these...

Thanks!
Rusty.
-- 
Help! Save Australia from the worst of the DMCA: http://linux.org.au/law

-
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