Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp556346pxy; Thu, 22 Apr 2021 08:11:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWwgBQ4Y1M0xgAQ7oFMaRFMHKW8fL2bIhnEsSGTrtWbbS130r4xD+eVBrPPfSxlNpG/2KK X-Received: by 2002:aa7:db9a:: with SMTP id u26mr4417816edt.292.1619104313870; Thu, 22 Apr 2021 08:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619104313; cv=none; d=google.com; s=arc-20160816; b=0dL61VIuEWLLKhCpVyEkq8LcbdMK/c9BuXuzjOIWyyXUYu5tcTVXkYzORGjuJT1De8 pWirWRw6ivWJWhsfNIjHBcpT41VZ4/6k4+VIPPTgD95nTzxHHabnMsuaIAmKsiFX8qku rGDBXqF10BoBVts+6XFoRfhXl735V+nvMeyKr22w/kjomE5Em54RsDBnDWTnJf16Vrbh 1WbTEU/3vmWqtwumfv89Dpq+996T+FlIfSoEkQFKWAuk0zrwilAkJFMCDrjgwOpx8VYj 1wdnOTmY2MvE5STJjCukjZeqf+YQqorWMCVVUqkzZ0XmHjX/cFEVlwb9c/SZRqLhfSPi GUnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dGYTI5hb6XF/TrVV+tK4E4xlOyG7i9BsqrnGlynZSJM=; b=MYBsi6HnDUShY1Vurgt6RX/v6CqiYgjGOmFGMRtsBnvT2Cs+mPR9D4CJQDFx91JXtH Q2HNmlpxYIZI8bYVc5mSv4fDMtLGFxHQmw9yFW+fiLfOqBwLXg44giY327PhfH4qboxF 14n2CDjED3doFpdfArq20xYYesLy6i5BlQEk592XOOKJN/3DFjYz/J11JnLY58AXis94 VXPK+N6oFWSoTII75HyeDgT0M5Nl99PTmNW2IoI1g4Fy/pXDYgHQ7OWZEAjRMmwZuy36 DZUItCVF5MMJ3TmbJr50iY7jm+2lCiw+dNhe1TE2BUXl2HivgULxDEWp0AoK2P4tKo7i qmgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rkqpNHxQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si2469791edw.212.2021.04.22.08.11.30; Thu, 22 Apr 2021 08:11:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rkqpNHxQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237474AbhDVPKv (ORCPT + 99 others); Thu, 22 Apr 2021 11:10:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:51992 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236563AbhDVPKq (ORCPT ); Thu, 22 Apr 2021 11:10:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1619104211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dGYTI5hb6XF/TrVV+tK4E4xlOyG7i9BsqrnGlynZSJM=; b=rkqpNHxQEq8IWYLVp0llAxNQCop0wQDhH19sDYwFQ1gk0VAjV4ZLRAnd/O5DophQu1UYRk pEiSJ2EiOmjVHzPlg2XnZBk5IWyblvtmK0qwMpFZl7499bg6QnKLQwCytl7FzyMM9fxSya SXO1bDbx/20HgyDjak27WeKH3lnP8Hs= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E9411B16D; Thu, 22 Apr 2021 15:10:10 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , Peter Zijlstra Subject: [PATCH 1/3] xen: check required Xen features Date: Thu, 22 Apr 2021 17:10:05 +0200 Message-Id: <20210422151007.2205-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210422151007.2205-1-jgross@suse.com> References: <20210422151007.2205-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linux kernel is not supported to run on Xen versions older than 4.0. Add tests for required Xen features always being present in Xen 4.0 and newer. Signed-off-by: Juergen Gross --- drivers/xen/features.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/xen/features.c b/drivers/xen/features.c index 25c053b09605..60503299c9bc 100644 --- a/drivers/xen/features.c +++ b/drivers/xen/features.c @@ -9,13 +9,26 @@ #include #include #include +#include #include +#include #include #include #include +/* + * 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); \ + } + u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly; EXPORT_SYMBOL_GPL(xen_features); @@ -31,4 +44,9 @@ void xen_setup_features(void) for (j = 0; j < 32; j++) xen_features[i * 32 + j] = !!(fi.submap & 1<