From patchwork Sat Jan 7 07:50:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 640079 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1177622pvb; Sat, 7 Jan 2023 00:04:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXvDVsu6vlZYH2ryRPROCoQ1LMY0oW+MlHVRr4T7zLvIpZysOQuAMqhb/S6bGHVvceGUTiOy X-Received: by 2002:a05:6214:418d:b0:532:2141:e5ea with SMTP id ld13-20020a056214418d00b005322141e5eamr5649337qvb.25.1673078685654; Sat, 07 Jan 2023 00:04:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673078685; cv=none; d=google.com; s=arc-20160816; b=fCJiXSNzt4IKf5IcQXx5aBN46aJWsMmULEdHqIwJ9d9icsMCv0oPsqO+7so5P7hBRm 23SPIQfl59OOUd9pszbSdoI0BPJyOQmkYpgajkrkwT459OV8Rs/SThoxT7xCPPK8ev73 Uqzbgim9alYRJwr/sIBV9LfgFA7sPLeOh/epEdirvLhy5TU8B0HVadkBoDHm0pprNMQJ OaNubUfi0lI3gpeevKY5ivXNNIzTQby8SfcsvVSybUxzmiSAEWe/3Vxk27cpcGfVKmbU eYLnOLTEl5zk738dnv2B84kcoP+e8FsFSKUZUJf6Ag/K6S15gUjFZXrv8iJebkWo+OlX uGJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3O5Ms/RtpTraGLeGvCx1Y/nQAb5S+FqNP9jL5oxLexo=; b=nkg4ElX1UPXSkWWI6l3WtFzgcHmk3s10WW4Jfl70jGyEUQZZwYc4D+LELBRpX7RpYG XrLkRQf/TdgO7I23nUZwzHME+mWNPV49Agt/JSsDifPDGfIKu3HcYwhgeUCK4WT53a6q f7uXGHMGXJ1H5z8hE3a4/mSvKzFOtnlmS4FyLTeMArS4JxZq3thVm+Yoypxq81MBRX+k uaVe+ZAGA36hiMhS5hTSmfaZIYs03E95eNk1b9nyVQ+yUQPowL9Bjo30tn/ji7tAanMe n2cMu/HRXU9bTlTEL9qgL84M6Z3Vh4IA4y2CvelAiELRS1IkI3wpX2xhJ7oZn/6nQQxN taPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HicwfyeX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 7-20020a05621420e700b004c6d74d313dsi1876746qvk.351.2023.01.07.00.04.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jan 2023 00:04:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HicwfyeX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pE3zP-0003iE-74; Sat, 07 Jan 2023 02:51:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pE3zG-0003eP-7H for qemu-devel@nongnu.org; Sat, 07 Jan 2023 02:51:31 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pE3zD-0004Ao-2q for qemu-devel@nongnu.org; Sat, 07 Jan 2023 02:51:29 -0500 Received: by mail-pj1-x1032.google.com with SMTP id l1-20020a17090a384100b00226f05b9595so2111041pjf.0 for ; Fri, 06 Jan 2023 23:51:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3O5Ms/RtpTraGLeGvCx1Y/nQAb5S+FqNP9jL5oxLexo=; b=HicwfyeXjZE7cdKrE90Z3AXtdlYNPSVj+vru/RNVnIjQUTDgjJzpdgXA/Qa08y7BVn 76Vy3yj85zL0NSXU4Y9ZkSRlgkTrAeIQy/XMx9Mq9/cOUaL9NE3PGTF5Rc6Tbaye/Rt+ qZLwGvVnC70/IYm8qIO23A249YhemxzEKDnhWnbeAQMT643AsuwJl4ra5cFvlhHaiutd vKbpyKcicBiTYk6lAs394psfmXE/iOYKsar1sTQFCqD80EhFxp2SYtVmYTSfENTXYC9N +hwpc09fzUsRPIMLCivwJAr+IghwrGNyXR8GjwHurmd6Hi3GpC6u4sGc0KK+MMdni18l uX3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3O5Ms/RtpTraGLeGvCx1Y/nQAb5S+FqNP9jL5oxLexo=; b=TNrZZRHCbpRk/w+Uk1wt70opdWeVfGHoPQFtpzk0OYT+9vAth3KZyqSFUa4/deyqNq TMsri0OgBog6H/i405eLBLuhq9rv/Bw+JM/DIbWo24sZARjCDyme6eaRXd8SoqyRm+kC U4Fs4HtOkRRjB+M4G0mRjmdoA8gkWtD+Gg4LmjfNqRtxdW39Sso+0tE6j3VLKlGbUbQp QeB89ydHuDUJkpVptavp/Sm571vRCYlGdkRvuOh014X97/uZ5qBl991aBGoAlwXDTjgr a/eO0/bCs1+vog8WwMLvzxI/dZJe50PcYluwkPPg5QqrY9yEhbKU6qpmdtdGnMNAmH7l HyUA== X-Gm-Message-State: AFqh2koXuQkmyja8oX3fJmK84SBbqsXWQK4G0YPTsklLDBTq3ozjLJ87 3xs2yy2elSolfu16KQeeAUSyAuVRl3H0Bm/2 X-Received: by 2002:a17:90a:de04:b0:226:c0ff:20f6 with SMTP id m4-20020a17090ade0400b00226c0ff20f6mr10353991pjv.16.1673077884793; Fri, 06 Jan 2023 23:51:24 -0800 (PST) Received: from stoup.. ([2602:47:d48c:8101:9d81:5b04:51d7:acae]) by smtp.gmail.com with ESMTPSA id bj5-20020a17090b088500b00212e5068e17sm1945119pjb.40.2023.01.06.23.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 23:51:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich Subject: [PULL 05/27] tcg/s390x: Check for long-displacement facility at startup Date: Fri, 6 Jan 2023 23:50:56 -0800 Message-Id: <20230107075118.1814503-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230107075118.1814503-1-richard.henderson@linaro.org> References: <20230107075118.1814503-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We are already assuming the existance of long-displacement, but were not being explicit about it. This has been present since z990. Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 6 ++++-- tcg/s390x/tcg-target.c.inc | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 645f522058..7f230ed243 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -52,11 +52,13 @@ typedef enum TCGReg { #define TCG_TARGET_NB_REGS 64 -/* A list of relevant facilities used by this translator. Some of these - are required for proper operation, and these are checked at startup. */ +/* Facilities required for proper operation; checked at startup. */ #define FACILITY_ZARCH_ACTIVE 2 #define FACILITY_LONG_DISP 18 + +/* Facilities that are checked at runtime. */ + #define FACILITY_EXT_IMM 21 #define FACILITY_GEN_INST_EXT 34 #define FACILITY_LOAD_ON_COND 45 diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index dea889ffa1..1fcefba7ba 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -3211,6 +3211,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) static void query_s390_facilities(void) { unsigned long hwcap = qemu_getauxval(AT_HWCAP); + const char *which; /* Is STORE FACILITY LIST EXTENDED available? Honestly, I believe this is present on all 64-bit systems, but let's check for it anyway. */ @@ -3232,6 +3233,20 @@ static void query_s390_facilities(void) if (!(hwcap & HWCAP_S390_VXRS)) { s390_facilities[2] = 0; } + + /* + * Check for all required facilities. + * ZARCH_ACTIVE is done via preprocessor check for 64-bit. + */ + if (!HAVE_FACILITY(LONG_DISP)) { + which = "long-displacement"; + goto fail; + } + return; + + fail: + error_report("%s: missing required facility %s", __func__, which); + exit(EXIT_FAILURE); } static void tcg_target_init(TCGContext *s)