From patchwork Wed May 3 07:06:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678769 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp915434wrs; Wed, 3 May 2023 00:45:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7o1gqavIqS0QkW38Qp/k27UZqm+Y+4O7urPTAbAs9A8Eo2uIYccUEIrH8aBcOQHl8qVqE0 X-Received: by 2002:a05:622a:308:b0:3e4:d889:bc63 with SMTP id q8-20020a05622a030800b003e4d889bc63mr30458046qtw.35.1683099917260; Wed, 03 May 2023 00:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683099917; cv=none; d=google.com; s=arc-20160816; b=RDym7IzJ4TRfggEpQtHwrjwIc4/c1jPdABBhBvLfQwUbj5Az6TQBwRxnaoEj5qbvI2 uiKnfKenP0POh26bJfsmWo83ZrwqrGsnENEEgQKUVPowVIWqtRT50YTWKr+1Os97Hm9F lqDN/Rkr1Wh29Gopnq/yGoOn6P4xeoXA/X2juS0nVkoiuRkx6DXtwFG3zVJuPsPBnMZw tAuoKGpa7iWwHMLnLQyl6xgyx2YViM4OoJCXlWBJJA9omTU0YpkGh5ymD+tQXiPV2dBK WZmz9tb5WC1AV2gceBbcF+MmqbfdOgudTnAMaKSamdOmnMILPgmXbYH509sNc1fhPV8F UhUw== 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=aAyn23NNKwO/1XsRHskmfzd2MQvBg6cAe9fh2Cc0YQvfzSuGVUJb8A2I+dJ9EBkT9t 14rQ3q2xfaMBgHFii8VcWK7z16GdeyehxPY2EdHxKzXJS3SldlPgm5c4odhC4xbuOZB8 wxI22xsxQakjiyW/B1fk+U+qLImZH3RZvusCFt81ZhevKzk614UgMC8eQFv69yyztwrZ 4cRpkFgCl3HzGYgJgM1iYkyKqsTPWrSCyBCtc9PWBzri5FFeJm07GP0ILbu9ZU0tC0RB tM/2KVO5oM1jnYeXx8MOjp/Zar2ZoqRR1od+JKX0o10Dv+sNgKK66zwms/Y0QwzsDqFc tixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CO0Sw3lt; 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 v5-20020a05622a144500b003eed110305asi18549866qtx.723.2023.05.03.00.45.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:45:17 -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=CO0Sw3lt; 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 1pu6bn-0004nl-Cm; Wed, 03 May 2023 03:09:03 -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 1pu6am-0008FD-Pe for qemu-devel@nongnu.org; Wed, 03 May 2023 03:08:02 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6aE-0005qN-Sw for qemu-devel@nongnu.org; Wed, 03 May 2023 03:08:00 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f1728c2a57so47627065e9.0 for ; Wed, 03 May 2023 00:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683097645; x=1685689645; 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=CO0Sw3ltI+LRP4jx8Sqcg7I/yQ9ZmMrVpTIL7MErWesdzwUdYs8CFLkEwMpecXxhgL hW6J1wQrEAHyIDwYHd+UMWEqR691ODuMDVugiZTf3v1mz+tU3k46xGq/xsswx8XOTK4s F869utksGgjQDdnKRb8HTgml/Dgj+RJnBhcuujUBc7ioIIdeIbm3vsoEapBuWZbnGCu4 n2C/ln00C+GetzoLzEYzS6FtNT3Q+wgZq3QaLlnBawcL8sTM0XqM7tYcJTlLa/y92ppU 2Jn8k1tpbmMZeDrJENpog13oTS0wNLcfgaPVRaIBWZohvuD30aw3O8Dg6knSNbsR0taZ d7ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683097645; x=1685689645; 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=ZYQUtMm7ax8u2m/WnLT63cgSr2DNtooeig4Vlalb4yLGx8MSSeyg/VGhmoUSsy61C7 r+ageIoIL+YalaVfwGxUvGym7YQgdFLsUTs0nxSfMhYShuD0GZtLlTOOvZnf5w7g463N LHmKKt5MfI7TC3GSOw17fOBr1Yr5hoUEBigX1KagKaciO9Gti0bcRK98ovkwsahsjvro pIa2bfcMazKMzyPBTQUSGnE+K21MSRFwEGbsclR/1flfdSjCmU6xnj7gYOTn6VHdbWBK cdV47fevNBNHJYdksVQNzyAGpJIkGEiYy9r6ZyEKt+fQhjBYZEZfT4TdhXh8SZ6SkZqh rQFw== X-Gm-Message-State: AC+VfDx87GiO/gusAypeLVo577l03Ux2c7ZCzdxfpb02MDxYrQnk6Qp3 0rLUhJNeGVvF9x2xsfyaAFRDsVMpupySY4kQBZX13A== X-Received: by 2002:a1c:7502:0:b0:3ee:36f:3485 with SMTP id o2-20020a1c7502000000b003ee036f3485mr14848011wmc.8.1683097644870; Wed, 03 May 2023 00:07:24 -0700 (PDT) Received: from stoup.Home ([2a02:c7c:74db:8d00:c01d:9d74:b630:9087]) by smtp.gmail.com with ESMTPSA id q3-20020a1cf303000000b003f3157988f8sm921184wmq.26.2023.05.03.00.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:07:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: git@xen0n.name, gaosong@loongson.cn, philmd@linaro.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH v4 36/57] tcg/loongarch64: Assert the host supports unaligned accesses Date: Wed, 3 May 2023 08:06:35 +0100 Message-Id: <20230503070656.1746170-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503070656.1746170-1-richard.henderson@linaro.org> References: <20230503070656.1746170-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32d.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;