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 + *

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 m...@linux.vnet.ibm.com 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

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 r...@twiddle.net 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 + * + *

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 r...@twiddle.net 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:34:28 +0100 Andreas Färber afaer...@suse.de 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,

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 an

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 m...@linux.vnet.ibm.com: On Fri, 20 Feb 2015 10:11:55 -0800 Richard Henderson r...@twiddle.net wrote: +static inline uint64_t big_endian_bit(unsigned long nr) +{ +return 1ul (BITS_PER_LONG - (nr % BITS_PER_LONG)); +}; This is

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 r...@twiddle.net 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

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 ag...@suse.de wrote: Am 20.02.2015 um 19:59 schrieb Michael Mueller m...@linux.vnet.ibm.com: On Fri, 20 Feb 2015 10:11:55 -0800 Richard Henderson r...@twiddle.net wrote: +static inline uint64_t big_endian_bit(unsigned long nr)

[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