Re: [PATCH 1/3] xen: check required Xen features

From: Juergen Gross
Date: Mon May 10 2021 - 09:29:47 EST


On 10.05.21 14:11, Boris Ostrovsky wrote:

On 4/22/21 11:10 AM, Juergen Gross wrote:
+/*
+ * Linux kernel expects at least Xen 4.0.
+ *
+ * Assume some features to be available for that reason (depending on guest
+ * mode, of course).
+ */
+#define chk_feature(f) { \
+ if (!xen_feature(f)) \
+ pr_err("Xen: feature %s not available!\n", #f); \
+ }


With your changes in the subsequent patches, are we still going to function properly without those features? (i.e. maybe we should just panic)

Depends on the use case.

XENFEAT_gnttab_map_avail_bits is relevant for driver domains using
user space backends only. In case it is not available "interesting"
things might happen.

XENFEAT_mmu_pt_update_preserve_ad not being present would result in
a subsequent mmu-update function using that feature returning -ENOSYS,
so this wouldn't be unrecognized.

So panic() might be a good idea in case the features are not available.

(Also, chk_required_features() perhaps?)

Fine with me.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature