Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-31 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, Mar 15, 2022 at 03:50:26PM +0100, Kevin Wolf wrote: [...] >> ...using C++ in coroutine code means that all of the block layer would >> suddenly become C++ and would be most affected by this effect. I'm not >> sure if that's something I would like to see, at

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-31 Thread Markus Armbruster
Hanna Reitz writes: > On 17.03.22 16:11, Paolo Bonzini wrote: >> On 3/16/22 13:32, Stefan Hajnoczi wrote: >>> You can define rules and a way to enforce a subset of C++, but I think >>> over time the code will be C++. A policy that is complicated discourages >>> contributors. >>> >>> For these

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-17 Thread Hanna Reitz
On 17.03.22 16:11, Paolo Bonzini wrote: On 3/16/22 13:32, Stefan Hajnoczi wrote: You can define rules and a way to enforce a subset of C++, but I think over time the code will be C++. A policy that is complicated discourages contributors. For these reasons I think that if code runs through a

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-17 Thread Paolo Bonzini
On 3/16/22 13:32, Stefan Hajnoczi wrote: You can define rules and a way to enforce a subset of C++, but I think over time the code will be C++. A policy that is complicated discourages contributors. For these reasons I think that if code runs through a C++ compiler we should just allow C++.

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-17 Thread Daniel P . Berrangé
On Wed, Mar 16, 2022 at 12:08:33AM +0100, Paolo Bonzini wrote: > On 3/15/22 16:55, Daniel P. Berrangé wrote: > > Expecting maintainers to enforce a subset during code review feels > > like it would be a tedious burden, that will inevitably let stuff > > through because humans are fallible,

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-17 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 3/15/22 16:55, Daniel P. Berrangé wrote: > > Expecting maintainers to enforce a subset during code review feels > > like it would be a tedious burden, that will inevitably let stuff > > through because humans are fallible, especially when presented

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-16 Thread Stefan Hajnoczi
On Wed, Mar 16, 2022 at 01:06:02PM +, Daniel P. Berrangé wrote: > On Wed, Mar 16, 2022 at 12:32:48PM +, Stefan Hajnoczi wrote: > > On Tue, Mar 15, 2022 at 06:29:50PM +0100, Paolo Bonzini wrote: > > > On 3/15/22 15:24, Peter Maydell wrote: > > > > On Tue, 15 Mar 2022 at 14:09, Stefan

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-16 Thread Kevin Wolf
Am 16.03.2022 um 13:40 hat Stefan Hajnoczi geschrieben: > On Wed, Mar 16, 2022 at 12:08:33AM +0100, Paolo Bonzini wrote: > > On 3/15/22 16:55, Daniel P. Berrangé wrote: > > > Expecting maintainers to enforce a subset during code review feels > > > like it would be a tedious burden, that will

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-16 Thread Daniel P . Berrangé
On Wed, Mar 16, 2022 at 12:32:48PM +, Stefan Hajnoczi wrote: > On Tue, Mar 15, 2022 at 06:29:50PM +0100, Paolo Bonzini wrote: > > On 3/15/22 15:24, Peter Maydell wrote: > > > On Tue, 15 Mar 2022 at 14:09, Stefan Hajnoczi wrote: > > > > Also, once C++ is available people will > > > > start

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-16 Thread Stefan Hajnoczi
On Wed, Mar 16, 2022 at 12:08:33AM +0100, Paolo Bonzini wrote: > On 3/15/22 16:55, Daniel P. Berrangé wrote: > > Expecting maintainers to enforce a subset during code review feels > > like it would be a tedious burden, that will inevitably let stuff > > through because humans are fallible,

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-16 Thread Stefan Hajnoczi
On Tue, Mar 15, 2022 at 06:29:50PM +0100, Paolo Bonzini wrote: > On 3/15/22 15:24, Peter Maydell wrote: > > On Tue, 15 Mar 2022 at 14:09, Stefan Hajnoczi wrote: > > > Also, once C++ is available people will > > > start submitting C++ patches simply because they are more comfortable > > > with C++

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 16:55, Daniel P. Berrangé wrote: Expecting maintainers to enforce a subset during code review feels like it would be a tedious burden, that will inevitably let stuff through because humans are fallible, especially when presented with uninspiring, tedious, repetitive tasks.

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Tue, Mar 15, 2022 at 06:27:57PM +0100, Paolo Bonzini wrote: > On 3/15/22 10:32, Daniel P. Berrangé wrote: > > > > So NetBSD is our biggest constraint on requiring GCC 10 > > > > > > Do we care about the BSDs since they have newer compilers (including > > > gcc10) > > > available in pkgsrc?

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 17:15, Daniel P. Berrangé wrote: Bear with me as I suggest something potentially/probably silly given my limited knowledge of C++ coroutines. Given a function I know about: void coroutine_fn qio_channel_yield(QIOChannel *ioc, GIOCondition

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 15:24, Peter Maydell wrote: On Tue, 15 Mar 2022 at 14:09, Stefan Hajnoczi wrote: Also, once C++ is available people will start submitting C++ patches simply because they are more comfortable with C++ (especially one-time/infrequent contributors). This to my mind is the major

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/15/22 10:32, Daniel P. Berrangé wrote: So NetBSD is our biggest constraint on requiring GCC 10 Do we care about the BSDs since they have newer compilers (including gcc10) available in pkgsrc? If you go by the base system, then RHEL8 has 8.5.0 and newer version are only available with

When and how to use C++ (was Re: [PATCH experiment 00/16] C++20 coroutine backend)

2022-03-15 Thread Paolo Bonzini
On 3/15/22 15:50, Kevin Wolf wrote: I'm not sure what the C++ lock guards offer that our current lock guards don't? Passing down lock guards makes sense to me, but why can't you do that with QemuLockable? Passing a QemuLockable alone doesn't ensure that the lock has been taken. I guess we

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Mon, Mar 14, 2022 at 10:31:47AM +0100, Paolo Bonzini wrote: > However, there are no ramifications to actual coroutine code, except > for the template syntax "CoroutineFn" for the function and > the mandatory co_await/co_return keywords... both of which are an > improvement, really: the fact

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Tue, Mar 15, 2022 at 03:50:26PM +0100, Kevin Wolf wrote: > Am 15.03.2022 um 15:05 hat Stefan Hajnoczi geschrieben: > > On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > > > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > > > If we can reach a consensus about C++ language usage in

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Stefan Hajnoczi
On Tue, Mar 15, 2022 at 03:50:26PM +0100, Kevin Wolf wrote: > Am 15.03.2022 um 15:05 hat Stefan Hajnoczi geschrieben: > > On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > > > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > > > If we can reach a consensus about C++ language usage in

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Kevin Wolf
Am 15.03.2022 um 15:05 hat Stefan Hajnoczi geschrieben: > On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > > If we can reach a consensus about C++ language usage in QEMU then I'm in > > > favor of using C++ coroutines. It's probably

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Peter Maydell
On Tue, 15 Mar 2022 at 14:09, Stefan Hajnoczi wrote: > Also, once C++ is available people will > start submitting C++ patches simply because they are more comfortable > with C++ (especially one-time/infrequent contributors). This to my mind is the major argument against using C++ for

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Stefan Hajnoczi
On Mon, Mar 14, 2022 at 05:21:22PM +0100, Paolo Bonzini wrote: > On 3/14/22 15:07, Stefan Hajnoczi wrote: > > If we can reach a consensus about C++ language usage in QEMU then I'm in > > favor of using C++ coroutines. It's probably not realistic to think we > > can limit C++ language usage to just

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Daniel P . Berrangé
On Tue, Mar 15, 2022 at 10:05:32AM +0100, Paolo Bonzini wrote: > On 3/14/22 17:52, Daniel P. Berrangé wrote: > > RHEL-8: 10.0.1 > > openSUSE Leap 15.3: 9.0.1 > >Ubuntu LTS 18.04: 6.0.0 > > FreeBSD 12: 8.0.1 > > > > Ubuntu 18.04 drops off our list after

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-15 Thread Paolo Bonzini
On 3/14/22 17:52, Daniel P. Berrangé wrote: RHEL-8: 10.0.1 openSUSE Leap 15.3: 9.0.1 Ubuntu LTS 18.04: 6.0.0 FreeBSD 12: 8.0.1 Ubuntu 18.04 drops off our list after 7.0 comes out OpenSUSE Leap 15.2 was EOL'd by SUSE themselves in Jan 2022, We use it as

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-14 Thread Richard Henderson
On 3/14/22 09:21, Paolo Bonzini wrote: But perhaps someone will try to use templates to replace repeated inclusion (which is common in hw/display) and others will follow suit. The code in fpu/ desperately calls out for overloading and templates. At present it is a tangle of _Generic and

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-14 Thread Daniel P . Berrangé
On Mon, Mar 14, 2022 at 10:31:47AM +0100, Paolo Bonzini wrote: > This was compiled with GCC 11 only. Coroutine support was added in > GCC 10, released in 2020, which IIRC is much newer than the most recent > release we support. Currrently we target 7.4: commit

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-14 Thread Paolo Bonzini
On 3/14/22 15:07, Stefan Hajnoczi wrote: If we can reach a consensus about C++ language usage in QEMU then I'm in favor of using C++ coroutines. It's probably not realistic to think we can limit C++ language usage to just coroutines forever. Someone finds another C++ feature they absolutely need

Re: [PATCH experiment 00/16] C++20 coroutine backend

2022-03-14 Thread Stefan Hajnoczi
On Mon, Mar 14, 2022 at 10:31:47AM +0100, Paolo Bonzini wrote: > However, there are no ramifications to actual coroutine code, except > for the template syntax "CoroutineFn" for the function and > the mandatory co_await/co_return keywords... both of which are an > improvement, really: the fact

[PATCH experiment 00/16] C++20 coroutine backend

2022-03-14 Thread Paolo Bonzini
It turns out that going from a prototype C++ implementation of the QEMU API, to something that could build tests/unit/test-coroutine, was just a few hours work; and once it compiled, only one line had to be changed for every test to pass. Most of the differences between C and C++ already show up