Skip to contentSkip to conversation

feature flags use

DISCUSSION Jan Beulich 3 participants 6 messages Nov 10, 2006 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Following the need to allocate a new feature flag I soon realized that currently there is not even a place to store them - this to me is particularly puzzling for XENFEAT_pae_pgdir_above_4gb, as I would have expected that the CR3 handling in PAE mode gets adjusted according to whether the guest has that flag set. Any reason for that (other than *assuming* that guests without that flag will always pass the low 12 bits of CR3 clear)? Namely, what's the purpose of having the guest specify that flag if it doesn't really change anything?

So, in turn, it seems to me that I'll first have to create a domctl to allow setting feature flags reported by the guest (and manually fill them for dom0), and the tools then would have to follow. The problematic part with this is that this must happen early enough to make sure the hv didn't use any of the flag values, yet - much like the (un-)setting of the compatibility mode flag, and that the hv has to verify the call isn't made too late.

Such a new domctl could certainly be combined with the one setting the mode (native or compat) of the (pv) guest - would that be considered desirable?

Jan

#1 lore raw

Hi,

Quoted 8 lines

Following the need to allocate a new feature flag I soon realized that currently there is not even a place to store them - this to me is particularly puzzling for XENFEAT_pae_pgdir_above_4gb, as I would have expected that the CR3 handling in PAE mode gets adjusted according to whether the guest has that flag set. Any reason for that (other than *assuming* that guests without that flag will always pass the low 12 bits of CR3 clear)? Namely, what's the purpose of having the guest specify that flag if it doesn't really change anything?

Works the other way around: The flags are xen-specfic, not guest specific. The guest has to check whenever xen supports pgd's above 4GB before placing them there.

cheers,
Gerd

Signature · 2 lines
Gerd Hoffmann <[email protected]>
http://www.suse.de/~kraxel/julika-dora.jpeg
#2 lore raw
Quoted 3 lines

Works the other way around: The flags are xen-specfic, not guest specific. The guest has to check whenever xen supports pgd's above 4GB before placing them there.

By itself, this makes sense, but what's the purpose of the guest advertising it supports this via the feature string then?

Jan

#3 lore raw
Quoted 6 lines · Jan Beulich
Quoted 3 lines

Works the other way around: The flags are xen-specfic, not guest specific. The guest has to check whenever xen supports pgd's above 4GB before placing them there.

By itself, this makes sense, but what's the purpose of the guest advertising it supports this via the feature string then?

Dunno. Well, in theory the domain builder would be able to take care then and allow placing the initial pgd above 4GB only if the guest (and xen, but that is implicit due to xen and tools must match) can handle it. In practice the domain builder doesn't.

cheers,
Gerd

Signature · 2 lines
Gerd Hoffmann <[email protected]>
http://www.suse.de/~kraxel/julika-dora.jpeg

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

#5 lore raw
Quoted 4 lines

That flag is treated oddly. Actually we detect if the kernel uses Elf notes or whether it has the string PAE=yes[extended]. In either case we notify the hypervisor via *vm_assist*! This then decides whether or not we advertise the XENFEAT flag to the domU.

I was talking about XENFEAT_pae_pgdir_above_4gb - this flag appears to be be useless.
Also, regardless of whether you advertise support for the feature to a domU, the code inside Xen doesn't treat the two cases (kernel with and without this flag set) differently.

Quoted 2 lines

Anyway, what feature flag do you want to add? Is this to distinguish PV PAE guest from PV 64-bit guest?

At this point I was thinking about that hypervisor_virt_start change that the kernel needs to advertise it can deal with.

Jan

#6 lore raw
Quoted 3 lines
Quoted 1 line

That flag is treated oddly. Actually we detect if the kernel uses Elf

notes

Quoted 1 line

or whether it has the string PAE=yes[extended]. In either case we

notify

Quoted 2 lines

the

Quoted 1 line

hypervisor via *vm_assist*! This then decides whether or not we

advertise

Quoted 3 lines
Quoted 1 line

the XENFEAT flag to the domU.

I was talking about XENFEAT_pae_pgdir_above_4gb - this flag appears to

be

Quoted 4 lines

be useless.
Also, regardless of whether you advertise support for the feature to a domU,
the code inside Xen doesn't treat the two cases (kernel with and

without

Quoted 2 lines

this
flag set) differently.

The xc_linux_restore code in the tools library needs to be able to read the feature flag from Xen.

Ian