From patchwork Tue Apr 25 19:31:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 676851 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp2882570wrs; Tue, 25 Apr 2023 12:48:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZhrYHkGGQtI82sDa1AF2A8AXNno/49ugGbK51JYna4Wv1+dIBA+AUkH5/qFORcDghz8qOD X-Received: by 2002:a05:6214:e84:b0:5fd:7701:88c5 with SMTP id hf4-20020a0562140e8400b005fd770188c5mr34292432qvb.6.1682452120007; Tue, 25 Apr 2023 12:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682452119; cv=none; d=google.com; s=arc-20160816; b=reM+/R81Y/ZgOLGLznvODzYnUHd2+FTQ3BjKE4eixCpKNS+kL8C/CEwwuoi24wMkVP 7k+0WtkYULtlgbKi2NNcqgwHRCNEFtFmEI1qx9WOAzzzJc/pv+tDIlcRJDKxox8811PT /tfW6CCKNygPX0PDcrsSvmMprvw/8peZgevj+lVINcjm+W61y5uOuncqTXrLq+DLBQsX +WLQbNaXVEcf6K/bjraEvwYlt7nAvP5YqHJeENKrtPVuF/cetsH8o/1d8dtKEcJuIXvC kt7xGVuJtkMuVQePIg+5QWtXfp35gdFmi7mYavXH7dxAOy2y5YrBrBUqiWXRpvmKwYwO vp/Q== 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=g0XhypHJuKT2RLCHGyOOS8cpna/MQwPu76GFexENMHE=; b=Vn3FEVtezkyMw/FFQu8gyHnKHzA/JArwzLSgdZQSUlmFDPfwV67JvKZwcfrCfsmGoF 9aekgiIp5JxuC0UNXTb2ZG7eO5+CBdhu/mHXv3ihz80aVNzuwjdsh4z3gTcW27blxedO dybhuote65UprdW836x+YK6lQfJ02USP3B3iydPpTSnSlXVj2Ho+ezp67++p7MYSHqnR JGDRqWhzo5L1ogvQMC/2DMdPMkxaXJ/RirVDTkrZR724I0QlwFetudgCZHaXbonDC05h 0NHsvF16+pZCkjsJXZNftR8hep+HApI2hPyyCXvi7v3tYptVbOhFVUMFmGYJL6CS4OKs 4w6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jY9Pccdy; 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 k14-20020a05620a414e00b0074e325ed7f8si8845775qko.395.2023.04.25.12.48.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Apr 2023 12:48:39 -0700 (PDT) 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=jY9Pccdy; 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 1prOS8-0006Ew-L1; Tue, 25 Apr 2023 15:35:52 -0400 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 1prORp-0005f5-HE for qemu-devel@nongnu.org; Tue, 25 Apr 2023 15:35:35 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prORQ-0005NK-Fj for qemu-devel@nongnu.org; Tue, 25 Apr 2023 15:35:32 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4ec8eca56cfso6845302e87.0 for ; Tue, 25 Apr 2023 12:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682451307; x=1685043307; 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=g0XhypHJuKT2RLCHGyOOS8cpna/MQwPu76GFexENMHE=; b=jY9PccdyiHArO3/JJSCICJ7FGAdsOcrBmmU33RDGy7T3AeAsX3mCVdJYeUHy052XTT FXFJ1d4O7nCxSQCJFC3BMWdxW/D07gQEnomYuof4BHfOriO25C7GurU1Rjo5gi6KzoZF IhIEEdPgF823nEyzy2LX9rYKaoJMtXWGPO1so+BqeX+x56jAXG0w7Dz7KqI+wdKSupwF NtVkltM8XWCQ3bXiUdEm7UCNGNGBvOZ2OGnH8CoLNg6EnWMqXJlZmxp/hp6MVZ0HOUPv 7DutXNFNajw+SHefo8lE4zbiapraLb0hEosaF0Fw+hIc9eHWDS9cXIzGviPHkTuGqAwA vmPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682451307; x=1685043307; 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=g0XhypHJuKT2RLCHGyOOS8cpna/MQwPu76GFexENMHE=; b=Y/4NRA6EAV8SB0D133MlzBXWLRsNHZ/1EmNhmsBw8vTnsmjVLE3vsWEiU6bBUtjqcQ tFXn21D4UKymd/NmcmVnikSGAe+XDZZTGq/uKT86D36VkNnRj+el9l+SAiBqVzYSmahG Ajym/cxwmCJF5EYVHvlHXYaFvvFdfKa+SrE3Cm607/QPB3fnK/lX4IULyzrShSGvDJO0 Ol5ENPrtBnQvP48EvGDPiLxypEYkEU1UBft4UOCFDpdHGFTey2CuWI76UQVuaURjxZMe XCwuITQxI3xukYMB5qH0TK4aRgFWq4y1FJDiTnec+WIdQsIAmjzWHjYdEgl0wOqB/DWH SrpQ== X-Gm-Message-State: AAQBX9cPRkRXraKYDkVqECJlqf7bThiIPd7Bik3yIwUPB+11FdUsfW3J 1LS9xYP0SI8Yd6mSrdz34ca8cCWwJZJ+6oYLkpsbiQ== X-Received: by 2002:a05:6512:374b:b0:4b6:eca8:f6ca with SMTP id a11-20020a056512374b00b004b6eca8f6camr5131335lfs.67.1682451306802; Tue, 25 Apr 2023 12:35:06 -0700 (PDT) Received: from stoup.. ([91.209.212.61]) by smtp.gmail.com with ESMTPSA id z23-20020a2e8857000000b002a8c271de33sm2160484ljj.67.2023.04.25.12.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 12:35:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, git@xen0n.name, jiaxun.yang@flygoat.com, philmd@linaro.org Subject: [PATCH v3 36/57] tcg/loongarch64: Assert the host supports unaligned accesses Date: Tue, 25 Apr 2023 20:31:25 +0100 Message-Id: <20230425193146.2106111-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230425193146.2106111-1-richard.henderson@linaro.org> References: <20230425193146.2106111-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=richard.henderson@linaro.org; helo=mail-lf1-x132.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 This should be true of all server class loongarch64. Signed-off-by: Richard Henderson --- tcg/loongarch64/tcg-target.c.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc index e651ec5c71..ccc13ffdb4 100644 --- a/tcg/loongarch64/tcg-target.c.inc +++ b/tcg/loongarch64/tcg-target.c.inc @@ -30,6 +30,7 @@ */ #include "../tcg-ldst.c.inc" +#include #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { @@ -1674,6 +1675,11 @@ static void tcg_target_qemu_prologue(TCGContext *s) static void tcg_target_init(TCGContext *s) { + unsigned long hwcap = qemu_getauxval(AT_HWCAP); + + /* All server class loongarch have UAL; only embedded do not. */ + assert(hwcap & HWCAP_LOONGARCH_UAL); + tcg_target_available_regs[TCG_TYPE_I32] = ALL_GENERAL_REGS; tcg_target_available_regs[TCG_TYPE_I64] = ALL_GENERAL_REGS;