From patchwork Wed Oct 18 23:31:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735181 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1258844wro; Wed, 18 Oct 2023 16:34:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHF4jyVCchDsOFqbGndPkXbuGTEnmEKO5HD56ML+JODHDmf1ANY1Q+nRa1xE9EgS/7TKv3i X-Received: by 2002:ad4:5d6e:0:b0:66c:e3b2:13f4 with SMTP id fn14-20020ad45d6e000000b0066ce3b213f4mr651339qvb.65.1697672063881; Wed, 18 Oct 2023 16:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697672063; cv=none; d=google.com; s=arc-20160816; b=lAaj2EVH0ddcAuhiKLMs+AA9VWOWRd7u2pPeKMJ7KWWvCFthqRWw3DoHbbiroFtGHM 3BPlhcXreRs1FgJ+h7hWzkKumAc9dSAd8Uq1cGJtDWipa2S3vhVLmcEYxg+HjvafiXjG nxwElHY3xzVg+rRoTf6yWPPlDb2i77uiRCUmpjzUt4lRehzp2X4mr8NlSI0JUrRg/18g PhXjrFslDqSuw7d4M62EFHPe4h1tpOOo6KRZpbsfVIDTejXW60OR96Vebs1FpPq+YZ81 Q+hICBguyxeK7bkUNK3J06piA/8XX9lat1RKpnb8AN8Y3HPrP4hGGymF9mZhqj2n70+O 9oUQ== 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=KeKGrdrxTYoWvojPluBjviNWq1U0AbGSCGNtTdLurtI=; fh=XdZcuDF0lIDVBff2CYkB4/gQzRNs362lYRoE1KF8IAU=; b=O3gig6YrH7uE8L1miHYR/CuUNslQTPZ53GGBTpCgW4ufXxcgFSsWAQfK+7XjIWlnpX iA8KysUyXiRhVNgTXRZufVL7Q+ATuWlh2nWqKUcRl7tpuEBzaY9vzJuGFwXRjCL0sYN4 i51GLOGOiPiDMOB7VB3bQxw/3zsThFnLuqo9Bd6iRa+4Gg20fNBjknY3K8G2L9vjYynh nzUmWi34PGkgPcgaT/CYXzCdkM2W5ONR0Ei6Sp0o2F8GYPXkNFlJwv0S8BIyxmq47/hH IHo3aXDG2TDK+6riklSr22dWU1kdJ+DUlMzYC+KZ2uXnHECEQYeIA5QNIyhoM0yN3Ns2 ZMwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RjcgIrZ4; 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 ev19-20020a0562140a9300b0063d456fcd44si713799qvb.515.2023.10.18.16.34.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 16:34:23 -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=RjcgIrZ4; 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 1qtG0u-0003wH-CU; Wed, 18 Oct 2023 19:31:44 -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 1qtG0s-0003fx-Df for qemu-devel@nongnu.org; Wed, 18 Oct 2023 19:31:42 -0400 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtG0p-0000I4-TU for qemu-devel@nongnu.org; Wed, 18 Oct 2023 19:31:42 -0400 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-3575287211bso27379195ab.1 for ; Wed, 18 Oct 2023 16:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697671899; x=1698276699; darn=nongnu.org; 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=KeKGrdrxTYoWvojPluBjviNWq1U0AbGSCGNtTdLurtI=; b=RjcgIrZ4kB5mPpL2skFbOjOpDzAVP4HGYyuYWAQTyacyOLElsoIBi6XQ9cjbvV8MEy cOCHFbNhvG3HPlW+7Gdw4HRds5iYEAF3pI+n7LAVrLN9xTmVbp8Qmtc2DTKY23xxGrn7 ACXcaZxKhKuGq6wJORMme9JVCPltiqr3OtB0a7Y2MLAN4XF4xGHSa9B5vz3r8+lb5q2M /LQnOqp1ByiHre1Ov5qYl2j9/XrLOtvCFDZSFdpHuycrdFFogTb/rrzgnva7L1j8vjeF Wd0FrvMSSt19jC0+4pCBVyxs2mcefA0x1gAlHEUAz7Ew0KWdp6K0b3twhFRfETwsBKU9 ckrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697671899; x=1698276699; 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=KeKGrdrxTYoWvojPluBjviNWq1U0AbGSCGNtTdLurtI=; b=xOKSAOc2HvHgByr7s0wMX07wfBaanj8Vf5f5YNJFv+Un/bzo1ZkPWJBAxEMRLoxmzF LHC0c/V6odnCw3elcz/Z7+esQDwFiGSqZ6BGt0yjsnkE+d+aObL88AHVgAIjq9FwZWTJ ujac3VdweoaG7UkS3RTObvALIShEfalPKQTeKzsmRhC1gyG/0ZDAl3vSpf/R+f2lGJGG lF8c/+SxRISBuz3W5Z+1g5vdYwjPK8QUNIGfKp6JYZJZsWokGSVR5ghMoU5/yPBchHBB W11/w6AqX8DMWvZqCAVLI3yrcpA8OkOHa5JvoZnJfY+3TXQp9eLVqz2N01OoEB/dKA5+ 4emg== X-Gm-Message-State: AOJu0YzPXdSpgQ7FrMh9chLmYlHV8T/8FS2yEEMnBCtPp/kwZlrVGQp0 tv2fnw1i6CXnlMLsxdE9G0f4vmNRR3KsXnnq1tQ= X-Received: by 2002:a92:c262:0:b0:34f:a4c5:8eca with SMTP id h2-20020a92c262000000b0034fa4c58ecamr999999ild.27.1697671898776; Wed, 18 Oct 2023 16:31:38 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id g9-20020aa796a9000000b006be5af77f06sm3881690pfk.2.2023.10.18.16.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 16:31:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Jiajie Chen Subject: [PULL 04/14] linux-user/elfload: Enable LSX/LASX in HWCAP for LoongArch Date: Wed, 18 Oct 2023 16:31:24 -0700 Message-Id: <20231018233134.1594292-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018233134.1594292-1-richard.henderson@linaro.org> References: <20231018233134.1594292-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::12c; envelope-from=richard.henderson@linaro.org; helo=mail-il1-x12c.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 From: Jiajie Chen Since support for LSX and LASX is landed in QEMU recently, we can update HWCAPS accordingly. Signed-off-by: Jiajie Chen Reviewed-by: Richard Henderson Message-Id: <20231001085315.1692667-1-c@jia.je> Signed-off-by: Richard Henderson --- linux-user/elfload.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 213fd3e584..2e3809f03c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1237,6 +1237,14 @@ static uint32_t get_elf_hwcap(void) hwcaps |= HWCAP_LOONGARCH_LAM; } + if (FIELD_EX32(cpu->env.cpucfg[2], CPUCFG2, LSX)) { + hwcaps |= HWCAP_LOONGARCH_LSX; + } + + if (FIELD_EX32(cpu->env.cpucfg[2], CPUCFG2, LASX)) { + hwcaps |= HWCAP_LOONGARCH_LASX; + } + return hwcaps; }