Skip to contentSkip to conversation

Stubdom breakage in 4.5

DISCUSSION Wei Liu 4 participants 10 messages Feb 3, 2015 – Feb 5, 2015

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

Hi all

I recently found out that stubdom in 4.5 is broken.

A proper fix to that issue is likely to alter the start up protocol, which is not acceptable for backport.

Providing a backport that doesn't alter the protocol used to start up stubdom is difficult.

Paul, do you have any insight how we can fix stubdom in 4.5? Even a backportable workaround is better than just have stubdom broken.

Wei.

#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 03 February 2015 12:22
To: [email protected]
Cc: Wei Liu; Ian Campbell; Ian Jackson; Paul Durrant; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Stubdom breakage in 4.5

Hi all

I recently found out that stubdom in 4.5 is broken.

Quoted 9 lines

A proper fix to that issue is likely to alter the start up protocol, which is not acceptable for backport.

Providing a backport that doesn't alter the protocol used to start up stubdom is difficult.

Paul, do you have any insight how we can fix stubdom in 4.5? Even a backportable workaround is better than just have stubdom broken.

The minimal fix from your PoV, I guess, would be something that tells Xen not to complete I/O in the absence of a matching IOREQ but to wait until one is there, IIUC? It's a bit icky, and I don't know what form that something would be in.

Paul

Quoted 1 line

Wei.

#2 lore raw
Quoted 18 lines · Paul Durrant
Quoted 18 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 03 February 2015 12:22
To: [email protected]
Cc: Wei Liu; Ian Campbell; Ian Jackson; Paul Durrant; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Stubdom breakage in 4.5

Hi all

I recently found out that stubdom in 4.5 is broken.

A proper fix to that issue is likely to alter the start up protocol, which is not acceptable for backport.

Providing a backport that doesn't alter the protocol used to start up stubdom is difficult.

Quoted 8 lines
Quoted 3 lines

Paul, do you have any insight how we can fix stubdom in 4.5? Even a backportable workaround is better than just have stubdom broken.

The minimal fix from your PoV, I guess, would be something that tells Xen not to complete I/O in the absence of a matching IOREQ but to wait until one is there, IIUC? It's a bit icky, and I don't know what form that something would be in.

"wait until one is there" == "the default ioreq is registered", i.e. put it on the default ring in anticipation of something eventually consuming it? This was the behaviour in 4.4 and earlier AIUI.

I think reverting to that behaviour (nb, not by actually reverting the feature) in the 4.5 branch would be the best compromise, since as Wei says the proper fix for 4.6 will likely involve too much to backport (since it will involve fixing the startup interlock between toolstack and multiple qemus, and protocol changes like that aren't really stable backport candidates).

Either way, this regression certainly needs fixing in 4.5 as well as unstable/4.6. It's my understanding that the stuff Don is doing is (at least partially) addressing the latter?

Paul, can you take care of fixing, or ensuring someone else is fixing, the issue, please.

Ian.

#3 lore raw
Quoted 47 lines

-----Original Message-----
From: Ian Campbell
Sent: 03 February 2015 13:48
To: Paul Durrant
Cc: Wei Liu; [email protected]; Ian Jackson; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Re: Stubdom breakage in 4.5

Quoted 18 lines · Paul Durrant
Quoted 18 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 03 February 2015 12:22
To: [email protected]
Cc: Wei Liu; Ian Campbell; Ian Jackson; Paul Durrant; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Stubdom breakage in 4.5

Hi all

I recently found out that stubdom in 4.5 is broken.

A proper fix to that issue is likely to alter the start up protocol, which is not acceptable for backport.

Providing a backport that doesn't alter the protocol used to start up stubdom is difficult.

Quoted 8 lines
Quoted 3 lines

Paul, do you have any insight how we can fix stubdom in 4.5? Even a backportable workaround is better than just have stubdom broken.

The minimal fix from your PoV, I guess, would be something that tells Xen not to complete I/O in the absence of a matching IOREQ but to wait until one is there, IIUC? It's a bit icky, and I don't know what form that something would be in.

"wait until one is there" == "the default ioreq is registered", i.e. put it on the default ring in anticipation of something eventually consuming it? This was the behaviour in 4.4 and earlier AIUI.

I think reverting to that behaviour (nb, not by actually reverting the feature) in the 4.5 branch would be the best compromise, since as Wei says the proper fix for 4.6 will likely involve too much to backport (since it will involve fixing the startup interlock between toolstack and multiple qemus, and protocol changes like that aren't really stable backport candidates).

Quoted 4 lines

Either way, this regression certainly needs fixing in 4.5 as well as unstable/4.6. It's my understanding that the stuff Don is doing is (at least partially) addressing the latter?

No, I don't think the stuff Don is doing will help this. He has need to steer his emulation requests, which are new and distinct. The case here is that you need an emulator for existent types of IOREQ to be present before the guest gets going and the toolstack is not ensuring this, so yes, forcibly creating the default emulator during domain build would solve that problem. However it does introduce another problem... Upstream QEMU now no longer hooks into Xen as the default emulator and therefore will not get emulation requests for the TPM probe done by hvmloader; those are now completed by Xen but would end up wedging the VM if Xen thought that a default emulator would eventually turn up. So, forcible creation of the default emulator would still need to be something that could be turned off if the latest upstream QEMU were in use.

Quoted 3 lines

Paul, can you take care of fixing, or ensuring someone else is fixing, the issue, please.

I'm happy to fix once the best course of action is agreed.

Paul

Quoted 1 line

Ian.

#4 lore raw
Quoted 22 lines · Paul Durrant
Quoted 20 lines

-----Original Message-----
From: Ian Campbell
Sent: 03 February 2015 13:48
To: Paul Durrant
Cc: Wei Liu; [email protected]; Ian Jackson; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Re: Stubdom breakage in 4.5

Quoted 11 lines · Paul Durrant
Quoted 11 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 03 February 2015 12:22
To: [email protected]
Cc: Wei Liu; Ian Campbell; Ian Jackson; Paul Durrant; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Stubdom breakage in 4.5

Hi all

I recently found out that stubdom in 4.5 is broken.

Quoted 8 lines
Quoted 4 lines

Either way, this regression certainly needs fixing in 4.5 as well as unstable/4.6. It's my understanding that the stuff Don is doing is (at least partially) addressing the latter?

No, I don't think the stuff Don is doing will help this. He has need to steer his emulation requests, which are new and distinct. The case here is that you need an emulator for existent types of IOREQ to be present before the guest gets going and the toolstack is not ensuring this, so yes, forcibly creating the default emulator during domain build would solve that problem. However it does introduce another problem... Upstream QEMU now no longer hooks into Xen as the default emulator and therefore will not get emulation requests for the TPM probe done by hvmloader; those are now completed by Xen but would end up wedging the VM if Xen thought that a default emulator would eventually turn up. So, forcible creation of the default emulator would still need to be something that could be turned off if the latest upstream QEMU were in use.

Most of what I have posted does not apply. The only possible one that comes to mind is about using QEMU master (of the newer 4.6 QEMU) with 4.5 which I am assuming is not the case here (for reference it is about creating a default_ioreq_server to the QEMU that did call hvm_ioreq_server_enable() 1st, and then a 2nd time as the default one. (Message-ID: <[email protected]>; Subject: Re: [Qemu-devel] [PATCH v5 2/2] Xen: Use the ioreq-server API when available)).

-Don Slutz

Quoted 16 lines
Quoted 3 lines

Paul, can you take care of fixing, or ensuring someone else is fixing, the issue, please.

I'm happy to fix once the best course of action is agreed.

Paul

Quoted 1 line

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
In reply to Ian Campbell
Quoted 74 lines

-----Original Message-----
From: Paul Durrant
Sent: 03 February 2015 14:00
To: Ian Campbell
Cc: Wei Liu; [email protected]; Ian Jackson; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: RE: Stubdom breakage in 4.5

Quoted 8 lines

-----Original Message-----
From: Ian Campbell
Sent: 03 February 2015 13:48
To: Paul Durrant
Cc: Wei Liu; [email protected]; Ian Jackson; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Re: Stubdom breakage in 4.5

Quoted 6 lines
Quoted 5 lines · Paul Durrant
Quoted 5 lines

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: 03 February 2015 12:22
To: [email protected]
Cc: Wei Liu; Ian Campbell; Ian Jackson; Paul Durrant; Jan Beulich;

Andrew

Quoted 33 lines
Quoted 13 lines
Quoted 13 lines

Cooper; Stefano Stabellini
Subject: Stubdom breakage in 4.5

Hi all

I recently found out that stubdom in 4.5 is broken.

A proper fix to that issue is likely to alter the start up protocol, which is not acceptable for backport.

Providing a backport that doesn't alter the protocol used to start up stubdom is difficult.

Quoted 8 lines
Quoted 3 lines

Paul, do you have any insight how we can fix stubdom in 4.5? Even a backportable workaround is better than just have stubdom broken.

The minimal fix from your PoV, I guess, would be something that tells Xen not to complete I/O in the absence of a matching IOREQ but to wait until one is there, IIUC? It's a bit icky, and I don't know what form that something would be in.

"wait until one is there" == "the default ioreq is registered", i.e. put it on the default ring in anticipation of something eventually consuming it? This was the behaviour in 4.4 and earlier AIUI.

I think reverting to that behaviour (nb, not by actually reverting the feature) in the 4.5 branch would be the best compromise, since as Wei says the proper fix for 4.6 will likely involve too much to backport (since it will involve fixing the startup interlock between toolstack and multiple qemus, and protocol changes like that aren't really stable backport candidates).

Quoted 4 lines

Either way, this regression certainly needs fixing in 4.5 as well as unstable/4.6. It's my understanding that the stuff Don is doing is (at least partially) addressing the latter?

No, I don't think the stuff Don is doing will help this. He has need to steer his emulation requests, which are new and distinct. The case here is that you need an emulator for existent types of IOREQ to be present before the guest gets going and the toolstack is not ensuring this, so yes, forcibly creating the default emulator during domain build would solve that problem. However it does introduce another problem...
Upstream QEMU now no longer hooks into Xen as the default emulator and therefore will not get emulation requests for the TPM probe done by hvmloader; those are now completed by Xen but would end up wedging the VM if Xen thought that a default emulator would eventually turn up. So, forcible creation of the default emulator would still need to be something that could be turned off if the latest upstream QEMU were in use.

Quoted 6 lines
Quoted 3 lines

Paul, can you take care of fixing, or ensuring someone else is fixing, the issue, please.

I'm happy to fix once the best course of action is agreed.

How about this as a slightly hacky solution that I think may work in both cases?

If Xen finds no emulator at all for an HVM guest then it waits around for at least one to show up before processing an emulation request. Until one does it stalls the vcpu in question indefinitely, but on the first emulator attach (i.e. ioreq server creations) then the IO will always be processed, even if it doesn't match the ioreq server.

If no-one shouts I'll proceed along those lines.

Paul

Quoted 4 lines

Paul

Quoted 1 line

Ian.

#6 lore raw
Quoted 7 lines · Paul Durrant

How about this as a slightly hacky solution that I think may work in both cases?

If Xen finds no emulator at all for an HVM guest then it waits around for at least one to show up before processing an emulation request. Until one does it stalls the vcpu in question indefinitely, but on the first emulator attach (i.e. ioreq server creations) then the IO will always be processed, even if it doesn't match the ioreq server.

It sounds plausible to me and seems like it would probably be backportable.

Longer term I think we still need to fix the domain creation interlock for launching multiple qemu's, ioreq servers and any other type of service thing we might launch (whether in a stub dom or not), at which point we may be able to remove the above workaround too.

Ian.

#7 lore raw
Quoted 12 lines

-----Original Message-----
From: Ian Campbell
Sent: 04 February 2015 12:30
To: Paul Durrant
Cc: Wei Liu; [email protected]; Ian Jackson; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Re: Stubdom breakage in 4.5

Quoted 1 line · Paul Durrant

How about this as a slightly hacky solution that I think may work in both

cases?

Quoted 1 line
Quoted 9 lines
Quoted 5 lines

If Xen finds no emulator at all for an HVM guest then it waits around for at least one to show up before processing an emulation request. Until one does it stalls the vcpu in question indefinitely, but on the first emulator attach (i.e. ioreq server creations) then the IO will always be processed, even if it doesn't match the ioreq server.

It sounds plausible to me and seems like it would probably be backportable.

Actually I think it may be even simpler, although I've not tried it. If hvm_domain_initialise() pauses the domain and the first hvm_ioreq_server_enable() unpauses it, I'm hoping that may be enough.

Quoted 5 lines

Longer term I think we still need to fix the domain creation interlock for launching multiple qemu's, ioreq servers and any other type of service thing we might launch (whether in a stub dom or not), at which point we may be able to remove the above workaround too.

Yes. Once the toolstack is aware it can keep the domain paused until all emulators report readiness.

Paul

Quoted 3 lines

Ian.

#8 lore raw
Quoted 18 lines · Paul Durrant
Quoted 18 lines

-----Original Message-----
From: Ian Campbell
Sent: 04 February 2015 12:30
To: Paul Durrant
Cc: Wei Liu; [email protected]; Ian Jackson; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Re: Stubdom breakage in 4.5

Quoted 1 line · Paul Durrant

How about this as a slightly hacky solution that I think may work in both

cases?

Quoted 6 lines

If Xen finds no emulator at all for an HVM guest then it waits around for at least one to show up before processing an emulation request. Until one does it stalls the vcpu in question indefinitely, but on the first emulator attach (i.e. ioreq server creations) then the IO will always be processed, even if it doesn't match the ioreq server.

Quoted 6 lines
Quoted 3 lines

It sounds plausible to me and seems like it would probably be backportable.

Actually I think it may be even simpler, although I've not tried it. If hvm_domain_initialise() pauses the domain and the first hvm_ioreq_server_enable() unpauses it, I'm hoping that may be enough.

You do need to keep the PVH case in mind here.

-Don Slutz

Quoted 19 lines
Quoted 5 lines

Longer term I think we still need to fix the domain creation interlock for launching multiple qemu's, ioreq servers and any other type of service thing we might launch (whether in a stub dom or not), at which point we may be able to remove the above workaround too.

Yes. Once the toolstack is aware it can keep the domain paused until all emulators report readiness.

Paul

Quoted 3 lines

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
Quoted 31 lines

-----Original Message-----
From: Don Slutz [mailto:[email protected]]
Sent: 04 February 2015 21:42
To: Paul Durrant; Ian Campbell
Cc: Wei Liu; Andrew Cooper; [email protected]; Stefano Stabellini; Jan Beulich; Ian Jackson
Subject: Re: [Xen-devel] Stubdom breakage in 4.5

Quoted 22 lines · Paul Durrant
Quoted 21 lines

-----Original Message-----
From: Ian Campbell
Sent: 04 February 2015 12:30
To: Paul Durrant
Cc: Wei Liu; [email protected]; Ian Jackson; Jan Beulich; Andrew Cooper; Stefano Stabellini
Subject: Re: Stubdom breakage in 4.5

Quoted 1 line · Paul Durrant

How about this as a slightly hacky solution that I think may work in both

cases?

Quoted 6 lines

If Xen finds no emulator at all for an HVM guest then it waits around for at least one to show up before processing an emulation request. Until one does it stalls the vcpu in question indefinitely, but on the first emulator attach (i.e. ioreq server creations) then the IO will always be processed, even if it doesn't match the ioreq server.

It sounds plausible to me and seems like it would probably be backportable.

Quoted 6 lines
Quoted 1 line

Actually I think it may be even simpler, although I've not tried it. If

hvm_domain_initialise() pauses the domain and the first hvm_ioreq_server_enable() unpauses it, I'm hoping that may be enough.

Quoted 1 line

You do need to keep the PVH case in mind here.

Yes indeed. My test patch does not do the extra pause for PVH.

Actually one thing that's in your patch series does 'help' a bit. The folding together of the has_dm check and the IO completion means that at least hvmloader gets back f-s rather than 0-s for the emulation that doesn't hit :-/

Paul

Quoted 23 lines

-Don Slutz

Quoted 7 lines
Quoted 5 lines

Longer term I think we still need to fix the domain creation interlock for launching multiple qemu's, ioreq servers and any other type of service thing we might launch (whether in a stub dom or not), at which point we may be able to remove the above workaround too.

Yes. Once the toolstack is aware it can keep the domain paused until all

emulators report readiness.

Quoted 12 lines

Paul

Quoted 3 lines

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel