Skip to contentSkip to conversation

PV driver compatibility

PATCH Ky Srinivasan 2 participants 2 messages Jan 21, 2010 – Jan 22, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

On 1/21/2010 at 3:38 PM, in message

< [email protected] >, Ian Campbell

Quoted 11 lines · < [email protected] > wrote:
Quoted 3 lines · Keir Fraser
Quoted 1 line · Ky Srinivasan

The attached patch fixes what I believe is a typo and permits guests

running

Quoted 6 lines
Quoted 3 lines

the latest PV drivers to correctly interact with older back-ends.

Ian,

Quoted 8 lines
Quoted 1 line

You introduced the magic port value check, in xen-unstable:19964.

I'm guilty of pretty poor changelogging there, aren't I, I've no idea how the unmodified drivers part of the change relates to the comment :-(

Quoted 1 line

Can you ack/nack this please?

What vintage of older back-ends are we talking about?

We shipped sles11 on xen-3.3.1 and this is where we encountered the problem - hosting a sles11 sp1 (based on xen-4.0.0) guest on a sles11 host.

Quoted 4 lines

What is their behaviour when reading from that port? Can we test for a specific value instead of anything != MAGIC or is there some other way to identify them?

Looking at your documentation for this new protocol, I recall seeing that if the magic value was not read, it was ok to silently return to be compatible.

Quoted 6 lines

Without some sort of unplugging mechanism we run the risk of having both PV and Emulated disk controllers active, accessing the same virtual disk and with drivers loaded in the guest, which is potentially very dangerous for the user's data. Did those older backends implement some alternative unplugging mechanism we should be trying?

We have had a mechanism for disabling the emulation when the PV drivers are loaded for some time now.

Quoted 5 lines

The whole point of this magic check is to ensure we are running on a backend which is new enough to do the unplugging in a safe way, so I think failing to switch to PV and sticking with emulated on such platforms the safe approach.

This breaks the compatibility with systems that have already been shipped in the sense we cannot run the guests with PV drivers. The proposed patch fixes the problem.

Regards,

K. Y

Quoted 9 lines

I'd suggest that this issue should be fixed by backporting the backend support for the safe unplug protocol -- I don't think the patch for such minimal support is that big or risky. Failing that perhaps it could at least be something you need to explicitly ask for if you have somehow verified that there is no danger of the emulated and PV backends trampling each other, e.g. via a frontend module parameter.

Ian.

#2 lore raw
Quoted 20 lines · Ky Srinivasan
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

On 1/21/2010 at 3:38 PM, in message

< [email protected] >, Ian Campbell

Quoted 16 lines · < [email protected] > wrote:
Quoted 3 lines · Keir Fraser
Quoted 1 line · Ky Srinivasan

The attached patch fixes what I believe is a typo and permits guests

running

Quoted 7 lines
Quoted 3 lines

the latest PV drivers to correctly interact with older back-ends.

Ian,

You introduced the magic port value check, in xen-unstable:19964.

I'm guilty of pretty poor changelogging there, aren't I, I've no idea how the unmodified drivers part of the change relates to the comment :-(

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Can you ack/nack this please?

What vintage of older back-ends are we talking about?

We shipped sles11 on xen-3.3.1 and this is where we encountered the problem - hosting a sles11 sp1 (based on xen-4.0.0) guest on a sles11 host.

OK, so not ancient.

Quoted 8 lines
Quoted 4 lines

What is their behaviour when reading from that port? Can we test for a specific value instead of anything != MAGIC or is there some other way to identify them?

Looking at your documentation for this new protocol, I recall seeing that if the magic value was not read, it was ok to silently return to be compatible.

Which docs? i386-dm/README.hvm-pv-magic-ioport-disable in the qemu-xen tree says:
1) When the drivers first come up, they check whether the unplug logic is available by reading a two-byte magic number from IO port 0x10. These should be 0x49d2. If the magic number doesn't match, the drivers don't do anything.

I take that to mean the drivers should not load if the magic value doesn't match.

Quoted 7 lines
Quoted 5 lines

Without some sort of unplugging mechanism we run the risk of having both PV and Emulated disk controllers active, accessing the same virtual disk and with drivers loaded in the guest, which is potentially very dangerous for the user's data. Did those older backends implement some alternative unplugging mechanism we should be trying?

We have had a mechanism for disabling the emulation when the PV drivers are loaded for some time now.

What is the mechanism? Why doesn't your patch add support for that mechanism instead of just nobbling the current one?

Quoted 8 lines
Quoted 4 lines

The whole point of this magic check is to ensure we are running on a backend which is new enough to do the unplugging in a safe way, so I think failing to switch to PV and sticking with emulated on such platforms the safe approach.

This breaks the compatibility with systems that have already been shipped in the sense we cannot run the guests with PV drivers. The proposed patch fixes the problem.

The guest still work though, right? Just with emulated drivers.

If you add a module option override instead of just skipping the safety latch which the current mechanism implements then this patch would be OK and it would be a simple guest tweak to switch PV drivers back on if you have arranged out-of-band for the emulated devices to be unplugged.

Ian.