Re: [Qemu-devel] [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Michael Mueller
On Fri, 20 Feb 2015 20:21:45 +0100 Alexander Graf wrote: > > > > > Am 20.02.2015 um 19:59 schrieb Michael Mueller : > > > > On Fri, 20 Feb 2015 10:11:55 -0800 > > Richard Henderson wrote: > > > >>> +static inline uint64_t big_endian_bit(unsigned long nr) > >>> +{ > >>> +return 1ul << (B

Re: [Qemu-devel] [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Alexander Graf
> Am 20.02.2015 um 19:59 schrieb Michael Mueller : > > On Fri, 20 Feb 2015 10:11:55 -0800 > Richard Henderson wrote: > >>> +static inline uint64_t big_endian_bit(unsigned long nr) >>> +{ >>> +return 1ul << (BITS_PER_LONG - (nr % BITS_PER_LONG)); >>> +}; >> >> This is buggy. NR=0 shoul

Re: [Qemu-devel] [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Michael Mueller
On Fri, 20 Feb 2015 10:11:55 -0800 Richard Henderson wrote: > > +static inline uint64_t big_endian_bit(unsigned long nr) > > +{ > > +return 1ul << (BITS_PER_LONG - (nr % BITS_PER_LONG)); > > +}; > > This is buggy. NR=0 should map to 63, not 64. I'm sure I was asked to replace my constant

Re: [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Richard Henderson
On 02/17/2015 06:24 AM, Michael Mueller wrote: > +static inline uint64_t big_endian_bit(unsigned long nr) > +{ > +return 1ul << (BITS_PER_LONG - (nr % BITS_PER_LONG)); > +}; This is buggy. NR=0 should map to 63, not 64. > +return !!(*ptr & big_endian_bit(nr)); Personally I dislike !! as

Re: [Qemu-devel] [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Michael Mueller
On Fri, 20 Feb 2015 17:34:28 +0100 Andreas Färber wrote: > Please note that QEMU uses gtk-doc style, where the description goes > between arguments and Returns:, and the function name gets a ':'. > There's also fancy syntax like #CPUClass, %true, etc. On my TODOs... Thanks, Michael -- To unsub

Re: [Qemu-devel] [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Andreas Färber
Am 20.02.2015 um 17:12 schrieb Michael Mueller: > On Fri, 20 Feb 2015 08:02:42 -0800 > Richard Henderson wrote: > >>> +/** >>> + * s390_test_facility - test if given facility bit is set facility list >>> + * of given cpu class >>> + * @class: address of cpu class to test >>>

Re: [Qemu-devel] [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Michael Mueller
On Fri, 20 Feb 2015 17:12:49 +0100 Michael Mueller wrote: > Good spot, it's not being used yet. It's planned to be used with a patch that > implements zPCI > related instructions on QEMU side. Maybe you have seen the discussion from > Frank Blaschka in > this e-mail list in regard to that. I w

Re: [Qemu-devel] [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Michael Mueller
On Fri, 20 Feb 2015 08:02:42 -0800 Richard Henderson wrote: > > +/** > > + * s390_test_facility - test if given facility bit is set facility list > > + * of given cpu class > > + * @class: address of cpu class to test > > + * @nr: bit number to test > > + * > > + * Returns: t

Re: [RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-20 Thread Richard Henderson
On 02/17/2015 06:24 AM, Michael Mueller wrote: > +/** > + * s390_test_facility - test if given facility bit is set facility list > + * of given cpu class > + * @class: address of cpu class to test > + * @nr: bit number to test > + * > + * Returns: true in case it is set > + *

[RFC PATCH v2 10/15] cpu-model/s390: Add cpu class initialization routines

2015-02-17 Thread Michael Mueller
This patch provides routines to dynamically update the previously defined S390 cpu classes in the current host context. The main function performing this process is s390_setup_cpu_classes(). It takes the current host context as parameter to setup the classes accordingly. It basically performs the f