Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-15 Thread Jürgen Groß
On 05.08.25 11:49, Jan Beulich wrote: On 05.08.2025 11:33, Stewart Hildebrand wrote: On 8/5/25 05:17, Jan Beulich wrote: On 05.08.2025 11:06, Stewart Hildebrand wrote: On 8/5/25 03:44, Jan Beulich wrote: On 04.08.2025 18:57, Stewart Hildebrand wrote: On 8/4/25 03:57, Jan Beulich wrote: On 0

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-05 Thread Jan Beulich
On 05.08.2025 11:33, Stewart Hildebrand wrote: > On 8/5/25 05:17, Jan Beulich wrote: >> On 05.08.2025 11:06, Stewart Hildebrand wrote: >>> On 8/5/25 03:44, Jan Beulich wrote: On 04.08.2025 18:57, Stewart Hildebrand wrote: > On 8/4/25 03:57, Jan Beulich wrote: >> On 01.08.2025 22:24, St

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-05 Thread Stewart Hildebrand
On 8/5/25 05:17, Jan Beulich wrote: > On 05.08.2025 11:06, Stewart Hildebrand wrote: >> On 8/5/25 03:44, Jan Beulich wrote: >>> On 04.08.2025 18:57, Stewart Hildebrand wrote: On 8/4/25 03:57, Jan Beulich wrote: > On 01.08.2025 22:24, Stewart Hildebrand wrote: >> @@ -839,6 +839,9 @@ voi

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-05 Thread Jan Beulich
On 05.08.2025 11:06, Stewart Hildebrand wrote: > On 8/5/25 03:44, Jan Beulich wrote: >> On 04.08.2025 18:57, Stewart Hildebrand wrote: >>> On 8/4/25 03:57, Jan Beulich wrote: On 01.08.2025 22:24, Stewart Hildebrand wrote: > @@ -839,6 +839,9 @@ void sched_destroy_vcpu(struct vcpu *v) >

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-05 Thread Stewart Hildebrand
On 8/5/25 03:44, Jan Beulich wrote: > On 04.08.2025 18:57, Stewart Hildebrand wrote: >> On 8/4/25 03:57, Jan Beulich wrote: >>> On 01.08.2025 22:24, Stewart Hildebrand wrote: @@ -839,6 +839,9 @@ void sched_destroy_vcpu(struct vcpu *v) { struct sched_unit *unit = v->sched_unit;

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-05 Thread Jan Beulich
On 04.08.2025 18:57, Stewart Hildebrand wrote: > On 8/4/25 03:57, Jan Beulich wrote: >> On 01.08.2025 22:24, Stewart Hildebrand wrote: >>> @@ -839,6 +839,9 @@ void sched_destroy_vcpu(struct vcpu *v) >>> { >>> struct sched_unit *unit = v->sched_unit; >>> >>> +if ( !unit ) >>> +re

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-04 Thread Stewart Hildebrand
On 8/3/25 09:19, Andrew Cooper wrote: > On 01/08/2025 9:24 pm, Stewart Hildebrand wrote: >> In vcpu_create after scheduler data is allocated, if >> vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label >> resulting in a memory leak. >> >> Move sched_destroy_vcpu and destroy_waitqueue_

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-04 Thread Stewart Hildebrand
On 8/4/25 03:57, Jan Beulich wrote: > On 01.08.2025 22:24, Stewart Hildebrand wrote: >> @@ -839,6 +839,9 @@ void sched_destroy_vcpu(struct vcpu *v) >> { >> struct sched_unit *unit = v->sched_unit; >> >> +if ( !unit ) >> +return; >> + >> kill_timer(&v->periodic_timer); >>

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-04 Thread Jan Beulich
On 01.08.2025 22:24, Stewart Hildebrand wrote: > @@ -839,6 +839,9 @@ void sched_destroy_vcpu(struct vcpu *v) > { > struct sched_unit *unit = v->sched_unit; > > +if ( !unit ) > +return; > + > kill_timer(&v->periodic_timer); > kill_timer(&v->singleshot_timer); > kil

Re: [PATCH v2] xen: rework error handling in vcpu_create

2025-08-03 Thread Andrew Cooper
On 01/08/2025 9:24 pm, Stewart Hildebrand wrote: > In vcpu_create after scheduler data is allocated, if > vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label > resulting in a memory leak. > > Move sched_destroy_vcpu and destroy_waitqueue_vcpu to vcpu_teardown. > Make vcpu_teardown i

[PATCH v2] xen: rework error handling in vcpu_create

2025-08-01 Thread Stewart Hildebrand
In vcpu_create after scheduler data is allocated, if vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label resulting in a memory leak. Move sched_destroy_vcpu and destroy_waitqueue_vcpu to vcpu_teardown. Make vcpu_teardown idempotent: deal with NULL unit. Fix vcpu_runstate_get (call