From patchwork Mon Jul 1 16:07:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808833 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649392wrr; Mon, 1 Jul 2024 09:08:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVHKOhISZUWF5ncphkGVsbXS6qHKcRaKvV9UDX84Iry8y+ab4Fj0PoahQgdDP16sitUeJ721sdE5ZEFgmBPmULK X-Google-Smtp-Source: AGHT+IFZ5LZpreXRiznikYCP5Ap7RfdCB1pTI9aPFAU3SKNLM9eQdL4GtFAwN1LcRmGq1GAueYZe X-Received: by 2002:a05:6830:3d17:b0:702:1deb:4bc9 with SMTP id 46e09a7af769-7021deb4e34mr926304a34.28.1719850106472; Mon, 01 Jul 2024 09:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850106; cv=none; d=google.com; s=arc-20160816; b=xq8wjgdSQhDSCSn8nAQKEnpuiK85/BNa5myLXz43EKVnkd6L3zX4VnwVzQrs9bvbGg SiIfdzJSyn1+KnNAU80lQDh3I/qp6pSR9jqNrA44GhBUTUpwqFqR96vk//GseLOooqff 5cmQx72NT1CKt2CaBoFYhW0Yx2LPlmW1gPjy5+Be/lr0I5orZPZzjAT1wE4s1g48DS+d MJPlhOKVwnIiUv+pKQoAxkfxb7sIets/esActmF+XoAtTsxXoO1UPF+ILKzkmvgZuwl+ DxzENCAjBx4geYxcLxqow5XlvhBzcq76l9wM6N6mfhEoHrzZS1Uq0iDsUIvjOJJAI+3N 66xw== 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:to:from :dkim-signature; bh=DEL1nYqcktgvW/KVYnuY/WYje2WQ4Eqs61dE2s1g5tU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=w9msTRfRflsn/2i2OjXu+Jm/NUQjg0QLgSotLs0gfcSZN/Ctqm/8N2AVsBAW7C/5Ie mPAcPchzVH8hkhwo999FCNFNnoV0Nr9tb7Z74sr4jBcJj4XWHwLBnT1eT7R7l755LO8H Jzgizl2pwXLjDIzBwOlct9RUmDKj0wJf96+nXTF4vjfG3ZZ041GaBlV3DWYuIBWfP03j lm77fzOgiuoaKIWuE7occYofnMiJZUjbXuylqX3PPGqjytIDddzOMvwxU5VALgFVSRni VMQALb2XBPnTN5cz1NL9vRukuOsAdWLcwyFgRNQ7B2IK13flb8Z1mZUx5iCi9/7DggcY V8Yg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NgeeOT3A; 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 ada2fe7eead31-48f9b18c4adsi1109409137.175.2024.07.01.09.08.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:26 -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=NgeeOT3A; 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 1sOJZL-00012d-Uo; Mon, 01 Jul 2024 12:07:56 -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 1sOJZ2-0000eA-Qe for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:37 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJYy-0005PT-Oh for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:36 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2e72224c395so35569421fa.3 for ; Mon, 01 Jul 2024 09:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850051; x=1720454851; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=DEL1nYqcktgvW/KVYnuY/WYje2WQ4Eqs61dE2s1g5tU=; b=NgeeOT3ANjWyMO8fT8Hqo8DRFnGbg+y6+/I0Vf6AZrMamHz+9FyoPTzcTzwPwjqbBE Gp7J40lqkkAY2lzV3Ml/OsWjma+ZvzlXTDoeSuXJYaNHVNiUgTu6R+168OmOixukF6La +vRh2CsoV2zVX1SMOk1BR8yUo+E44b01aBXl7O2Vu4gYMwT51Mokr/KRd9XL++cYysBl NGtgia0AP07yqIDzXZQ1c1zf2moF2QDNzsCIqNhF/msjJnC0OpbDbbXz/MkfxqjeZn2S ECYIC1/ZL4RidELKODngZhqC2zVtvr7eUh5oU3xIkyULO8zN4MgXQA5yNmnbt8Xwzp7j rjYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850051; x=1720454851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DEL1nYqcktgvW/KVYnuY/WYje2WQ4Eqs61dE2s1g5tU=; b=Kq2jjL9xcKe3zx4w3a0aZ/1OUwWi49QOWAWlecBwSwxPwSGzxHjv1pFSWzKFz59PzR lbIycYJhb/jx9AujtsSi6SitUf8R/hRujvqlncVdoRdBAyghOaxaHXDZp5ug+SySLsTE UFzQf+UrEldYJDxXTjqxZtg/9BqDkLPbxjOcG018d7SG0Z7AwdoqSfkb/gPVBEC159Og 4drDtBrcnIFBmmz7P+hy1f4oAmimME+PbX5GjkmQiqZNKq5zTP1df5CH1yi9aZa3OZoS AkXQDGBOOjr79cdUL+dSLB3r/MS89XOdSzpKAETSqqALb4EBguzv31Le2UF9f8wk7bGd fR7w== X-Gm-Message-State: AOJu0YxS98VtJc6JQPe0KffwXI1pzxudOzn76gCi55+oEycyMVD/D+8+ TBsxJr1R9d1FqgvD3zzk4o/mROCXPL4wrORNgkaWSKCuFx/qy0CKajPNxAqS06yB0ZOGdzIam5X bU8s= X-Received: by 2002:a2e:300e:0:b0:2ec:616e:1c92 with SMTP id 38308e7fff4ca-2ee5e337980mr39436591fa.2.1719850050705; Mon, 01 Jul 2024 09:07:30 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:30 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/29] hw/nvram: Add BCM2835 OTP device Date: Mon, 1 Jul 2024 17:07:01 +0100 Message-Id: <20240701160729.1910763-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x235.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: Rayhan Faizel The OTP device registers are currently stubbed. For now, the device houses the OTP rows which will be accessed directly by other peripherals. Signed-off-by: Rayhan Faizel Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/nvram/bcm2835_otp.h | 68 ++++++++++++ hw/nvram/bcm2835_otp.c | 187 +++++++++++++++++++++++++++++++++ hw/nvram/meson.build | 1 + 3 files changed, 256 insertions(+) create mode 100644 include/hw/nvram/bcm2835_otp.h create mode 100644 hw/nvram/bcm2835_otp.c diff --git a/include/hw/nvram/bcm2835_otp.h b/include/hw/nvram/bcm2835_otp.h new file mode 100644 index 00000000000..1df33700bde --- /dev/null +++ b/include/hw/nvram/bcm2835_otp.h @@ -0,0 +1,68 @@ +/* + * BCM2835 One-Time Programmable (OTP) Memory + * + * Copyright (c) 2024 Rayhan Faizel + * + * SPDX-License-Identifier: MIT + */ + +#ifndef BCM2835_OTP_H +#define BCM2835_OTP_H + +#include "hw/sysbus.h" +#include "qom/object.h" + +#define TYPE_BCM2835_OTP "bcm2835-otp" +OBJECT_DECLARE_SIMPLE_TYPE(BCM2835OTPState, BCM2835_OTP) + +#define BCM2835_OTP_ROW_COUNT 66 + +/* https://elinux.org/BCM2835_registers#OTP */ +#define BCM2835_OTP_BOOTMODE_REG 0x00 +#define BCM2835_OTP_CONFIG_REG 0x04 +#define BCM2835_OTP_CTRL_LO_REG 0x08 +#define BCM2835_OTP_CTRL_HI_REG 0x0c +#define BCM2835_OTP_STATUS_REG 0x10 +#define BCM2835_OTP_BITSEL_REG 0x14 +#define BCM2835_OTP_DATA_REG 0x18 +#define BCM2835_OTP_ADDR_REG 0x1c +#define BCM2835_OTP_WRITE_DATA_READ_REG 0x20 +#define BCM2835_OTP_INIT_STATUS_REG 0x24 + + +/* -- Row 32: Undocumented -- */ + +#define BCM2835_OTP_ROW_32 32 + +/* Lock OTP Programming (Customer OTP and private key) */ +#define BCM2835_OTP_ROW_32_LOCK BIT(6) + +/* -- Row 36-43: Customer OTP -- */ + +#define BCM2835_OTP_CUSTOMER_OTP 36 +#define BCM2835_OTP_CUSTOMER_OTP_LEN 8 + +/* Magic numbers to lock programming of customer OTP and private key */ +#define BCM2835_OTP_LOCK_NUM1 0xffffffff +#define BCM2835_OTP_LOCK_NUM2 0xaffe0000 + +/* -- Row 56-63: Device-specific private key -- */ + +#define BCM2835_OTP_PRIVATE_KEY 56 +#define BCM2835_OTP_PRIVATE_KEY_LEN 8 + + +struct BCM2835OTPState { + /* */ + SysBusDevice parent_obj; + + /* */ + MemoryRegion iomem; + uint32_t otp_rows[BCM2835_OTP_ROW_COUNT]; +}; + + +uint32_t bcm2835_otp_get_row(BCM2835OTPState *s, unsigned int row); +void bcm2835_otp_set_row(BCM2835OTPState *s, unsigned int row, uint32_t value); + +#endif diff --git a/hw/nvram/bcm2835_otp.c b/hw/nvram/bcm2835_otp.c new file mode 100644 index 00000000000..c4aed28472b --- /dev/null +++ b/hw/nvram/bcm2835_otp.c @@ -0,0 +1,187 @@ +/* + * BCM2835 One-Time Programmable (OTP) Memory + * + * The OTP implementation is mostly a stub except for the OTP rows + * which are accessed directly by other peripherals such as the mailbox. + * + * The OTP registers are unimplemented due to lack of documentation. + * + * Copyright (c) 2024 Rayhan Faizel + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "qemu/log.h" +#include "hw/nvram/bcm2835_otp.h" +#include "migration/vmstate.h" + +/* OTP rows are 1-indexed */ +uint32_t bcm2835_otp_get_row(BCM2835OTPState *s, unsigned int row) +{ + assert(row <= BCM2835_OTP_ROW_COUNT && row >= 1); + + return s->otp_rows[row - 1]; +} + +void bcm2835_otp_set_row(BCM2835OTPState *s, unsigned int row, + uint32_t value) +{ + assert(row <= BCM2835_OTP_ROW_COUNT && row >= 1); + + /* Real OTP rows work as e-fuses */ + s->otp_rows[row - 1] |= value; +} + +static uint64_t bcm2835_otp_read(void *opaque, hwaddr addr, unsigned size) +{ + switch (addr) { + case BCM2835_OTP_BOOTMODE_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_BOOTMODE_REG\n"); + break; + case BCM2835_OTP_CONFIG_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_CONFIG_REG\n"); + break; + case BCM2835_OTP_CTRL_LO_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_CTRL_LO_REG\n"); + break; + case BCM2835_OTP_CTRL_HI_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_CTRL_HI_REG\n"); + break; + case BCM2835_OTP_STATUS_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_STATUS_REG\n"); + break; + case BCM2835_OTP_BITSEL_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_BITSEL_REG\n"); + break; + case BCM2835_OTP_DATA_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_DATA_REG\n"); + break; + case BCM2835_OTP_ADDR_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_ADDR_REG\n"); + break; + case BCM2835_OTP_WRITE_DATA_READ_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_WRITE_DATA_READ_REG\n"); + break; + case BCM2835_OTP_INIT_STATUS_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_INIT_STATUS_REG\n"); + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad offset 0x%" HWADDR_PRIx "\n", __func__, addr); + } + + return 0; +} + +static void bcm2835_otp_write(void *opaque, hwaddr addr, + uint64_t value, unsigned int size) +{ + switch (addr) { + case BCM2835_OTP_BOOTMODE_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_BOOTMODE_REG\n"); + break; + case BCM2835_OTP_CONFIG_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_CONFIG_REG\n"); + break; + case BCM2835_OTP_CTRL_LO_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_CTRL_LO_REG\n"); + break; + case BCM2835_OTP_CTRL_HI_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_CTRL_HI_REG\n"); + break; + case BCM2835_OTP_STATUS_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_STATUS_REG\n"); + break; + case BCM2835_OTP_BITSEL_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_BITSEL_REG\n"); + break; + case BCM2835_OTP_DATA_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_DATA_REG\n"); + break; + case BCM2835_OTP_ADDR_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_ADDR_REG\n"); + break; + case BCM2835_OTP_WRITE_DATA_READ_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_WRITE_DATA_READ_REG\n"); + break; + case BCM2835_OTP_INIT_STATUS_REG: + qemu_log_mask(LOG_UNIMP, + "bcm2835_otp: BCM2835_OTP_INIT_STATUS_REG\n"); + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, + "%s: Bad offset 0x%" HWADDR_PRIx "\n", __func__, addr); + } +} + +static const MemoryRegionOps bcm2835_otp_ops = { + .read = bcm2835_otp_read, + .write = bcm2835_otp_write, + .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, +}; + +static void bcm2835_otp_realize(DeviceState *dev, Error **errp) +{ + BCM2835OTPState *s = BCM2835_OTP(dev); + memory_region_init_io(&s->iomem, OBJECT(dev), &bcm2835_otp_ops, s, + TYPE_BCM2835_OTP, 0x80); + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); + + memset(s->otp_rows, 0x00, sizeof(s->otp_rows)); +} + +static const VMStateDescription vmstate_bcm2835_otp = { + .name = TYPE_BCM2835_OTP, + .version_id = 1, + .minimum_version_id = 1, + .fields = (const VMStateField[]) { + VMSTATE_UINT32_ARRAY(otp_rows, BCM2835OTPState, BCM2835_OTP_ROW_COUNT), + VMSTATE_END_OF_LIST() + } +}; + +static void bcm2835_otp_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = bcm2835_otp_realize; + dc->vmsd = &vmstate_bcm2835_otp; +} + +static const TypeInfo bcm2835_otp_info = { + .name = TYPE_BCM2835_OTP, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(BCM2835OTPState), + .class_init = bcm2835_otp_class_init, +}; + +static void bcm2835_otp_register_types(void) +{ + type_register_static(&bcm2835_otp_info); +} + +type_init(bcm2835_otp_register_types) diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build index 4996c72456f..10f3639db6a 100644 --- a/hw/nvram/meson.build +++ b/hw/nvram/meson.build @@ -1,5 +1,6 @@ system_ss.add(files('fw_cfg-interface.c')) system_ss.add(files('fw_cfg.c')) +system_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2835_otp.c')) system_ss.add(when: 'CONFIG_CHRP_NVRAM', if_true: files('chrp_nvram.c')) system_ss.add(when: 'CONFIG_DS1225Y', if_true: files('ds1225y.c')) system_ss.add(when: 'CONFIG_NMC93XX_EEPROM', if_true: files('eeprom93xx.c')) From patchwork Mon Jul 1 16:07:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808829 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649095wrr; Mon, 1 Jul 2024 09:07:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUmXrMnhWYmadlKXJnj5Qnz29do3u7ZZkbXWB/zXteCWdvtVLj2hY47XkXpyhwh7cmTPCUoeK+x1o3If/sIpKee X-Google-Smtp-Source: AGHT+IF5ToxAsb6Bbd0ZHea/ksWJfUtsHP+F1yvQAPXOZCAGaoBwtMidONB1QVX/pfKvQk5FdSCY X-Received: by 2002:a05:620a:4621:b0:79d:7d22:7f63 with SMTP id af79cd13be357-79d7d22803emr1002554985a.24.1719850076749; Mon, 01 Jul 2024 09:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850076; cv=none; d=google.com; s=arc-20160816; b=rtpyT7GFsVv5XlZaCCQct3By98AiwS4kVtvNUvM6SYRqkCDPNCwvHFlqURk/MKwziN 9fFUJTPnVWzbaGanuHBEVkjQqR6lTdAQc4Qw0rSQP156Z90Hx0cpg23AFKyim3+oNbN0 aD7UIwBxn9QsYetsINhZaaWBKHtMjufzRC7A5U2COvlhcCZ2Oy4shwb7VuNv4CGac6Dr 2ng+X1qAkmPc2Lr+ieRIvr2E0M25Va+BJjbcoekUDUCvmWxmfojW+gK5sHsfis1jyFFe N7XB5CPRmfT09rnAWo3g1U0z0jS86hjQkezWbW4JwCY7BQUrwj0+0IFPG+/Yz2tPDUkr dBFw== 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:to:from :dkim-signature; bh=nBC68qSnOqe/t92MltF2syiNU9SSpcqCVp8DGlNvqpI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hoaqAHN//LFhHX5oyqvn0QKGFiJUVzvA9wTV707QZ3r5TSWiC9xr5a/eGKk9FzV3F+ G5uMjRU2Gl4jeFcx+dZ2yoMGmCS/A6Hp8G+kW2syS5hj7ScvZtbBpsvwBVlBexhYPwy1 tbqY3H1XcMnCo4PD5vRTppqCosgWXWiw6Z4LSAq3w1wpmpYe+0+VjSRihW8oqqRlaPl8 U/uSFdSPpTxQn2Ufh8bhoK4UwLPk+90VIGad4bQOd09lnwtl5LhyrDa0mrfMgvn5Sdj7 KxSpRynUu+B0kC/QuneuRvZHZZPaJREzjo2lEzPsA1tb01qJyz1RBMYi7ShMKddZJ+zl PtVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WuaBfAhy; 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 71dfb90a1353d-4f292265581si1017626e0c.191.2024.07.01.09.07.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:07:56 -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=WuaBfAhy; 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 1sOJZH-0000mp-02; Mon, 01 Jul 2024 12:07:51 -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 1sOJZ4-0000fW-D9 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:41 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJYz-0005PX-0w for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:37 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42564a0d3ceso20398315e9.0 for ; Mon, 01 Jul 2024 09:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850051; x=1720454851; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nBC68qSnOqe/t92MltF2syiNU9SSpcqCVp8DGlNvqpI=; b=WuaBfAhyiTenmafgBTqQw5MtYuqtk5TAOYpMaSce4A58cWQm73f0VTlyqrS8/rFrpn rqFa1gWanfWgmlCXonNnVVaxhL3xf9y00PVKEqlgCcgrW2nvNH5ucHtnSm9/qD6f18fG WWfOyEgSdR7aRiDwh/kX92A036YXNQnujsWsbzq+feWfk1E2iPW6P/im+8Y/itg/a4Vq v/pzGKePwmdYnsrBRzgOTtrObGd3NbOX1BuEzznLl+FaIJyFZV2ODiY7EKkpiaLfYepC tmNWWMQn9cCztz+gEA7QbTD4cmIZAvbjB+0lbCynd+G06cK5igy0HNRrl2B3ngVEFKci sAfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850051; x=1720454851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nBC68qSnOqe/t92MltF2syiNU9SSpcqCVp8DGlNvqpI=; b=H8di7AL51SSf7MqK1Elxx00pAejs0Eo88z++Ow5e/tISGzQf80/nyI3ZMnVjedISGi yYlaNMDfusXyMyqAMdDkEZ1vNUw5L+iVcuNmvq4TkLYM0g5pC/L0TowZ5IHBuXweFEbT lhghlr3X/QS129V2mbJPcipcqik8UunFDq4TDi5SdcKD3JldOodsfBFOhjKY+cYxSSg5 6kCqdcaxXnLkPM/ZuV1COQVhNs3rA4gsNE/D6uoz0mKI/ZI8gVqXMs4aQ1RlYCHeCIW2 KJida4j9qcYVeaY5jI7ycLiUHC967MGCJyuYLl8eykJt7xz3ZuoDKX5UxqhcDMts7SNu 35UQ== X-Gm-Message-State: AOJu0Yw+7Wf3qMZuAjIoSYyao8a80A7bn63UpuFGWNJgztkNNEa+qaBP iw2PeaIKaI5rSgbpy5r2PiVpvRScuarCDhs6wdR48mhh9kuDASreB98ii8vGEk0jTi6BYJY6I+n Y7as= X-Received: by 2002:a05:600c:c88:b0:421:5609:115d with SMTP id 5b1f17b1804b1-4257a074875mr34605385e9.41.1719850051208; Mon, 01 Jul 2024 09:07:31 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:31 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/29] hw/arm: Connect OTP device to BCM2835 Date: Mon, 1 Jul 2024 17:07:02 +0100 Message-Id: <20240701160729.1910763-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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: Rayhan Faizel Replace stubbed OTP memory region with the new OTP device. Signed-off-by: Rayhan Faizel Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/arm/bcm2835_peripherals.h | 3 ++- hw/arm/bcm2835_peripherals.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_peripherals.h index 636203baa5a..1eeaeec9e0e 100644 --- a/include/hw/arm/bcm2835_peripherals.h +++ b/include/hw/arm/bcm2835_peripherals.h @@ -33,6 +33,7 @@ #include "hw/usb/hcd-dwc2.h" #include "hw/ssi/bcm2835_spi.h" #include "hw/i2c/bcm2835_i2c.h" +#include "hw/nvram/bcm2835_otp.h" #include "hw/misc/unimp.h" #include "qom/object.h" @@ -71,7 +72,7 @@ struct BCMSocPeripheralBaseState { BCM2835SPIState spi[1]; BCM2835I2CState i2c[3]; OrIRQState orgated_i2c_irq; - UnimplementedDeviceState otp; + BCM2835OTPState otp; UnimplementedDeviceState dbus; UnimplementedDeviceState ave0; UnimplementedDeviceState v3d; diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 1695d8b453a..7d735bb56cf 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -116,6 +116,10 @@ static void raspi_peripherals_base_init(Object *obj) object_property_add_const_link(OBJECT(&s->fb), "dma-mr", OBJECT(&s->gpu_bus_mr)); + /* OTP */ + object_initialize_child(obj, "bcm2835-otp", &s->otp, + TYPE_BCM2835_OTP); + /* Property channel */ object_initialize_child(obj, "property", &s->property, TYPE_BCM2835_PROPERTY); @@ -374,6 +378,14 @@ void bcm_soc_peripherals_common_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->fb), 0, qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_FB)); + /* OTP */ + if (!sysbus_realize(SYS_BUS_DEVICE(&s->otp), errp)) { + return; + } + + memory_region_add_subregion(&s->peri_mr, OTP_OFFSET, + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->otp), 0)); + /* Property channel */ if (!sysbus_realize(SYS_BUS_DEVICE(&s->property), errp)) { return; @@ -500,7 +512,6 @@ void bcm_soc_peripherals_common_realize(DeviceState *dev, Error **errp) create_unimp(s, &s->i2s, "bcm2835-i2s", I2S_OFFSET, 0x100); create_unimp(s, &s->smi, "bcm2835-smi", SMI_OFFSET, 0x100); create_unimp(s, &s->bscsl, "bcm2835-spis", BSC_SL_OFFSET, 0x100); - create_unimp(s, &s->otp, "bcm2835-otp", OTP_OFFSET, 0x80); create_unimp(s, &s->dbus, "bcm2835-dbus", DBUS_OFFSET, 0x8000); create_unimp(s, &s->ave0, "bcm2835-ave0", AVE0_OFFSET, 0x8000); create_unimp(s, &s->v3d, "bcm2835-v3d", V3D_OFFSET, 0x1000); From patchwork Mon Jul 1 16:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808840 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649786wrr; Mon, 1 Jul 2024 09:09:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUd1ZqftARzl5m3IYmWEQGUwSi6aIof0U+JcxGktyvdf+i4POTT8/4oHrRmfqMo7cpCEeiopOWhicwGAMSIAEFm X-Google-Smtp-Source: AGHT+IHfcDCx0T+VbAtGECDM/o8IbTqKckqNl5K7Xc95hH2iZN+rGd3nybqGotHdvuVMedns3TKH X-Received: by 2002:ac8:5dc8:0:b0:441:5a6c:6b7d with SMTP id d75a77b69052e-44662f469f7mr98357591cf.55.1719850151683; Mon, 01 Jul 2024 09:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850151; cv=none; d=google.com; s=arc-20160816; b=eECeoXETS+VeN9pQjKsV9AUfOD/IoM7BInGMkI5EebmsKP0za74xuDASCPg1KPrNzh er4Zp6SwCmth+cnVK3LzQYguysj1wlDZLQUrU9FeKvabOoo5l0J0INkI+GTQoHQT3OkQ 2S0DFwTwTlfqCfzX+zM3iwPrpglpa5NrUkgkKdm62hYuKSHmLHr61jmUNttBqlbHQkX8 EfBenh+FKLM7MDoo1Wr8e844VZYSMfz3zUQupytE3hFoRkBPToiMFfl3Yx4DMFZjstpC vv3BX68xqNObvjZsPAj6AwqIsIEo1ObsFkPDvAWcHZ4OFI7pnw8qU20NBbpHGLPBC0t8 26cA== 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:to:from :dkim-signature; bh=v4q4C3V/5/Br3sgQcvb/M3Jy91TsPgVVMFf55olF/G8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=s2fpOBIRLz6nVu0OvKXXavvdUMMz5dr49ESMMHtlcXFZDGeLp0hXENZ0fI+Pe9NLWE WEAt78T38+4dpCev+Q726I7kT1gzotqxx2zTA6zN7fiuGopM5KYSvvWDhm4DZV4s2Sba SXS2kSd3lHhKXYk2HIdhdRoIFdtFH2rsqzLAagVtfdEl5gQO2xrx0kR9T+/kAetcboNM KSvFj8rJC3v2tNlozU28AcPMX9HXWTjNyaFJGic9Tb1urfjCbqwQInIo8uv/F1R5aa7k RFW3HECEXOfEjI0NXMX1scU4rSBwiVvJrkV8PJRD+I2E5YGhCm1mltIYe53JEwqhz+mw mnBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cQkVIHzA; 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 d75a77b69052e-446514e5d39si80504961cf.770.2024.07.01.09.09.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:09:11 -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=cQkVIHzA; 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 1sOJZL-00012B-Jd; Mon, 01 Jul 2024 12:07:55 -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 1sOJZ4-0000fV-Au for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:41 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ0-0005Pe-4E for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:37 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2ebed33cb65so34368941fa.2 for ; Mon, 01 Jul 2024 09:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850052; x=1720454852; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=v4q4C3V/5/Br3sgQcvb/M3Jy91TsPgVVMFf55olF/G8=; b=cQkVIHzAFfZYHIbtnxgnBEWvlfvpsqwFZDjsgzKE0MCvAhmF18bDafKcfzS4Im6Bi1 16g1+41mzoiEarkTIWC8DPr7UtTfAuuBvo7lrtuA7HVn9dxaLtJvAObC9VbVd2UuuwXZ no1liUXKBrkR0qLcFefKla8R+sVo12BDbzMVYHqeLmunnreVUcgBencK+N48mwF3WzwH Xx7sbxlV4G5w55wFQ3XzQ+XP6S9NcoJdbdN9TLks9JuRunkTu0wSS/I00IfRIKRPvzby 52QxcYcbE16eH70qn4OQ5o0MzXuJGSbbMPIlfeGGSq1Ycjk36UoHma3jUZse08+EfwWT Cbbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850052; x=1720454852; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v4q4C3V/5/Br3sgQcvb/M3Jy91TsPgVVMFf55olF/G8=; b=Hxcl8dCgn8P2+4FxCGaRNFd0OM+UistWMOTnI3LuM5zRAwnn77IJEZuvuY6RMwiYFj JhXKSONQoX8LbYqyO6wGZeFlBNsvwPag3iOFMAWUu2URkKMihxHGR0kYefrCRN1VXjm/ /+MnwarWcJxJwkofccJfyQYVRiwppz6b4XwLbWymmJVc89EGCs2N14OqWpu6WZQqDAhA T3CY6zSI21nTzq2ATjzfDAjeFan0FRBd6tXfB157ELmbXfulajJqyj/yZVkh4Vjpw7WS jBxT05sN2sZvyIt1TUaCzbxp1PXjcVXsOJa2987meoBwuyAsWjHa10fyOWAmuZ5b9PZD DmpA== X-Gm-Message-State: AOJu0YyyfjXGniUiJlGileHQAjz7eVa13AVo4t5a1VI/6nR9rGdhqd5S spbhl1FStAqK6J4EhnOqsYBm+gxmUMs/cjrx5lRUBpF9s+QWVAgQD3hRrxrLVuEQsCqlTOdpITu 6m3g= X-Received: by 2002:a2e:bc0d:0:b0:2ec:18e5:e686 with SMTP id 38308e7fff4ca-2ee5e6f2727mr50981591fa.33.1719850051757; Mon, 01 Jul 2024 09:07:31 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:31 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/29] hw/misc: Implement mailbox properties for customer OTP and device specific private keys Date: Mon, 1 Jul 2024 17:07:03 +0100 Message-Id: <20240701160729.1910763-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x236.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: Rayhan Faizel Four mailbox properties are implemented as follows: 1. Customer OTP: GET_CUSTOMER_OTP and SET_CUSTOMER_OTP 2. Device-specific private key: GET_PRIVATE_KEY and SET_PRIVATE_KEY. The customer OTP is located in the rows 36-43. The device-specific private key is located in the rows 56-63. The customer OTP can be locked with the magic numbers 0xffffffff 0xaffe0000 when running the SET_CUSTOMER_OTP mailbox command. Bit 6 of row 32 indicates this lock, which is undocumented. The lock also applies to the device-specific private key. Signed-off-by: Rayhan Faizel Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/arm/raspberrypi-fw-defs.h | 2 + include/hw/misc/bcm2835_property.h | 2 + hw/arm/bcm2835_peripherals.c | 2 + hw/misc/bcm2835_property.c | 87 ++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) diff --git a/include/hw/arm/raspberrypi-fw-defs.h b/include/hw/arm/raspberrypi-fw-defs.h index 8b404e05336..60b8e5b4513 100644 --- a/include/hw/arm/raspberrypi-fw-defs.h +++ b/include/hw/arm/raspberrypi-fw-defs.h @@ -56,6 +56,7 @@ enum rpi_firmware_property_tag { RPI_FWREQ_GET_THROTTLED = 0x00030046, RPI_FWREQ_GET_CLOCK_MEASURED = 0x00030047, RPI_FWREQ_NOTIFY_REBOOT = 0x00030048, + RPI_FWREQ_GET_PRIVATE_KEY = 0x00030081, RPI_FWREQ_SET_CLOCK_STATE = 0x00038001, RPI_FWREQ_SET_CLOCK_RATE = 0x00038002, RPI_FWREQ_SET_VOLTAGE = 0x00038003, @@ -73,6 +74,7 @@ enum rpi_firmware_property_tag { RPI_FWREQ_SET_PERIPH_REG = 0x00038045, RPI_FWREQ_GET_POE_HAT_VAL = 0x00030049, RPI_FWREQ_SET_POE_HAT_VAL = 0x00038049, + RPI_FWREQ_SET_PRIVATE_KEY = 0x00038081, RPI_FWREQ_SET_POE_HAT_VAL_OLD = 0x00030050, RPI_FWREQ_NOTIFY_XHCI_RESET = 0x00030058, RPI_FWREQ_GET_REBOOT_FLAGS = 0x00030064, diff --git a/include/hw/misc/bcm2835_property.h b/include/hw/misc/bcm2835_property.h index ba8896610cc..2f93fd0c757 100644 --- a/include/hw/misc/bcm2835_property.h +++ b/include/hw/misc/bcm2835_property.h @@ -11,6 +11,7 @@ #include "hw/sysbus.h" #include "net/net.h" #include "hw/display/bcm2835_fb.h" +#include "hw/nvram/bcm2835_otp.h" #include "qom/object.h" #define TYPE_BCM2835_PROPERTY "bcm2835-property" @@ -26,6 +27,7 @@ struct BCM2835PropertyState { MemoryRegion iomem; qemu_irq mbox_irq; BCM2835FBState *fbdev; + BCM2835OTPState *otp; MACAddr macaddr; uint32_t board_rev; diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 7d735bb56cf..ac153a96b9a 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -132,6 +132,8 @@ static void raspi_peripherals_base_init(Object *obj) OBJECT(&s->fb)); object_property_add_const_link(OBJECT(&s->property), "dma-mr", OBJECT(&s->gpu_bus_mr)); + object_property_add_const_link(OBJECT(&s->property), "otp", + OBJECT(&s->otp)); /* Extended Mass Media Controller */ object_initialize_child(obj, "sdhci", &s->sdhci, TYPE_SYSBUS_SDHCI); diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index bdd9a6bbcec..63de3db6215 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -32,6 +32,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) uint32_t tmp; int n; uint32_t offset, length, color; + uint32_t start_num, number, otp_row; /* * Copy the current state of the framebuffer config; we will update @@ -322,6 +323,89 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) 0); resplen = VCHI_BUSADDR_SIZE; break; + + /* Customer OTP */ + + case RPI_FWREQ_GET_CUSTOMER_OTP: + start_num = ldl_le_phys(&s->dma_as, value + 12); + number = ldl_le_phys(&s->dma_as, value + 16); + + resplen = 8 + 4 * number; + + for (n = start_num; n < start_num + number && + n < BCM2835_OTP_CUSTOMER_OTP_LEN; n++) { + otp_row = bcm2835_otp_get_row(s->otp, + BCM2835_OTP_CUSTOMER_OTP + n); + stl_le_phys(&s->dma_as, + value + 20 + ((n - start_num) << 2), otp_row); + } + break; + case RPI_FWREQ_SET_CUSTOMER_OTP: + start_num = ldl_le_phys(&s->dma_as, value + 12); + number = ldl_le_phys(&s->dma_as, value + 16); + + resplen = 4; + + /* Magic numbers to permanently lock customer OTP */ + if (start_num == BCM2835_OTP_LOCK_NUM1 && + number == BCM2835_OTP_LOCK_NUM2) { + bcm2835_otp_set_row(s->otp, + BCM2835_OTP_ROW_32, + BCM2835_OTP_ROW_32_LOCK); + break; + } + + /* If row 32 has the lock bit, don't allow further writes */ + if (bcm2835_otp_get_row(s->otp, BCM2835_OTP_ROW_32) & + BCM2835_OTP_ROW_32_LOCK) { + break; + } + + for (n = start_num; n < start_num + number && + n < BCM2835_OTP_CUSTOMER_OTP_LEN; n++) { + otp_row = ldl_le_phys(&s->dma_as, + value + 20 + ((n - start_num) << 2)); + bcm2835_otp_set_row(s->otp, + BCM2835_OTP_CUSTOMER_OTP + n, otp_row); + } + break; + + /* Device-specific private key */ + + case RPI_FWREQ_GET_PRIVATE_KEY: + start_num = ldl_le_phys(&s->dma_as, value + 12); + number = ldl_le_phys(&s->dma_as, value + 16); + + resplen = 8 + 4 * number; + + for (n = start_num; n < start_num + number && + n < BCM2835_OTP_PRIVATE_KEY_LEN; n++) { + otp_row = bcm2835_otp_get_row(s->otp, + BCM2835_OTP_PRIVATE_KEY + n); + stl_le_phys(&s->dma_as, + value + 20 + ((n - start_num) << 2), otp_row); + } + break; + case RPI_FWREQ_SET_PRIVATE_KEY: + start_num = ldl_le_phys(&s->dma_as, value + 12); + number = ldl_le_phys(&s->dma_as, value + 16); + + resplen = 4; + + /* If row 32 has the lock bit, don't allow further writes */ + if (bcm2835_otp_get_row(s->otp, BCM2835_OTP_ROW_32) & + BCM2835_OTP_ROW_32_LOCK) { + break; + } + + for (n = start_num; n < start_num + number && + n < BCM2835_OTP_PRIVATE_KEY_LEN; n++) { + otp_row = ldl_le_phys(&s->dma_as, + value + 20 + ((n - start_num) << 2)); + bcm2835_otp_set_row(s->otp, + BCM2835_OTP_PRIVATE_KEY + n, otp_row); + } + break; default: qemu_log_mask(LOG_UNIMP, "bcm2835_property: unhandled tag 0x%08x\n", tag); @@ -449,6 +533,9 @@ static void bcm2835_property_realize(DeviceState *dev, Error **errp) s->dma_mr = MEMORY_REGION(obj); address_space_init(&s->dma_as, s->dma_mr, TYPE_BCM2835_PROPERTY "-memory"); + obj = object_property_get_link(OBJECT(dev), "otp", &error_abort); + s->otp = BCM2835_OTP(obj); + /* TODO: connect to MAC address of USB NIC device, once we emulate it */ qemu_macaddr_default_if_unset(&s->macaddr); From patchwork Mon Jul 1 16:07:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808842 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649993wrr; Mon, 1 Jul 2024 09:09:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW9mAkhojPh3DJhVGA37Nnm9lyUfuFl0Dm8ceQHJRgluVRtfozFsVg/FovhzfNge72x2mLngG7AvA7+uh/3R9cD X-Google-Smtp-Source: AGHT+IGj5ve87ZjRP/0toEwlxEFml2UPd5KRzmlxUAut2yyXK0pqnyV4CjCLHGIavHq3wLRzfNTC X-Received: by 2002:a05:620a:44d3:b0:79d:71c2:5d31 with SMTP id af79cd13be357-79d7ba7899bmr869905685a.62.1719850172471; Mon, 01 Jul 2024 09:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850172; cv=none; d=google.com; s=arc-20160816; b=gTF+vv9DLsPme+XscyPUZv2W+fqffCT1O00QOSGv+Kzol+8FBrBu1lXEv1K1rIrMKH IRB3f01/8EIW7rG8g32nFG/tj4iEUrAOALGikzqBolPCSlQoHssqZO0BKxPrRafsKzef igEbT5ae+8H1Miq9LHw9CRtqMr3JM1823njls6gxMkRwFYB6FvRYNzJ/YL8HXnTEMzNP GPIjcUyY9cj+HXfxwDfCXYeTpvs28H5dm74xUhXZ2ZkCPm9dzi+FZoUtnp/4kvznlDMh qZg6eVUMhjdSpw4Pd25YQimKTRSepWBEiM8h3ZU/iZu1SVSHhCSRmSZkdWiOcn/B9GFk n7kQ== 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:to:from :dkim-signature; bh=n2HEIr2aWh0/VnzuRGuJ20MxeoVg0gSXyflQZjqPsQI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=pmNq6/X7BoDkAS9RkpRXIQBe76QD4aR9U48wZr6z4xwdQ8jZH0Lv8/c02MxnyShTK1 VELs6ZDKY0fD3gKCaIea6p4XpDlTkQna269hlMc9/r2Et/hSskRNHn0MshxUpg4eLav6 LAOoYfDpRHu7Ia/grMqziPvr/kWtLxdZWOWaumwiZ/n2bxlaGBFA8B91KXr4pWtVAzRV G50s1AJDmSmBXB6DVyQwPMPUoYBmcbjsVGqPe3rlJG1GvmoZA3D/ctP+mQS4MkLd7rZh 4a6d60JE/JrqhWNWgVJjcCYxSPEVXUgtyIiXYzgzpZud0ydHAA9nERyvfist0bEyPcGV IbNw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ei9uNi0r; 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 af79cd13be357-79d69307c36si786817785a.399.2024.07.01.09.09.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:09:32 -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=ei9uNi0r; 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 1sOJZR-0001LB-A2; Mon, 01 Jul 2024 12:08:02 -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 1sOJZ2-0000eB-Qm for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:37 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ0-0005Pf-2k for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:36 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42565697036so25316405e9.1 for ; Mon, 01 Jul 2024 09:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850052; x=1720454852; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=n2HEIr2aWh0/VnzuRGuJ20MxeoVg0gSXyflQZjqPsQI=; b=ei9uNi0rMElC3vF+McJqdu1xBFGRADIvLgpiWBzr1txfJsExNjhfTrb36n68ceclJl DpzClZMMrddQNCMxTwxoWk6AJFD2gmilH+6UKi9lFrfXmwrIDA3583P338+7XxFl05cX 450vSMsV6I7+xGGcECodyimjLZtnm9ByceRhOL0GH/suLQFhW+UI0MSIBHSATihEdYH3 tugqEI2lFAy+TAofP6OD6zOEugH5T68kg6ahHurvWNLwoipMcEz4sZ9h4k/wke1WqOu/ P0aZb8xkTGosQkNU1CX2zLxuHlD1E1tAbqNQc83++J7sg2JxS0bBOH8wNCFd1QjPxRIU cvEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850052; x=1720454852; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n2HEIr2aWh0/VnzuRGuJ20MxeoVg0gSXyflQZjqPsQI=; b=RHK1DMYOYdubesGYlJLYHBdHcOImKwIumbDR7YHOS009H8Ke8sMk5GBwmzWuUKLieH Zhxtsk5O9eK68qV6pkvgyFURd44HcMAyVXEGw0WTGHMBjVFxuIAVbItTbLVnA4cy/E5B +b0HBwy23S8f7D5lUSJ0ScBEoZjG6IWXXdJvCIu1ARRp1OzBMRr8BftsiryRPchYJBad Zq7BlqcefW+mhRX5ZZFt/TgWsaJI/k2CXvWaJyA1SypRClh/Y4PyusnrzB6ezhlNVh79 mzn1BcT4Ce//+b6NgxNjeMphSy5qPQgVVbsAosD/zZRxjNeV1V3UQqyTsQZuYNAxgJhf LKnw== X-Gm-Message-State: AOJu0YyoY+lLRBe1CSNJNmUgdExJJh31vj5alSmm5yqElLYAdu2FAuw0 6kSZIaxyv879tctqhMoRVx37OpI6YRWkIiXuuGWhnS4tEuoVC1jKP1QB3QqyaC6hZo+8lyc9IQh s8uE= X-Received: by 2002:a05:600c:1d14:b0:424:a401:f012 with SMTP id 5b1f17b1804b1-4257984c6cfmr55374295e9.3.1719850052223; Mon, 01 Jul 2024 09:07:32 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:32 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/29] tests/avocado: update firmware for sbsa-ref Date: Mon, 1 Jul 2024 17:07:04 +0100 Message-Id: <20240701160729.1910763-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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: Marcin Juszkiewicz Update firmware to have graphics card memory fix from EDK2 commit c1d1910be6e04a8b1a73090cf2881fb698947a6e: OvmfPkg/QemuVideoDxe: add feature PCD to remap framebuffer W/C Some platforms (such as SBSA-QEMU on recent builds of the emulator) only tolerate misaligned accesses to normal memory, and raise alignment faults on such accesses to device memory, which is the default for PCIe MMIO BARs. When emulating a PCIe graphics controller, the framebuffer is typically exposed via a MMIO BAR, while the disposition of the region is closer to memory (no side effects on reads or writes, except for the changing picture on the screen; direct random access to any pixel in the image). In order to permit the use of such controllers on platforms that only tolerate these types of accesses for normal memory, it is necessary to remap the memory. Use the DXE services to set the desired capabilities and attributes. Hide this behavior under a feature PCD so only platforms that really need it can enable it. (OVMF on x86 has no need for this) With this fix enabled we can boot sbsa-ref with more than one cpu core. Signed-off-by: Marcin Juszkiewicz Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-id: 20240620-b4-new-firmware-v3-1-29a3a2f1be1e@linaro.org Signed-off-by: Peter Maydell --- tests/avocado/machine_aarch64_sbsaref.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py index 6bb82f2a03c..e854ec6a1af 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -37,18 +37,18 @@ def fetch_firmware(self): Used components: - - Trusted Firmware 2.11.0 - - Tianocore EDK2 stable202405 - - Tianocore EDK2-platforms commit 4bbd0ed + - Trusted Firmware v2.11.0 + - Tianocore EDK2 4d4f569924 + - Tianocore EDK2-platforms 3f08401 """ # Secure BootRom (TF-A code) fs0_xz_url = ( "https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/" - "20240528-140808/edk2/SBSA_FLASH0.fd.xz" + "20240619-148232/edk2/SBSA_FLASH0.fd.xz" ) - fs0_xz_hash = "fa6004900b67172914c908b78557fec4d36a5f784f4c3dd08f49adb75e1892a9" + fs0_xz_hash = "0c954842a590988f526984de22e21ae0ab9cb351a0c99a8a58e928f0c7359cf7" tar_xz_path = self.fetch_asset(fs0_xz_url, asset_hash=fs0_xz_hash, algorithm='sha256') archive.extract(tar_xz_path, self.workdir) @@ -57,9 +57,9 @@ def fetch_firmware(self): # Non-secure rom (UEFI and EFI variables) fs1_xz_url = ( "https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/" - "20240528-140808/edk2/SBSA_FLASH1.fd.xz" + "20240619-148232/edk2/SBSA_FLASH1.fd.xz" ) - fs1_xz_hash = "5f3747d4000bc416d9641e33ff4ac60c3cc8cb74ca51b6e932e58531c62eb6f7" + fs1_xz_hash = "c6ec39374c4d79bb9e9cdeeb6db44732d90bb4a334cec92002b3f4b9cac4b5ee" tar_xz_path = self.fetch_asset(fs1_xz_url, asset_hash=fs1_xz_hash, algorithm='sha256') archive.extract(tar_xz_path, self.workdir) From patchwork Mon Jul 1 16:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808830 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649103wrr; Mon, 1 Jul 2024 09:07:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXmTnW0lVhbnkUPcTAj7wOTuYLpbMiRohH7rwd95KPdjs7+WM8uMM5WEPiBcd9aKvD0o2AQp/AX1G4swuyLhYnH X-Google-Smtp-Source: AGHT+IGELQQfmiM3bX9yJ9vUL+nze9mAGhedv8gQ77i0XI9nIRFrVRaTZWeLfnvA2n/TTER/QPwk X-Received: by 2002:a05:622a:134b:b0:444:ab91:e067 with SMTP id d75a77b69052e-44662e3dc19mr87748941cf.36.1719850077168; Mon, 01 Jul 2024 09:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850077; cv=none; d=google.com; s=arc-20160816; b=PSCBilMEOWThYz8s+8kOq/aFm1xAGcJZkSVj/n3Rh7er5TZiqSsoXy7SyYjVicZKuL lx3wGmxnJCEKTqmYzu0KCoR9PxIsWWCP3LNj6d6dEzjBtTP+3qEQ8RK+Xj9MRIeZv05J 8Ku+1CP/+OY0zZ/LtXg0dhsvB1y9sjRNtwayvcDSf46D6R6ol54HV480xktIhkW0Bx3U Q14zerv5pWKn44XDkvg1RtM/ZB6/MGSdH47mNhTorlx6/RRSV6SV6ML7q6EEtXGirheT ZcRpEHcJgWOK3GF6o+3WEV+FgapYONa6EXuqNh+KexP/fSwY6JoLpzRf/SzF1yKtHMV+ 6fnw== 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:to:from :dkim-signature; bh=9i1t7NGFbpDxWQ4N6M+2vJDuEoC6XNQqU7Rbq4fgGT0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hnwdUhKNh+ZkPX7GvMRJxpBqh3b18uKo5FFd8c2mgHE0jYo9/KRWoAb3ElYYAzn7jg mCBPhKG1XH7asSShvAmv3t5ccdfLzBRo2jlrdR20vg5NtmQ4QuwAdxhzT1SaB1Z8Y86U 7tasI0X9PL5WomSEzm/w/dgsg3m3fIARqfTnBeYKnPcDYnRNQby0apnzsrdTO4p/rXrM cl/GP2hcs0sJZYI7+kZv/ZvbFQj6/5/l8EbZmLJn4l5lPe7fE8uQnYdE03uBgAnnaVHe r49dbA9SQDEqNmxPts2fc4m/h9fjtDAa3Uz/ny0DQLxu+c01yHb0/CuuPLhw0ZP/szti rQLA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yxk3v8LX; 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 d75a77b69052e-446514aa16bsi80490911cf.499.2024.07.01.09.07.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:07:57 -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=Yxk3v8LX; 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 1sOJZH-0000mS-0z; Mon, 01 Jul 2024 12:07:51 -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 1sOJZ2-0000e9-Q9 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:37 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ0-0005Pk-4M for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:36 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42565cdf99cso28820345e9.3 for ; Mon, 01 Jul 2024 09:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850053; x=1720454853; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9i1t7NGFbpDxWQ4N6M+2vJDuEoC6XNQqU7Rbq4fgGT0=; b=Yxk3v8LXp9vWM9eFBAgOwkHgkwOzvqu6hSuqmFf9ykAcsftNdT4+YVDZKx1vWJKS9O d76QIAmZkVPKgy8kgWW74JN4OHrRXoveGbbvR0vB4hwFnuP+8dwDicV8gELmI5paX7Ls Pv83TzQWAx4+X6Zz4PM7kPkS3oOp99IEH3CTfZTZeBBj9jq144gBNBKiPmpmtTWw23wf NGXInL2jpfuVm0/qT0wtk/2AGzkcXN9ISgqt0CdnIZrX1HYEUtXdWqpi1PPzaA5MkroF Q4cnND8leNeeC6P807mhqNWAaxFJNJ73YdJzXZlR9D2xBzeH5iQ0RnAjRpuCPD9ZebCC A/0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850053; x=1720454853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9i1t7NGFbpDxWQ4N6M+2vJDuEoC6XNQqU7Rbq4fgGT0=; b=B/qfooQ7x3dQOD1gy9/puCkC+nmPuYFdkdSEwNmkWSqo9DVkjffig36YgM+RN4bGv3 z0HUoGL7t0xhElEBdSIuAWVS6eVCOvVOTAxBv2gXLBdP+SNFJDdYsTm8myWVQAvsuFF+ OH5WXyu1+HMViESXQ6Cm3FQQsSQtOvfd2F/YkrGKI34iChNMHVua1fQXEOIoa6fMkh4w l6VYpdRQ9GWiQvfSuEYGkw2Fnk2nefqhj6VRI3y+Q6mWGNnRZkyXb8Yd7Bqb8b0XU9xl CFBH49EPjkRQm5AFoJPoE2LnHlR4LIJORCEN1LWm6vfSxKUW/wsDL0qnirCcYHzH2RbW VnYQ== X-Gm-Message-State: AOJu0Yx9i+OHoA8n9MPSjBhpZJqvCENvGnzcCYCHwKF+h8TImj+KwKFF LOfjbmyQKyt9fsaGN/FTHakctxU6VaUSe+u7XqB4v5avm8hJOGPXqzglHTdJboFaPuM5tDyY+3O 8Eao= X-Received: by 2002:a05:600c:6d4:b0:425:5fd9:370f with SMTP id 5b1f17b1804b1-4257a006636mr51411945e9.9.1719850052625; Mon, 01 Jul 2024 09:07:32 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:32 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/29] tests/avocado: use default amount of cores on sbsa-ref Date: Mon, 1 Jul 2024 17:07:05 +0100 Message-Id: <20240701160729.1910763-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.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: Marcin Juszkiewicz The version of the sbsa-ref EDK2 firmware we used to use in this test had a bug where it might make an unaligned access to the framebuffer, which causes a guest crash on newer versions of QEMU where we enforce the architectural requirement that unaligned accesses to Device memory should take an exception. We happened to not notice this because our test was booting with "-smp 1" and through luck this didn't write the boot logo to the framebuffer at an unaligned address; but trying to boot the same firmware with two CPUs would result in a guest crash. Now we have updated the firmware we're using for the test, we can make the test use all the cores on the board, so we are testing the SMP boot path. Signed-off-by: Marcin Juszkiewicz Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-id: 20240620-b4-new-firmware-v3-2-29a3a2f1be1e@linaro.org Signed-off-by: Peter Maydell --- tests/avocado/machine_aarch64_sbsaref.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py index e854ec6a1af..e920bbf08c1 100644 --- a/tests/avocado/machine_aarch64_sbsaref.py +++ b/tests/avocado/machine_aarch64_sbsaref.py @@ -75,8 +75,6 @@ def fetch_firmware(self): f"if=pflash,file={fs0_path},format=raw", "-drive", f"if=pflash,file={fs1_path},format=raw", - "-smp", - "1", "-machine", "sbsa-ref", ) From patchwork Mon Jul 1 16:07:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808837 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649558wrr; Mon, 1 Jul 2024 09:08:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX8G8hPg3Kot67yNheBUn82YDRkrAn6gWctn6sNhVe1ZSngOvQRMGFoiLBUcRJ/MNwnw3WSSQ3q4+4JGZ3pcDVw X-Google-Smtp-Source: AGHT+IGjPLV6b5LCJbR0KcCMqlVgio5IyBZi2Z8N3oecmx2yHwzED9VSxBci5/tJfmUlGayhZ+mi X-Received: by 2002:a05:6102:5113:b0:48f:6961:4c97 with SMTP id ada2fe7eead31-48faf084378mr6597331137.10.1719850124816; Mon, 01 Jul 2024 09:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850124; cv=none; d=google.com; s=arc-20160816; b=dKEF//hJwsYGEJFnZ3PuzAWkzspQSjBHXiHXZQjdRJHx1t3E6mRZDDRI/imMAz/7vY dNyrIfjFQgu0pbLXHJGflnb5Os6N3JgN5zd+1TNQZIm4kwWCw7IvoEWoiDxaX3innM43 ak80f10wKk0xemS4DA2ZtOdNIhuvObet7rJNnZPwKdl1iedaCgnkK6YKZCVGnaVUBnsm rn5cZDhIWjLzHFquLVdJR9ImsnGsG3vVCalPje+IRAXkb+Nn9DmdW5TWn3IzAasnU0G/ t986mN0fx6HSl19EIAel9wJ8iLDiNQOBvwer5whllultEuatVZJCV01ToLb6WmRm5W7k PP5Q== 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:to:from :dkim-signature; bh=77qm/ulkxZX7SdkResvcWiVey4AydnKET0AsgP+gR9E=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=zfs/iPX0CeJ7nJ9w6R+uSbIEAZjsgDfaeNj5Q9U9OnLn3+y0RKbUMC3xWc4sQ5IN+F bmGurRoNnv3Rl1k3vdB+GvJn6Y0vmpzQeUZz7l0CiBQRdwkke9JwIBnqmS6UBC1DjCUf AMIC7r2tWflbZXM/x0GDRXPum+XJGVPIgZW3YB1H+7K/JpHbEGmIUTBGYGZUS87otK3f J3RgOxmUX1glmi/NFc9MRprQh70pmvOxu2vAwnIyXBlFxJwtPtn5Oq2aLbM+TBUEUafR hlyGf6nRyC/aa7zYUn5cGK5pVd65lGEmP+2IM5mwOD+xr2eqMDVx/4romvesEjjKJo3G HxBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U/MHIEN3"; 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 ada2fe7eead31-48f9b23f646si1159075137.276.2024.07.01.09.08.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:44 -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="U/MHIEN3"; 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 1sOJZd-0001gd-EY; Mon, 01 Jul 2024 12:08:13 -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 1sOJZ7-0000iS-Nf for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ0-0005Pp-G1 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:40 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-424ad991cbbso25269065e9.0 for ; Mon, 01 Jul 2024 09:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850053; x=1720454853; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=77qm/ulkxZX7SdkResvcWiVey4AydnKET0AsgP+gR9E=; b=U/MHIEN3AOx+nkDaE6JVfhhsekgDj116goIDrZ/xwbI+y+OreJig84+rdIzq6HrdnS g6JmEBOUiRdUodHdcGmBYr8UxYGuaW4BBoOS3C5+uYSEXJ8ciPtKVvdNI1Z2qYb0yr5S d1uiKdGHxGSVW0BgQjpKOaLgutVxo512jXGJNMHYc2aLp1ZI1A5QmmhfKg77CtSDioEB T0e+aLtwpM84bAZ+pkD2hMWCzC6DCgRd/6e3nyJpRFlH+abyikkrmeHijrEQhNx9J5Pm aP1TndkbJPv3b++Wb2Y7B/CjPfzpCFmERhTjNvBCOSK9bcgGEkUvLpcn9dRxXWaDnoMf 8szA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850053; x=1720454853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=77qm/ulkxZX7SdkResvcWiVey4AydnKET0AsgP+gR9E=; b=DTON1hxBJXwIAVHfbHtc2bqiTsbb/85IFpJXwzYXX2KA/j7fba6ITqxIpaUIKPuMMW tRfsS4yMwIEMkLD08cdob6N9LgsbOcwx+PrV5M26BSUh02gPtNAiM4uQc7LpGjv06YOq PqQGGLGNhd5hCLQnXcZGLu42BEkjAhDFlgO1IDA8mk1fE+Ab2WRn0V080YECK8Cvsgea evzr3Rsh0snX4hdfcCCSD6JEunucwJqGpoquJf82RMS5JQP8/NAKMAnYfwjp31FWdPbp 4x60aBvFZsLTiWAAdhkhFLfMQpJgw5eqdzcfIh0ABcPrRrBrGzhQVAlgBDS3k0WYjzkN /uRA== X-Gm-Message-State: AOJu0Yxq+EjFwgvlNWbHj4ErOL7H45CMV/IdbUE4kRL4O7wABVxeENmZ 5OD09jwYvYOCgT6EyThUI2OiiM+yHZXS3Wmi4hbOzv+mruWqEaa4JpmkqS8GqcyUO/DVIr8gxfp csoM= X-Received: by 2002:a05:600c:1d1a:b0:424:a578:fc1 with SMTP id 5b1f17b1804b1-4257a05c0a3mr39768355e9.25.1719850053094; Mon, 01 Jul 2024 09:07:33 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:32 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/29] hw/arm/smmu-common: Replace smmu_iommu_mr with smmu_find_sdev Date: Mon, 1 Jul 2024 17:07:06 +0100 Message-Id: <20240701160729.1910763-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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, T_SPF_TEMPERROR=0.01 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: Nicolin Chen The caller of smmu_iommu_mr wants to get sdev for smmuv3_flush_config(). Do it directly instead of bridging with an iommu mr pointer. Signed-off-by: Nicolin Chen Message-id: 20240619002218.926674-1-nicolinc@nvidia.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/arm/smmu-common.h | 4 ++-- hw/arm/smmu-common.c | 8 ++------ hw/arm/smmuv3.c | 12 ++++-------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index 5ec2e6c1a43..687b7ca132d 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -182,8 +182,8 @@ int smmu_ptw(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags perm, */ SMMUTransTableInfo *select_tt(SMMUTransCfg *cfg, dma_addr_t iova); -/* Return the iommu mr associated to @sid, or NULL if none */ -IOMMUMemoryRegion *smmu_iommu_mr(SMMUState *s, uint32_t sid); +/* Return the SMMUDevice associated to @sid, or NULL if none */ +SMMUDevice *smmu_find_sdev(SMMUState *s, uint32_t sid); #define SMMU_IOTLB_MAX_SIZE 256 diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 1ce706bf94b..b6601cc102e 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -620,20 +620,16 @@ static const PCIIOMMUOps smmu_ops = { .get_address_space = smmu_find_add_as, }; -IOMMUMemoryRegion *smmu_iommu_mr(SMMUState *s, uint32_t sid) +SMMUDevice *smmu_find_sdev(SMMUState *s, uint32_t sid) { uint8_t bus_n, devfn; SMMUPciBus *smmu_bus; - SMMUDevice *smmu; bus_n = PCI_BUS_NUM(sid); smmu_bus = smmu_find_smmu_pcibus(s, bus_n); if (smmu_bus) { devfn = SMMU_PCI_DEVFN(sid); - smmu = smmu_bus->pbdev[devfn]; - if (smmu) { - return &smmu->iommu; - } + return smmu_bus->pbdev[devfn]; } return NULL; } diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 2d1e0d55ec2..445e04ddf7c 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -1218,20 +1218,18 @@ static int smmuv3_cmdq_consume(SMMUv3State *s) case SMMU_CMD_CFGI_STE: { uint32_t sid = CMD_SID(&cmd); - IOMMUMemoryRegion *mr = smmu_iommu_mr(bs, sid); - SMMUDevice *sdev; + SMMUDevice *sdev = smmu_find_sdev(bs, sid); if (CMD_SSEC(&cmd)) { cmd_error = SMMU_CERROR_ILL; break; } - if (!mr) { + if (!sdev) { break; } trace_smmuv3_cmdq_cfgi_ste(sid); - sdev = container_of(mr, SMMUDevice, iommu); smmuv3_flush_config(sdev); break; @@ -1260,20 +1258,18 @@ static int smmuv3_cmdq_consume(SMMUv3State *s) case SMMU_CMD_CFGI_CD_ALL: { uint32_t sid = CMD_SID(&cmd); - IOMMUMemoryRegion *mr = smmu_iommu_mr(bs, sid); - SMMUDevice *sdev; + SMMUDevice *sdev = smmu_find_sdev(bs, sid); if (CMD_SSEC(&cmd)) { cmd_error = SMMU_CERROR_ILL; break; } - if (!mr) { + if (!sdev) { break; } trace_smmuv3_cmdq_cfgi_cd(sid); - sdev = container_of(mr, SMMUDevice, iommu); smmuv3_flush_config(sdev); break; } From patchwork Mon Jul 1 16:07:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808849 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651627wrr; Mon, 1 Jul 2024 09:12:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/OQuzxNGoEXz/yct9TK7K2O5T4l5eg/kTzi642qF/pZ3W7JvMHU0NrumoTn6uGdKbkaSXPLHCXATnc+GwyYHu X-Google-Smtp-Source: AGHT+IGr6AAyJ3/4qDpmW8ZQVoPt0mzG/L+MC5RAhU+FHh7A6eIyQvuyuiFTrI1i9MA3Ml7FeaSy X-Received: by 2002:a05:6214:238a:b0:6b4:f888:ebb5 with SMTP id 6a1803df08f44-6b5b7055f61mr66758436d6.9.1719850357453; Mon, 01 Jul 2024 09:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850357; cv=none; d=google.com; s=arc-20160816; b=LwL8FtyMFNH9HazuN8qvmTiNSRTjt1SRuRo7X/JeEs1+6bftjg6j0BCCvfbSMDYv7I uD5LFSq8c5YTtMPE+wbgcgzwNXM9P6EECuNbTGvSSVr78jB0P62zI0RrUDm4P6K503xx vOLqoU4fFdkGGWZZB2yVKRAjVG+l95ovd6G2HI0VDvy+e2h7aF1iRCi8BziQRE3U6DcY 5rirjCSLrFOKokySBYCpQyB6UOnNhNLEd60+YVlVGRbjVW1i5Vn+0yNG1Z+mSj+dsCMo Bqvrksc/SlPNKZmOhLb9uK7aicS84sfTNhaTlu/XXvF4jfDbVdMPIqvXxNXtJEQlrxXS J0EQ== 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:to:from :dkim-signature; bh=GhKst7WHN9ASn36oUshu4tgIXvUX+N4f2K/V8e/wSkQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=fNZ3YQtzq3TDB+/4BqXa40lJ66/n6QeMFa6pQewxJ/X9vc+I0mpxHXLYNAKqSFsiQM 3KznfqT48l91GeXNaJFa6NJOPQWwva2asM8QwdymcIwLKRP29rk58ezK4vjyaIIpWqRr dqWMd28dr2dXvkP4Fn0/bsbqcpaBr45KYy4JPobC+jbEF8p6Kkn/47oHrmnJ1nANB/6Q 1gTvP0i0x3DnShOajhOBGKX/NqdRj76kUDtNipspLwlUL7oBRXhrzWOQCum2fkIeG5Ea wiJYycuVj94+qoM3yXnwITlsPhZONwFPlwS3fiYGTDCYreLYPItrWl9Y56Daw0ai8czG hgxw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d1xM7R2M; 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 6a1803df08f44-6b59e5ace53si85914866d6.202.2024.07.01.09.12.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:37 -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=d1xM7R2M; 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 1sOJZp-00024l-RJ; Mon, 01 Jul 2024 12:08:25 -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 1sOJZ5-0000fx-GM for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:41 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ1-0005Pv-6q for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:38 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ec5fad1984so44297841fa.0 for ; Mon, 01 Jul 2024 09:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850053; x=1720454853; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GhKst7WHN9ASn36oUshu4tgIXvUX+N4f2K/V8e/wSkQ=; b=d1xM7R2M+W+05gDqcDAGKx9xZMUi/baONBD8QTyXK52amGj0Nzq5+J+00tV3H64a5u WnLMBh0R7urrk11Os005oLG8fm2hZylveE4l8kzcAz7uCfYIuPAECFUzo48f9iE90oOt Me3VRpUt7v9VHWYYY6cS3opuaMPHcIdW7WJyxq3KbZj1vf3Ga02ZJgSWD7l2+u6kw+e4 A14Xx6TK7b1wlEX9Vu+rWAb2H9J2i8rqoPBcl8FCSOP4v0zksH4QWvrERXwLS+KRpM99 Smqmo/gqOMfO7fprWRZZwKDeBSTt/BafUZyySHmIUwSTnliCK0E8D+G7Uw2QywpNZR6W ommw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850053; x=1720454853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GhKst7WHN9ASn36oUshu4tgIXvUX+N4f2K/V8e/wSkQ=; b=nlg02bxDX1D+89MLaLmkrEco5+dOT4fWiWfsP5LK0O2JkOclLBSzA+GtA4Ac9tf+S1 2RqnJuDaJDoYUdV4uu4l6iC7cPL3Ph1eBjqH13vyhhe5BapcQ3BJUDCF2ZDnnj06z6g+ f4TgyXiKN3uNt5y5wl9dNsGoGnX8xPT1E2EtRuB10QaLL+yhmgBrsAglTCYc+QWh7xkx 8WVb9gJJUaFXdkYJwlSNAjCtZ7Q3uGtJWdaM75fz5Jiy/1W1I6lINrEEHqtdd+4qNcUj BqXdvx6jguapMORmYuuC4AIhIjcQH24Yu+TXHDR4BfKDRYy0JuBO4jSCcV+p5KTJQM/d rgBg== X-Gm-Message-State: AOJu0YxSgO9jpamGm/jGf6aNixeW1caBkIIsjQndilCMmxNbEzXn3g+i nbAvucFO/3rW+PARM51t2j1rzZY8Svc35UG8BTUokqekQ31vWJbmsxWl2fJuT2vVwQ/Ou0Glplt YRqY= X-Received: by 2002:a2e:bc04:0:b0:2eb:2e0b:72c with SMTP id 38308e7fff4ca-2ee5e393e7emr52167731fa.16.1719850053546; Mon, 01 Jul 2024 09:07:33 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:33 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/29] target/arm: Fix VCMLA Dd, Dn, Dm[idx] Date: Mon, 1 Jul 2024 17:07:07 +0100 Message-Id: <20240701160729.1910763-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x22c.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: Richard Henderson The inner loop, bounded by eltspersegment, must not be larger than the outer loop, bounded by elements. Cc: qemu-stable@nongnu.org Fixes: 18fc2405781 ("target/arm: Implement SVE fp complex multiply add (indexed)") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2376 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/vec_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index b05922b425f..7b34cc98afe 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -907,7 +907,7 @@ void HELPER(gvec_fcmlah_idx)(void *vd, void *vn, void *vm, void *va, intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); uint32_t neg_real = flip ^ neg_imag; intptr_t elements = opr_sz / sizeof(float16); - intptr_t eltspersegment = 16 / sizeof(float16); + intptr_t eltspersegment = MIN(16 / sizeof(float16), elements); intptr_t i, j; /* Shift boolean to the sign bit so we can xor to negate. */ @@ -969,7 +969,7 @@ void HELPER(gvec_fcmlas_idx)(void *vd, void *vn, void *vm, void *va, intptr_t index = extract32(desc, SIMD_DATA_SHIFT + 2, 2); uint32_t neg_real = flip ^ neg_imag; intptr_t elements = opr_sz / sizeof(float32); - intptr_t eltspersegment = 16 / sizeof(float32); + intptr_t eltspersegment = MIN(16 / sizeof(float32), elements); intptr_t i, j; /* Shift boolean to the sign bit so we can xor to negate. */ From patchwork Mon Jul 1 16:07:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808851 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651637wrr; Mon, 1 Jul 2024 09:12:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVRzfoF9ZufayB8HLc86yzYqYo9gLqr7p/FVvwrsHOwlBfP5tFrI1SRKGaCMDJDmD1oJVlmZ5SiwuSlP06n/brn X-Google-Smtp-Source: AGHT+IHfFd6Xx9Y4vr8Im6uX0hsiVVF9y+LHbOcTNtuzWuhHLGOQ3yQBqa7gu2LYvL4/Hp2vRJYl X-Received: by 2002:ad4:5ca3:0:b0:6b0:7e89:f4e1 with SMTP id 6a1803df08f44-6b5b70bae2fmr82873826d6.25.1719850358643; Mon, 01 Jul 2024 09:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850358; cv=none; d=google.com; s=arc-20160816; b=zUP+/3fv1s+nz7KCxu755bcEfMV45ZalpdKIkUGVBXFsldeHgIcsY/o5v038ixRT5V t/A1YbVaunQubvs1RzQAZ5UXRlb8B+oNLrE7bEQxxhtvafJ3a2PbsUTWQv3kWb20qCDo RkpBAwfWOmzC4KYBZnpVIE6D23IopECIkvWaTWoQtbEgncC5TyWiE+D6SIhcIjxGWQny nxMtPcqcxeo52Uk4tYEnFvs340ua7dq4oBCbrBD3YhZ1drlZNYiV/ZTPTcq58KzHmWHU T4MtoO2C/DdiY1UlKq94fa6Yth4sERWTV8AWESBw/rgRrWZ1ErFtqR959/EDx+5AnYO5 TP7A== 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:to:from :dkim-signature; bh=akaP5CkcB85NRotBS27Sn9QbMl98HIBsHqiBEU5glnA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Oi9LIuQsN2i6hAx5d6N9uYul9NdQm3NRJsfHtJVm5ysP60McMN7olDoFem7pS/GWkI EzBPzT2zxawz2rRhz/jtUKHv9iQquvoGge/xYoY6u1yxfqfNihSpHUDz94Xtav9yWkeL aIrHnsstx66i8bWaMRFygYuP7pqUdm+sptuVy0yIMTwX6KiOLiUUQ48KO6JDCjO7qf8c GXSPOMQkMRETqoQE+huLTFpMsxrUqn3KqNo3kBrwzKnpfCOU3rNGmHBzwKs3wTs25lAk zX1WQYteVL5jpVt42QU3T6U1/2KLDA9Jz9qggHBQX47ES84b2Z1VtdMAyGRNSVXVRLJJ X60g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tjK9qR4+; 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 6a1803df08f44-6b59e60a7d0si83937506d6.483.2024.07.01.09.12.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:38 -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=tjK9qR4+; 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 1sOJZN-0001DW-Uc; Mon, 01 Jul 2024 12:07:57 -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 1sOJZ7-0000io-Ou for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ3-0005Pz-An for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:40 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42562a984d3so22946035e9.3 for ; Mon, 01 Jul 2024 09:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850054; x=1720454854; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=akaP5CkcB85NRotBS27Sn9QbMl98HIBsHqiBEU5glnA=; b=tjK9qR4+zybpryZmgTMTeQG0UJknsN59KSJvUeXiB1snzApX1ZHnxJCp3NrVEXp5wS FVfgSmJD2NzXQR+qs3kK1PRdvqfZhsaho2pjmboV60ZWRhgKYZ+87B6uOl+QAdUqYMsg 2Bam18Z8eAF1VIZiIjjYkvpbqgGZBSvxQuq3fB8YNvpvfAX8FE8W9GzSsuCZKM41v0Zf MK5IE6FxhZIWLmqRT0Ua59AE9wgKLv23Q8QEK0Jv2NugiAGSz10HNiIny6Oeh9pEhNmv 5pSnE2l6zKhiXwia1Bc26EqL3zJNAUI3X7MfJQkOpIVbxqmapCGHUlwon+sOilOdy+kh wsVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850054; x=1720454854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=akaP5CkcB85NRotBS27Sn9QbMl98HIBsHqiBEU5glnA=; b=eq04IR2jaKjYfYKPevkflo9xo6uHVhEw+i5qKyj4H2wJkKSvIqzXLnBkxWmvL31mDE eBUdOA2juRa1v0fQlz/dZAOWHyyA+Otaf8hPRzFNMVyuSvAIeUWji5o4y71DZUwSd7iT uFW5dTvFwRx4+UA5mglNONhTB4fxmqPL91+CxOnzfET3nAsl9AMQ+teieL44HcqywsXc fw6eQXDKKHNtcBM4fUB/WA3SI1BmlpAemAj4voKOlbjpG7g4kNKeGKXxXsSbks5fH9Ih pEECXvgGDTpVrBNs4694FtGYjAsnl558wWMUI2jkQIrda51Z/AS159ukfdcLZ+afQ5Rj nQiQ== X-Gm-Message-State: AOJu0YzSAnFR4Ug8Pw0xQdRLRoFckTR+v6EqMZDMeVZUq/GxSYruDqXV Nq0i43MjkDvDLt3sk07RVp0TKmbLJ10A0xiY4KLN7V6ZQeQOohOt6BDx9YsO+VL1AiKEtQr1jTi DsnA= X-Received: by 2002:a05:600c:5cb:b0:424:a4c1:6ee7 with SMTP id 5b1f17b1804b1-4257a010baamr39399315e9.18.1719850053972; Mon, 01 Jul 2024 09:07:33 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:33 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/29] target/arm: Fix SQDMULH (by element) with Q=0 Date: Mon, 1 Jul 2024 17:07:08 +0100 Message-Id: <20240701160729.1910763-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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: Richard Henderson The inner loop, bounded by eltspersegment, must not be larger than the outer loop, bounded by elements. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/vec_helper.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index 7b34cc98afe..d477479bb19 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -317,10 +317,12 @@ void HELPER(neon_sqdmulh_idx_h)(void *vd, void *vn, void *vm, intptr_t i, j, opr_sz = simd_oprsz(desc); int idx = simd_data(desc); int16_t *d = vd, *n = vn, *m = (int16_t *)vm + H2(idx); + intptr_t elements = opr_sz / 2; + intptr_t eltspersegment = MIN(16 / 2, elements); - for (i = 0; i < opr_sz / 2; i += 16 / 2) { + for (i = 0; i < elements; i += 16 / 2) { int16_t mm = m[i]; - for (j = 0; j < 16 / 2; ++j) { + for (j = 0; j < eltspersegment; ++j) { d[i + j] = do_sqrdmlah_h(n[i + j], mm, 0, false, false, vq); } } @@ -333,10 +335,12 @@ void HELPER(neon_sqrdmulh_idx_h)(void *vd, void *vn, void *vm, intptr_t i, j, opr_sz = simd_oprsz(desc); int idx = simd_data(desc); int16_t *d = vd, *n = vn, *m = (int16_t *)vm + H2(idx); + intptr_t elements = opr_sz / 2; + intptr_t eltspersegment = MIN(16 / 2, elements); - for (i = 0; i < opr_sz / 2; i += 16 / 2) { + for (i = 0; i < elements; i += 16 / 2) { int16_t mm = m[i]; - for (j = 0; j < 16 / 2; ++j) { + for (j = 0; j < eltspersegment; ++j) { d[i + j] = do_sqrdmlah_h(n[i + j], mm, 0, false, true, vq); } } @@ -512,10 +516,12 @@ void HELPER(neon_sqdmulh_idx_s)(void *vd, void *vn, void *vm, intptr_t i, j, opr_sz = simd_oprsz(desc); int idx = simd_data(desc); int32_t *d = vd, *n = vn, *m = (int32_t *)vm + H4(idx); + intptr_t elements = opr_sz / 4; + intptr_t eltspersegment = MIN(16 / 4, elements); - for (i = 0; i < opr_sz / 4; i += 16 / 4) { + for (i = 0; i < elements; i += 16 / 4) { int32_t mm = m[i]; - for (j = 0; j < 16 / 4; ++j) { + for (j = 0; j < eltspersegment; ++j) { d[i + j] = do_sqrdmlah_s(n[i + j], mm, 0, false, false, vq); } } @@ -528,10 +534,12 @@ void HELPER(neon_sqrdmulh_idx_s)(void *vd, void *vn, void *vm, intptr_t i, j, opr_sz = simd_oprsz(desc); int idx = simd_data(desc); int32_t *d = vd, *n = vn, *m = (int32_t *)vm + H4(idx); + intptr_t elements = opr_sz / 4; + intptr_t eltspersegment = MIN(16 / 4, elements); - for (i = 0; i < opr_sz / 4; i += 16 / 4) { + for (i = 0; i < elements; i += 16 / 4) { int32_t mm = m[i]; - for (j = 0; j < 16 / 4; ++j) { + for (j = 0; j < eltspersegment; ++j) { d[i + j] = do_sqrdmlah_s(n[i + j], mm, 0, false, true, vq); } } From patchwork Mon Jul 1 16:07:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808836 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649531wrr; Mon, 1 Jul 2024 09:08:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXjg0oVzLVWj++LVlCCvvcqpI4d+mg7rLa0EUAw9ohQLfC4oMHG8YmZuwBZcbarK3rjJop4dU9sL0nHQp3K9Hwq X-Google-Smtp-Source: AGHT+IGPI7Kd+8Gr3C1Rd9ki49PQdSWJBhsFaHBBX2uIV4Cb6hi1/EHV8Xy5bpBc69ctpq8PkjTe X-Received: by 2002:ad4:4eec:0:b0:6b5:4e07:2a55 with SMTP id 6a1803df08f44-6b5b70cd66dmr69412426d6.29.1719850122969; Mon, 01 Jul 2024 09:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850122; cv=none; d=google.com; s=arc-20160816; b=Qaw0llA4d/ASvnqGEvuOUV8MGBsf7XyEoUq/uZDjIrC2GqfqUfPEpFe0UvQjCj/6yv Qs3RlBy1rTTkeMQF8kWeM1MemGIZkrufhajjjz2LnQWVfdKI7i65fewqp260nFcjq7Rb q8d7q1ifYV5TOHtos4hXu+pFhRGDmceGNJNpRzhKn4+g9rPf0QySAfbHNhNGY2AenyJb LCPt6AMsfrFXnN9615MJ8dLpN+/DY9MUeBVcF+mwLr/Y8KGrwh02S6DzifTzzp26fkBz nRdlu8TJv0fk6d0PPADf3ImEKFgY/cdzf4YyKiDiOzZg/MGuHWuKDOv0Hmb/lNL3eyie Z2vw== 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:to:from :dkim-signature; bh=NhncFmRxTCqHeeAjQL/H7qSFcoMoI/tEsiuUH4prtHE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ehcCwi90kSrYhvRJkdwHG9ShhF99YUXJgi5pl9D2FJlK6si8eMBOluyPGKACBxr8WI WeYjW+/Tni3ABb39IepFfk88xYkY/oVr6J9wTpgxzaopxDAXYIA2NIQ9dEViiqjsZjOt lU/mcRc3CUfUYQlScSHhflRf9a4j4vOyUiZHBBMsG/+Y9iXrKfDJwYyz+3G7V/ef+6a7 SMV1JvgsJmZUKs8tMBFqa+PP2EbZwNl3/QxfEFseHfXzAC5Cdu66UATCvvLICiyvmpj+ CKiRGYHJ2CrKUnQDRoVvgzn8M7Qnwdm0vnzYjeai9+qTZY97ezY+Iz596igO/pKGVAso Gbag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MnVHK/8i"; 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 6a1803df08f44-6b59e5f0e5csi86504246d6.422.2024.07.01.09.08.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:42 -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="MnVHK/8i"; 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 1sOJZy-0002aS-5z; Mon, 01 Jul 2024 12:08:34 -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 1sOJZ6-0000g0-En for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:41 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ2-0005QP-Fz for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:40 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-424acfff613so29038325e9.0 for ; Mon, 01 Jul 2024 09:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850054; x=1720454854; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NhncFmRxTCqHeeAjQL/H7qSFcoMoI/tEsiuUH4prtHE=; b=MnVHK/8i71eFjzLn7SWXn/ArTniqv0ai07leHFpYw7YNWeYJrgDfByvkdygD4UF0dx jtUiyyYNmDXkZU7b1eP5KyKc6vIGVxEfb/RlLlGpZfbCwZZ9kak++xVi1m+WRbcqtkuu BZXYZ2OJWwEpL4V8WnAChkv3JjamhppR5nZE5jPIGn/ionNkyQYS/+Hrmgh0njWLc0f4 txwc1YsH5e4pRTQJhtHlhT0ebPvndu4G6teGnstbyCh9/Lj8XqmvI1a5pyns4tqMzw+z ZvMVI1gJpX9c5AWYBAYtDy5oxhnuMowDq/+B16qKDkQuASiqRgok30YwKIYMf1zgTPSm UZjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850054; x=1720454854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NhncFmRxTCqHeeAjQL/H7qSFcoMoI/tEsiuUH4prtHE=; b=P4/Yv3p9DY5qpAOfHH+TzJ0s3P5LhhGXDqQcucsByzuZpCLJ6tMv9zaFLo0J9tMVGq LSmpJwol8lbHjkXhfkPZ/RaxazZyh8bUXfFVFupPV8jXVF1JU3FU2Ir8+uJkcXWevFTf glJJerCv3YbeAUFvnEt8GyCFYrZngy4DWQZXTUbsLze3BB7iVoRaqEwq0T9+G/zZZnkK fZMZou87AGI93TxFZvEwP6HqYZFQibsJ41XQDgQruzOF5ZiqbTc15BK+F9xljZ+5NNo/ GEqE4nn/CEX/+iIQY/kv3eCf1v6N0G0ek1k19lqj6+c51DpPo9fFcvb+7Fw8ufaS5esk U4Ig== X-Gm-Message-State: AOJu0YxkNEaqWbWi4r12HejTQ9fLOmMbZkRa/bK1SZ+vt6Vjz8J97LHh CbuSzF3uKOs93Irqdl5AtsWJcyqF9PoC8MARj8mwIz9T0itIg/7/X9W5r2JZmbGKO0qmjMru0sJ zccw= X-Received: by 2002:a05:600c:3552:b0:424:aa35:9fb9 with SMTP id 5b1f17b1804b1-42579ffcc91mr52436785e9.2.1719850054359; Mon, 01 Jul 2024 09:07:34 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/29] target/arm: Fix FJCVTZS vs flush-to-zero Date: Mon, 1 Jul 2024 17:07:09 +0100 Message-Id: <20240701160729.1910763-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Richard Henderson Input denormals cause the Javascript inexact bit (output to Z) to be set. Cc: qemu-stable@nongnu.org Fixes: 6c1f6f2733a ("target/arm: Implement ARMv8.3-JSConv") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2375 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-4-richard.henderson@linaro.org [PMM: fixed hardcoded tab in test case] Signed-off-by: Peter Maydell --- target/arm/vfp_helper.c | 18 +++++++++--------- tests/tcg/aarch64/test-2375.c | 21 +++++++++++++++++++++ tests/tcg/aarch64/Makefile.target | 3 ++- 3 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 tests/tcg/aarch64/test-2375.c diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index ce26b8a71a1..50d7042fa9e 100644 --- a/target/arm/vfp_helper.c +++ b/target/arm/vfp_helper.c @@ -1091,8 +1091,8 @@ const FloatRoundMode arm_rmode_to_sf_map[] = { uint64_t HELPER(fjcvtzs)(float64 value, void *vstatus) { float_status *status = vstatus; - uint32_t inexact, frac; - uint32_t e_old, e_new; + uint32_t frac, e_old, e_new; + bool inexact; e_old = get_float_exception_flags(status); set_float_exception_flags(0, status); @@ -1100,13 +1100,13 @@ uint64_t HELPER(fjcvtzs)(float64 value, void *vstatus) e_new = get_float_exception_flags(status); set_float_exception_flags(e_old | e_new, status); - if (value == float64_chs(float64_zero)) { - /* While not inexact for IEEE FP, -0.0 is inexact for JavaScript. */ - inexact = 1; - } else { - /* Normal inexact or overflow or NaN */ - inexact = e_new & (float_flag_inexact | float_flag_invalid); - } + /* Normal inexact, denormal with flush-to-zero, or overflow or NaN */ + inexact = e_new & (float_flag_inexact | + float_flag_input_denormal | + float_flag_invalid); + + /* While not inexact for IEEE FP, -0.0 is inexact for JavaScript. */ + inexact |= value == float64_chs(float64_zero); /* Pack the result and the env->ZF representation of Z together. */ return deposit64(frac, 32, 32, inexact); diff --git a/tests/tcg/aarch64/test-2375.c b/tests/tcg/aarch64/test-2375.c new file mode 100644 index 00000000000..84c7e7de716 --- /dev/null +++ b/tests/tcg/aarch64/test-2375.c @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* Copyright (c) 2024 Linaro Ltd */ +/* See https://gitlab.com/qemu-project/qemu/-/issues/2375 */ + +#include + +int main(void) +{ + int r, z; + + asm("msr fpcr, %2\n\t" + "fjcvtzs %w0, %d3\n\t" + "cset %1, eq" + : "=r"(r), "=r"(z) + : "r"(0x01000000L), /* FZ = 1 */ + "w"(0xfcff00L)); /* denormal */ + + assert(r == 0); + assert(z == 0); + return 0; +} diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 70d728ae9af..4ecbca6a416 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -41,8 +41,9 @@ endif # Pauth Tests ifneq ($(CROSS_CC_HAS_ARMV8_3),) -AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5 +AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5 test-2375 pauth-%: CFLAGS += -march=armv8.3-a +test-2375: CFLAGS += -march=armv8.3-a run-pauth-1: QEMU_OPTS += -cpu max run-pauth-2: QEMU_OPTS += -cpu max # Choose a cpu with FEAT_Pauth but without FEAT_FPAC for pauth-[45]. From patchwork Mon Jul 1 16:07:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808850 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651618wrr; Mon, 1 Jul 2024 09:12:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWoY0p39OO2Sgo/2jMVaLLXpYGlsiL1RuOUs1w1S8mC5p9MB/53VmWqqRout029TJ2GH0yvKJPTo49XZ6mwOKUJ X-Google-Smtp-Source: AGHT+IHH8GcTz8TY5wJ8gcgeVATlsu6cfSQeiEuBsK5pobVqfwaxU62kMsUc+cdd43nB7G1GhQAO X-Received: by 2002:a05:6214:d0f:b0:6af:6799:912c with SMTP id 6a1803df08f44-6b5b71a2476mr65800576d6.54.1719850357043; Mon, 01 Jul 2024 09:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850357; cv=none; d=google.com; s=arc-20160816; b=hbUdT5BcP05MFZ4UlEVWozwctu25a1QG6eLUQlLbuCTcbQh2zgUchBX3IEu4wlYKU6 4s8ePd3tgMgiBk4V3GLKMRJjvKy0yr6sol0U0yt/JVOr44dFIA8sWCcBRJ6p7J01p2sE QFDu7u4ZSIQV5qV7NJxBgs52jgYTvC+ZWPBVEXUZ8l/0797o5lD/saodBWa2uOKACel3 SSrvu0cp4TrZx9dVv59UE6ZQUr3THZY0Ddh2gu7FPJjEbs25+A3XWdqwhXsTBB0reSIp 7iYQRiEjGvzAxvgOg4gO21cU8LE9t6fwqqkfFmfw4G6xd04QbOSq/lQ8vtT+midDF9WR Pz7A== 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:to:from :dkim-signature; bh=JxKVJIA5wo1qWrq4v4ZGoeISyR7a2N05QyKg/e3Ewm4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=oeaBVqz9w2K3VGR1SIXwT6qqX9nbLr0krbXXq24Jj3plG4kvzKRSsuJ4gEj2RVUfQX yvnZNLM6SFHqYIbPGSRN5Z8wyF+L+srbd0KelQAh+NIw6r1wmKJuMS8ZGFRW1cTunehX tiM28MESLvJ+7BMFDN6ReNKqG7a+dxCXI9fjqp7aNwiw75OQww/pBlv+BwUDfk0Rmglq gLs1Keuvjqm/Y2TCZEtpspg45vZigBtp6yzOEoY9jJTyCEORPb+45+Q+Z0zHQHzmjBn3 Tk2WuRzed2pMJjGBEfsscig1j66eAwcD3lkAnGICi20831deKJJoViOkUndrJA0zG1IA sIpg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YVnNa8zp; 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 6a1803df08f44-6b59e60b0fcsi83306596d6.511.2024.07.01.09.12.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:37 -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=YVnNa8zp; 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 1sOJa3-0002tY-E8; Mon, 01 Jul 2024 12:08:39 -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 1sOJZC-0000mv-Q9 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:47 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ2-0005Qa-It for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:45 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42574064b16so19649565e9.2 for ; Mon, 01 Jul 2024 09:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850055; x=1720454855; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JxKVJIA5wo1qWrq4v4ZGoeISyR7a2N05QyKg/e3Ewm4=; b=YVnNa8zphu1q/VVCeMfH5DQyBmvN5VbM3qSX5vbflXerk9cQMGnMFpbg7gRWe9o9Rj EreY5I5c2BJpqHDWLLRBF+rVg3GTVPY3haOBqCzxN/dni+/jh+PVsTwIPt/+noeHH+yD LSoUo9hG7laegMojzV5fbgxjZ5BcqeZgaAwoe50CWBiuAtQ4q5qE0sGnczpxrxdDs4gf kJcMETdhlolXrgcv0oihbNPVcwLdJ3J2nHHm9+A8NhL48KJep+uyT9mTpLcOHbN+XLiP jf+U6HCkKMh/1FNelwTcFMg/rQeYlbuxylXPLzWtqArFWeMhT7jYF2nJ56tdzv+MhlY/ dPVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850055; x=1720454855; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JxKVJIA5wo1qWrq4v4ZGoeISyR7a2N05QyKg/e3Ewm4=; b=kqDjbnYlzmbzwSRds/luc6M3aKXaPNPLCbkauBDLP+FsDLh1oOo5M42hNyUqyEHZG/ ThvCrWawe6cOboADNrC7umuR0vw2XoSHhoRCYEYMYhqaVFIgzbnj/EJr+2igDB+hZsjp GyKXDQF7zwMpvZD7S+dV+xtF7bvLhGPTd1Zts+XLfsggn1guoUHJXJ2YKx0WR0sS8uet vvG26aUvE2kuXVr8/UYgpFBwvaC0PEKKP+gcJMR0J3sVSsE4mJc9xuhcB38UQOC/Ccup lQ5tWnJYNjacyuJc52Ft1zhw8mC0n1mQbufDYHqMKjQ7wMcdyY55fxCmofhL9R2qU5lT UfBA== X-Gm-Message-State: AOJu0Yw9tv9smmi7yb0dMTJc6ewkb4nahUEHbbwG6ejrZ2YGDy/q/6Fv 6bfo0yhdd5HfB5Cc5ZImr3egP2mIlOU2qFu1IF/J8t0/Qn+NMh66FNhUdLqQeY3kMj5AJmeInXN bhCs= X-Received: by 2002:a05:600c:3388:b0:424:a587:51d3 with SMTP id 5b1f17b1804b1-4257a02f6f2mr41278005e9.13.1719850054860; Mon, 01 Jul 2024 09:07:34 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/29] target/arm: Convert SQRDMLAH, SQRDMLSH to decodetree Date: Mon, 1 Jul 2024 17:07:10 +0100 Message-Id: <20240701160729.1910763-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-5-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 10 ++ target/arm/tcg/a64.decode | 16 +++ target/arm/tcg/translate-a64.c | 206 +++++++++++++-------------------- target/arm/tcg/vec_helper.c | 72 ++++++++++++ 4 files changed, 180 insertions(+), 124 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index eca2043fc2a..970d059dec5 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -979,6 +979,16 @@ DEF_HELPER_FLAGS_5(neon_sqrdmulh_idx_h, TCG_CALL_NO_RWG, DEF_HELPER_FLAGS_5(neon_sqrdmulh_idx_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(neon_sqrdmlah_idx_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(neon_sqrdmlah_idx_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) + +DEF_HELPER_FLAGS_5(neon_sqrdmlsh_idx_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(neon_sqrdmlsh_idx_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) + DEF_HELPER_FLAGS_4(sve2_sqdmulh_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_sqdmulh_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_sqdmulh_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 2b7a3254a0e..613cc9365cf 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -781,6 +781,8 @@ CMEQ_s 0111 1110 111 ..... 10001 1 ..... ..... @rrr_d SQDMULH_s 0101 1110 ..1 ..... 10110 1 ..... ..... @rrr_e SQRDMULH_s 0111 1110 ..1 ..... 10110 1 ..... ..... @rrr_e +SQRDMLAH_s 0111 1110 ..0 ..... 10000 1 ..... ..... @rrr_e +SQRDMLSH_s 0111 1110 ..0 ..... 10001 1 ..... ..... @rrr_e ### Advanced SIMD scalar pairwise @@ -941,6 +943,8 @@ MLS_v 0.10 1110 ..1 ..... 10010 1 ..... ..... @qrrr_e SQDMULH_v 0.00 1110 ..1 ..... 10110 1 ..... ..... @qrrr_e SQRDMULH_v 0.10 1110 ..1 ..... 10110 1 ..... ..... @qrrr_e +SQRDMLAH_v 0.10 1110 ..0 ..... 10000 1 ..... ..... @qrrr_e +SQRDMLSH_v 0.10 1110 ..0 ..... 10001 1 ..... ..... @qrrr_e ### Advanced SIMD scalar x indexed element @@ -966,6 +970,12 @@ SQDMULH_si 0101 1111 10 .. .... 1100 . 0 ..... ..... @rrx_s SQRDMULH_si 0101 1111 01 .. .... 1101 . 0 ..... ..... @rrx_h SQRDMULH_si 0101 1111 10 . ..... 1101 . 0 ..... ..... @rrx_s +SQRDMLAH_si 0111 1111 01 .. .... 1101 . 0 ..... ..... @rrx_h +SQRDMLAH_si 0111 1111 10 .. .... 1101 . 0 ..... ..... @rrx_s + +SQRDMLSH_si 0111 1111 01 .. .... 1111 . 0 ..... ..... @rrx_h +SQRDMLSH_si 0111 1111 10 .. .... 1111 . 0 ..... ..... @rrx_s + ### Advanced SIMD vector x indexed element FMUL_vi 0.00 1111 00 .. .... 1001 . 0 ..... ..... @qrrx_h @@ -1004,6 +1014,12 @@ SQDMULH_vi 0.00 1111 10 . ..... 1100 . 0 ..... ..... @qrrx_s SQRDMULH_vi 0.00 1111 01 .. .... 1101 . 0 ..... ..... @qrrx_h SQRDMULH_vi 0.00 1111 10 . ..... 1101 . 0 ..... ..... @qrrx_s +SQRDMLAH_vi 0.10 1111 01 .. .... 1101 . 0 ..... ..... @qrrx_h +SQRDMLAH_vi 0.10 1111 10 .. .... 1101 . 0 ..... ..... @qrrx_s + +SQRDMLSH_vi 0.10 1111 01 .. .... 1111 . 0 ..... ..... @qrrx_h +SQRDMLSH_vi 0.10 1111 10 .. .... 1111 . 0 ..... ..... @qrrx_s + # Floating-point conditional select FCSEL 0001 1110 .. 1 rm:5 cond:4 11 rn:5 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 93543da39cc..32c24c74220 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5235,6 +5235,43 @@ static const ENVScalar2 f_scalar_sqrdmulh = { }; TRANS(SQRDMULH_s, do_env_scalar2_hs, a, &f_scalar_sqrdmulh) +typedef struct ENVScalar3 { + NeonGenThreeOpEnvFn *gen_hs[2]; +} ENVScalar3; + +static bool do_env_scalar3_hs(DisasContext *s, arg_rrr_e *a, + const ENVScalar3 *f) +{ + TCGv_i32 t0, t1, t2; + + if (a->esz != MO_16 && a->esz != MO_32) { + return false; + } + if (!fp_access_check(s)) { + return true; + } + + t0 = tcg_temp_new_i32(); + t1 = tcg_temp_new_i32(); + t2 = tcg_temp_new_i32(); + read_vec_element_i32(s, t0, a->rn, 0, a->esz); + read_vec_element_i32(s, t1, a->rm, 0, a->esz); + read_vec_element_i32(s, t2, a->rd, 0, a->esz); + f->gen_hs[a->esz - 1](t0, tcg_env, t0, t1, t2); + write_fp_sreg(s, a->rd, t0); + return true; +} + +static const ENVScalar3 f_scalar_sqrdmlah = { + { gen_helper_neon_qrdmlah_s16, gen_helper_neon_qrdmlah_s32 } +}; +TRANS_FEAT(SQRDMLAH_s, aa64_rdm, do_env_scalar3_hs, a, &f_scalar_sqrdmlah) + +static const ENVScalar3 f_scalar_sqrdmlsh = { + { gen_helper_neon_qrdmlsh_s16, gen_helper_neon_qrdmlsh_s32 } +}; +TRANS_FEAT(SQRDMLSH_s, aa64_rdm, do_env_scalar3_hs, a, &f_scalar_sqrdmlsh) + static bool do_cmop_d(DisasContext *s, arg_rrr_e *a, TCGCond cond) { if (fp_access_check(s)) { @@ -5552,6 +5589,8 @@ TRANS(CMTST_v, do_gvec_fn3, a, gen_gvec_cmtst) TRANS(SQDMULH_v, do_gvec_fn3_no8_no64, a, gen_gvec_sqdmulh_qc) TRANS(SQRDMULH_v, do_gvec_fn3_no8_no64, a, gen_gvec_sqrdmulh_qc) +TRANS_FEAT(SQRDMLAH_v, aa64_rdm, do_gvec_fn3_no8_no64, a, gen_gvec_sqrdmlah_qc) +TRANS_FEAT(SQRDMLSH_v, aa64_rdm, do_gvec_fn3_no8_no64, a, gen_gvec_sqrdmlsh_qc) /* * Advanced SIMD scalar/vector x indexed element @@ -5681,6 +5720,29 @@ static bool do_env_scalar2_idx_hs(DisasContext *s, arg_rrx_e *a, TRANS(SQDMULH_si, do_env_scalar2_idx_hs, a, &f_scalar_sqdmulh) TRANS(SQRDMULH_si, do_env_scalar2_idx_hs, a, &f_scalar_sqrdmulh) +static bool do_env_scalar3_idx_hs(DisasContext *s, arg_rrx_e *a, + const ENVScalar3 *f) +{ + if (a->esz < MO_16 || a->esz > MO_32) { + return false; + } + if (fp_access_check(s)) { + TCGv_i32 t0 = tcg_temp_new_i32(); + TCGv_i32 t1 = tcg_temp_new_i32(); + TCGv_i32 t2 = tcg_temp_new_i32(); + + read_vec_element_i32(s, t0, a->rn, 0, a->esz); + read_vec_element_i32(s, t1, a->rm, a->idx, a->esz); + read_vec_element_i32(s, t2, a->rd, 0, a->esz); + f->gen_hs[a->esz - 1](t0, tcg_env, t0, t1, t2); + write_fp_sreg(s, a->rd, t0); + } + return true; +} + +TRANS_FEAT(SQRDMLAH_si, aa64_rdm, do_env_scalar3_idx_hs, a, &f_scalar_sqrdmlah) +TRANS_FEAT(SQRDMLSH_si, aa64_rdm, do_env_scalar3_idx_hs, a, &f_scalar_sqrdmlsh) + static bool do_fp3_vector_idx(DisasContext *s, arg_qrrx_e *a, gen_helper_gvec_3_ptr * const fns[3]) { @@ -5838,6 +5900,20 @@ static gen_helper_gvec_4 * const f_vector_idx_sqrdmulh[2] = { }; TRANS(SQRDMULH_vi, do_int3_qc_vector_idx, a, f_vector_idx_sqrdmulh) +static gen_helper_gvec_4 * const f_vector_idx_sqrdmlah[2] = { + gen_helper_neon_sqrdmlah_idx_h, + gen_helper_neon_sqrdmlah_idx_s, +}; +TRANS_FEAT(SQRDMLAH_vi, aa64_rdm, do_int3_qc_vector_idx, a, + f_vector_idx_sqrdmlah) + +static gen_helper_gvec_4 * const f_vector_idx_sqrdmlsh[2] = { + gen_helper_neon_sqrdmlsh_idx_h, + gen_helper_neon_sqrdmlsh_idx_s, +}; +TRANS_FEAT(SQRDMLSH_vi, aa64_rdm, do_int3_qc_vector_idx, a, + f_vector_idx_sqrdmlsh) + /* * Advanced SIMD scalar pairwise */ @@ -9536,84 +9612,6 @@ static void disas_simd_scalar_three_reg_diff(DisasContext *s, uint32_t insn) } } -/* AdvSIMD scalar three same extra - * 31 30 29 28 24 23 22 21 20 16 15 14 11 10 9 5 4 0 - * +-----+---+-----------+------+---+------+---+--------+---+----+----+ - * | 0 1 | U | 1 1 1 1 0 | size | 0 | Rm | 1 | opcode | 1 | Rn | Rd | - * +-----+---+-----------+------+---+------+---+--------+---+----+----+ - */ -static void disas_simd_scalar_three_reg_same_extra(DisasContext *s, - uint32_t insn) -{ - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int opcode = extract32(insn, 11, 4); - int rm = extract32(insn, 16, 5); - int size = extract32(insn, 22, 2); - bool u = extract32(insn, 29, 1); - TCGv_i32 ele1, ele2, ele3; - TCGv_i64 res; - bool feature; - - switch (u * 16 + opcode) { - case 0x10: /* SQRDMLAH (vector) */ - case 0x11: /* SQRDMLSH (vector) */ - if (size != 1 && size != 2) { - unallocated_encoding(s); - return; - } - feature = dc_isar_feature(aa64_rdm, s); - break; - default: - unallocated_encoding(s); - return; - } - if (!feature) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - - /* Do a single operation on the lowest element in the vector. - * We use the standard Neon helpers and rely on 0 OP 0 == 0 - * with no side effects for all these operations. - * OPTME: special-purpose helpers would avoid doing some - * unnecessary work in the helper for the 16 bit cases. - */ - ele1 = tcg_temp_new_i32(); - ele2 = tcg_temp_new_i32(); - ele3 = tcg_temp_new_i32(); - - read_vec_element_i32(s, ele1, rn, 0, size); - read_vec_element_i32(s, ele2, rm, 0, size); - read_vec_element_i32(s, ele3, rd, 0, size); - - switch (opcode) { - case 0x0: /* SQRDMLAH */ - if (size == 1) { - gen_helper_neon_qrdmlah_s16(ele3, tcg_env, ele1, ele2, ele3); - } else { - gen_helper_neon_qrdmlah_s32(ele3, tcg_env, ele1, ele2, ele3); - } - break; - case 0x1: /* SQRDMLSH */ - if (size == 1) { - gen_helper_neon_qrdmlsh_s16(ele3, tcg_env, ele1, ele2, ele3); - } else { - gen_helper_neon_qrdmlsh_s32(ele3, tcg_env, ele1, ele2, ele3); - } - break; - default: - g_assert_not_reached(); - } - - res = tcg_temp_new_i64(); - tcg_gen_extu_i32_i64(res, ele3); - write_fp_dreg(s, rd, res); -} - static void handle_2misc_64(DisasContext *s, int opcode, bool u, TCGv_i64 tcg_rd, TCGv_i64 tcg_rn, TCGv_i32 tcg_rmode, TCGv_ptr tcg_fpstatus) @@ -10892,14 +10890,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) int rot; switch (u * 16 + opcode) { - case 0x10: /* SQRDMLAH (vector) */ - case 0x11: /* SQRDMLSH (vector) */ - if (size != 1 && size != 2) { - unallocated_encoding(s); - return; - } - feature = dc_isar_feature(aa64_rdm, s); - break; case 0x02: /* SDOT (vector) */ case 0x12: /* UDOT (vector) */ if (size != MO_32) { @@ -10957,6 +10947,8 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } break; default: + case 0x10: /* SQRDMLAH (vector) */ + case 0x11: /* SQRDMLSH (vector) */ unallocated_encoding(s); return; } @@ -10969,14 +10961,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x0: /* SQRDMLAH (vector) */ - gen_gvec_fn3(s, is_q, rd, rn, rm, gen_gvec_sqrdmlah_qc, size); - return; - - case 0x1: /* SQRDMLSH (vector) */ - gen_gvec_fn3(s, is_q, rd, rn, rm, gen_gvec_sqrdmlsh_qc, size); - return; - case 0x2: /* SDOT / UDOT */ gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, 0, u ? gen_helper_gvec_udot_b : gen_helper_gvec_sdot_b); @@ -12059,13 +12043,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x0b: /* SQDMULL, SQDMULL2 */ is_long = true; break; - case 0x1d: /* SQRDMLAH */ - case 0x1f: /* SQRDMLSH */ - if (!dc_isar_feature(aa64_rdm, s)) { - unallocated_encoding(s); - return; - } - break; case 0x0e: /* SDOT */ case 0x1e: /* UDOT */ if (is_scalar || size != MO_32 || !dc_isar_feature(aa64_dp, s)) { @@ -12127,6 +12104,8 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x18: /* FMLAL2 */ case 0x19: /* FMULX */ case 0x1c: /* FMLSL2 */ + case 0x1d: /* SQRDMLAH */ + case 0x1f: /* SQRDMLSH */ unallocated_encoding(s); return; } @@ -12320,33 +12299,13 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) tcg_op, tcg_idx); } break; - case 0x1d: /* SQRDMLAH */ - read_vec_element_i32(s, tcg_res, rd, pass, - is_scalar ? size : MO_32); - if (size == 1) { - gen_helper_neon_qrdmlah_s16(tcg_res, tcg_env, - tcg_op, tcg_idx, tcg_res); - } else { - gen_helper_neon_qrdmlah_s32(tcg_res, tcg_env, - tcg_op, tcg_idx, tcg_res); - } - break; - case 0x1f: /* SQRDMLSH */ - read_vec_element_i32(s, tcg_res, rd, pass, - is_scalar ? size : MO_32); - if (size == 1) { - gen_helper_neon_qrdmlsh_s16(tcg_res, tcg_env, - tcg_op, tcg_idx, tcg_res); - } else { - gen_helper_neon_qrdmlsh_s32(tcg_res, tcg_env, - tcg_op, tcg_idx, tcg_res); - } - break; default: case 0x01: /* FMLA */ case 0x05: /* FMLS */ case 0x09: /* FMUL */ case 0x19: /* FMULX */ + case 0x1d: /* SQRDMLAH */ + case 0x1f: /* SQRDMLSH */ g_assert_not_reached(); } @@ -12538,7 +12497,6 @@ static const AArch64DecodeTable data_proc_simd[] = { { 0x0e000000, 0xbf208c00, disas_simd_tb }, { 0x0e000800, 0xbf208c00, disas_simd_zip_trn }, { 0x2e000000, 0xbf208400, disas_simd_ext }, - { 0x5e008400, 0xdf208400, disas_simd_scalar_three_reg_same_extra }, { 0x5e200000, 0xdf200c00, disas_simd_scalar_three_reg_diff }, { 0x5e200800, 0xdf3e0c00, disas_simd_scalar_two_reg_misc }, { 0x5f000000, 0xdf000400, disas_simd_indexed }, /* scalar indexed */ diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index d477479bb19..98604d170fd 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -347,6 +347,42 @@ void HELPER(neon_sqrdmulh_idx_h)(void *vd, void *vn, void *vm, clear_tail(d, opr_sz, simd_maxsz(desc)); } +void HELPER(neon_sqrdmlah_idx_h)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, j, opr_sz = simd_oprsz(desc); + int idx = simd_data(desc); + int16_t *d = vd, *n = vn, *m = (int16_t *)vm + H2(idx); + intptr_t elements = opr_sz / 2; + intptr_t eltspersegment = MIN(16 / 2, elements); + + for (i = 0; i < elements; i += 16 / 2) { + int16_t mm = m[i]; + for (j = 0; j < eltspersegment; ++j) { + d[i + j] = do_sqrdmlah_h(n[i + j], mm, d[i + j], false, true, vq); + } + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + +void HELPER(neon_sqrdmlsh_idx_h)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, j, opr_sz = simd_oprsz(desc); + int idx = simd_data(desc); + int16_t *d = vd, *n = vn, *m = (int16_t *)vm + H2(idx); + intptr_t elements = opr_sz / 2; + intptr_t eltspersegment = MIN(16 / 2, elements); + + for (i = 0; i < elements; i += 16 / 2) { + int16_t mm = m[i]; + for (j = 0; j < eltspersegment; ++j) { + d[i + j] = do_sqrdmlah_h(n[i + j], mm, d[i + j], true, true, vq); + } + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + void HELPER(sve2_sqrdmlah_h)(void *vd, void *vn, void *vm, void *va, uint32_t desc) { @@ -546,6 +582,42 @@ void HELPER(neon_sqrdmulh_idx_s)(void *vd, void *vn, void *vm, clear_tail(d, opr_sz, simd_maxsz(desc)); } +void HELPER(neon_sqrdmlah_idx_s)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, j, opr_sz = simd_oprsz(desc); + int idx = simd_data(desc); + int32_t *d = vd, *n = vn, *m = (int32_t *)vm + H4(idx); + intptr_t elements = opr_sz / 4; + intptr_t eltspersegment = MIN(16 / 4, elements); + + for (i = 0; i < elements; i += 16 / 4) { + int32_t mm = m[i]; + for (j = 0; j < eltspersegment; ++j) { + d[i + j] = do_sqrdmlah_s(n[i + j], mm, d[i + j], false, true, vq); + } + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + +void HELPER(neon_sqrdmlsh_idx_s)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, j, opr_sz = simd_oprsz(desc); + int idx = simd_data(desc); + int32_t *d = vd, *n = vn, *m = (int32_t *)vm + H4(idx); + intptr_t elements = opr_sz / 4; + intptr_t eltspersegment = MIN(16 / 4, elements); + + for (i = 0; i < elements; i += 16 / 4) { + int32_t mm = m[i]; + for (j = 0; j < eltspersegment; ++j) { + d[i + j] = do_sqrdmlah_s(n[i + j], mm, d[i + j], true, true, vq); + } + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + void HELPER(sve2_sqrdmlah_s)(void *vd, void *vn, void *vm, void *va, uint32_t desc) { From patchwork Mon Jul 1 16:07:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808835 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649478wrr; Mon, 1 Jul 2024 09:08:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWIvIymBax+IX2EM9/SDdQnWAB6gioyjUSndVXP8s2LWv/wN7jz85HgJl9vMi7vmia86hzagd+R7mR0eoJ9hCgK X-Google-Smtp-Source: AGHT+IGrXmYXQpobQc4YILI4FVKSvdXWstnI+O+qtY+YOUkVljPZrlltT9N3t5q9DaEU6itmMnST X-Received: by 2002:a05:6102:4a45:b0:48f:1674:f5bb with SMTP id ada2fe7eead31-48faf084407mr6118645137.9.1719850115949; Mon, 01 Jul 2024 09:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850115; cv=none; d=google.com; s=arc-20160816; b=HRMfiQ4kgERb5d6IuqVZgl93xvgK3qxcpd7wavcKSxhY4vE5TUGdKBIcGPwEaNNSdO tyQQTEQATagOEctydNIM3iyAYpEnIu4qyHSsRukN1Cdh9ymHQ/xhHUHQx7CcITk10BwM 9mgDX0xSu+dgEqnc9J/a3IEvST38iK4Mjd7eX5cVQt4evPQzzzr95XNo0J0impSq+oQ8 Ru/A4Byh2nUS8J1nscLso2mV29TGvMIHVGwrOLSrRQc/1XKKFwp1WYw9vZHZ9LrlzstI oL48YpB+Q8tYKElAzNYpD7KRfasoRjZn0Pj0+kaZ1mQely/O5GFt/OY0XHCSar+pgXBr fJLA== 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:to:from :dkim-signature; bh=KO+Ue5WI+Dk6bpHtouuUAVCsqXLYR79qpaKwGCAIHiM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=W46q8Fq7kZea29yROahxVEc6+eLl38B4Xw0+Xjxpgr28HPl+8EyHCx918bCFU74i+n z/LWnLujVk3XMS8iXajw2Z3Pr00zV/W0AIJUPWeSnu+nXs3YdVwlzEfHey84kyQNCC3q K1zAUI3yLogJ6O9Y4THHxiNpo3Gmenk1KJLJt3NGKkl2JYxRV27b8eCeXT/0PE1lRQ3U OdLpByHZn11O6LFqeEFQajStTx2LNnYwA3GFFBKnNnIQ9LoGwX/fmNHwbvlpPqwuH0zz cdGzzGrNdQ9Qeo/YrkhBvoQQoD4As5ss8YxwsNq7dt91OXPeV4Skkp7mcBzVCBxfkkoL vmDg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egDQKOVz; 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 ada2fe7eead31-48f9b27e1a3si1197802137.640.2024.07.01.09.08.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:35 -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=egDQKOVz; 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 1sOJZN-0001EF-Vq; Mon, 01 Jul 2024 12:07:58 -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 1sOJZ6-0000fz-Ed for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:41 -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 1sOJZ3-0005Qj-VF for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:39 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-424ad289912so23112615e9.2 for ; Mon, 01 Jul 2024 09:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850055; x=1720454855; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KO+Ue5WI+Dk6bpHtouuUAVCsqXLYR79qpaKwGCAIHiM=; b=egDQKOVzYIYuj8BYa8rgTiXbdOX31rxbLQ7EAKbfgLZ1j2+iDt2McAnd94IQNY2QMd aDppJB8nLy//jrkG0TZVmPq7UaFBQeuG7abcXBHnEOnSVAlvsKLpmUxZvMVWXbWki5w6 Cxah8obq3KA0YBKtnRD+xGWhmp9ybspmCo+gYD78PmDYTi249SC1dR/ONwO3PB91H9DG zHSgMv011QcsFJbZZR1xBCR53nvqZ5nukbxTukPBS+DqvNQURWkHWDPUUJwz8x3WPLl4 wUdN7u9Tt0fyICUQU8hmnyC6hgo522dL4YVbP0sKJa+GUrrGtyEmfDTp9mWMnJ5tQ3Co Krzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850055; x=1720454855; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KO+Ue5WI+Dk6bpHtouuUAVCsqXLYR79qpaKwGCAIHiM=; b=wa2ie3XF6t5RFCECRTxp9mSoQncKEoP3JsMql4yqEK6TrN9PE1lLl0ysdoEc/CKhvQ 4NZu7C0ZzC95P68g5uLEuTRb2Z9Jw0BtKoeavGv9ZPzwH4xG1ptFKwfkWDlPVdlwuHAD T6D3FUB0n2uG3EVmak7k9BdNmBLkDax7twmY5eYQpVOXswDjVqz7r/3iH/UncD9ED29B UcIVURSTCMn45UVPsJvInVsBGnfzsYHiDHz+U1ULPQWzzQDzCgzB9X0gJh8bKeMR40gE UQGRPn4i3bDPBFobVndCkC5VEQaAcSy9tkJzeh3dI+Eh9Dlv3OFOX98qoNte/eYy+iJu EUkw== X-Gm-Message-State: AOJu0YystVVntDMGF9mi3toSwPMNVEoDhg7Fm8GI7PXa3kAnx2sqwq55 bqrz+3Nz6dSRN6nZjFWh5oHSllhXu1+hzguJt30hu8eMNj5BD/wppjQHUyoKtEx8aGosBq5AOIb 3vBg= X-Received: by 2002:a05:600c:4da1:b0:424:acf6:6068 with SMTP id 5b1f17b1804b1-4257a03479emr47823985e9.34.1719850055334; Mon, 01 Jul 2024 09:07:35 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:35 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/29] target/arm: Convert SDOT, UDOT to decodetree Date: Mon, 1 Jul 2024 17:07:11 +0100 Message-Id: <20240701160729.1910763-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@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 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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 7 +++++ target/arm/tcg/translate-a64.c | 54 ++++++++++++++++++---------------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 613cc9365cf..7411d4ba979 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -61,6 +61,7 @@ @qrrr_b . q:1 ...... ... rm:5 ...... rn:5 rd:5 &qrrr_e esz=0 @qrrr_h . q:1 ...... ... rm:5 ...... rn:5 rd:5 &qrrr_e esz=1 +@qrrr_s . q:1 ...... ... rm:5 ...... rn:5 rd:5 &qrrr_e esz=2 @qrrr_sd . q:1 ...... ... rm:5 ...... rn:5 rd:5 &qrrr_e esz=%esz_sd @qrrr_e . q:1 ...... esz:2 . rm:5 ...... rn:5 rd:5 &qrrr_e @qr2r_e . q:1 ...... esz:2 . ..... ...... rm:5 rd:5 &qrrr_e rn=%rd @@ -946,6 +947,9 @@ SQRDMULH_v 0.10 1110 ..1 ..... 10110 1 ..... ..... @qrrr_e SQRDMLAH_v 0.10 1110 ..0 ..... 10000 1 ..... ..... @qrrr_e SQRDMLSH_v 0.10 1110 ..0 ..... 10001 1 ..... ..... @qrrr_e +SDOT_v 0.00 1110 100 ..... 10010 1 ..... ..... @qrrr_s +UDOT_v 0.10 1110 100 ..... 10010 1 ..... ..... @qrrr_s + ### Advanced SIMD scalar x indexed element FMUL_si 0101 1111 00 .. .... 1001 . 0 ..... ..... @rrx_h @@ -1020,6 +1024,9 @@ SQRDMLAH_vi 0.10 1111 10 .. .... 1101 . 0 ..... ..... @qrrx_s SQRDMLSH_vi 0.10 1111 01 .. .... 1111 . 0 ..... ..... @qrrx_h SQRDMLSH_vi 0.10 1111 10 .. .... 1111 . 0 ..... ..... @qrrx_s +SDOT_vi 0.00 1111 10 .. .... 1110 . 0 ..... ..... @qrrx_s +UDOT_vi 0.10 1111 10 .. .... 1110 . 0 ..... ..... @qrrx_s + # Floating-point conditional select FCSEL 0001 1110 .. 1 rm:5 cond:4 11 rn:5 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 32c24c74220..f2e7d8d75c6 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5592,6 +5592,18 @@ TRANS(SQRDMULH_v, do_gvec_fn3_no8_no64, a, gen_gvec_sqrdmulh_qc) TRANS_FEAT(SQRDMLAH_v, aa64_rdm, do_gvec_fn3_no8_no64, a, gen_gvec_sqrdmlah_qc) TRANS_FEAT(SQRDMLSH_v, aa64_rdm, do_gvec_fn3_no8_no64, a, gen_gvec_sqrdmlsh_qc) +static bool do_dot_vector(DisasContext *s, arg_qrrr_e *a, + gen_helper_gvec_4 *fn) +{ + if (fp_access_check(s)) { + gen_gvec_op4_ool(s, a->q, a->rd, a->rn, a->rm, a->rd, 0, fn); + } + return true; +} + +TRANS_FEAT(SDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_sdot_b) +TRANS_FEAT(UDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_udot_b) + /* * Advanced SIMD scalar/vector x indexed element */ @@ -5914,6 +5926,18 @@ static gen_helper_gvec_4 * const f_vector_idx_sqrdmlsh[2] = { TRANS_FEAT(SQRDMLSH_vi, aa64_rdm, do_int3_qc_vector_idx, a, f_vector_idx_sqrdmlsh) +static bool do_dot_vector_idx(DisasContext *s, arg_qrrx_e *a, + gen_helper_gvec_4 *fn) +{ + if (fp_access_check(s)) { + gen_gvec_op4_ool(s, a->q, a->rd, a->rn, a->rm, a->rd, a->idx, fn); + } + return true; +} + +TRANS_FEAT(SDOT_vi, aa64_dp, do_dot_vector_idx, a, gen_helper_gvec_sdot_idx_b) +TRANS_FEAT(UDOT_vi, aa64_dp, do_dot_vector_idx, a, gen_helper_gvec_udot_idx_b) + /* * Advanced SIMD scalar pairwise */ @@ -10890,14 +10914,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) int rot; switch (u * 16 + opcode) { - case 0x02: /* SDOT (vector) */ - case 0x12: /* UDOT (vector) */ - if (size != MO_32) { - unallocated_encoding(s); - return; - } - feature = dc_isar_feature(aa64_dp, s); - break; case 0x03: /* USDOT */ if (size != MO_32) { unallocated_encoding(s); @@ -10947,8 +10963,10 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } break; default: + case 0x02: /* SDOT (vector) */ case 0x10: /* SQRDMLAH (vector) */ case 0x11: /* SQRDMLSH (vector) */ + case 0x12: /* UDOT (vector) */ unallocated_encoding(s); return; } @@ -10961,11 +10979,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x2: /* SDOT / UDOT */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, 0, - u ? gen_helper_gvec_udot_b : gen_helper_gvec_sdot_b); - return; - case 0x3: /* USDOT */ gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, 0, gen_helper_gvec_usdot_b); return; @@ -12043,13 +12056,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x0b: /* SQDMULL, SQDMULL2 */ is_long = true; break; - case 0x0e: /* SDOT */ - case 0x1e: /* UDOT */ - if (is_scalar || size != MO_32 || !dc_isar_feature(aa64_dp, s)) { - unallocated_encoding(s); - return; - } - break; case 0x0f: switch (size) { case 0: /* SUDOT */ @@ -12099,12 +12105,14 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x09: /* FMUL */ case 0x0c: /* SQDMULH */ case 0x0d: /* SQRDMULH */ + case 0x0e: /* SDOT */ case 0x10: /* MLA */ case 0x14: /* MLS */ case 0x18: /* FMLAL2 */ case 0x19: /* FMULX */ case 0x1c: /* FMLSL2 */ case 0x1d: /* SQRDMLAH */ + case 0x1e: /* UDOT */ case 0x1f: /* SQRDMLSH */ unallocated_encoding(s); return; @@ -12180,12 +12188,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) } switch (16 * u + opcode) { - case 0x0e: /* SDOT */ - case 0x1e: /* UDOT */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, index, - u ? gen_helper_gvec_udot_idx_b - : gen_helper_gvec_sdot_idx_b); - return; case 0x0f: switch (extract32(insn, 22, 2)) { case 0: /* SUDOT */ From patchwork Mon Jul 1 16:07:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808838 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649638wrr; Mon, 1 Jul 2024 09:08:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX/ygnERq/jPg07vxXjlH3ajP0EJyevVSUMai21DZNoqO2ZUnbMCstE/YtoSO3H98Vct5D43U/VnK7ccxiLPf8v X-Google-Smtp-Source: AGHT+IE4ZIsrk9E3DIQ3DUhWvAy6qJtPbkrkm0JLwQKGzK5esfvNfIZOpRkiAwe8oR9j3liK26sU X-Received: by 2002:a05:622a:471a:b0:446:67f0:a709 with SMTP id d75a77b69052e-44667f0acbdmr57883071cf.2.1719850134351; Mon, 01 Jul 2024 09:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850134; cv=none; d=google.com; s=arc-20160816; b=0IeOBwzOex+lq18xld1v1jA/0S9lLI36S3o7J1fS2VKOt0S4BT4UViMJtTvMCYqTeX GquUtShRpxkgHB4Xef18QJm5VASJwTiIZ8FsrLixYP4LWDd5IFvVAqYF5RjKvdqo/A/3 GeLmlHo+niAhKRU0S9cP6KipcOUkUj1zfzXptqNrRrEgOGlqRDuVUE40fu87sTU9twaT Biz/qRstfVTyj8Z+B7Zg77AcCGW8Ndw3M4zK3xVlu7oi0yAVJmFvK8Hh2VdrxK6KpWu0 x8oru6Lg5hdKDuhZGmrc1UbS4rQARHEmP9YyJWWv+JXdxnFFKtSDz8XYydvuvgQPDUgF kByg== 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:to:from :dkim-signature; bh=TwkSgmO9Be8D3RYsOTNA1AgmrtjR1gadtiRZvQ/VZg0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=e9x19lkXcGdrWaFxVX9mo1MFkgK4haUv8h4T0Kw5kIMSSsDO1KZSCcoExyK6YjAmWw 9eUBz+ZA5sxYXwAUX3HeSsM6/stm0YiUsH7jOhJGgBtmcDUY8K5azfFAW3djOXYAx6N5 jcJJjLKS4xb1e5vQWf6Yu6WHZ9DKeePOw2m3oZjYF+x5vK9iPUVYsuXbzqoT0T/VYp2o KuMcBmjykxzjjtCJFWmsrPggPdN/gMI4z2rCFzELATZQw5aSknCN10a/3QK6TfqJIMpd 13hllOgQs71Quw1FXDs1gGOTHspAhyE37k8OUdu4Ut/FXmECc481l4JG9b5TaqZEaJg2 x63g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qrmw3GV1; 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 d75a77b69052e-44677b633a4si13875791cf.626.2024.07.01.09.08.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:54 -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=qrmw3GV1; 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 1sOJa9-0003mI-Lm; Mon, 01 Jul 2024 12:08:45 -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 1sOJZ8-0000jC-7g for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ3-0005Qr-VH for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:41 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ec58040f39so30723921fa.2 for ; Mon, 01 Jul 2024 09:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850056; x=1720454856; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=TwkSgmO9Be8D3RYsOTNA1AgmrtjR1gadtiRZvQ/VZg0=; b=qrmw3GV1//fFxHmfilQzldEumLjVPRFrhsKGOPN0THPMNlqKr5ESLoYGd6epktCrZm 8JKyP1yYKqQ3z/wdhZ2OE2xUe125EWDrXXvWdABDsH48PUSipdSMlUDpetIDaZ5t29Y2 HuJYLzZlCcLc1WIX3H6qHXWx3JuvYBnMpNPtaJpAFIXmEM/BCxCaNILZKDwpzWWmBtfa eB1Pi8h7ZF1eiI77Kta1HcxipXfF3sSTeOgB6herxegOpntjINKVY6d9m67/+pzvNnHO TkkMzBiKUQHHEDodYwqFZEqdSh7d8m5SWrykuY7PUAXm6VJWMQFwAVSWqjRSnoejuyXt 6H3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850056; x=1720454856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TwkSgmO9Be8D3RYsOTNA1AgmrtjR1gadtiRZvQ/VZg0=; b=F1siNz9FSQmpivNHZq6B3iHnMbo3AVW4fduMAXzDJXzQ1I5wIrYcwVrDkIQHOJyORZ ldd4llBKRifzkqjwfeVZwneUHQbO49vw1rDIKQ/YYinmbEdpTC3iQ9Ayg6rmzypBEAEU 3nQ7Dc/NVst3zfdZmNAGhHe1GLNUZ24NRb/FxdyiUXL5sVNXU0lg6v+w5TOEKGs7iRCF LJmY/r+vKQ/dfrZN4w+VYIO/feFusBJF9JfFLrV0wk8nWHA+n+ATwQ8csQRSfstxcPJN 3RmGzw93M6gclb4QWLHZllbUuMe9QogKR1WGn0zI8PkamVrtU8qatOu1Uhd/p9cL6D0+ tmgg== X-Gm-Message-State: AOJu0YyuIDeOdH7/UH5+7wsf8I/cjB2NsPrMlFy2tzrF3ntzWiGoA/Oi OyKsbnRBe5QyKJeeb9YVTJvGpob+OZ6BLCK2+YRr/DHu74MGv66FLA3Pt4hjf0xhgQoGY3UQdJa xpdg= X-Received: by 2002:a05:651c:485:b0:2ec:5061:d7eb with SMTP id 38308e7fff4ca-2ee5e3910e6mr37448131fa.30.1719850055735; Mon, 01 Jul 2024 09:07:35 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:35 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/29] target/arm: Convert SUDOT, USDOT to decodetree Date: Mon, 1 Jul 2024 17:07:12 +0100 Message-Id: <20240701160729.1910763-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x234.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-7-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 +++ target/arm/tcg/translate-a64.c | 35 ++++++++-------------------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 7411d4ba979..8a0251f83cf 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -949,6 +949,7 @@ SQRDMLSH_v 0.10 1110 ..0 ..... 10001 1 ..... ..... @qrrr_e SDOT_v 0.00 1110 100 ..... 10010 1 ..... ..... @qrrr_s UDOT_v 0.10 1110 100 ..... 10010 1 ..... ..... @qrrr_s +USDOT_v 0.00 1110 100 ..... 10011 1 ..... ..... @qrrr_s ### Advanced SIMD scalar x indexed element @@ -1026,6 +1027,8 @@ SQRDMLSH_vi 0.10 1111 10 .. .... 1111 . 0 ..... ..... @qrrx_s SDOT_vi 0.00 1111 10 .. .... 1110 . 0 ..... ..... @qrrx_s UDOT_vi 0.10 1111 10 .. .... 1110 . 0 ..... ..... @qrrx_s +SUDOT_vi 0.00 1111 00 .. .... 1111 . 0 ..... ..... @qrrx_s +USDOT_vi 0.00 1111 10 .. .... 1111 . 0 ..... ..... @qrrx_s # Floating-point conditional select diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index f2e7d8d75c6..9a658ca8769 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5603,6 +5603,7 @@ static bool do_dot_vector(DisasContext *s, arg_qrrr_e *a, TRANS_FEAT(SDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_sdot_b) TRANS_FEAT(UDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_udot_b) +TRANS_FEAT(USDOT_v, aa64_i8mm, do_dot_vector, a, gen_helper_gvec_usdot_b) /* * Advanced SIMD scalar/vector x indexed element @@ -5937,6 +5938,10 @@ static bool do_dot_vector_idx(DisasContext *s, arg_qrrx_e *a, TRANS_FEAT(SDOT_vi, aa64_dp, do_dot_vector_idx, a, gen_helper_gvec_sdot_idx_b) TRANS_FEAT(UDOT_vi, aa64_dp, do_dot_vector_idx, a, gen_helper_gvec_udot_idx_b) +TRANS_FEAT(SUDOT_vi, aa64_i8mm, do_dot_vector_idx, a, + gen_helper_gvec_sudot_idx_b) +TRANS_FEAT(USDOT_vi, aa64_i8mm, do_dot_vector_idx, a, + gen_helper_gvec_usdot_idx_b) /* * Advanced SIMD scalar pairwise @@ -10914,13 +10919,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) int rot; switch (u * 16 + opcode) { - case 0x03: /* USDOT */ - if (size != MO_32) { - unallocated_encoding(s); - return; - } - feature = dc_isar_feature(aa64_i8mm, s); - break; case 0x04: /* SMMLA */ case 0x14: /* UMMLA */ case 0x05: /* USMMLA */ @@ -10964,6 +10962,7 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) break; default: case 0x02: /* SDOT (vector) */ + case 0x03: /* USDOT */ case 0x10: /* SQRDMLAH (vector) */ case 0x11: /* SQRDMLSH (vector) */ case 0x12: /* UDOT (vector) */ @@ -10979,10 +10978,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x3: /* USDOT */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, 0, gen_helper_gvec_usdot_b); - return; - case 0x04: /* SMMLA, UMMLA */ gen_gvec_op4_ool(s, 1, rd, rn, rm, rd, 0, u ? gen_helper_gvec_ummla_b @@ -12058,14 +12053,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) break; case 0x0f: switch (size) { - case 0: /* SUDOT */ - case 2: /* USDOT */ - if (is_scalar || !dc_isar_feature(aa64_i8mm, s)) { - unallocated_encoding(s); - return; - } - size = MO_32; - break; case 1: /* BFDOT */ if (is_scalar || !dc_isar_feature(aa64_bf16, s)) { unallocated_encoding(s); @@ -12082,6 +12069,8 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) size = MO_16; break; default: + case 0: /* SUDOT */ + case 2: /* USDOT */ unallocated_encoding(s); return; } @@ -12190,18 +12179,10 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) switch (16 * u + opcode) { case 0x0f: switch (extract32(insn, 22, 2)) { - case 0: /* SUDOT */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, index, - gen_helper_gvec_sudot_idx_b); - return; case 1: /* BFDOT */ gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, index, gen_helper_gvec_bfdot_idx); return; - case 2: /* USDOT */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, index, - gen_helper_gvec_usdot_idx_b); - return; case 3: /* BFMLAL{B,T} */ gen_gvec_op4_fpst(s, 1, rd, rn, rm, rd, 0, (index << 1) | is_q, gen_helper_gvec_bfmlal_idx); From patchwork Mon Jul 1 16:07:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808853 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651695wrr; Mon, 1 Jul 2024 09:12:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXqtRFGh/nIDHtJUER08QDRbM2Qr+xyts0Y4M11nHMdKBxPSU2MXVFxs3i/4NyhbdaUcrs/4+9Z20P7MNcWL9zi X-Google-Smtp-Source: AGHT+IE+dzyhUqyqfPJUC9/MBtdLuGAF7VGmsMIpouayPyaCiPDyXqo+/FeeXRn/SXgOFroAju3e X-Received: by 2002:a05:620a:2e7:b0:79d:6cdf:c3d7 with SMTP id af79cd13be357-79d7bae8c80mr678423285a.73.1719850365232; Mon, 01 Jul 2024 09:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850365; cv=none; d=google.com; s=arc-20160816; b=D+JtySaEMcIq1A7etgMVHcLJ1JxYUHgTDPvjwFYewpHGVOg6dO6nCwmNCEDSCtnwyC 89sj7O4L6jFF4KqPO5CecQ+/bU0Es/GZcX7/I4SkgmacFE60x/Ly6YlgvMovxNqVvrE9 P0GIh31vX9ErpZUmNdgrS3WXCqnFJYnGdWPj6SzcddIBr15sIGIU3HK9nb9N0KWFoovj fitGFiCVkyhnJzRsT//VQNVNYYdOjcMjRLv4CodPtPGlsQAT+5IgxfWlLreasxC55b9L 21YzjgWfIeRrMy+/eG+UPCcKecVnSaccJtYd42f8ETuqPLG5LbNMDl0bCa2INOjEmH48 ok/A== 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:to:from :dkim-signature; bh=CgRYVkIIweHtjr+ZTjlTznMU791NJv4qRCbRXJ37zVc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=cgqB/7MW86hPCHpWhdshlSO3ZCVCkeTTPSte2c2VRF908bTb1shPS0HJiT9EhzvBFt sC5vJgC6+B2FQ3++NtgflDolgmSHAHyqCbLUEZl2P1JCFmwWOs+WIAUq86Lp6oKU7DJ6 OzXT8U93/6y4TBLDC2EIYOqDT89xHlcZS5W3OFyNrTySyPj4sn92we9QhRR1peXpgYWJ zVa07c47f+GQmJ2KwSm21MjNVP8zDqzwILQdvY+dBRvBXeADEoyA8z065kUPOGPRD3Ad EhA5hsuPQF3dO2O9Qtt9dCda/wN1ssl61UaPvHuq4/FieJkuqPtDQM7itR4O+30Brdow UJvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ldZU8eSc; 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 af79cd13be357-79d6933188dsi820765885a.546.2024.07.01.09.12.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:45 -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=ldZU8eSc; 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 1sOJa5-0003DZ-Ml; Mon, 01 Jul 2024 12:08:41 -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 1sOJZ7-0000iQ-Nu for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ3-0005R2-VO for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:41 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-425680b1d3aso22213235e9.2 for ; Mon, 01 Jul 2024 09:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850056; x=1720454856; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=CgRYVkIIweHtjr+ZTjlTznMU791NJv4qRCbRXJ37zVc=; b=ldZU8eScDCM4Kj7jTLlhWVylDMjzxRFuCja9WnVHF+zWWpmB3AOYQIVbBa9nMUxXg+ zPoWREWLBpC4DBPAYd+Jtz3T2dld10RnEpP3gfmExHnIVEH51yIFHP4JXgoVadzEv+5b bl4PVy7QsUIrBfVKYSQw/si8FTlf00A/6FnqvWuer6NN+nYX39q6+ct7c2WLcE3LsBGt MDc9JS9e7sZ1w8SA8S1beWArpl5pddHiXt0P4lrLLuPD78vfvjzMyx88piQ5MLcOKbwJ 4oAyFo5fFtNStn75McmaP282S9V7EnOCSfO+II6kbKGssOfnFvSeB0lTQehUmBbMAEET LTSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850056; x=1720454856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CgRYVkIIweHtjr+ZTjlTznMU791NJv4qRCbRXJ37zVc=; b=E/XE2MtL3M6HYKu07vxw0ftWDScm5HFA7kDl8QoVAO2P8t7Nh6X1JOCufQGnwNAeBx RfumWVqEwrry5A1AwwE6cvlCejQ9iT6MHagsqjb6KlF0sufCIu+/RRvj4Myp1bqqFXju HToFFWzVQEKmI7R6P0xYV7iAQELJbo5d9q4ma7v3sCj9Adu/TlBxkaFN1DDkaIyZ/Ki3 DNiep8Gl8ffHrfNkwwmYcGKTo4hqbMyZ14yvp/HlgpUo8riM1mLbY4DY+Deowqb2ukcA 7hMvR286QMNkjcyanW8rWRo4HpDOsYHkpJbpYPSEHVsCgRJ9Mko0QHAetTkUWY2thwU8 cKqg== X-Gm-Message-State: AOJu0YyIqwbN/ZA/OoDdiy0PZHPfVjbn2TkwVsfq1Ih47X4I2qDLOxHA kGJXTFHgCI2Py6AP/EjdXh0iuCXf/+hID3eSW2eozI8ilvQW3YE+n9+n9d514J011AlVIcUray6 8Y+c= X-Received: by 2002:a05:600c:1793:b0:425:7ac6:9709 with SMTP id 5b1f17b1804b1-4257ac698c2mr43048445e9.3.1719850056396; Mon, 01 Jul 2024 09:07:36 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:36 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/29] target/arm: Convert BFDOT to decodetree Date: Mon, 1 Jul 2024 17:07:13 +0100 Message-Id: <20240701160729.1910763-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-8-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 2 ++ target/arm/tcg/translate-a64.c | 20 +++++--------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 8a0251f83cf..6819fd25873 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -950,6 +950,7 @@ SQRDMLSH_v 0.10 1110 ..0 ..... 10001 1 ..... ..... @qrrr_e SDOT_v 0.00 1110 100 ..... 10010 1 ..... ..... @qrrr_s UDOT_v 0.10 1110 100 ..... 10010 1 ..... ..... @qrrr_s USDOT_v 0.00 1110 100 ..... 10011 1 ..... ..... @qrrr_s +BFDOT_v 0.10 1110 010 ..... 11111 1 ..... ..... @qrrr_s ### Advanced SIMD scalar x indexed element @@ -1029,6 +1030,7 @@ SDOT_vi 0.00 1111 10 .. .... 1110 . 0 ..... ..... @qrrx_s UDOT_vi 0.10 1111 10 .. .... 1110 . 0 ..... ..... @qrrx_s SUDOT_vi 0.00 1111 00 .. .... 1111 . 0 ..... ..... @qrrx_s USDOT_vi 0.00 1111 10 .. .... 1111 . 0 ..... ..... @qrrx_s +BFDOT_vi 0.00 1111 01 .. .... 1111 . 0 ..... ..... @qrrx_s # Floating-point conditional select diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 9a658ca8769..0f44cd5aee5 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5604,6 +5604,7 @@ static bool do_dot_vector(DisasContext *s, arg_qrrr_e *a, TRANS_FEAT(SDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_sdot_b) TRANS_FEAT(UDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_udot_b) TRANS_FEAT(USDOT_v, aa64_i8mm, do_dot_vector, a, gen_helper_gvec_usdot_b) +TRANS_FEAT(BFDOT_v, aa64_bf16, do_dot_vector, a, gen_helper_gvec_bfdot) /* * Advanced SIMD scalar/vector x indexed element @@ -5942,6 +5943,8 @@ TRANS_FEAT(SUDOT_vi, aa64_i8mm, do_dot_vector_idx, a, gen_helper_gvec_sudot_idx_b) TRANS_FEAT(USDOT_vi, aa64_i8mm, do_dot_vector_idx, a, gen_helper_gvec_usdot_idx_b) +TRANS_FEAT(BFDOT_vi, aa64_bf16, do_dot_vector_idx, a, + gen_helper_gvec_bfdot_idx) /* * Advanced SIMD scalar pairwise @@ -10951,11 +10954,11 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) break; case 0x1f: switch (size) { - case 1: /* BFDOT */ case 3: /* BFMLAL{B,T} */ feature = dc_isar_feature(aa64_bf16, s); break; default: + case 1: /* BFDOT */ unallocated_encoding(s); return; } @@ -11036,9 +11039,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) return; case 0xf: switch (size) { - case 1: /* BFDOT */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, 0, gen_helper_gvec_bfdot); - break; case 3: /* BFMLAL{B,T} */ gen_gvec_op4_fpst(s, 1, rd, rn, rm, rd, false, is_q, gen_helper_gvec_bfmlal); @@ -12053,13 +12053,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) break; case 0x0f: switch (size) { - case 1: /* BFDOT */ - if (is_scalar || !dc_isar_feature(aa64_bf16, s)) { - unallocated_encoding(s); - return; - } - size = MO_32; - break; case 3: /* BFMLAL{B,T} */ if (is_scalar || !dc_isar_feature(aa64_bf16, s)) { unallocated_encoding(s); @@ -12070,6 +12063,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) break; default: case 0: /* SUDOT */ + case 1: /* BFDOT */ case 2: /* USDOT */ unallocated_encoding(s); return; @@ -12179,10 +12173,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) switch (16 * u + opcode) { case 0x0f: switch (extract32(insn, 22, 2)) { - case 1: /* BFDOT */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, index, - gen_helper_gvec_bfdot_idx); - return; case 3: /* BFMLAL{B,T} */ gen_gvec_op4_fpst(s, 1, rd, rn, rm, rd, 0, (index << 1) | is_q, gen_helper_gvec_bfmlal_idx); From patchwork Mon Jul 1 16:07:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808844 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1650349wrr; Mon, 1 Jul 2024 09:10:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVfRwXrdvdS1NSv0XfXtKDev+gAN3cJfW6MnRvn8jQrodEb7iuFbRZN7izUirVwSmEt7/5LrilGpXpbd6gotmuY X-Google-Smtp-Source: AGHT+IFZ0NO+HnMBMAAIDNMj2Ys4UENI35OgHoPv+ua2FRgladfvU7Glx0Rl9/IYuAgqS3IjFnlM X-Received: by 2002:a05:6214:f0f:b0:6b2:ccb5:8b7b with SMTP id 6a1803df08f44-6b5b6f5a5camr109774466d6.31.1719850209829; Mon, 01 Jul 2024 09:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850209; cv=none; d=google.com; s=arc-20160816; b=kkBuccYm44LQRtpTYRxzmomhOBepvE37fnIxC2IFkzqKhJ4EmdvSKte17JJF2roPFN xnjF31Gp1KJLpvN4aRw5Vrl8Nv1rVwPi2WEuvPU2jI23+3Gy/Q6Bv5MdVwcy+5wQ8OuY 5FGPNBZa4Bv9wP/Yq3g2cWrkyB4RfkBU6u00mK+pMRaeetap0cqFmGY+OctII2cvYIOV EqIy3c5whL6tuZdS+o/MsQZf3B5Lgfp8rgcWt/I/WeIkeEHboInlTzoJsndEBIA2IAwG tpKh0fGyvgFzSmcCsOkAD4DyYnI7yu6CjbpTOmY9kgKHrb+Yb+l2nV1OLK/75iAQFcN9 vyIA== 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:to:from :dkim-signature; bh=gRmQl+sZaZDBm/N4F1+THBUYvhq2tRdWf0ndyFtrCmE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=kx2QxmHrSR6c4Gtwb7Q69TtkjjyHANuOyLLOKJrPydlpm1zCeH/cZjjLeobZR3C6b6 pf3YHBIBXHD1BQRw6nYXDDBJMgA3rg/V756gy0cEV2jrGeC2vjd2BPzAAJux9zYEr3tF T7bl+H6BJFdxgYClyUpnHpvdk/EW7cCfj2gL3ujPqUHzWsIZk+qooHHIo0XdywoMM8Aw ZtOuPsdFDegpCcH3VOJuGavFLOslodf/h4mtQNi5c1tfqMPplja7ICjIgJMiw6UFRUXd 016CNlkxvDbXuz5uQaTLsagc42/eqLWIG4DNGjhM5vszT5Tb0BsBcUKA7osp9Y9dcQAZ oHfg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rw5bIHNW; 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 6a1803df08f44-6b59e36c35csi83658976d6.168.2024.07.01.09.10.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:10:09 -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=rw5bIHNW; 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 1sOJZU-0001Oh-Ba; Mon, 01 Jul 2024 12:08:05 -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 1sOJZ8-0000jD-Nb for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ5-0005RH-Rv for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:42 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52cd8897c73so3687807e87.2 for ; Mon, 01 Jul 2024 09:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850057; x=1720454857; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=gRmQl+sZaZDBm/N4F1+THBUYvhq2tRdWf0ndyFtrCmE=; b=rw5bIHNW4v6r2AjVtkbXCHYcJ44Ize4rcZF/WvobOi6qv30R2fLjLQ9UzYGgyi2rEr B9tYGpsL5KgAlW7V+Fq/alXIVfJY/MSehBq6Qu6VvI7anHZDltYPXWjMTWxCSi0Dsw0J 3wzC76X9ZDDxlzcwCuI0qA7lMZYUvdm75GlLGa10KxwMjAm6u4vlq9/JDsY4SrdPa4ay c2fvj5ovNh4xZpZOmY6qwQIAD6gP4nUwYaMwhNTFnZivA1kJjmm22Bj7DflW4dJtzZcn gCmV1RzG+JUEwDi9jIYOvkP5xuJe8tEkTKMWwh2YqGBXWulNpuFmpHNi0wi0GONGsaY1 VhQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850057; x=1720454857; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gRmQl+sZaZDBm/N4F1+THBUYvhq2tRdWf0ndyFtrCmE=; b=MeaIffw1SmiNSu0zUeiZT8c7V+MC/AG77V+9Sllw3sSoxWjmwzoFqDob85/3HIaOdW bEuu5ym9SCjDHoorGXP8nEAFe1ckD9KZZoysXPusZeCtik9MBbxE/nEHkFWZZheY6hVI +Nelik17L2Y8obg36QGLpW//m0b6kONfIDfJLI+CZ6S9xfHNJ1OdbqNrlFf2OQX1Bhdt Flo2HKaov127DMeBYzp3Vxo8BNVv1sZbgKqeLxpzfS/coz7VG69rK4TzO1klKN5mREqE /LFyvhohr3nV90A7YRdESws5V6y+kV5dymIJOoEa7NZ0SJLWlUuERt1RXdzqE1Tx4hXd 7xxg== X-Gm-Message-State: AOJu0Yz2Y+v8VgfcV5hKBzdivz9g+fBl0JPVbDHQ8JmbFwPorS4LwSFE WWv6ncgbxfoosyKb8ue9NYRuGhUQEZVxpAh+laq5pEwsg3YV8ajWyv00lobQksZtoV2P5Whtbe3 jYNw= X-Received: by 2002:a05:6512:6c7:b0:52b:79d6:5c28 with SMTP id 2adb3069b0e04-52e826f75f3mr3841176e87.52.1719850056893; Mon, 01 Jul 2024 09:07:36 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:36 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/29] target/arm: Convert BFMLALB, BFMLALT to decodetree Date: Mon, 1 Jul 2024 17:07:14 +0100 Message-Id: <20240701160729.1910763-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12d.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-9-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 2 + target/arm/tcg/translate-a64.c | 77 +++++++++++++--------------------- 2 files changed, 31 insertions(+), 48 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 6819fd25873..15344a73de4 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -951,6 +951,7 @@ SDOT_v 0.00 1110 100 ..... 10010 1 ..... ..... @qrrr_s UDOT_v 0.10 1110 100 ..... 10010 1 ..... ..... @qrrr_s USDOT_v 0.00 1110 100 ..... 10011 1 ..... ..... @qrrr_s BFDOT_v 0.10 1110 010 ..... 11111 1 ..... ..... @qrrr_s +BFMLAL_v 0.10 1110 110 ..... 11111 1 ..... ..... @qrrr_h ### Advanced SIMD scalar x indexed element @@ -1031,6 +1032,7 @@ UDOT_vi 0.10 1111 10 .. .... 1110 . 0 ..... ..... @qrrx_s SUDOT_vi 0.00 1111 00 .. .... 1111 . 0 ..... ..... @qrrx_s USDOT_vi 0.00 1111 10 .. .... 1111 . 0 ..... ..... @qrrx_s BFDOT_vi 0.00 1111 01 .. .... 1111 . 0 ..... ..... @qrrx_s +BFMLAL_vi 0.00 1111 11 .. .... 1111 . 0 ..... ..... @qrrx_h # Floating-point conditional select diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 0f44cd5aee5..95be862dde4 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5606,6 +5606,19 @@ TRANS_FEAT(UDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_udot_b) TRANS_FEAT(USDOT_v, aa64_i8mm, do_dot_vector, a, gen_helper_gvec_usdot_b) TRANS_FEAT(BFDOT_v, aa64_bf16, do_dot_vector, a, gen_helper_gvec_bfdot) +static bool trans_BFMLAL_v(DisasContext *s, arg_qrrr_e *a) +{ + if (!dc_isar_feature(aa64_bf16, s)) { + return false; + } + if (fp_access_check(s)) { + /* Q bit selects BFMLALB vs BFMLALT. */ + gen_gvec_op4_fpst(s, true, a->rd, a->rn, a->rm, a->rd, false, a->q, + gen_helper_gvec_bfmlal); + } + return true; +} + /* * Advanced SIMD scalar/vector x indexed element */ @@ -5946,6 +5959,20 @@ TRANS_FEAT(USDOT_vi, aa64_i8mm, do_dot_vector_idx, a, TRANS_FEAT(BFDOT_vi, aa64_bf16, do_dot_vector_idx, a, gen_helper_gvec_bfdot_idx) +static bool trans_BFMLAL_vi(DisasContext *s, arg_qrrx_e *a) +{ + if (!dc_isar_feature(aa64_bf16, s)) { + return false; + } + if (fp_access_check(s)) { + /* Q bit selects BFMLALB vs BFMLALT. */ + gen_gvec_op4_fpst(s, true, a->rd, a->rn, a->rm, a->rd, 0, + (a->idx << 1) | a->q, + gen_helper_gvec_bfmlal_idx); + } + return true; +} + /* * Advanced SIMD scalar pairwise */ @@ -10952,23 +10979,13 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } feature = dc_isar_feature(aa64_bf16, s); break; - case 0x1f: - switch (size) { - case 3: /* BFMLAL{B,T} */ - feature = dc_isar_feature(aa64_bf16, s); - break; - default: - case 1: /* BFDOT */ - unallocated_encoding(s); - return; - } - break; default: case 0x02: /* SDOT (vector) */ case 0x03: /* USDOT */ case 0x10: /* SQRDMLAH (vector) */ case 0x11: /* SQRDMLSH (vector) */ case 0x12: /* UDOT (vector) */ + case 0x1f: /* BFDOT / BFMLAL */ unallocated_encoding(s); return; } @@ -11037,17 +11054,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) case 0xd: /* BFMMLA */ gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, 0, gen_helper_gvec_bfmmla); return; - case 0xf: - switch (size) { - case 3: /* BFMLAL{B,T} */ - gen_gvec_op4_fpst(s, 1, rd, rn, rm, rd, false, is_q, - gen_helper_gvec_bfmlal); - break; - default: - g_assert_not_reached(); - } - return; - default: g_assert_not_reached(); } @@ -12051,24 +12057,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x0b: /* SQDMULL, SQDMULL2 */ is_long = true; break; - case 0x0f: - switch (size) { - case 3: /* BFMLAL{B,T} */ - if (is_scalar || !dc_isar_feature(aa64_bf16, s)) { - unallocated_encoding(s); - return; - } - /* can't set is_fp without other incorrect size checks */ - size = MO_16; - break; - default: - case 0: /* SUDOT */ - case 1: /* BFDOT */ - case 2: /* USDOT */ - unallocated_encoding(s); - return; - } - break; case 0x11: /* FCMLA #0 */ case 0x13: /* FCMLA #90 */ case 0x15: /* FCMLA #180 */ @@ -12089,6 +12077,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x0c: /* SQDMULH */ case 0x0d: /* SQRDMULH */ case 0x0e: /* SDOT */ + case 0x0f: /* SUDOT / BFDOT / USDOT / BFMLAL */ case 0x10: /* MLA */ case 0x14: /* MLS */ case 0x18: /* FMLAL2 */ @@ -12171,14 +12160,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) } switch (16 * u + opcode) { - case 0x0f: - switch (extract32(insn, 22, 2)) { - case 3: /* BFMLAL{B,T} */ - gen_gvec_op4_fpst(s, 1, rd, rn, rm, rd, 0, (index << 1) | is_q, - gen_helper_gvec_bfmlal_idx); - return; - } - g_assert_not_reached(); case 0x11: /* FCMLA #0 */ case 0x13: /* FCMLA #90 */ case 0x15: /* FCMLA #180 */ From patchwork Mon Jul 1 16:07:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808854 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651748wrr; Mon, 1 Jul 2024 09:12:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWtXoav5P2f9NlcH4LN/cVYGJcckgVn2L8OhmiunVEEOkYpEqVkcGQVpIW05CWRupNAhZijKdgVb7BA+kEzj/WM X-Google-Smtp-Source: AGHT+IH2/o5S6DAl9i75EvzxOQkU+uiARi9cFa6K05rGurVU/CNbwApKxmTDOdIcT8mb3oJrfOj7 X-Received: by 2002:a05:6214:f2b:b0:6b5:83bb:11b8 with SMTP id 6a1803df08f44-6b5b70d07f3mr79170086d6.33.1719850371553; Mon, 01 Jul 2024 09:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850371; cv=none; d=google.com; s=arc-20160816; b=wn7KU2/OKA/25WqsHwxMVFNvV1OUTeiTNJuFxIlOtNnyEjj8k3o82489vvfvqh3s2U +sa/vh/My7U25QeLXBm1wEcug11SdOptfIi61js4KkoJbCsnRsI1duoRMpP6XvjknXeL x9ExEwm18UkVw5aK5EGCxRdlnZR7YNbrIdTiSrNWb03nGbuYS6mGJ6I9Inp6Xpunau2o dlec2Rv0IYUVT1x66W2CmbEmHaFK+t9IDovsBGlbGSb86ozAe1+n6mM1BMgqY/2g0SXD o1KZXzD5T3yHWhcarPcqRMGQM5SfLVG5YyajWMPQ4uTz+RsoNaMFq1K51UkOvvHuptZz zRqg== 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:to:from :dkim-signature; bh=WcptyOOEUYTd0t/bHxTS3PyzqFwxPQNZMLdE2NJrMms=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Nc5PCoCS9Q3VooXbdN0WVLAEjNHxCE8WuD/40I6NxeluVixhtJsrTGufKcjqmXNpaj QYzSBgbpsjOOG2X3jdMm0RjklPqhM+ZWMjorxa/d1V3CfIClhkTEaKbNZygcOhSc0GDL Yz+zlZe843xtaRf6wle7qdw9mFIsw7uNpgLaehkkaua6vNRz/t8rfMRwG6c9ozFL6ryK jYKmucmxd2GxKUjT5ZpsLqnsN60fP2CDkvbFZ1iTDgGn0eRp1v31qvd8b0dtOO3S85xL hd8GbS1hZqomlUoGyNzFSnGx+tmqaQz4MtJuA4pgcefFUxz0MqWRR60tTd5NMh3zEBC+ 170A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fawhr6n1; 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 6a1803df08f44-6b59e611b2dsi84449366d6.525.2024.07.01.09.12.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:51 -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=Fawhr6n1; 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 1sOJa5-0003CN-Kh; Mon, 01 Jul 2024 12:08:41 -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 1sOJZA-0000kE-9w for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:45 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ5-0005RY-Tp for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so19250075e9.1 for ; Mon, 01 Jul 2024 09:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850057; x=1720454857; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WcptyOOEUYTd0t/bHxTS3PyzqFwxPQNZMLdE2NJrMms=; b=Fawhr6n1S++cvcs1JdEczzIOQsRvMyOHg9cvpjU8v51ep9UC4GNA18Eq4hiluffV2X foEnq3qcVS9Jkmqh3Rtc7yG/K6XPbJYYOOVgPcu0cE7SNkzALaeaqFs/WjA67IjjRVqR 9gle5L8hcv1/QloeJxtv5KHl1RY9kz/uGXyGsix0rL+GYUOqXFd/TJURTzWWncDU052v Z+2RdFsWD8fFI+J2/yHhfR1QApvfkIftVZcg9RQrnZCDF3LmkfEJ8cGIBw0pRVT4mRO6 sOaYWMK2Z+ka5PS0pR+0tgu1NEEhwYq5aewfOCdmRl36e3nzRe+mAEgrDkXAVBZxZtV/ F82Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850057; x=1720454857; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WcptyOOEUYTd0t/bHxTS3PyzqFwxPQNZMLdE2NJrMms=; b=aY1IgNdtGQc/KLoe9yb4okKF3CaV0YgjC0lNFlGQGSsDClbB5oifL44ZjH4UEoG+y4 hbCPYHP0rtl90tmzUHBQ+J33MsiXjbwal8fL2V5Y0C5MjOKbQW2c5YT5d5Y/YuLyWs/x QNEkuPJiKHgmR0kiY8Qzkkun//jAvZ7UbUYjWsO0hI17nwz0eTFLgd8Q3YvSJGGsz+xi V1LtdpoyggkfymnnS+BCly4hv2qklc9tiSRhEgFaOG42qMJXXYTiDZGQVf10xW0VJDOn w/4kL8e5ovYal7zcnZC3K0kFJgo2Buxdf/3s6r96SFlMKa6jWeJxCslLKPAFcV1efcLb bL5A== X-Gm-Message-State: AOJu0YwBPzYrIVHqOlHjO2LPIF92BGZxnQ4z8pWF+XQNtkpKiN6QH2s2 cqKbCt9YfCsZJS6uGRJdiv+Sp6U2xJdCswdtw9PJ8ecSEe7REMVL/9LNjHUuY5Y3ADcys34Up0V h0Ls= X-Received: by 2002:a05:600c:48a2:b0:421:7ab8:59c with SMTP id 5b1f17b1804b1-42579862523mr61227905e9.10.1719850057420; Mon, 01 Jul 2024 09:07:37 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/29] target/arm: Convert BFMMLA, SMMLA, UMMLA, USMMLA to decodetree Date: Mon, 1 Jul 2024 17:07:15 +0100 Message-Id: <20240701160729.1910763-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 4 ++++ target/arm/tcg/translate-a64.c | 36 ++++++++-------------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 15344a73de4..b2c7e36969e 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -952,6 +952,10 @@ UDOT_v 0.10 1110 100 ..... 10010 1 ..... ..... @qrrr_s USDOT_v 0.00 1110 100 ..... 10011 1 ..... ..... @qrrr_s BFDOT_v 0.10 1110 010 ..... 11111 1 ..... ..... @qrrr_s BFMLAL_v 0.10 1110 110 ..... 11111 1 ..... ..... @qrrr_h +BFMMLA 0110 1110 010 ..... 11101 1 ..... ..... @rrr_q1e0 +SMMLA 0100 1110 100 ..... 10100 1 ..... ..... @rrr_q1e0 +UMMLA 0110 1110 100 ..... 10100 1 ..... ..... @rrr_q1e0 +USMMLA 0100 1110 100 ..... 10101 1 ..... ..... @rrr_q1e0 ### Advanced SIMD scalar x indexed element diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 95be862dde4..2697c4b305b 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5605,6 +5605,10 @@ TRANS_FEAT(SDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_sdot_b) TRANS_FEAT(UDOT_v, aa64_dp, do_dot_vector, a, gen_helper_gvec_udot_b) TRANS_FEAT(USDOT_v, aa64_i8mm, do_dot_vector, a, gen_helper_gvec_usdot_b) TRANS_FEAT(BFDOT_v, aa64_bf16, do_dot_vector, a, gen_helper_gvec_bfdot) +TRANS_FEAT(BFMMLA, aa64_bf16, do_dot_vector, a, gen_helper_gvec_bfmmla) +TRANS_FEAT(SMMLA, aa64_i8mm, do_dot_vector, a, gen_helper_gvec_smmla_b) +TRANS_FEAT(UMMLA, aa64_i8mm, do_dot_vector, a, gen_helper_gvec_ummla_b) +TRANS_FEAT(USMMLA, aa64_i8mm, do_dot_vector, a, gen_helper_gvec_usmmla_b) static bool trans_BFMLAL_v(DisasContext *s, arg_qrrr_e *a) { @@ -10949,15 +10953,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) int rot; switch (u * 16 + opcode) { - case 0x04: /* SMMLA */ - case 0x14: /* UMMLA */ - case 0x05: /* USMMLA */ - if (!is_q || size != MO_32) { - unallocated_encoding(s); - return; - } - feature = dc_isar_feature(aa64_i8mm, s); - break; case 0x18: /* FCMLA, #0 */ case 0x19: /* FCMLA, #90 */ case 0x1a: /* FCMLA, #180 */ @@ -10972,19 +10967,16 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } feature = dc_isar_feature(aa64_fcma, s); break; - case 0x1d: /* BFMMLA */ - if (size != MO_16 || !is_q) { - unallocated_encoding(s); - return; - } - feature = dc_isar_feature(aa64_bf16, s); - break; default: case 0x02: /* SDOT (vector) */ case 0x03: /* USDOT */ + case 0x04: /* SMMLA */ + case 0x05: /* USMMLA */ case 0x10: /* SQRDMLAH (vector) */ case 0x11: /* SQRDMLSH (vector) */ case 0x12: /* UDOT (vector) */ + case 0x14: /* UMMLA */ + case 0x1d: /* BFMMLA */ case 0x1f: /* BFDOT / BFMLAL */ unallocated_encoding(s); return; @@ -10998,15 +10990,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } switch (opcode) { - case 0x04: /* SMMLA, UMMLA */ - gen_gvec_op4_ool(s, 1, rd, rn, rm, rd, 0, - u ? gen_helper_gvec_ummla_b - : gen_helper_gvec_smmla_b); - return; - case 0x05: /* USMMLA */ - gen_gvec_op4_ool(s, 1, rd, rn, rm, rd, 0, gen_helper_gvec_usmmla_b); - return; - case 0x8: /* FCMLA, #0 */ case 0x9: /* FCMLA, #90 */ case 0xa: /* FCMLA, #180 */ @@ -11051,9 +11034,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } return; - case 0xd: /* BFMMLA */ - gen_gvec_op4_ool(s, is_q, rd, rn, rm, rd, 0, gen_helper_gvec_bfmmla); - return; default: g_assert_not_reached(); } From patchwork Mon Jul 1 16:07:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808847 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651584wrr; Mon, 1 Jul 2024 09:12:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVMlE5cvLLXipPANkzMl3/u6sotScgdVE7S40868bYb1+Ubk/GN30pB5GCQ+zwXQqg+oc85D6KoEHMzik71v+1P X-Google-Smtp-Source: AGHT+IGPp6XD+Q2K8EjaeP/tDKsoOYzLEGQEkVu+a/X2vfYYhRNit7zMZs3dIUqzTBI+9HEu9s6S X-Received: by 2002:a05:622a:588:b0:446:6282:b8f7 with SMTP id d75a77b69052e-44662e527d7mr66852281cf.56.1719850354290; Mon, 01 Jul 2024 09:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850354; cv=none; d=google.com; s=arc-20160816; b=MiqJuX87CNN4+eSa12qLjdhoSfkRD9SygruRoJKeJdOxoj7GmW4aC/fzFmep9UQxMU kuqAs11BwAAKCdsqtF2PxiG//PnUh5L7K/XLZNIKLwPt/FxV8gBteX4pb280ml0E+wtJ t1XIv/LTmexX4WC+oaP4/wv3yglX6MnksgyaSCU01f0raFHPptrjsiHTe0k1pNW/QazN Ai9jvZIFGLfM/RdDODm4xK6uFhsAcJaX8O4oMXpls9cG3vNY6BPXpH8UW5LlrsB55lYM wVOPK1dv6QMWfNk+5K/6prakU0qStrpfgtwTeoCSLNAw+X52XxhcLUZqBM9RvTwa9g+g VubA== 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:to:from :dkim-signature; bh=0DUSrmAchhl9dxnhXDfumSKasw+WhgPIfpoDjJK7jzk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=c1Hu5KZImyicFXdoCFJQbuEFEIzLWvv3OCnZiC8Vn7Y8lwrB98t3hNfLMMjm0lfWLE sAWPDEFcqs1G5yTtp8oSXskN/6Z0VRKH7xbLDHRVdpBs8EMWTFxwBUyAyNv4Ce+StstS a5TkLY7lhInohI0/VwPMRH11UCLZSJBTCF2XdCZQySBgvsl4rFsYd29G2X7ITVHi31dd xaEXp+nKdIB1W9TK5xIzjJwdqYEpSrA1TatvnNXy8ft/b5E0/A8ms9hoegagOJSG6aNo 6HOb3UV+cM6fMMPGKzqCvXGmDUcw/B0F5UJ43UmvOhn3xRPYy4TTnqnw5FzMJcWjenPk Cndg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wPPNzpyN; 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 d75a77b69052e-446516e512csi84771661cf.802.2024.07.01.09.12.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:34 -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=wPPNzpyN; 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 1sOJZx-0002Uh-8B; Mon, 01 Jul 2024 12:08:33 -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 1sOJZ9-0000jt-LO for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:44 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ7-0005SN-GQ for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2eaea28868dso45173311fa.3 for ; Mon, 01 Jul 2024 09:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850058; x=1720454858; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0DUSrmAchhl9dxnhXDfumSKasw+WhgPIfpoDjJK7jzk=; b=wPPNzpyNG7sL6sMpxW/WB8M77DbgkWKpykFJMrrfttV6/FTGoLr1yBISlSGoNExr2h RXICnnpvKuGzay1aLb+m++JuVy4ppUyxvN+Ca+/YYT3VGyIjudHia2tqZsocAkwIvWoQ wOLBKMV2wQkzgxRjITxEaP9JwJyUj1nSvaZJBtV156W6+Y0l1JXEJLu5RL4XO+co/+MS 9w4L7QtjWCoSpEdbLUVRmiriqueP8pogR6Bbvj3vook7Ud2yvSNAo0yHTYeYdsGFpMoE zfCv426NXTSvUE1sE3qYSh90Y2dzphCCjz3FV6GLLtUgNhB3TCgxZC+bqHpf4rFiQAXT W5mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850058; x=1720454858; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0DUSrmAchhl9dxnhXDfumSKasw+WhgPIfpoDjJK7jzk=; b=sjvL9/sp9oadouztUF60IcJ27bzZ/Ku/XCJzQd9LsNElMlDbbiUpe9P0EQOioEUKSC 32PsR3d84I8202iBz21YuH+AAVIlHO+Ox0uNeowRdcDXvcb7OpdDxOqiyhIb7EmmX6IZ MMg7T9VTqo+QRd3u9rOhbN6Vd0cdbUmoABlw7XMOPd7FzW0L573uoReXFbzhyHxBZNn/ Fok9YBxxioDQUiWp3W30N3WoR85jPpandECdNbq2bRxBZY/tPRxq8tYM1cDEUdA0UN5D P8Fa3q9T4Y4Q+z74eDy0Oq5cGriL+TFWTobkcFT//wNAjUiuigZ6xmCv325TRFYqgNMx 4bUA== X-Gm-Message-State: AOJu0Yw0LQXs2Rl4Ubt5VHvDSCLzFq2vXbrbxTC6ktvRnmqrx2ivl6u4 xnHXSt8ecWWDyclEfG6dlsTOpZhW6/uP24pU8BG506pKSm1n4pHppkqAPWNc6Lw/NvOjRY+oO6I /Cec= X-Received: by 2002:a2e:9997:0:b0:2ec:5430:7f7c with SMTP id 38308e7fff4ca-2ee5e707c8fmr43763071fa.53.1719850058594; Mon, 01 Jul 2024 09:07:38 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/29] target/arm: Add data argument to do_fp3_vector Date: Mon, 1 Jul 2024 17:07:16 +0100 Message-Id: <20240701160729.1910763-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x232.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-11-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 2697c4b305b..57cdde008ef 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5290,7 +5290,7 @@ TRANS(CMHS_s, do_cmop_d, a, TCG_COND_GEU) TRANS(CMEQ_s, do_cmop_d, a, TCG_COND_EQ) TRANS(CMTST_s, do_cmop_d, a, TCG_COND_TSTNE) -static bool do_fp3_vector(DisasContext *s, arg_qrrr_e *a, +static bool do_fp3_vector(DisasContext *s, arg_qrrr_e *a, int data, gen_helper_gvec_3_ptr * const fns[3]) { MemOp esz = a->esz; @@ -5313,7 +5313,7 @@ static bool do_fp3_vector(DisasContext *s, arg_qrrr_e *a, } if (fp_access_check(s)) { gen_gvec_op3_fpst(s, a->q, a->rd, a->rn, a->rm, - esz == MO_16, 0, fns[esz - 1]); + esz == MO_16, data, fns[esz - 1]); } return true; } @@ -5323,168 +5323,168 @@ static gen_helper_gvec_3_ptr * const f_vector_fadd[3] = { gen_helper_gvec_fadd_s, gen_helper_gvec_fadd_d, }; -TRANS(FADD_v, do_fp3_vector, a, f_vector_fadd) +TRANS(FADD_v, do_fp3_vector, a, 0, f_vector_fadd) static gen_helper_gvec_3_ptr * const f_vector_fsub[3] = { gen_helper_gvec_fsub_h, gen_helper_gvec_fsub_s, gen_helper_gvec_fsub_d, }; -TRANS(FSUB_v, do_fp3_vector, a, f_vector_fsub) +TRANS(FSUB_v, do_fp3_vector, a, 0, f_vector_fsub) static gen_helper_gvec_3_ptr * const f_vector_fdiv[3] = { gen_helper_gvec_fdiv_h, gen_helper_gvec_fdiv_s, gen_helper_gvec_fdiv_d, }; -TRANS(FDIV_v, do_fp3_vector, a, f_vector_fdiv) +TRANS(FDIV_v, do_fp3_vector, a, 0, f_vector_fdiv) static gen_helper_gvec_3_ptr * const f_vector_fmul[3] = { gen_helper_gvec_fmul_h, gen_helper_gvec_fmul_s, gen_helper_gvec_fmul_d, }; -TRANS(FMUL_v, do_fp3_vector, a, f_vector_fmul) +TRANS(FMUL_v, do_fp3_vector, a, 0, f_vector_fmul) static gen_helper_gvec_3_ptr * const f_vector_fmax[3] = { gen_helper_gvec_fmax_h, gen_helper_gvec_fmax_s, gen_helper_gvec_fmax_d, }; -TRANS(FMAX_v, do_fp3_vector, a, f_vector_fmax) +TRANS(FMAX_v, do_fp3_vector, a, 0, f_vector_fmax) static gen_helper_gvec_3_ptr * const f_vector_fmin[3] = { gen_helper_gvec_fmin_h, gen_helper_gvec_fmin_s, gen_helper_gvec_fmin_d, }; -TRANS(FMIN_v, do_fp3_vector, a, f_vector_fmin) +TRANS(FMIN_v, do_fp3_vector, a, 0, f_vector_fmin) static gen_helper_gvec_3_ptr * const f_vector_fmaxnm[3] = { gen_helper_gvec_fmaxnum_h, gen_helper_gvec_fmaxnum_s, gen_helper_gvec_fmaxnum_d, }; -TRANS(FMAXNM_v, do_fp3_vector, a, f_vector_fmaxnm) +TRANS(FMAXNM_v, do_fp3_vector, a, 0, f_vector_fmaxnm) static gen_helper_gvec_3_ptr * const f_vector_fminnm[3] = { gen_helper_gvec_fminnum_h, gen_helper_gvec_fminnum_s, gen_helper_gvec_fminnum_d, }; -TRANS(FMINNM_v, do_fp3_vector, a, f_vector_fminnm) +TRANS(FMINNM_v, do_fp3_vector, a, 0, f_vector_fminnm) static gen_helper_gvec_3_ptr * const f_vector_fmulx[3] = { gen_helper_gvec_fmulx_h, gen_helper_gvec_fmulx_s, gen_helper_gvec_fmulx_d, }; -TRANS(FMULX_v, do_fp3_vector, a, f_vector_fmulx) +TRANS(FMULX_v, do_fp3_vector, a, 0, f_vector_fmulx) static gen_helper_gvec_3_ptr * const f_vector_fmla[3] = { gen_helper_gvec_vfma_h, gen_helper_gvec_vfma_s, gen_helper_gvec_vfma_d, }; -TRANS(FMLA_v, do_fp3_vector, a, f_vector_fmla) +TRANS(FMLA_v, do_fp3_vector, a, 0, f_vector_fmla) static gen_helper_gvec_3_ptr * const f_vector_fmls[3] = { gen_helper_gvec_vfms_h, gen_helper_gvec_vfms_s, gen_helper_gvec_vfms_d, }; -TRANS(FMLS_v, do_fp3_vector, a, f_vector_fmls) +TRANS(FMLS_v, do_fp3_vector, a, 0, f_vector_fmls) static gen_helper_gvec_3_ptr * const f_vector_fcmeq[3] = { gen_helper_gvec_fceq_h, gen_helper_gvec_fceq_s, gen_helper_gvec_fceq_d, }; -TRANS(FCMEQ_v, do_fp3_vector, a, f_vector_fcmeq) +TRANS(FCMEQ_v, do_fp3_vector, a, 0, f_vector_fcmeq) static gen_helper_gvec_3_ptr * const f_vector_fcmge[3] = { gen_helper_gvec_fcge_h, gen_helper_gvec_fcge_s, gen_helper_gvec_fcge_d, }; -TRANS(FCMGE_v, do_fp3_vector, a, f_vector_fcmge) +TRANS(FCMGE_v, do_fp3_vector, a, 0, f_vector_fcmge) static gen_helper_gvec_3_ptr * const f_vector_fcmgt[3] = { gen_helper_gvec_fcgt_h, gen_helper_gvec_fcgt_s, gen_helper_gvec_fcgt_d, }; -TRANS(FCMGT_v, do_fp3_vector, a, f_vector_fcmgt) +TRANS(FCMGT_v, do_fp3_vector, a, 0, f_vector_fcmgt) static gen_helper_gvec_3_ptr * const f_vector_facge[3] = { gen_helper_gvec_facge_h, gen_helper_gvec_facge_s, gen_helper_gvec_facge_d, }; -TRANS(FACGE_v, do_fp3_vector, a, f_vector_facge) +TRANS(FACGE_v, do_fp3_vector, a, 0, f_vector_facge) static gen_helper_gvec_3_ptr * const f_vector_facgt[3] = { gen_helper_gvec_facgt_h, gen_helper_gvec_facgt_s, gen_helper_gvec_facgt_d, }; -TRANS(FACGT_v, do_fp3_vector, a, f_vector_facgt) +TRANS(FACGT_v, do_fp3_vector, a, 0, f_vector_facgt) static gen_helper_gvec_3_ptr * const f_vector_fabd[3] = { gen_helper_gvec_fabd_h, gen_helper_gvec_fabd_s, gen_helper_gvec_fabd_d, }; -TRANS(FABD_v, do_fp3_vector, a, f_vector_fabd) +TRANS(FABD_v, do_fp3_vector, a, 0, f_vector_fabd) static gen_helper_gvec_3_ptr * const f_vector_frecps[3] = { gen_helper_gvec_recps_h, gen_helper_gvec_recps_s, gen_helper_gvec_recps_d, }; -TRANS(FRECPS_v, do_fp3_vector, a, f_vector_frecps) +TRANS(FRECPS_v, do_fp3_vector, a, 0, f_vector_frecps) static gen_helper_gvec_3_ptr * const f_vector_frsqrts[3] = { gen_helper_gvec_rsqrts_h, gen_helper_gvec_rsqrts_s, gen_helper_gvec_rsqrts_d, }; -TRANS(FRSQRTS_v, do_fp3_vector, a, f_vector_frsqrts) +TRANS(FRSQRTS_v, do_fp3_vector, a, 0, f_vector_frsqrts) static gen_helper_gvec_3_ptr * const f_vector_faddp[3] = { gen_helper_gvec_faddp_h, gen_helper_gvec_faddp_s, gen_helper_gvec_faddp_d, }; -TRANS(FADDP_v, do_fp3_vector, a, f_vector_faddp) +TRANS(FADDP_v, do_fp3_vector, a, 0, f_vector_faddp) static gen_helper_gvec_3_ptr * const f_vector_fmaxp[3] = { gen_helper_gvec_fmaxp_h, gen_helper_gvec_fmaxp_s, gen_helper_gvec_fmaxp_d, }; -TRANS(FMAXP_v, do_fp3_vector, a, f_vector_fmaxp) +TRANS(FMAXP_v, do_fp3_vector, a, 0, f_vector_fmaxp) static gen_helper_gvec_3_ptr * const f_vector_fminp[3] = { gen_helper_gvec_fminp_h, gen_helper_gvec_fminp_s, gen_helper_gvec_fminp_d, }; -TRANS(FMINP_v, do_fp3_vector, a, f_vector_fminp) +TRANS(FMINP_v, do_fp3_vector, a, 0, f_vector_fminp) static gen_helper_gvec_3_ptr * const f_vector_fmaxnmp[3] = { gen_helper_gvec_fmaxnump_h, gen_helper_gvec_fmaxnump_s, gen_helper_gvec_fmaxnump_d, }; -TRANS(FMAXNMP_v, do_fp3_vector, a, f_vector_fmaxnmp) +TRANS(FMAXNMP_v, do_fp3_vector, a, 0, f_vector_fmaxnmp) static gen_helper_gvec_3_ptr * const f_vector_fminnmp[3] = { gen_helper_gvec_fminnump_h, gen_helper_gvec_fminnump_s, gen_helper_gvec_fminnump_d, }; -TRANS(FMINNMP_v, do_fp3_vector, a, f_vector_fminnmp) +TRANS(FMINNMP_v, do_fp3_vector, a, 0, f_vector_fminnmp) static bool do_fmlal(DisasContext *s, arg_qrrr_e *a, bool is_s, bool is_2) { From patchwork Mon Jul 1 16:07:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808848 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651608wrr; Mon, 1 Jul 2024 09:12:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWjv+eJXUtpEKjSTY6y820OS6l+/Xo1ptfhY5n5gPsY8lSrRiSFrQ39SgufgQkCvL0Q9Bsbi+b3rvUYTfXRXwFm X-Google-Smtp-Source: AGHT+IHBfLvbO6Ja8Ct++mbEnVdO6cz7ruxSjgD4aOthb7pIwXBvGoc4EEJEyAH8ScIagI5zJMAh X-Received: by 2002:a05:622a:2c3:b0:446:4354:29de with SMTP id d75a77b69052e-44662d9723emr89547081cf.15.1719850356563; Mon, 01 Jul 2024 09:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850356; cv=none; d=google.com; s=arc-20160816; b=C7iq222G4a0muCKrrpyMnJ+UkAMnRROiIFk/zTA/YjgEP4v/gQrRGwvhlwP5UfLXfP yeoRcgRwViKD1WTNK4ya1vuKYNd5EoIXmbu5mVV2wO1NNuawxA/56MgOcNIo6KXz+So3 mMt9SFnEIfHYwfawxUuHW+4xSGnorRYIndQJkTWYfMAiGw+EqpWwSDiTqAIEL/tj5hVt XMl5tADm29WWdPkGMJTpT2YTHUVnM/HL9BJ4oNH2Ma/MsuAbAWHElIfEIzwdvjgyggF7 CEwIJizwQzZJpzMyK9mM2buYOHRkAgw24KI/e3NiFqn86IP2YSzoM9L6KHPFqYCodJ0W Ekuw== 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:to:from :dkim-signature; bh=umdxzDnNtxvX2vzuW8yZcnHx92cHpebXW3DiyrvU1yg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Kn8wRwciBrIfAWWrUjDLq0v8tASu+1WCwmM4bUAnpAyLWlInlgUKxFy8QsBFrwm+2I Mf5+4lW8fr0CFDsk8hW/+6KLxZ24jQuGO+bvCytVAT+nP7d4t5bJGbDcJDCIW2FrQ0XB 4yDpW4WrCx3Iv7MKATy8H93Okr+xKZWSqNckp8GwwB+wv8uP2afq9tvdJYpg4BvVPRdk Pcs4IQG389nJ0IwqgZw40vnugc0yL8q+QAlqMhtwYyZ0FVrWsVX67Yf6/SB8XY/dyxF5 Q8qv/709q3FpH8UEy0LLCKX8hMbXou9KA32K9FvnXKC1jUdFe1nysC3fyDXAzPK4g5IS YqJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C+cfErdm; 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 d75a77b69052e-446512cc48dsi90341241cf.37.2024.07.01.09.12.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:36 -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=C+cfErdm; 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 1sOJa3-0002tX-43; Mon, 01 Jul 2024 12:08:39 -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 1sOJZ9-0000jF-8t for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ7-0005SS-F9 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:43 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42563a9fa58so23271845e9.0 for ; Mon, 01 Jul 2024 09:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850059; x=1720454859; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=umdxzDnNtxvX2vzuW8yZcnHx92cHpebXW3DiyrvU1yg=; b=C+cfErdmnIzMV6ooNwOFhD4BwkkwOCTsmaEed5nzlKMoGDMvKaHc4cE9dDFLB80jPj 8ZWvYts1kuhy8+BMGptp2/P4TM7Nm23zLVXi09HPbz5mULpeot52sYCdH0cUvKLSwZw3 wHlo7/90jGqKtRxCkUSQPy5PqNHP3uUWEDfz0yYL+AvOp5hia/BeEx10xO88hl0ETQBr oUGuXzodazyhSPRoVeQBqI0fg5uO/YoCJA0qUyRJTF8tdrtgolRGlFgVpZYTeOUP0zcz jC4QHIYw2Rbug4uoTf6blliROeJ3pF1vTF4Iv0MvCDg2Zv1tyqaquffF+d+UslaHYQgA cpAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850059; x=1720454859; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=umdxzDnNtxvX2vzuW8yZcnHx92cHpebXW3DiyrvU1yg=; b=tWTMj6roZ6RtsxQqN7Nwir7BfYHY1+pV5vaLZD49FTLKGjLZlsJTDkgbOGztuY10H4 81kgUy4G1ZGFmDRPCnhsM/OpIUh0mRrjMqNDkSA1BtgJietP5dlXXxxLBjrxbkq9MAi1 kHlGmrrO2vlC0FNsAuELlzN5a0HYAb9DwpjjXU3OyFp9CYE/sCtiRnOhz813ketnacW/ zDMpT+jZ5bBVWEOW7JVyiGszz/yCJtiJbKwzNVlqSuwcPPy2ieIULtqt1XHq0s9qZlZt hOjI7TEE5Ey82lom1NQ6kq5xjvhcVgTxFD4eu071BikPsl3Q/YakyQEq1boyDbUV17Po RTYg== X-Gm-Message-State: AOJu0Yyz+DInx/Ix1ITniIiqUYyzLC39db+L8dpl4pCz3EeHMPFc8u5g koOOhq57w2KEUYwwGpMNroBBP80LmJ0eVLhUl/yHkCTo49vqcSPUVct+KH/JX4Dst+Yzw1BrQdz DRis= X-Received: by 2002:a05:600c:2157:b0:425:5eff:7182 with SMTP id 5b1f17b1804b1-4257a02ce71mr42028755e9.31.1719850059075; Mon, 01 Jul 2024 09:07:39 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:38 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/29] target/arm: Convert FCADD to decodetree Date: Mon, 1 Jul 2024 17:07:17 +0100 Message-Id: <20240701160729.1910763-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-12-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 +++ target/arm/tcg/translate-a64.c | 33 ++++++++++----------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index b2c7e36969e..f330919851b 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -957,6 +957,9 @@ SMMLA 0100 1110 100 ..... 10100 1 ..... ..... @rrr_q1e0 UMMLA 0110 1110 100 ..... 10100 1 ..... ..... @rrr_q1e0 USMMLA 0100 1110 100 ..... 10101 1 ..... ..... @rrr_q1e0 +FCADD_90 0.10 1110 ..0 ..... 11100 1 ..... ..... @qrrr_e +FCADD_270 0.10 1110 ..0 ..... 11110 1 ..... ..... @qrrr_e + ### Advanced SIMD scalar x indexed element FMUL_si 0101 1111 00 .. .... 1001 . 0 ..... ..... @rrx_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 57cdde008ef..a1b338263ff 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5623,6 +5623,14 @@ static bool trans_BFMLAL_v(DisasContext *s, arg_qrrr_e *a) return true; } +static gen_helper_gvec_3_ptr * const f_vector_fcadd[3] = { + gen_helper_gvec_fcaddh, + gen_helper_gvec_fcadds, + gen_helper_gvec_fcaddd, +}; +TRANS_FEAT(FCADD_90, aa64_fcma, do_fp3_vector, a, 0, f_vector_fcadd) +TRANS_FEAT(FCADD_270, aa64_fcma, do_fp3_vector, a, 1, f_vector_fcadd) + /* * Advanced SIMD scalar/vector x indexed element */ @@ -10957,8 +10965,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) case 0x19: /* FCMLA, #90 */ case 0x1a: /* FCMLA, #180 */ case 0x1b: /* FCMLA, #270 */ - case 0x1c: /* FCADD, #90 */ - case 0x1e: /* FCADD, #270 */ if (size == 0 || (size == 1 && !dc_isar_feature(aa64_fp16, s)) || (size == 3 && !is_q)) { @@ -10976,7 +10982,9 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) case 0x11: /* SQRDMLSH (vector) */ case 0x12: /* UDOT (vector) */ case 0x14: /* UMMLA */ + case 0x1c: /* FCADD, #90 */ case 0x1d: /* BFMMLA */ + case 0x1e: /* FCADD, #270 */ case 0x1f: /* BFDOT / BFMLAL */ unallocated_encoding(s); return; @@ -11013,27 +11021,6 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) } return; - case 0xc: /* FCADD, #90 */ - case 0xe: /* FCADD, #270 */ - rot = extract32(opcode, 1, 1); - switch (size) { - case 1: - gen_gvec_op3_fpst(s, is_q, rd, rn, rm, size == 1, rot, - gen_helper_gvec_fcaddh); - break; - case 2: - gen_gvec_op3_fpst(s, is_q, rd, rn, rm, size == 1, rot, - gen_helper_gvec_fcadds); - break; - case 3: - gen_gvec_op3_fpst(s, is_q, rd, rn, rm, size == 1, rot, - gen_helper_gvec_fcaddd); - break; - default: - g_assert_not_reached(); - } - return; - default: g_assert_not_reached(); } From patchwork Mon Jul 1 16:07:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808845 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1650406wrr; Mon, 1 Jul 2024 09:10:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUV/XbT1guhJ2WDM8y2C3531xZyPPjNusWJYkWIp24a1WmZL1c0hmm76eYnCUStn6KscuIbT8QyUM2qshsEVuzP X-Google-Smtp-Source: AGHT+IEqA+Ynyep4peVv3hf1qVEmVHovODXRaq4osLV4qWKpBon0Gdp6N1jyKnVykiJgCnqkRpSQ X-Received: by 2002:ac8:7292:0:b0:446:6824:166a with SMTP id d75a77b69052e-44668241a88mr65308131cf.10.1719850215352; Mon, 01 Jul 2024 09:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850215; cv=none; d=google.com; s=arc-20160816; b=0lHmNSlTpeYEu7d8/oxWt7+XN9P2J/15yUDD7iGPPGbKLe6vaX1LzYAVllXl7Cl4Ri jDkbM/qBuxJRcCYXnIBHAfmNbcki6DTxA+it+YKH29hGPSqKVbPDGL+ahB2J3zsgqYQI wNrSZe7i2Ga94kzjrYm6t6ZU++F5CCa+BU3YQ5X+i775Fb8btOAE4+vALb7UI7pE/iiI rBKuqa0ACoDBwIms6GRSQd7SguHgGcT+ICEGot9D/PxgYkBl+FiYtpphy8cy60wDIDE1 iFr6FqQYHrlO5btEu1FWxQlBgIknsvk0T4frJB7uq5uIHTzd+w85Qv2FGJ/2931iuxtA fdGg== 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:to:from :dkim-signature; bh=M2I7ELGzNQpMmc24W8H+5tkTCIyVn6DUcVu3sM63/1Q=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=D0Qg41KHauozg6hk9ldhrDQn/EY4KYHdNC2m3KwD8Czx0cpJY2tRBpifp4GPD0gfs5 4FQeve7I+eKESm8Cx16Ae3Y9lrMgas/MCIbcgTgwfIFErUak9IJyO0MPDoU7NFIVVJgB oruVpPLAT952w2oiDi6nFOL8scRq3qhC+68oWuGQZYooTaIqbBF9vRsJ3sPe2PwUY6JT Nzs5xwuD4MlZLFRRuVfLB7RD/APT6Sgx0U/+R1nlL8BuGC17fsa4RLzVyPmOqtXDxr2W W19fYtVZ0JZ1mZzuaxWu8jH5/gDtZyHOdSdQ2DeSzaWAJWeXk5GITGUf87Rozs1bxxTN uP6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gBOowIL8; 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 d75a77b69052e-446512cbe18si84109861cf.123.2024.07.01.09.10.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:10:15 -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=gBOowIL8; 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 1sOJaA-0003v0-Bz; Mon, 01 Jul 2024 12:08:46 -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 1sOJZE-0000pK-KT for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -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 1sOJZ7-0005Sa-Gi for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:48 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52cdf4bc083so4731173e87.2 for ; Mon, 01 Jul 2024 09:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850059; x=1720454859; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=M2I7ELGzNQpMmc24W8H+5tkTCIyVn6DUcVu3sM63/1Q=; b=gBOowIL8WE998zAyeaZgGs0eY/49USojmQBb6uJz1ODQN6/RSj34w5uNZGYxjdsevP /CU1dr0jRS6ND/BvlZoGnW+xb0aXkcGVy1Ts8CJ5De0LyhipRUsvJ1wDjef3MfEH9qAF 38bodtYs7jnz58aU27tzO0RzBfC9MUzWLTgQvnUEeMB5x0s+pvHVtJ9LrOV6OOCyDEf9 lmUfft2wTKLAIWqGhpManaR1kEVVv3G8ThPQPXw6NZRL2VV48K+6JYwubGW8EdOq0l7j v/KwGXRdX3JTs4trHCdWOD7dnMyrFeiGeqfFYT8jcVa4wczTxUb1JcZr1HxjfIS0ZQyN dOpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850059; x=1720454859; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M2I7ELGzNQpMmc24W8H+5tkTCIyVn6DUcVu3sM63/1Q=; b=hKXw9JqgL2ekggQECjiWgaF9caTcAC6MucxtTQQJWDibwQP9v+6JmzYPeMfaRakKgW MRUN6BxhEb15OVLXZRf/my9Hys/z34ClPiJ1hi86vJTCf1hdpVeMu8fCtonMZH7GkNlg J96abF5SmHvmhgZObXvepEZS51tZcUOuIO1fQ2AUmWGmqF/Clc1bNa9QZ2hmMo+Japap nD8A46G4tngnBuUF5cMNKbetVCpS0Lk+YtRXJTR8THZqAhIoZ3Kf9apYJ8mvZSlAe/CY h9h1WDiDA8VCQXPr8UpFfvVkT6wOAjKdJ5E25TCBLPajcDWwhmQ9UyaluWQYszgpdRYa taXQ== X-Gm-Message-State: AOJu0YwXPDF5OfctCQni289hAylQpVp6cB/YWcPVXlEj4sIeNIE2nkAP byaOSJTferf+/88A7ehs2oueO2QyZXZd7DG18Ccf44kpM+iNS7y35frkcA9jOH/YnFtFOt8yAhy oFHs= X-Received: by 2002:a05:6512:b11:b0:52c:7f12:61d1 with SMTP id 2adb3069b0e04-52e82643bdemr4871424e87.1.1719850059518; Mon, 01 Jul 2024 09:07:39 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:39 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/29] target/arm: Convert FCMLA to decodetree Date: Mon, 1 Jul 2024 17:07:18 +0100 Message-Id: <20240701160729.1910763-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=peter.maydell@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 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: Richard Henderson Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-13-richard.henderson@linaro.org Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- target/arm/tcg/a64.decode | 6 + target/arm/tcg/translate-a64.c | 238 ++++++++++----------------------- 2 files changed, 74 insertions(+), 170 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f330919851b..223eac3cac2 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -960,6 +960,8 @@ USMMLA 0100 1110 100 ..... 10101 1 ..... ..... @rrr_q1e0 FCADD_90 0.10 1110 ..0 ..... 11100 1 ..... ..... @qrrr_e FCADD_270 0.10 1110 ..0 ..... 11110 1 ..... ..... @qrrr_e +FCMLA_v 0 q:1 10 1110 esz:2 0 rm:5 110 rot:2 1 rn:5 rd:5 + ### Advanced SIMD scalar x indexed element FMUL_si 0101 1111 00 .. .... 1001 . 0 ..... ..... @rrx_h @@ -1041,6 +1043,10 @@ USDOT_vi 0.00 1111 10 .. .... 1111 . 0 ..... ..... @qrrx_s BFDOT_vi 0.00 1111 01 .. .... 1111 . 0 ..... ..... @qrrx_s BFMLAL_vi 0.00 1111 11 .. .... 1111 . 0 ..... ..... @qrrx_h +FCMLA_vi 0 0 10 1111 01 idx:1 rm:5 0 rot:2 1 0 0 rn:5 rd:5 esz=1 q=0 +FCMLA_vi 0 1 10 1111 01 . rm:5 0 rot:2 1 . 0 rn:5 rd:5 esz=1 idx=%hl q=1 +FCMLA_vi 0 1 10 1111 10 0 rm:5 0 rot:2 1 idx:1 0 rn:5 rd:5 esz=2 q=1 + # Floating-point conditional select FCSEL 0001 1110 .. 1 rm:5 cond:4 11 rn:5 rd:5 esz=%esz_hsd diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index a1b338263ff..161fa2659c4 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5631,6 +5631,39 @@ static gen_helper_gvec_3_ptr * const f_vector_fcadd[3] = { TRANS_FEAT(FCADD_90, aa64_fcma, do_fp3_vector, a, 0, f_vector_fcadd) TRANS_FEAT(FCADD_270, aa64_fcma, do_fp3_vector, a, 1, f_vector_fcadd) +static bool trans_FCMLA_v(DisasContext *s, arg_FCMLA_v *a) +{ + gen_helper_gvec_4_ptr *fn; + + if (!dc_isar_feature(aa64_fcma, s)) { + return false; + } + switch (a->esz) { + case MO_64: + if (!a->q) { + return false; + } + fn = gen_helper_gvec_fcmlad; + break; + case MO_32: + fn = gen_helper_gvec_fcmlas; + break; + case MO_16: + if (!dc_isar_feature(aa64_fp16, s)) { + return false; + } + fn = gen_helper_gvec_fcmlah; + break; + default: + return false; + } + if (fp_access_check(s)) { + gen_gvec_op4_fpst(s, a->q, a->rd, a->rn, a->rm, a->rd, + a->esz == MO_16, a->rot, fn); + } + return true; +} + /* * Advanced SIMD scalar/vector x indexed element */ @@ -5985,6 +6018,33 @@ static bool trans_BFMLAL_vi(DisasContext *s, arg_qrrx_e *a) return true; } +static bool trans_FCMLA_vi(DisasContext *s, arg_FCMLA_vi *a) +{ + gen_helper_gvec_4_ptr *fn; + + if (!dc_isar_feature(aa64_fcma, s)) { + return false; + } + switch (a->esz) { + case MO_16: + if (!dc_isar_feature(aa64_fp16, s)) { + return false; + } + fn = gen_helper_gvec_fcmlah_idx; + break; + case MO_32: + fn = gen_helper_gvec_fcmlas_idx; + break; + default: + g_assert_not_reached(); + } + if (fp_access_check(s)) { + gen_gvec_op4_fpst(s, a->q, a->rd, a->rn, a->rm, a->rd, + a->esz == MO_16, (a->idx << 2) | a->rot, fn); + } + return true; +} + /* * Advanced SIMD scalar pairwise */ @@ -10942,90 +11002,6 @@ static void disas_simd_three_reg_diff(DisasContext *s, uint32_t insn) } } -/* AdvSIMD three same extra - * 31 30 29 28 24 23 22 21 20 16 15 14 11 10 9 5 4 0 - * +---+---+---+-----------+------+---+------+---+--------+---+----+----+ - * | 0 | Q | U | 0 1 1 1 0 | size | 0 | Rm | 1 | opcode | 1 | Rn | Rd | - * +---+---+---+-----------+------+---+------+---+--------+---+----+----+ - */ -static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn) -{ - int rd = extract32(insn, 0, 5); - int rn = extract32(insn, 5, 5); - int opcode = extract32(insn, 11, 4); - int rm = extract32(insn, 16, 5); - int size = extract32(insn, 22, 2); - bool u = extract32(insn, 29, 1); - bool is_q = extract32(insn, 30, 1); - bool feature; - int rot; - - switch (u * 16 + opcode) { - case 0x18: /* FCMLA, #0 */ - case 0x19: /* FCMLA, #90 */ - case 0x1a: /* FCMLA, #180 */ - case 0x1b: /* FCMLA, #270 */ - if (size == 0 - || (size == 1 && !dc_isar_feature(aa64_fp16, s)) - || (size == 3 && !is_q)) { - unallocated_encoding(s); - return; - } - feature = dc_isar_feature(aa64_fcma, s); - break; - default: - case 0x02: /* SDOT (vector) */ - case 0x03: /* USDOT */ - case 0x04: /* SMMLA */ - case 0x05: /* USMMLA */ - case 0x10: /* SQRDMLAH (vector) */ - case 0x11: /* SQRDMLSH (vector) */ - case 0x12: /* UDOT (vector) */ - case 0x14: /* UMMLA */ - case 0x1c: /* FCADD, #90 */ - case 0x1d: /* BFMMLA */ - case 0x1e: /* FCADD, #270 */ - case 0x1f: /* BFDOT / BFMLAL */ - unallocated_encoding(s); - return; - } - if (!feature) { - unallocated_encoding(s); - return; - } - if (!fp_access_check(s)) { - return; - } - - switch (opcode) { - case 0x8: /* FCMLA, #0 */ - case 0x9: /* FCMLA, #90 */ - case 0xa: /* FCMLA, #180 */ - case 0xb: /* FCMLA, #270 */ - rot = extract32(opcode, 0, 2); - switch (size) { - case 1: - gen_gvec_op4_fpst(s, is_q, rd, rn, rm, rd, true, rot, - gen_helper_gvec_fcmlah); - break; - case 2: - gen_gvec_op4_fpst(s, is_q, rd, rn, rm, rd, false, rot, - gen_helper_gvec_fcmlas); - break; - case 3: - gen_gvec_op4_fpst(s, is_q, rd, rn, rm, rd, false, rot, - gen_helper_gvec_fcmlad); - break; - default: - g_assert_not_reached(); - } - return; - - default: - g_assert_not_reached(); - } -} - static void handle_2misc_widening(DisasContext *s, int opcode, bool is_q, int size, int rn, int rd) { @@ -12001,10 +11977,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) int rn = extract32(insn, 5, 5); int rd = extract32(insn, 0, 5); bool is_long = false; - int is_fp = 0; - bool is_fp16 = false; int index; - TCGv_ptr fpst; switch (16 * u + opcode) { case 0x02: /* SMLAL, SMLAL2 */ @@ -12024,16 +11997,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x0b: /* SQDMULL, SQDMULL2 */ is_long = true; break; - case 0x11: /* FCMLA #0 */ - case 0x13: /* FCMLA #90 */ - case 0x15: /* FCMLA #180 */ - case 0x17: /* FCMLA #270 */ - if (is_scalar || !dc_isar_feature(aa64_fcma, s)) { - unallocated_encoding(s); - return; - } - is_fp = 2; - break; default: case 0x00: /* FMLAL */ case 0x01: /* FMLA */ @@ -12046,7 +12009,11 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) case 0x0e: /* SDOT */ case 0x0f: /* SUDOT / BFDOT / USDOT / BFMLAL */ case 0x10: /* MLA */ + case 0x11: /* FCMLA #0 */ + case 0x13: /* FCMLA #90 */ case 0x14: /* MLS */ + case 0x15: /* FCMLA #180 */ + case 0x17: /* FCMLA #270 */ case 0x18: /* FMLAL2 */ case 0x19: /* FMULX */ case 0x1c: /* FMLSL2 */ @@ -12057,46 +12024,12 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) return; } - switch (is_fp) { - case 1: /* normal fp */ - unallocated_encoding(s); /* in decodetree */ - return; - - case 2: /* complex fp */ - /* Each indexable element is a complex pair. */ - size += 1; - switch (size) { - case MO_32: - if (h && !is_q) { - unallocated_encoding(s); - return; - } - is_fp16 = true; - break; - case MO_64: - break; - default: - unallocated_encoding(s); - return; - } - break; - - default: /* integer */ - switch (size) { - case MO_8: - case MO_64: - unallocated_encoding(s); - return; - } - break; - } - if (is_fp16 && !dc_isar_feature(aa64_fp16, s)) { - unallocated_encoding(s); - return; - } - /* Given MemOp size, adjust register and indexing. */ switch (size) { + case MO_8: + case MO_64: + unallocated_encoding(s); + return; case MO_16: index = h << 2 | l << 1 | m; break; @@ -12104,14 +12037,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) index = h << 1 | l; rm |= m << 4; break; - case MO_64: - if (l || !is_q) { - unallocated_encoding(s); - return; - } - index = h; - rm |= m << 4; - break; default: g_assert_not_reached(); } @@ -12120,32 +12045,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) return; } - if (is_fp) { - fpst = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR); - } else { - fpst = NULL; - } - - switch (16 * u + opcode) { - case 0x11: /* FCMLA #0 */ - case 0x13: /* FCMLA #90 */ - case 0x15: /* FCMLA #180 */ - case 0x17: /* FCMLA #270 */ - { - int rot = extract32(insn, 13, 2); - int data = (index << 2) | rot; - tcg_gen_gvec_4_ptr(vec_full_reg_offset(s, rd), - vec_full_reg_offset(s, rn), - vec_full_reg_offset(s, rm), - vec_full_reg_offset(s, rd), fpst, - is_q ? 16 : 8, vec_full_reg_size(s), data, - size == MO_64 - ? gen_helper_gvec_fcmlas_idx - : gen_helper_gvec_fcmlah_idx); - } - return; - } - if (size == 3) { g_assert_not_reached(); } else if (!is_long) { @@ -12407,7 +12306,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) */ static const AArch64DecodeTable data_proc_simd[] = { /* pattern , mask , fn */ - { 0x0e008400, 0x9f208400, disas_simd_three_reg_same_extra }, { 0x0e200000, 0x9f200c00, disas_simd_three_reg_diff }, { 0x0e200800, 0x9f3e0c00, disas_simd_two_reg_misc }, { 0x0e300800, 0x9f3e0c00, disas_simd_across_lanes }, From patchwork Mon Jul 1 16:07:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808857 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651987wrr; Mon, 1 Jul 2024 09:13:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXlpj79yZ0kOsfieVbRVruutbmBj3gBnG9MCUj82EEvWLWIbgsmJoTkORxwYXPzF6+LpouWv1AJg9j1lZKdOp6V X-Google-Smtp-Source: AGHT+IE2unMsZ3GSTSAY+pfz85+0Sl/CNP+ZEhGpS6z0193mMp3iUQvwrJYUd9xoEgYr06rtaM9G X-Received: by 2002:ac8:4e11:0:b0:446:641d:d0ec with SMTP id d75a77b69052e-446641de39amr56070081cf.57.1719850396854; Mon, 01 Jul 2024 09:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850396; cv=none; d=google.com; s=arc-20160816; b=xOXBJk79W1Ji3DStHoDWzGF4AdCsggGoawzFJa6Z7fpVvbvxEtAZgaNuRIAuXPucW5 PCv0Vo/wHEUcNPT2CYAQNKsdav0O6o1l6X+DORyXBptoGhkfFP9c1JrGsc+wty+SQy3P V6rNJJNRCJM0LMqQUUmOaViw5Jrqc1xbmEWxQNxr7p8p9G7mfIuWZebXLO8Rp8jo3Ouz ksRFGwTNaZhB3OXkAvbyONFD6lasj913RtrluA6QaLpEeRSN8MIP0QNLSZW37PiuupOt aUZprJ3px6S+uetBZjmfAZiyymdGkiK0t48rsH/02+odQjJTfNop+uI58XzGUgAle3ZC xoXQ== 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:to:from :dkim-signature; bh=iLACqgTTEHhqCS+ObmefTAtVB4Q6QNPzyB2rXjNCxak=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=WGXppB1pMmS7QSihdXpl7bSRTUTFlgaS6IyWCb2HmfyqOy0OoOmW0hDGtv3HwCWZRp TZAYeXJPDK4pn2ZKwAOPq2IFCok1I+eMYak5L0GkSpzliS3vwbl5NLByBb+b97TExNxH kS5vtQWj1Ot2H5oX2EzPZAkSjSNQ8e25Y/nsaDEYZN1kiiXem70RE6rQ6BSwZ06gaD1v AObGE5VvmstzJBxvodapLjqd55RbFWpkCb7wV+yqSya2H8iOm3BwZiZ8CKJekTH7bAzk 46FP2dBaCQwpb81GFhOIYsXjeEO8/pynekLUvHJiiIWaYOoZZimRa4GM3YbtJJRMiEMN anvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egvhZ1oR; 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 d75a77b69052e-446514d988csi81651051cf.692.2024.07.01.09.13.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:13:16 -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=egvhZ1oR; 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 1sOJa6-0003L3-BX; Mon, 01 Jul 2024 12:08:42 -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 1sOJZD-0000nN-PL for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ8-0005Sz-7v for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:47 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-52d259dbe3cso3383819e87.0 for ; Mon, 01 Jul 2024 09:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850060; x=1720454860; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=iLACqgTTEHhqCS+ObmefTAtVB4Q6QNPzyB2rXjNCxak=; b=egvhZ1oR+ZCvtJe50zaLi/IyA3lwQv57jnLM6GC3+g7f8dSghHCUCBvhbNgANj8sS2 +j+GLnGzG7KAdghiDKSvUmNho5bRZdQVDkDZg3NeknPgozF5ZTWCHvzUbdvdkW+kd9hC jF7HGoPmYyldAttsaNi/EiqBHHSpFG7qPFzm88aejxUhit1MFF7kNhj5yzPDkWhoaWyh KLRwG6tBf4iXC9lpumeZUPRzbhbWFzRXsZejuyFPDCqZ1a8+CtaRmHtkxVZ/akVA40c6 hA2t/4CBMwUZlh2HwiBLTuhXINOrBPnlXEk1dkBm2lY9XHzHaEQUA1wfahVS3UVcYTMh zoPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850060; x=1720454860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iLACqgTTEHhqCS+ObmefTAtVB4Q6QNPzyB2rXjNCxak=; b=NxH4xwb8A60REXDfkZmCJTg8T+fYDC9AB6AChSFM1fdVjteY1Axw7x2vukTuZcQLc7 A3rDm0TbB8oyu3FZnOdo6PtK1onqEMh+o/c5F1heNYbjIWxLenObN6gzJP+yRCR9kglS GHa+XDJjVyOUmso/ZZ9nCVErSMJZzF2fMKQHHWkuFqGNeRMNfqhtgsD9COwH6mGYSQPp WqnIynoTh1Zh0NUZoT/6ZEjKdt5gxwttonWhhqr9i2f3Ursi1h+K6AMlYIgVeGDOMJet tezZLac+x40oRm/bxALhAFVUUQBWNRIP75zOqxBi5OjZIc5nEdMriKfMPVMihgk4UR3q hKww== X-Gm-Message-State: AOJu0YzmZE89ALrCyEyIn4QtB8W/WiB3vXnkG4XfdPx39deVAbUadu5J J9XAFSnEK32nRdZ/77nfzX/8AN96gzIPmnkwuBLlSbIEz5OvraPcfOd2uVNzjuKGKxmN7SfFNH4 3bpo= X-Received: by 2002:a05:6512:33c9:b0:52c:dfe6:70e0 with SMTP id 2adb3069b0e04-52e8264460dmr4607537e87.10.1719850060120; Mon, 01 Jul 2024 09:07:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:39 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/29] target/arm: Delete dead code from disas_simd_indexed Date: Mon, 1 Jul 2024 17:07:19 +0100 Message-Id: <20240701160729.1910763-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x133.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, T_SPF_TEMPERROR=0.01 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: Richard Henderson MLA, MLS, SQDMULH, SQRDMULH, were converted with 8db93dcd3def and f80701cb44d, and this code should have been removed then. Signed-off-by: Richard Henderson Message-id: 20240625183536.1672454-14-richard.henderson@linaro.org Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 93 ---------------------------------- 1 file changed, 93 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 161fa2659c4..6c07aeaf3bd 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -11976,7 +11976,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) int h = extract32(insn, 11, 1); int rn = extract32(insn, 5, 5); int rd = extract32(insn, 0, 5); - bool is_long = false; int index; switch (16 * u + opcode) { @@ -11990,12 +11989,10 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) unallocated_encoding(s); return; } - is_long = true; break; case 0x03: /* SQDMLAL, SQDMLAL2 */ case 0x07: /* SQDMLSL, SQDMLSL2 */ case 0x0b: /* SQDMULL, SQDMULL2 */ - is_long = true; break; default: case 0x00: /* FMLAL */ @@ -12047,96 +12044,6 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) if (size == 3) { g_assert_not_reached(); - } else if (!is_long) { - /* 32 bit floating point, or 16 or 32 bit integer. - * For the 16 bit scalar case we use the usual Neon helpers and - * rely on the fact that 0 op 0 == 0 with no side effects. - */ - TCGv_i32 tcg_idx = tcg_temp_new_i32(); - int pass, maxpasses; - - if (is_scalar) { - maxpasses = 1; - } else { - maxpasses = is_q ? 4 : 2; - } - - read_vec_element_i32(s, tcg_idx, rm, index, size); - - if (size == 1 && !is_scalar) { - /* The simplest way to handle the 16x16 indexed ops is to duplicate - * the index into both halves of the 32 bit tcg_idx and then use - * the usual Neon helpers. - */ - tcg_gen_deposit_i32(tcg_idx, tcg_idx, tcg_idx, 16, 16); - } - - for (pass = 0; pass < maxpasses; pass++) { - TCGv_i32 tcg_op = tcg_temp_new_i32(); - TCGv_i32 tcg_res = tcg_temp_new_i32(); - - read_vec_element_i32(s, tcg_op, rn, pass, is_scalar ? size : MO_32); - - switch (16 * u + opcode) { - case 0x10: /* MLA */ - case 0x14: /* MLS */ - { - static NeonGenTwoOpFn * const fns[2][2] = { - { gen_helper_neon_add_u16, gen_helper_neon_sub_u16 }, - { tcg_gen_add_i32, tcg_gen_sub_i32 }, - }; - NeonGenTwoOpFn *genfn; - bool is_sub = opcode == 0x4; - - if (size == 1) { - gen_helper_neon_mul_u16(tcg_res, tcg_op, tcg_idx); - } else { - tcg_gen_mul_i32(tcg_res, tcg_op, tcg_idx); - } - if (opcode == 0x8) { - break; - } - read_vec_element_i32(s, tcg_op, rd, pass, MO_32); - genfn = fns[size - 1][is_sub]; - genfn(tcg_res, tcg_op, tcg_res); - break; - } - case 0x0c: /* SQDMULH */ - if (size == 1) { - gen_helper_neon_qdmulh_s16(tcg_res, tcg_env, - tcg_op, tcg_idx); - } else { - gen_helper_neon_qdmulh_s32(tcg_res, tcg_env, - tcg_op, tcg_idx); - } - break; - case 0x0d: /* SQRDMULH */ - if (size == 1) { - gen_helper_neon_qrdmulh_s16(tcg_res, tcg_env, - tcg_op, tcg_idx); - } else { - gen_helper_neon_qrdmulh_s32(tcg_res, tcg_env, - tcg_op, tcg_idx); - } - break; - default: - case 0x01: /* FMLA */ - case 0x05: /* FMLS */ - case 0x09: /* FMUL */ - case 0x19: /* FMULX */ - case 0x1d: /* SQRDMLAH */ - case 0x1f: /* SQRDMLSH */ - g_assert_not_reached(); - } - - if (is_scalar) { - write_fp_sreg(s, rd, tcg_res); - } else { - write_vec_element_i32(s, tcg_res, rd, pass, MO_32); - } - } - - clear_vec_high(s, is_q, rd); } else { /* long ops: 16x16->32 or 32x32->64 */ TCGv_i64 tcg_res[2]; From patchwork Mon Jul 1 16:07:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808841 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649803wrr; Mon, 1 Jul 2024 09:09:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWcfTEAFqc8u5vhWulRo/czL4sF1MCVQ+wT6LPNYJVy5jKBKHwMah2d5ld77oBAvkBRD05dYPkY9zccCHzazleH X-Google-Smtp-Source: AGHT+IE8Ca+aUplHiOJRYFH5RB1AuGM73p3ayEs87oK2lkC/fOaXNn5E3WNFEaJwj7Y01/vofXP6 X-Received: by 2002:a05:622a:1a29:b0:446:5b7a:b066 with SMTP id d75a77b69052e-44662e4c08amr69694131cf.20.1719850152844; Mon, 01 Jul 2024 09:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850152; cv=none; d=google.com; s=arc-20160816; b=QK5h4TF0kkXK294H8x4tjSzoqiEDwo73J+grnwrphjGlFZMUhQHzTXewAtVXzwW5kf apeJwGp7aoM6Qqzm6lWatlWUxGuhpicbg+QbStr1z4CQj6gJgRTLeUyvdl/Ca9Ho7Zdv jzYLP5cv9brNV3wcG9bg3FcoxQoc5/08LEJqUUXJpvJ9r/H9I0SF5PCH1j/eqJSFr16n tZlX6yGR9hp4xiXrL6HvxzHFgKNOBr4pfernOczc4SGgm/zQYGv7LQY1/p4y/VyIwBgr 1WjxgmuMZK+jT39mo2UDzi/8k34fiDOw61tSZJ3rxurlAAVna7cvBsfJ2RRqXE15mf/N nR6A== 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:to:from :dkim-signature; bh=eMCn7R56dlpxU36g7EBOXlmw6Q3/lgJjMgb1HwXwFHw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Q5jYPHqNr4OaQ9nwfcz0jhi8uQxzSomXjMuriI6PpGqF4v/3kL5CSQTBUexyaX9f9/ bX7LXpZotz5ICgxipghricAk3jZuXTL2nAKJepm3gcw+41IPoqr4+W8GVNRsuBhk07Px SZIz/86a9OZzVj6nSIvkeEMmlxjQlrdeNxyjMfketr3CBaehtptUwjkcDSKS/27effMa 3hOyrxTkZ5beK8VJF3bkl4lDxVcf3ztwAKFfkJ1pvMPEoiaOJOZgwIiD/Zo7EQLXq+s/ FVtDsU5lakA3w7WC+gxmFJFg89ag10xGlOBIuHvD6CZE7i5M1jUSXwuxAbFTiMqAKoWA 98Ng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eieo9hiK; 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 d75a77b69052e-446514da0f9si81677481cf.695.2024.07.01.09.09.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:09:12 -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=eieo9hiK; 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 1sOJaB-000409-3R; Mon, 01 Jul 2024 12:08:47 -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 1sOJZI-0000wk-7x for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:54 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ8-0005T5-EL for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:52 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-52ce6c8db7bso4772868e87.1 for ; Mon, 01 Jul 2024 09:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850061; x=1720454861; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=eMCn7R56dlpxU36g7EBOXlmw6Q3/lgJjMgb1HwXwFHw=; b=eieo9hiKPkts0+XYtDSSLz8F5S0erwB6VsJS/Nvwm29HXGHKc5Qdns3BMw237N34tZ TBKV9BR6xBRUuPMMIwmO2pVMUW7EUWLhaaTh3C49805tFYQ3cZ963tvZyKXTRhE97MT9 L0EOaS+G26R9bXHqYhFlbYiYkc0f8Q7/Z0TZBblM0yYjP0IDmnmWo6GTT4rY7IsqHbAR uSMkP5QZlo/k5MiUsdIFBoA97mryjAO1TvPZIroGihQEPVHTTSiGQZVm8kNWJmgO5tz0 pJbqSM2qJE6c7+2NYm/wzOhav7KS/o2KDU1ANBXASXJP2LF3AGpnDufO2AtmghSJtcbX vpaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850061; x=1720454861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eMCn7R56dlpxU36g7EBOXlmw6Q3/lgJjMgb1HwXwFHw=; b=EFQe7R0n4RXhFkgkc1CvFdQNVuTZ5cawdidhhrlsG3t12W8tIu5A24ijjZ46fakZ3n wVFlY8sp5tt+XsbCb14TEVuMofswAvnTO3oOrTrgmhtgejHTfr1rE5ck0G7PiriAUGK+ +TWt4Kd6cT+vGUcsz4RoL2Bkg8HU+T0DMx0YhOGs57H8q0JI0JKuoIM0VC061M3d4aZj RqxM3i9JV/82YL6v8YEbBP7dia4ewVO/fLLj/eDpn3kOb5oLZjVEgnsT3H5nXIcpea3t /W4rxSKcYSmtFt5XLfJh7KHptTKo0VR8l8mm9W2Kv8lAulfM19Qe/hqySt4CDY3CnP7K TtTQ== X-Gm-Message-State: AOJu0Ywb0luevCaeZJKpmAul9IwzjYPYrS6ATf2uPvKmxWJjMpGDk3XF 0fNt45dc+t5ykZYNSRH4YDG3QrAy+ygJ8ySgOFZS+X9AnTp/J+do6/5obkoqFYpWdAFfE8+20pO 2fHg= X-Received: by 2002:a05:6512:1251:b0:52c:deba:7e6e with SMTP id 2adb3069b0e04-52e82691371mr5086850e87.29.1719850060812; Mon, 01 Jul 2024 09:07:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:40 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/29] target/arm: Fix indentation Date: Mon, 1 Jul 2024 17:07:20 +0100 Message-Id: <20240701160729.1910763-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x134.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: Gustavo Romero Fix comment indentation adding a missing space. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson Message-id: 20240624180915.4528-2-gustavo.romero@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/cpu64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 0899251eef4..71e1bfcd4ee 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1167,7 +1167,7 @@ void aarch64_max_tcg_initfn(Object *obj) t = cpu->isar.id_aa64isar2; t = FIELD_DP64(t, ID_AA64ISAR2, MOPS, 1); /* FEAT_MOPS */ - t = FIELD_DP64(t, ID_AA64ISAR2, BC, 1); /* FEAT_HBC */ + t = FIELD_DP64(t, ID_AA64ISAR2, BC, 1); /* FEAT_HBC */ t = FIELD_DP64(t, ID_AA64ISAR2, WFXT, 2); /* FEAT_WFxT */ cpu->isar.id_aa64isar2 = t; From patchwork Mon Jul 1 16:07:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808831 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649194wrr; Mon, 1 Jul 2024 09:08:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXfT9BXUVFbQOS1Zv63S4R6lHack0QKR9fomC8LG2rhUP7q0tu0oX1/9X6+82NonNzs7ds1bMSqXxdfCUkfNtmh X-Google-Smtp-Source: AGHT+IE0CXp4ybV1dG4E4kEgXShbRLCgjkmiKKyY6Toq5lEIvoGzhxFaQB+KxWHyLSyNJw7YQoeL X-Received: by 2002:a05:6122:3888:b0:4ec:fe12:4559 with SMTP id 71dfb90a1353d-4f2a5745ff4mr3401692e0c.13.1719850088989; Mon, 01 Jul 2024 09:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850088; cv=none; d=google.com; s=arc-20160816; b=pIr20+aG5hRuJMUJY51yZg7aycLtglNuGiL9kSzPpmaClhhai1b65k7E3IyOuHm2uC QU0YCFbDAhD7Wy+UerL9TEDtdsSo00SC5qeowVsQtRXnadKHchhH13KWeufSCVcd6zgB kjOhF1h8knl8FYtZBvOu6luXT8pMqYQxRZPmw9nrk6QsBIxfCgntCLwdGya9NmW/agCz osh96hoKP2fqzkAdC6d7EPrxOHkD6gtvGV3lhtH3kYZrJO1eF/LPYhyDnJId/ZvtMD0V a7f7VYsWPVXbqGEIQvsXbS3vj5GUr4zlkHPyA/VcbKdyBN7Nl8/l7wdFem2Eeal3U5Uc A1yQ== 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:to:from :dkim-signature; bh=NAjd9MzEHdZLfkEQtg/fWScyodUzBC9VZqmLgzQaiAI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=pFfQJwcyjHzfwk3rOifyW+nVsR9ZpNiO93yUz9LSv5FU0+qGcdYUs8k9rZoynDwy3K ANTnN3HK0rvtMnPfWIRVv9H6Ed5gbu9cLK4f+TtxVheXHoO0k+u0zwAxfOac0Xz0coC3 btxCn+74LDsVqMToL4wiLJGyTU3FjGSThUPLp6y3SI6Y+sUY5wX5XOcmSYIAXFovZ6Q+ 2aam0KCOGIDTTHRg8Xdw+igOsaLd6+gTt/ZfYU4oHcrZq2kjxYaUGwbQLg8OkLkm0DDj /5PgYSuIZnKt/VpY6+Eg0pEoRD7HyipUup/IdIK2WB7pqR7YYj373W4qhqtQdEe9w1zV +akw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dRIS0ElN; 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 ada2fe7eead31-48f9b299e39si1085405137.780.2024.07.01.09.08.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:08 -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=dRIS0ElN; 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 1sOJZM-000144-UG; Mon, 01 Jul 2024 12:07:56 -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 1sOJZC-0000mw-QO for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:47 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ8-0005TZ-RF for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:45 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-52cdebf9f53so3263646e87.2 for ; Mon, 01 Jul 2024 09:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850061; x=1720454861; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NAjd9MzEHdZLfkEQtg/fWScyodUzBC9VZqmLgzQaiAI=; b=dRIS0ElNDmrrODv+BRQuIjvz8jm4fkuQcov4MSYcFRCwBP+FLLX7nH4Gt7TFxO/HDu qb2hhrl2d6leTQr/mJCaSKLxLj7/AkfsgbdfsIOsaD3TespGVmsTt968DY/zng/U3K8M E0sgm6tXR1+F+Au9f33SlSeZGMtADUCqpuZeemlZZRxeuuD2vcRsEvPMzLpIq8q3Y3Jc 9QoEL2KYeY9NMA/hFCyb/yQb6B4nuSoD8CGl+DeiZNJjo2WoeWA+Z8mV4jvol1YY4VM6 17eWUjfKHwUjN41jg5VSOhZa4ryw6TOQoieIEnRycTEACYs4Iqv9wTubVxNaT5VKeG7f 3bLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850061; x=1720454861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NAjd9MzEHdZLfkEQtg/fWScyodUzBC9VZqmLgzQaiAI=; b=N5UqDNdL1Uy4+OoxloKwBsQQLX+r5JiMO0TEPB3IxjrjOVWiwhwVan0Ne3pzXNB5+0 2Hq0sQeGbyvwzoU0Yxex6zNlEFt9DSJAgfnTinkqRmFba9gSFnbLk/69LXPkU3kfLHfw dMr0p9TpAUk/NvrjKWJUdBuJQv5kZnXF/jQXp/O3rMFKF609bwdStIwFLSlucSdk3q3C 885o55sv680Fm8I/EnwZq0ACPshbuHOSaZKoM2sf4gpP8z2QB9pkYLDxQE8EpmlYsDUQ 0ehXIsxocS0auHiIcNhSm34bIfKTO1UvVjuwzxO9NKf29aJcmfD8OCtaWjQB4syNobJi RhwA== X-Gm-Message-State: AOJu0YznSLE1ubzcTiEP0DA7ot5f3aQj3WUGWbvAEsymG73bM9h5UpzK dPy6h/nbXhS7wifpfBmUO4QNAacBdlB9Zx/Dsc1rhpCm266Foe97qqD/jN/BrxiJD2sEbC7G6D4 n96c= X-Received: by 2002:a05:6512:3b29:b0:52c:d9f8:b033 with SMTP id 2adb3069b0e04-52e8264bcb5mr3781219e87.3.1719850061255; Mon, 01 Jul 2024 09:07:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/29] target/arm: Move initialization of debug ID registers Date: Mon, 1 Jul 2024 17:07:21 +0100 Message-Id: <20240701160729.1910763-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12b.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: Gustavo Romero Move the initialization of the debug ID registers to aa32_max_features, which is used to set the 32-bit ID registers. This ensures that the debug ID registers are consistently set for the max CPU in a single place. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson Message-id: 20240624180915.4528-3-gustavo.romero@linaro.org Signed-off-by: Peter Maydell --- target/arm/cpu.h | 2 ++ target/arm/tcg/cpu32.c | 31 ++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 3841359d0f1..d8eb986a047 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2299,6 +2299,8 @@ FIELD(DBGDEVID, DOUBLELOCK, 20, 4) FIELD(DBGDEVID, AUXREGS, 24, 4) FIELD(DBGDEVID, CIDMASK, 28, 4) +FIELD(DBGDEVID1, PCSROFFSET, 0, 4) + FIELD(MVFR0, SIMDREG, 0, 4) FIELD(MVFR0, FPSP, 4, 4) FIELD(MVFR0, FPDP, 8, 4) diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c index bdd82d912a2..28a5c033bb9 100644 --- a/target/arm/tcg/cpu32.c +++ b/target/arm/tcg/cpu32.c @@ -87,6 +87,34 @@ void aa32_max_features(ARMCPU *cpu) t = FIELD_DP32(t, ID_DFR0, PERFMON, 6); /* FEAT_PMUv3p5 */ cpu->isar.id_dfr0 = t; + /* Debug ID registers. */ + + /* Bit[15] is RES1, Bit[13] and Bits[11:0] are RES0. */ + t = 0x00008000; + t = FIELD_DP32(t, DBGDIDR, SE_IMP, 1); + t = FIELD_DP32(t, DBGDIDR, NSUHD_IMP, 1); + t = FIELD_DP32(t, DBGDIDR, VERSION, 6); /* Armv8 debug */ + t = FIELD_DP32(t, DBGDIDR, CTX_CMPS, 1); + t = FIELD_DP32(t, DBGDIDR, BRPS, 5); + t = FIELD_DP32(t, DBGDIDR, WRPS, 3); + cpu->isar.dbgdidr = t; + + t = 0; + t = FIELD_DP32(t, DBGDEVID, PCSAMPLE, 3); + t = FIELD_DP32(t, DBGDEVID, WPADDRMASK, 1); + t = FIELD_DP32(t, DBGDEVID, BPADDRMASK, 15); + t = FIELD_DP32(t, DBGDEVID, VECTORCATCH, 0); + t = FIELD_DP32(t, DBGDEVID, VIRTEXTNS, 1); + t = FIELD_DP32(t, DBGDEVID, DOUBLELOCK, 1); + t = FIELD_DP32(t, DBGDEVID, AUXREGS, 0); + t = FIELD_DP32(t, DBGDEVID, CIDMASK, 0); + cpu->isar.dbgdevid = t; + + /* Bits[31:4] are RES0. */ + t = 0; + t = FIELD_DP32(t, DBGDEVID1, PCSROFFSET, 2); + cpu->isar.dbgdevid1 = t; + t = cpu->isar.id_dfr1; t = FIELD_DP32(t, ID_DFR1, HPMN0, 1); /* FEAT_HPMN0 */ cpu->isar.id_dfr1 = t; @@ -955,9 +983,6 @@ static void arm_max_initfn(Object *obj) cpu->isar.id_isar4 = 0x00011142; cpu->isar.id_isar5 = 0x00011121; cpu->isar.id_isar6 = 0; - cpu->isar.dbgdidr = 0x3516d000; - cpu->isar.dbgdevid = 0x00110f13; - cpu->isar.dbgdevid1 = 0x2; cpu->isar.reset_pmcr_el0 = 0x41013000; cpu->clidr = 0x0a200023; cpu->ccsidr[0] = 0x701fe00a; /* 32KB L1 dcache */ From patchwork Mon Jul 1 16:07:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808839 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649671wrr; Mon, 1 Jul 2024 09:08:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWn2LQVk9eCyQKk/D1jfwY3GM2JlCiQKD08QanMOsyeOteXmPa3Kdvx88guizywyW9kJqLrYI+tgEzzL3lMnppw X-Google-Smtp-Source: AGHT+IG4s06RRBlScF6Rb3vSfjUrdl1NJpW/UNLXxXfZcgVSQRNpLU7aH8z+20vsWFRacr4asijD X-Received: by 2002:a05:6122:4a1b:b0:4ec:f773:209c with SMTP id 71dfb90a1353d-4f2a575709amr3089401e0c.14.1719850137885; Mon, 01 Jul 2024 09:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850137; cv=none; d=google.com; s=arc-20160816; b=Yriu0dsi8bwq7y6EOnid8CTt/P1NOaYZ3pyvKgr7/a1ZajK5A5mjaVi2h+gGPZ3Ozt NDumyeWYFi/KrCvQ5Fmb5JQK1LdHmzv0eZAZPtnUcyRPtkRHeyjT9ppGPhm0lA43LfFf 8XLQo6k+nITnGluryztnaLJ2b6V4PGQH9lVzfNcjabKp69vwOdBovzLggZ5ZqbhnWuDR qkzXlMR9kwPZIemtiREYOR3kIY/blmdZpIS9hPqUWNA4MBcQj++Z3F6SsWBI7mnP/mSf KyXGSMorE0w1sGFp7H6PqCFzhp2bECJ1xuDjKKh98Se+13n5DB+Pmp8tC4hSl52SvHmi GLiA== 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:to:from :dkim-signature; bh=Z7/IHdKKubpCBk70PI2w/9BtCaXUhcMHm9wylsLvrK0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hiO0T67Q1Khqd8Fdb4n/VsMSz3Lt2viAdDFFHh5qxovI8ATvQnet0SdTMH+dlxUucd GUwC3H52UeCekCR9X6lAimrobubKFCskgHap+hZatJGzeHgmZHjpjiADVIo85KZEKVQL EjWiGponSFIwqle3JK49mdiRgtujsQMSG7botx20Get4qPvqL0Tf3p1ypPqyxj61Txvh Pw4fv7oU069o0Z4B0z0jNeEuijL3X1TJxlLW3Seecf5FaAUFqhZFUuqcl8Dp72yBIBu5 2uwGSP7YQSTyOeJPVv/xKMgIWlLmlV+BFQVIJ7/J+1jJ8Z5gVXqI1YbpNEmP0dbLS6lM vfjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="t4Vv6MG/"; 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 71dfb90a1353d-4f29224e4e0si926975e0c.148.2024.07.01.09.08.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:57 -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="t4Vv6MG/"; 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 1sOJa5-00039D-6i; Mon, 01 Jul 2024 12:08:41 -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 1sOJZE-0000p8-CT for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZ9-0005Tk-FW for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:47 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-52cdd03d6aaso3693883e87.0 for ; Mon, 01 Jul 2024 09:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850061; x=1720454861; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Z7/IHdKKubpCBk70PI2w/9BtCaXUhcMHm9wylsLvrK0=; b=t4Vv6MG/Ev1n4mQvvepF5jZt5E4VCYefyvdVVKkuXavoGXywKe6OvzEKO0Lw0yP/vb S31GHSyJLUJg+lWw2q5QoOpxZPnBAaJF/gSEHpT7WvaeeznlRdo2vOPmbUYCBrbIVyPN iDhMRcFWKGOyaWgnHmZdhxRHkKHmZqVP5gTUROj0BLOtDOxQG3VqO/8bL4DrISCpmxGb p/+pccX+AH/m8f3lJOBLnF53B5z09dVWgI3RBeyZWI3utw05box/C8hqOjrbOKUvmUuB uxvidJccgCyLlkUkdq+DnMfewqWPt4i19VUKLpLm+xuq2V7nCP/EkdXvbaDnpgxEbJct LyKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850061; x=1720454861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z7/IHdKKubpCBk70PI2w/9BtCaXUhcMHm9wylsLvrK0=; b=B80JVFtK1Pob5JtyW7xPCFyG+BKzr4b71gSJnvlEfVn/3z4GGJEip/X8bcDWsBR8nw omkQSHhxgLmOeT5ddcj2tN29je/KAiTm3a+zcZCzXVPfxTqcEnA3qgV/qtwYBkhoZzYQ tlgccAkmDvmCnHq5wLK8zoqHES3+JEbwtSJzoscZC4D9vrzfwD5pqB/8LVeoNh4BoqJ/ DtS90DfBfa8wRvfaFQZOaQjMerrOkNsglR7NhK2KhfJ3xh9W3t5tyIF9sWNxRttmdI+5 NNPTA0gjir3D8NRfHpDbpnqXOnvq0o4UzsUnWGpP3PPp9fnOREnTrgSi2CeLDbg2Xatf a/OQ== X-Gm-Message-State: AOJu0Yz4AEDPqNO0QF8xPPr14bvmIWC3fF9NZjDvSMkJgiZTb8tHAgjM BYBZjdI77A/CdPkBgdQq8gYCPBEQYbc0UU+yNggZBG3HkJ4vVyC011cRBBSFgr5CUu2q5ENZfsR 1up8= X-Received: by 2002:a05:6512:10d1:b0:52c:c6a0:575c with SMTP id 2adb3069b0e04-52e82687f07mr4438791e87.33.1719850061673; Mon, 01 Jul 2024 09:07:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/29] target/arm: Enable FEAT_Debugv8p8 for -cpu max Date: Mon, 1 Jul 2024 17:07:22 +0100 Message-Id: <20240701160729.1910763-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12b.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: Gustavo Romero Enable FEAT_Debugv8p8 for max CPU. This feature is out of scope for QEMU since it concerns the external debug interface for JTAG, but is mandatory in Armv8.8 implementations, hence it is reported as supported in the ID registers. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson Message-id: 20240624180915.4528-4-gustavo.romero@linaro.org Signed-off-by: Peter Maydell --- docs/system/arm/emulation.rst | 1 + target/arm/tcg/cpu32.c | 6 +++--- target/arm/tcg/cpu64.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index 1a06a5feb6e..3ab6e726679 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -41,6 +41,7 @@ the following architecture extensions: - FEAT_Debugv8p1 (Debug with VHE) - FEAT_Debugv8p2 (Debug changes for v8.2) - FEAT_Debugv8p4 (Debug changes for v8.4) +- FEAT_Debugv8p8 (Debug changes for v8.8) - FEAT_DotProd (Advanced SIMD dot product instructions) - FEAT_DoubleFault (Double Fault Extension) - FEAT_E0PD (Preventing EL0 access to halves of address maps) diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c index 28a5c033bb9..20c2737f17b 100644 --- a/target/arm/tcg/cpu32.c +++ b/target/arm/tcg/cpu32.c @@ -82,8 +82,8 @@ void aa32_max_features(ARMCPU *cpu) cpu->isar.id_pfr2 = t; t = cpu->isar.id_dfr0; - t = FIELD_DP32(t, ID_DFR0, COPDBG, 9); /* FEAT_Debugv8p4 */ - t = FIELD_DP32(t, ID_DFR0, COPSDBG, 9); /* FEAT_Debugv8p4 */ + t = FIELD_DP32(t, ID_DFR0, COPDBG, 10); /* FEAT_Debugv8p8 */ + t = FIELD_DP32(t, ID_DFR0, COPSDBG, 10); /* FEAT_Debugv8p8 */ t = FIELD_DP32(t, ID_DFR0, PERFMON, 6); /* FEAT_PMUv3p5 */ cpu->isar.id_dfr0 = t; @@ -93,7 +93,7 @@ void aa32_max_features(ARMCPU *cpu) t = 0x00008000; t = FIELD_DP32(t, DBGDIDR, SE_IMP, 1); t = FIELD_DP32(t, DBGDIDR, NSUHD_IMP, 1); - t = FIELD_DP32(t, DBGDIDR, VERSION, 6); /* Armv8 debug */ + t = FIELD_DP32(t, DBGDIDR, VERSION, 10); /* FEAT_Debugv8p8 */ t = FIELD_DP32(t, DBGDIDR, CTX_CMPS, 1); t = FIELD_DP32(t, DBGDIDR, BRPS, 5); t = FIELD_DP32(t, DBGDIDR, WRPS, 3); diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 71e1bfcd4ee..fe232eb3069 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1253,7 +1253,7 @@ void aarch64_max_tcg_initfn(Object *obj) cpu->isar.id_aa64zfr0 = t; t = cpu->isar.id_aa64dfr0; - t = FIELD_DP64(t, ID_AA64DFR0, DEBUGVER, 9); /* FEAT_Debugv8p4 */ + t = FIELD_DP64(t, ID_AA64DFR0, DEBUGVER, 10); /* FEAT_Debugv8p8 */ t = FIELD_DP64(t, ID_AA64DFR0, PMUVER, 6); /* FEAT_PMUv3p5 */ t = FIELD_DP64(t, ID_AA64DFR0, HPMN0, 1); /* FEAT_HPMN0 */ cpu->isar.id_aa64dfr0 = t; From patchwork Mon Jul 1 16:07:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808856 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651998wrr; Mon, 1 Jul 2024 09:13:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU/SX4PpwHtfDKxRXbMJnmDFc6wSliqDiGP93r+TU6wjTa7QbASkpwb+C/bSG0JLHnNOKeX8AK0a2lv9mNfkIIB X-Google-Smtp-Source: AGHT+IElMEewxe0rGGfsZywjqesFeSKkhZ+SLCeih41Lmn8kmFh5BZzXM1XgFU/9GtFTrPcelx0Y X-Received: by 2002:a05:620a:2683:b0:79c:f0e:f793 with SMTP id af79cd13be357-79d7b99e142mr972158385a.14.1719850397721; Mon, 01 Jul 2024 09:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850397; cv=none; d=google.com; s=arc-20160816; b=0XeFxb9eTPdWSBgrL1Auj+1GHQoe56GEYLZxbDqyFBsA0aPZZJ6VxTdVz46uCFAAiT dmfOh98w3Yp3KuyD+VHPU8UrP6fE4zv35fzbczSJOYgPrCQN7JjgDX+mmODt+Un4YUGM uO3+pkKHYFHTAiY3FjjjoabjuJy9ptQQ85JdBbyY6EI3EGdCQR3XzfNu8KGBWxoFGmd2 UIwgTMGvg/apb/vkHUg+F10jvYETjAgrd/mzCB1ZERYwt9GVZ1FT8q9gBBFLfeKLdsJv IHWtHJA5kHkA1m6FZgxQbzHMZnF8vp+Uyjqw+2UVX8lnsaXYwmk8y+ccROz4YujhGDTQ MF+w== 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:to:from :dkim-signature; bh=pJ0vzkmN5Hgmb8rgDSg5G2IpqWGpWILmCLfl1B7KYcA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hxqV3YAprKN72BMKCscEMjBxuvAfem7qBIz+s10OOCseecWKCkM0gZzBFNeyBMkIv9 +jiWiuYbofC/A1OT6CkUxe1rUy1LgCBiXC1I3oMrc1kSKiIfKKT8dTGBK04UGdFwi7td scN4FLsVGcqE/omZUGkCzkfWPJetpjiklwLSsuS7F8gj8er1QbwnbMKQCdID5XxDUpSD zKI3dgJEXakpSlu6bpjMXk+/Kxc7pMwi6/RF2KbrztTLLpajyCFBq0HBn+qSRTPtNXfx UH4MnZFcmicPitUxj8ozSboFPAgspRl065v6E89rceYV9FQF4rV/y/prewVpVervdsUu wNrw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tv6cDWky; 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 af79cd13be357-79d8582843fsi384243385a.207.2024.07.01.09.13.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:13: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=tv6cDWky; 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 1sOJa6-0003OK-Os; Mon, 01 Jul 2024 12:08:42 -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 1sOJZE-0000p7-4p for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -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 1sOJZB-0005Tq-A6 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:47 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-425624255f3so19310585e9.0 for ; Mon, 01 Jul 2024 09:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850062; x=1720454862; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pJ0vzkmN5Hgmb8rgDSg5G2IpqWGpWILmCLfl1B7KYcA=; b=tv6cDWkygLPEXxBBrw9Vt1oUm4xIxeONQaQEG+N6fiQWqcmEgOSfE8l5iGc3yt18LB mLOIMofb/fA6Kj0U96nBh48IH4Zopaicg2kGsEMr/wFOHc34ZAM9X184Xy/PznmJgbKN z+YnfJe36Iq6sxWcBNx9/UONjvbqApmpSt2TYeqefZTgjhRztjzSO6GC0THofx/GcNGb 9aAmKQ99BJF7/9z8H+V35p9IqMIEUBNLSInP2q6vawreWQgNs1V+hse1EkDNFOth+fdI /1RSe3vC0u+2K/h4LkjQwo7kh3bjG4TLhe67NgaYuBFwzcqsrwnm90NRzRohOQECTbAZ r1Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850062; x=1720454862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pJ0vzkmN5Hgmb8rgDSg5G2IpqWGpWILmCLfl1B7KYcA=; b=OXtcf2Xo+gp7rggg2btv0HCorcI0jVcBvYz0pmAPBM6/9mXj82+9bCj8nJf8/v4LQ1 RKd80ohGhBDMCSJvBUIfVLgJhwsQXJoFTaMHrw+I3drE4YpCJ5SejUmLjUnewf+5aMWq gJdq5xh06kF+AxbKxQwk4bWSpzyTlarGTx8pm4UHh9xPS7lXfCXzvnZ5BXZVlTp9wiYt qvmhyX433YKk+9wplDZGeHEVP6q/PAyPrI5mQrFBuLjhBmGN9ravOE/KI6Xg/N/lfHT/ s0du03X7WgF6nArni+m9e+ht1XkVf7I+TswYCdZAMh3Kw3pMcExO7N1MnVKVA6z6JOSR icYg== X-Gm-Message-State: AOJu0YysWTX6qGcnV+pKu7UScIAJwdic1qtcDtZwysHD/FRt2UeX0J7u sab8GyGgiuDms9m/KiiiO5zDVYA7KbdFreHVsswHid/+FHf8GP+0dBlm4LbCNBVosUeGKJjznOg mKZs= X-Received: by 2002:a05:600c:1c21:b0:424:8be4:f2c with SMTP id 5b1f17b1804b1-4257984de8fmr53664175e9.2.1719850062128; Mon, 01 Jul 2024 09:07:42 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/29] MAINTAINERS: Update my family name Date: Mon, 1 Jul 2024 17:07:23 +0100 Message-Id: <20240701160729.1910763-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@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 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: Patrick Leis Signed-off-by: Patrick Leis Message-id: 20240626211623.3510701-1-venture@google.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 19f67dc5d21..13255d4a3bd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2496,7 +2496,7 @@ F: hw/net/tulip.c F: hw/net/tulip.h pca954x -M: Patrick Venture +M: Patrick Leis S: Maintained F: hw/i2c/i2c_mux_pca954x.c F: include/hw/i2c/i2c_mux_pca954x.h From patchwork Mon Jul 1 16:07:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808855 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651828wrr; Mon, 1 Jul 2024 09:13:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUOemrMUiMuS+OR6ORaVqGb9yW1DwbtRtZW2KWKtEUM6riOddJkeHTWO8DlL/h+JMVOFuxKecU5WUTuf1qzri+H X-Google-Smtp-Source: AGHT+IE1lr1rUm7FOG47IbnAKRfwAFhoepM/2epayJR1COZ2ptKEHRwnIMxFTaZEBRLAA8QMwuTv X-Received: by 2002:a9d:6c16:0:b0:6f9:82ca:15b5 with SMTP id 46e09a7af769-702076498e4mr7283227a34.18.1719850382383; Mon, 01 Jul 2024 09:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850382; cv=none; d=google.com; s=arc-20160816; b=RiWpHqRFi5Q1RsnWt/Y5kyIQXmNmWSwUtNZs1JgmhhtenhndR+/0Nj68NVBLuw4rEp tRnZ7op6+V+Na+sDn/LH8b+rAwD4Pw6pgy30BuDL7G+Nt+bRWS+60DIX56plJzTqeujT 6Gs0CpWHqlofpeY/6bWsrs/Kl7CzhrMt/D5grcLXrhWq0iaPqlvblvf3ts1DGU/zD3Kt xcuZzxC+wjIpIRlzV4bJFysFs94unlMu3xbnL5z1+4Jkcf3QrKcisGXZSOq6ln8kGHVo K1VpuT5Csh2AT/WYqnjmZcEvhPKIEOiUOBk1QBeSEPK4ZzntvVaAiSi2BFs19NG4nRV1 o+7A== 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:to:from :dkim-signature; bh=MZkBdG186zLNGmCWvbcnLg3ZsyZ6IKvGgCf1O/oJF1E=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=a7GMnmoir14nv6GUqp9I6rPIEXkG1aIpFa8+og70mAOX+/v74hzhu3HENBErCIhhcG TKT+qh4yvf4qoDC+tiSEJG5x9kcG5D7mA6x9Ieujpm1W6J1P5NKQbpVra121VRN0K5n2 iqulwZjAkQe0OFI9lKIpZfngTKHZlsw08Ylc830dTasPgH17WpEqlSDWHlSR2081ac9f OcNkV7KoEKH6FiMw/3ISeCbVBSNsqe2z8MpCnK+v9BGedRvVzxibO69Eoj9QzEt1y5zn Ix/sUWfzCLRRx1sxIGBARVH3OXULv9IzKCIQe3t7Ns3j5SGYpqTlaBDDm+oQfTAWm4oy nhTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s6t9vnvI; 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 d75a77b69052e-446513e68bdsi95500241cf.209.2024.07.01.09.13.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:13:02 -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=s6t9vnvI; 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 1sOJa7-0003TK-8V; Mon, 01 Jul 2024 12:08:43 -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 1sOJZG-0000pt-Gm for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZC-0005U8-KN for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2ec52fbb50aso37587651fa.3 for ; Mon, 01 Jul 2024 09:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850063; x=1720454863; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=MZkBdG186zLNGmCWvbcnLg3ZsyZ6IKvGgCf1O/oJF1E=; b=s6t9vnvI1FzACPzi1qAqgdqz11XABJwrFwo3RsOPEh5C5871Kuiac9B7gqPdfPiF5P uqMZjnnVL3cmMY43LEvc8rzj/fLIEJBp9oNKgz963chLJeklfqHUwKmBpTqaJIoKXSP3 CkkhX2OSPju9WwT0RqEngb+EEE+MPhQRzQaOkrzlfE21mQQIwmfmpH8FcrJkQLvWxyrj Y1ccKJ2xoXN8HRDw8G1VgcIw1M3O5Ni0PemX/yEIhBhdZmzTE/hh054dsghE3y5Clay1 nNkasULBv4JqjPX4VnGJYyVWRRw8/8q+g2vKhh9Rjk/UeC3QIWOhptVDSPNWrwh4MxTi K+mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850063; x=1720454863; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MZkBdG186zLNGmCWvbcnLg3ZsyZ6IKvGgCf1O/oJF1E=; b=bCuMtYf1vgyvprM1kqPvbm5F1pdG2LX711QlnRqlTxOWHHOaUc6dLvJR9lJZ6/qpOg 8Sdg3kTaaES8ioNrNAmEzhGGBoaoCCL6pIjksva/Ll8IfAlooQECGsUA8drafgoUm7Se qzlp6XyFgvtL+Xhlts24rwFwI+IyvQbV/1ExpziJJu3J3UNeg+5k+/+NcK23KGoC9+6R lJbldNr5lGVfuS2OBF60ugsEnFPNy0CBWe8O2om/2wS9vOmnOxnqsr+cu04nhOhlS6Wg FhaGfQGLFlknbtWs4mRtTCBIF8PbfN3j03OQidLy9Cxoysk0rX7ZbBAP0kMXYh6xPNfc PEew== X-Gm-Message-State: AOJu0Ywp3kCZxyF9Aag2nT3S3EMUY9W7a18aV4x45CuHfLHfPv6nvBVx +QhlnyfhpyejCPqBt1OC6obilPm/3CRvOjtIc2WKfef6ibesc8t16vEFY7ZhALb4JpEW/ceoCQw kTgA= X-Received: by 2002:a2e:beaa:0:b0:2ec:5668:3b93 with SMTP id 38308e7fff4ca-2ee5e393845mr55492611fa.12.1719850062557; Mon, 01 Jul 2024 09:07:42 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/29] hw/misc/zynq_slcr: Add boot-mode property Date: Mon, 1 Jul 2024 17:07:24 +0100 Message-Id: <20240701160729.1910763-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x233.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: Sai Pavan Boddu boot-mode property sets user values into BOOT_MODE register, on hardware these are derived from board switches. Signed-off-by: Sai Pavan Boddu Reviewed-by: Edgar E. Iglesias Reviewed-by: Francisco Iglesias Message-id: 20240621125906.1300995-2-sai.pavan.boddu@amd.com Signed-off-by: Peter Maydell --- hw/misc/zynq_slcr.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c index 3412ff099ea..ad814c3a79b 100644 --- a/hw/misc/zynq_slcr.c +++ b/hw/misc/zynq_slcr.c @@ -24,6 +24,8 @@ #include "hw/registerfields.h" #include "hw/qdev-clock.h" #include "qom/object.h" +#include "hw/qdev-properties.h" +#include "qapi/error.h" #ifndef ZYNQ_SLCR_ERR_DEBUG #define ZYNQ_SLCR_ERR_DEBUG 0 @@ -121,6 +123,7 @@ REG32(RST_REASON, 0x250) REG32(REBOOT_STATUS, 0x258) REG32(BOOT_MODE, 0x25c) + FIELD(BOOT_MODE, BOOT_MODE, 0, 4) REG32(APU_CTRL, 0x300) REG32(WDT_CLK_SEL, 0x304) @@ -195,6 +198,7 @@ struct ZynqSLCRState { Clock *ps_clk; Clock *uart0_ref_clk; Clock *uart1_ref_clk; + uint8_t boot_mode; }; /* @@ -371,7 +375,7 @@ static void zynq_slcr_reset_init(Object *obj, ResetType type) s->regs[R_FPGA_RST_CTRL] = 0x01F33F0F; s->regs[R_RST_REASON] = 0x00000040; - s->regs[R_BOOT_MODE] = 0x00000001; + s->regs[R_BOOT_MODE] = s->boot_mode & R_BOOT_MODE_BOOT_MODE_MASK; /* 0x700 - 0x7D4 */ for (i = 0; i < 54; i++) { @@ -588,6 +592,15 @@ static const ClockPortInitArray zynq_slcr_clocks = { QDEV_CLOCK_END }; +static void zynq_slcr_realize(DeviceState *dev, Error **errp) +{ + ZynqSLCRState *s = ZYNQ_SLCR(dev); + + if (s->boot_mode > 0xF) { + error_setg(errp, "Invalid boot mode %d specified", s->boot_mode); + } +} + static void zynq_slcr_init(Object *obj) { ZynqSLCRState *s = ZYNQ_SLCR(obj); @@ -610,15 +623,22 @@ static const VMStateDescription vmstate_zynq_slcr = { } }; +static Property zynq_slcr_props[] = { + DEFINE_PROP_UINT8("boot-mode", ZynqSLCRState, boot_mode, 1), + DEFINE_PROP_END_OF_LIST(), +}; + static void zynq_slcr_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); ResettableClass *rc = RESETTABLE_CLASS(klass); dc->vmsd = &vmstate_zynq_slcr; + dc->realize = zynq_slcr_realize; rc->phases.enter = zynq_slcr_reset_init; rc->phases.hold = zynq_slcr_reset_hold; rc->phases.exit = zynq_slcr_reset_exit; + device_class_set_props(dc, zynq_slcr_props); } static const TypeInfo zynq_slcr_info = { From patchwork Mon Jul 1 16:07:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808832 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649391wrr; Mon, 1 Jul 2024 09:08:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV17YyOo2eX7hne+mdd9hh30KadNH4kNivIsUFuJmSqEAf0gNr5QV1i3Vd+kGdEU35O4x5mVmhTljzg5KKT93OI X-Google-Smtp-Source: AGHT+IHPD3csB4ipMUMxJdjvK+cT8DSSIWSAEr1TopR/gMxROsRAuXLfAYCnjRWGCTHLog55JPQH X-Received: by 2002:a05:620a:2683:b0:79d:57ff:ba4d with SMTP id af79cd13be357-79d7ba75e5fmr720479485a.60.1719850106390; Mon, 01 Jul 2024 09:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850106; cv=none; d=google.com; s=arc-20160816; b=qA+ZkFScHolcFW1XlyqaJ5l9p9bdF7eA67LyYsjs7mHHjtH7/EWIl7/1c6eRugDT68 f3ev6iDh8yetYYdUX10vrmi57B+b5dNOjl7ICgIXVgdMRqNXuUHhXta8efvbjZGjmI50 EhJz5ePvMVimiGkJA1ukB+Gt/UkC6NlpwqpCrzPGvdYXVHjxsrWVETnfyl7J+JIyhqpZ lPOG7E7Qyz6SkRZz+mMUBXidk4DFFw7cdo7d4Iyfzys3Kq3ARdJQQaKp6kJPkoWUBXKl J5HzEckUjRWU5xl/dAUjxNCKeVyvjvQhnwC6TMi3oGIKt8ghslyfjauqAFI5ZmJ9CsWQ ScUg== 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:to:from :dkim-signature; bh=QnprYGSDTA/0TStnFoLmzzYBTMez64bKJk78fitMFgo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Gr4CKUpTWudeyOKNStx2KbcFuokXuDhpdq93S7+1Hlbi8NpuI7i+Kgjk2bv2X7HNi7 mtrl0BFwEtIE5OhFbjtkhbNmxDNBjVohMEFa43t1LH5RUijmTeYWz41h8XsMpCbUlk0G OD6/4lCfTvtkFq9zwDsWGO+dqcf6WuCAzlK9dm9DmwZa7nrWzX43Pw3zWt3HWUC4OaCz 1ZOMiye1a4BmOFAuaxpptEEDLpMEVlNAe2b4XAPmaQhJcsMwiiVPeYUc6tccHS/pwIDN Lvy54aCGJZ1/3ht7kHbSBRcL8KzShMbgYZQ6cR69lDUXo+R+YtKi1dH10DrxAzSbJOUa /q7w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rh0xQZfs; 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 af79cd13be357-79d69307c36si786623185a.399.2024.07.01.09.08.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:26 -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=Rh0xQZfs; 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 1sOJZg-0001kt-CO; Mon, 01 Jul 2024 12:08:18 -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 1sOJZG-0000pX-6c for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZC-0005UF-Ja for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:49 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42567ddf099so23097725e9.3 for ; Mon, 01 Jul 2024 09:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850063; x=1720454863; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=QnprYGSDTA/0TStnFoLmzzYBTMez64bKJk78fitMFgo=; b=Rh0xQZfsvMrXp1uocjN7/zXgTqjY93kfm6HL81XxDHaCKWZIlhE5bR188QWCVxfYQe JeLUYpvCqRWSIzVVh2wiR4RPj8MooV87B/X1dhe44OZ6GGl9TiBmvMVOBliiEpwYtY20 aDdCAZE1GrPoNlC3XjOWrEZswNqRwkVcWbrlrV/Y6eeRhGkWnCQbqolzVhE9xuQTZcBb S5wKPW6qfew7J5EZUw7KaYXxr1y9s5TcfzEfytXlawDR2+EDb60WzZQdI7xzuIrTv5DJ 92JGAt/is53NHCruFEEQlbap5R1P/TnjXQrNr1Kll1IbRxrU/0loke8l+fXyHbOvpRML SGYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850063; x=1720454863; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QnprYGSDTA/0TStnFoLmzzYBTMez64bKJk78fitMFgo=; b=Oq+Vr/Z/Uco9mF27OGe417jwV4cdVNs+yW1Of+spYSLeCKB/sW/fuJQhY+U1ce4LTu J2+7/Lv20TSYrodu8ilrNdnls4ZfFOilinx3gY1Ig8x5Uh0IJFwEqiHxDfUIz+AE0JB6 m93UK/8KQmbnSK2/qW3nh7ljoi04luQcSGwpbMGqVhK8gkD3fF7ikWu8FbEn4msnpvCi /tyDzCqJx/5ns0FPSK9bM6geT8uLDpNSfwUIe9d9bS0VrEBssCecsRLNX1Jp7xoQUc9/ bUY2e20UCZ1YXCewzRz83Y2iX+28a7GFJdNHQ9F+p8hIUq2eboukWleMLLmOZyE6dIiB sIPA== X-Gm-Message-State: AOJu0Yzs/gkiduc4aOGSL1MPMFbF0wGzRBjFhd8TMX8Te8N4QtAioWS7 j7S2AtrYX6wCGwinF1kecv+QLDQCKPjPVPkDFO1qmKSVO089VxaC0HHiOC0XGGfFM01Fbnm96We q0yU= X-Received: by 2002:a05:600c:2e4b:b0:424:8fa1:b2c3 with SMTP id 5b1f17b1804b1-4257a0117a8mr39302925e9.23.1719850063158; Mon, 01 Jul 2024 09:07:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/29] hw/arm/xilinx_zynq: Add boot-mode property Date: Mon, 1 Jul 2024 17:07:25 +0100 Message-Id: <20240701160729.1910763-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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: Sai Pavan Boddu Read boot-mode value as machine property and propagate that to SLCR.BOOT_MODE register. Signed-off-by: Sai Pavan Boddu Acked-by: Edgar E. Iglesias Reviewed-by: Francisco Iglesias Message-id: 20240621125906.1300995-3-sai.pavan.boddu@amd.com Signed-off-by: Peter Maydell --- hw/arm/xilinx_zynq.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index c79661bbc1b..3c56b9abe1c 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -38,6 +38,7 @@ #include "qom/object.h" #include "exec/tswap.h" #include "target/arm/cpu-qom.h" +#include "qapi/visitor.h" #define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9") OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, ZYNQ_MACHINE) @@ -90,6 +91,7 @@ struct ZynqMachineState { MachineState parent; Clock *ps_clk; ARMCPU *cpu[ZYNQ_MAX_CPUS]; + uint8_t boot_mode; }; static void zynq_write_board_setup(ARMCPU *cpu, @@ -176,6 +178,27 @@ static inline int zynq_init_spi_flashes(uint32_t base_addr, qemu_irq irq, return unit; } +static void zynq_set_boot_mode(Object *obj, const char *str, + Error **errp) +{ + ZynqMachineState *m = ZYNQ_MACHINE(obj); + uint8_t mode = 0; + + if (!strncasecmp(str, "qspi", 4)) { + mode = 1; + } else if (!strncasecmp(str, "sd", 2)) { + mode = 5; + } else if (!strncasecmp(str, "nor", 3)) { + mode = 2; + } else if (!strncasecmp(str, "jtag", 4)) { + mode = 0; + } else { + error_setg(errp, "%s boot mode not supported", str); + return; + } + m->boot_mode = mode; +} + static void zynq_init(MachineState *machine) { ZynqMachineState *zynq_machine = ZYNQ_MACHINE(machine); @@ -241,6 +264,7 @@ static void zynq_init(MachineState *machine) /* Create slcr, keep a pointer to connect clocks */ slcr = qdev_new("xilinx-zynq_slcr"); qdev_connect_clock_in(slcr, "ps_clk", zynq_machine->ps_clk); + qdev_prop_set_uint8(slcr, "boot-mode", zynq_machine->boot_mode); sysbus_realize_and_unref(SYS_BUS_DEVICE(slcr), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(slcr), 0, 0xF8000000); @@ -373,6 +397,7 @@ static void zynq_machine_class_init(ObjectClass *oc, void *data) NULL }; MachineClass *mc = MACHINE_CLASS(oc); + ObjectProperty *prop; mc->desc = "Xilinx Zynq Platform Baseboard for Cortex-A9"; mc->init = zynq_init; mc->max_cpus = ZYNQ_MAX_CPUS; @@ -380,6 +405,12 @@ static void zynq_machine_class_init(ObjectClass *oc, void *data) mc->ignore_memory_transaction_failures = true; mc->valid_cpu_types = valid_cpu_types; mc->default_ram_id = "zynq.ext_ram"; + prop = object_class_property_add_str(oc, "boot-mode", NULL, + zynq_set_boot_mode); + object_class_property_set_description(oc, "boot-mode", + "Supported boot modes:" + " jtag qspi sd nor"); + object_property_set_default_str(prop, "qspi"); } static const TypeInfo zynq_machine_type = { From patchwork Mon Jul 1 16:07:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808834 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1649468wrr; Mon, 1 Jul 2024 09:08:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWjJ4/hBXNsg7cNwcKkwfTpUiV8YSPds1r5TW2WMym8V51eic+Mwy605KyfMmtC0hTQuwr8wYz+RsmGxO1Qfx5p X-Google-Smtp-Source: AGHT+IF09KptBEEkJ0TfFxjPGK8rH0AcTP5XCmuiSPEOvxJNB4h3LWQsJG0GSFjHdKcNA1BucBIC X-Received: by 2002:a9d:7516:0:b0:700:d2b7:d6ff with SMTP id 46e09a7af769-7020768ea54mr6860828a34.2.1719850115237; Mon, 01 Jul 2024 09:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850115; cv=none; d=google.com; s=arc-20160816; b=WdWbRPcxUYCCsXsoKc5Qrv3FJOXzwVlhThecgZt7k3FSCqtspDfavG25SvK9bNd8Zz dkRuEPCLisj3MUy0lRC7LGkxPenRf8EFmBF5oa87s8R0RrtRIV5YS5sxhurZjtvYCJ0q g5lbvZ1MfaRIEbbvCuwsxBALK4jjQi2jeni5OqH643XfkF0Mkd7iNaOXiYDHhtpvpbq7 GMLlZMkpENokmW7xQLBoX+FIaeUGUxdt2Y2fkP7rimkfEG9qM2L5U9qYjAZsKKdtjnVR pPjzvYLNnmtMDG5LfShbtEC6DdafScxdIF2eW3e9llf2rHVkGtVkVdngg5s6VQDmwkoC r+bA== 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:to:from :dkim-signature; bh=9uXU1vzi0vhcsx2TB1L2j4c0uA3H0oIo7+Hi7Wb/bB0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=dxclQH5wn5I4Si8XJR0K8bnU4K0V3qjMwAFrABDoJp7InUBzRJ8Ww98NSTzUkkdy/8 y/YKC1bFkmesr0RwsHTYyvjfuZNNp41w+ieY+CeuU/Ndxhw3rYyPdXuwGTca//amzTzN 4GYTQsPPrKOr9rNsiVoyz5nCxn7NK3monF7KOUIMUYowdct68swhvfNUvhfTJWJf5s/V RTICgKvpcHAisD4VmF4y42sYUjXYGegZOYedWRlj7XtFai3wN+8C8acvB3R0BS5MD/Wh zcEab/PDVE3Cz+qCwIt83z0qpXMnxx+kS5ZnjyfzNXLALP5m4vA6inRRDii7rs21fmlC mNBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ek6OHYSq; 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 ada2fe7eead31-48f9b166be2si1155257137.87.2024.07.01.09.08.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:08:35 -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=ek6OHYSq; 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 1sOJZV-0001UH-TD; Mon, 01 Jul 2024 12:08:07 -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 1sOJZF-0000pU-PC for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:50 -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 1sOJZC-0005UK-KJ for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:49 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42567ddf099so23097765e9.3 for ; Mon, 01 Jul 2024 09:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850063; x=1720454863; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9uXU1vzi0vhcsx2TB1L2j4c0uA3H0oIo7+Hi7Wb/bB0=; b=ek6OHYSqNryR/d9WKcmHwNuqA/h1H/upU8q58ytfQg2nCXEUmxAS12lj+4OqeoJqHK 4EvOqi95MkAOlSmeh0twFBs+6M67booCgF1ynfi25VUksxRBjOf3TdjDZcLXzmljY3C/ ZGunQmqy/nGpWn6u+NS2osWGn8l4ylg+Lo0xQ80d4F8ngcVsAda5WfbCwZ2yRPXSK2mf G5N2iaUjtmjDeN1iDWyaeeV2Umjp+xODk+A+ZrCLiGMyk/OHLBCo25uiVNPKFbUl4kA7 y0omek1m9HYuRXKzlkiEFqKGO2l+UgLikXzSAlZl50zEcjHjAo1SnQMNxagcCuzOxJCl ZszQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850063; x=1720454863; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9uXU1vzi0vhcsx2TB1L2j4c0uA3H0oIo7+Hi7Wb/bB0=; b=JdkLYTuO6/14Vt3KIpvr8F9dYMC2fjtSJIHoRjMSvsvgo3trMNfxlWY021FmmiXSNG 5cNM/LnHIlLiU72OlMSd/2ug04NCDV9KFnfhPh6v1Va6ER43g4KDpgbQo94TjGa8rB9o 08VDCybw+Tv4bg75DDvh/LV2tkR6oQ/k0J2sxz++gaifRg2E5oDHsrg8SN1xq8+nCQty VFMOkVAevAOnBtkwmHKa3ZIBEfyNaknFx/YnoEJeVtvNUtsGnE1+HPnPsgcdjqazl5Ju eSEpqYS+gDBxULqfDT5GMXMCi++20Unn9lOTAl4V8YZyS3HkdnA8MlnGN59//0F913Ea VRWQ== X-Gm-Message-State: AOJu0Yza2Hrd1CKJoGKxFVWcpWTJyr6yq4ljffLFvax+fzObmnZvzuqy D28fQLV7OqUSFs47R1ilVSekjpno2G+o+ptT0zDdHeFHeRvU7eleD0OQbbJAEiU8xc7z51+01EO y/f4= X-Received: by 2002:a05:600c:4f52:b0:425:65b1:abbc with SMTP id 5b1f17b1804b1-4257a00aae8mr38071535e9.1.1719850063632; Mon, 01 Jul 2024 09:07:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/29] docs/system/arm: Add a doc for zynq board Date: Mon, 1 Jul 2024 17:07:26 +0100 Message-Id: <20240701160729.1910763-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@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, WEIRD_QUOTING=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: Sai Pavan Boddu Added the supported device list and an example command. Signed-off-by: Sai Pavan Boddu Reviewed-by: Edgar E. Iglesias Reviewed-by: Francisco Iglesias Message-id: 20240621125906.1300995-4-sai.pavan.boddu@amd.com Signed-off-by: Peter Maydell --- MAINTAINERS | 1 + docs/system/arm/xlnx-zynq.rst | 47 +++++++++++++++++++++++++++++++++++ docs/system/target-arm.rst | 1 + 3 files changed, 49 insertions(+) create mode 100644 docs/system/arm/xlnx-zynq.rst diff --git a/MAINTAINERS b/MAINTAINERS index 13255d4a3bd..6725913c8b3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1033,6 +1033,7 @@ F: hw/adc/zynq-xadc.c F: include/hw/misc/zynq_slcr.h F: include/hw/adc/zynq-xadc.h X: hw/ssi/xilinx_* +F: docs/system/arm/xlnx-zynq.rst Xilinx ZynqMP and Versal M: Alistair Francis diff --git a/docs/system/arm/xlnx-zynq.rst b/docs/system/arm/xlnx-zynq.rst new file mode 100644 index 00000000000..ade18a3fe13 --- /dev/null +++ b/docs/system/arm/xlnx-zynq.rst @@ -0,0 +1,47 @@ +Xilinx Zynq board (``xilinx-zynq-a9``) +====================================== +The Zynq 7000 family is based on the AMD SoC architecture. These products +integrate a feature-rich dual or single-core Arm Cortex-A9 MPCore based +processing system (PS) and AMD programmable logic (PL) in a single device. + +More details here: +https://docs.amd.com/r/en-US/ug585-zynq-7000-SoC-TRM/Zynq-7000-SoC-Technical-Reference-Manual + +QEMU xilinx-zynq-a9 board supports following devices: + - A9 MPCORE + - cortex-a9 + - GIC v1 + - Generic timer + - wdt + - OCM 256KB + - SMC SRAM@0xe2000000 64MB + - Zynq SLCR + - SPI x2 + - QSPI + - UART + - TTC x2 + - Gigabit Ethernet Controller x2 + - SD Controller x2 + - XADC + - Arm PrimeCell DMA Controller + - DDR Memory + - USB 2.0 x2 + +Running +""""""" +Direct Linux boot of a generic ARM upstream Linux kernel: + +.. code-block:: bash + + $ qemu-system-aarch64 -M xilinx-zynq-a9 \ + -dtb zynq-zc702.dtb -serial null -serial mon:stdio \ + -display none -m 1024 \ + -initrd rootfs.cpio.gz -kernel zImage + +For configuring the boot-mode provide the following on the command line: + +.. code-block:: bash + + -machine boot-mode=qspi + +Supported values are jtag, sd, qspi, nor. diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst index 870d30e3502..7b992722846 100644 --- a/docs/system/target-arm.rst +++ b/docs/system/target-arm.rst @@ -109,6 +109,7 @@ undocumented; you can get a complete list by running arm/virt arm/xenpvh arm/xlnx-versal-virt + arm/xlnx-zynq Emulated CPU architecture support ================================= From patchwork Mon Jul 1 16:07:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808846 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1650942wrr; Mon, 1 Jul 2024 09:11:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX/SCB0GR/NjUfvpFCXBGtdPc4/Rwbkt4w/mh32JrVoIQHAiVvxurGFX/OmldaKFCdS9SLBiB7hfpylX8zOIT6o X-Google-Smtp-Source: AGHT+IGHCokAL1HyfwWGiMZklMc9PC7dAJ5B+IqMkCc/0RwatFuotbfVa+kn8F6CG6PG3rVLRS2D X-Received: by 2002:a05:620a:40c1:b0:79d:6349:32ed with SMTP id af79cd13be357-79d7ba11559mr801546885a.44.1719850281460; Mon, 01 Jul 2024 09:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850281; cv=none; d=google.com; s=arc-20160816; b=p1XyoGS+HstZlUcQg+OPHg4we+xYgXkc9xgw8yIV696XyXjdftBiZz0PtRL6Ubj56/ YlIiQ8hBG7WV2rG7xYhBODuaC5ToGG3C14N69su5SXxZKFmptG1J2m2V5DO+8vepXvOR oQ9YWP2oPZuL3miUKgwHN0F9agrdioUGD9i9eAgs1SX+HogWGgBCie3p0bKTq1M0pOby 9zpvRorwTWghSaQO9n2gwYjZFSoeE7SWfEzDX66E1gJdOHLfzfPJqIDhd4Cq9FVPIets /tPk1jmX+nDH1cSl1UiCl9TKDSGp8Ai17VB5ny0vQ05KnD9X2XRcOn+XkCmD+YReioUk AftQ== 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:to:from :dkim-signature; bh=N665C21il6XnrjbsnfmTOCOC5JXdKF9F2qCwJefFlO8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BRL3KiwwlMMy97PFMakk/wXyym7aa+nO5tE5dzrfLUYNTZeT0P1dgKYrb600h6q3hs aJCakoIgSEavsKk9Rdsqv2RTZ56Q+p446xZIsTaQq2cgOb64M1TPAYhjm6Wl7zZ5gu4i 6ta+YKQwwUlIkcDMdZ61dgQKAqFEihEnbZT+Pt78F4Mgj4DO5kAUqhctf+74+pF7sQ3D 68DnZr4Os349k6RIW87vhEj3jL53JLn5/J2AVDZa+jMc4p2Kk/1RcMykCqtDsjYD2OFH yoF7ErVyd9X+pHa6j3eTcSgAxkxOHDRTUBnRCejHfDla1KVYQwf8iMst+2PLhD/qF6jQ yEaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R2fbrwI+; 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 af79cd13be357-79d93e8da23si75115785a.205.2024.07.01.09.11.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:11:21 -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=R2fbrwI+; 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 1sOJaR-0004ZF-M4; Mon, 01 Jul 2024 12:09:04 -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 1sOJZT-0001Sq-U8 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:08:04 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZD-0005Ue-Su for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:08:02 -0400 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2ebe0a81dc8so43097791fa.2 for ; Mon, 01 Jul 2024 09:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850066; x=1720454866; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=N665C21il6XnrjbsnfmTOCOC5JXdKF9F2qCwJefFlO8=; b=R2fbrwI+vkCAAZm783gpexVetFxqoTxj+IbPbL+QUZjJTXHrPANpccl/kBKQwPw35b UPywK4o6fhy1XnEMwWSMa9q2qxJpfpuo3cnbowLDNjrL3mjyMXnjaQVEF/GidEfUgQN7 e1LvhuKP4kfKd5y45Q27u1gzExPLATFuayl2t6ulXviSVBJb2laZ2ehRX8GCfVPPo54o UeLtiHdt93YJfk9dGe/NM9JPuyU3SgbU1m457y2CNY9lHqD6D0GRy9aF0Hhc1QljLfuh ctLoTiEdoZMUMnQ1dt72J8UdsQ0uuh8K//h0GdGffYT1bZ8dhpPaU0v7B3TbvzyF364C MJ0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850066; x=1720454866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N665C21il6XnrjbsnfmTOCOC5JXdKF9F2qCwJefFlO8=; b=rAKdvM/l7LdndZXeuaQTrHPcUD5oAutnKwyLVmiag3t2/JiodtDThQhWanS8sFf9AQ JvB1BHM/f3l/HJ57+P/RPmxRcErzX/PRhC6WxR+fGnDwyXdIhllCi8QHPuDTvRX3lEwZ /t71p6rwE1DfFs4MVf7Kutmsj/17JOq7uoNE79U94B9ByPr7gCejACrejifs3H/IHPnd LoSlLyXMbPXC9RqVNH/oO4yQb+//AlAfarWPmVjJau1i/MVMMsCORZnW9cZ7WzsFjzQx VP1XL4rJCyYHHb5148f0wFaMcxg4pvwjqoqqt+NobVR7+ow1++QBANsbG8wXfg8pym1r uf7A== X-Gm-Message-State: AOJu0Ywt1qEHz2oajNMFctdjjGvyRJVzpTNUWeDy00KY5CgUBmaZWrvv axfqk338vMoNq3MhRq9/QraQPdxLY4Se7FL3agZcxJD+qSz/5C+C23hUi0gRSdLxlJlHfkHMh5l BgoA= X-Received: by 2002:a05:6512:12cc:b0:52d:a55b:fa9d with SMTP id 2adb3069b0e04-52e8268cf32mr4519273e87.38.1719850064107; Mon, 01 Jul 2024 09:07:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 27/29] tests/qtest: Fix STM32L4x5 SYSCFG irq line 15 state assumption Date: Mon, 1 Jul 2024 17:07:27 +0100 Message-Id: <20240701160729.1910763-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x22e.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, 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: Inès Varhol The QTest `test_irq_pin_multiplexer` makes the assumption that the reset state of irq line 15 is low, which is false since STM32L4x5 GPIO was implemented (the reset state of pin GPIOA15 is high because there's pull-up and it results in the irq line 15 also being high at reset). It wasn't triggering an error because `test_interrupt` was mistakenly "resetting" the line low. This commit corrects these two mistakes by : - not setting the line low in `test_interrupt` - using an irq line in `test_irq_pin_multiplexer` which is low at reset Signed-off-by: Inès Varhol Message-id: 20240629104454.366283-1-ines.varhol@telecom-paris.fr Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- tests/qtest/stm32l4x5_syscfg-test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qtest/stm32l4x5_syscfg-test.c b/tests/qtest/stm32l4x5_syscfg-test.c index 506ca08bc24..1cdf8f05c80 100644 --- a/tests/qtest/stm32l4x5_syscfg-test.c +++ b/tests/qtest/stm32l4x5_syscfg-test.c @@ -223,7 +223,7 @@ static void test_interrupt(void) /* Clean the test */ syscfg_writel(SYSCFG_EXTICR1, 0x00000000); syscfg_set_irq(0, 0); - syscfg_set_irq(15, 0); + /* irq 15 is high at reset because GPIOA15 is high at reset */ syscfg_set_irq(17, 0); } @@ -237,21 +237,21 @@ static void test_irq_pin_multiplexer(void) syscfg_set_irq(0, 1); - /* Check that irq 0 was set and irq 15 wasn't */ + /* Check that irq 0 was set and irq 2 wasn't */ g_assert_true(get_irq(0)); - g_assert_false(get_irq(15)); + g_assert_false(get_irq(2)); /* Clean the test */ syscfg_set_irq(0, 0); - syscfg_set_irq(15, 1); + syscfg_set_irq(2, 1); - /* Check that irq 15 was set and irq 0 wasn't */ - g_assert_true(get_irq(15)); + /* Check that irq 2 was set and irq 0 wasn't */ + g_assert_true(get_irq(2)); g_assert_false(get_irq(0)); /* Clean the test */ - syscfg_set_irq(15, 0); + syscfg_set_irq(2, 0); } static void test_irq_gpio_multiplexer(void) From patchwork Mon Jul 1 16:07:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808852 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1651689wrr; Mon, 1 Jul 2024 09:12:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU7buyTu6ZGfg7/q3KGOe9W3JU0cjwOT41DbSpz+tsHy53iveEeon6u4GQNcYJNyGw0akwiD2C91a19cYwYZ8WE X-Google-Smtp-Source: AGHT+IEmBAgiwQcfCDeBoDiyyIfPYnEGmlqvD6XofgignTb3ICBGQLG7M4oF8jre4I2IjdEmt8yh X-Received: by 2002:a05:6830:3104:b0:702:13a7:3c08 with SMTP id 46e09a7af769-70213a73e28mr4522707a34.12.1719850364491; Mon, 01 Jul 2024 09:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850364; cv=none; d=google.com; s=arc-20160816; b=StZpkew4Bq+02Fhcr5xhFitr/2BPIy3ZhOEmA5jDijPxPc64SF5V9X24BPG1bRpgks Q7ccYvqIJhoXHFa4S516560BEIIrKvKYeUhtjrWt2c1nAhreFeRqzGnLDuahkF2u7pe2 jaea/rcVybE8AmQd7bz22xOH2eaIzpifgn7hy3Hpic7DRA7PC7TxqXQ8N3lZMQvUH044 gOgyfG0k3/xpFUhWx4DyCrkruGn3ln5kcg7UwZsLApQUZSNp2vgy+EaT0QxX/OBgHAct /tABl7Wi3h7O+nhmdXFBJvhCsfcRvRH4KYbgtHNj+6Stf0fYwyJVpVjbo1ar4VwgCxIw +bgA== 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:to:from :dkim-signature; bh=XF99cI8EMXtHQdN2r/6udNjoGMUqreNEU/+MKGXXDD0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=IFq0kLyxsN5hJgVNYQNtkhm8DWPAhHJL/FR94gOC7nf7RMolekiLVfwkUdke9j2Brf 63Cw3SibXMrHzRQuGNR5l/lJK2TZoxYQgoS3ouqtBbEqlFtfmbBz8aeoKThB9II4rfe+ PVaBoPg2iFvcyDHMWSQdPyJh7iQp2SQDGn56SOVS0XhOFMKroy0nvFJb3M24KpMrNqBU uKPh+2xmcjt8Ogi2SUJ9ZeoqvvCjUAzNP/Xt+GDZ7LbzYRI22z3DeAjVY4yDedj548UW q8z+7eqmJ37yui5upHm2wRORg5wntg3qI11yn/ZnOB699edSCh4MVeK7MBH7Jw71iYIS 5F8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HDcBAjce; 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 af79cd13be357-79d7fa3de61si470470685a.215.2024.07.01.09.12.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:12:44 -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=HDcBAjce; 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 1sOJZx-0002Uf-7p; Mon, 01 Jul 2024 12:08:33 -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 1sOJZI-0000wl-92 for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:53 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOJZE-0005Uz-Cn for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:52 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-52cd717ec07so4066287e87.0 for ; Mon, 01 Jul 2024 09:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850066; x=1720454866; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=XF99cI8EMXtHQdN2r/6udNjoGMUqreNEU/+MKGXXDD0=; b=HDcBAjceT7QOlkkAtv3vioO0BsUdkIB6V3BSWImhX5sNSyf2u5YkIp6Jj4Gz6FWjG8 Bf8MQrgUx1VDNekXsEoMNY0TWw1zTc6XHCZfZ8sq2KMQ6mNcJEOE8fkhhG6RXyODllVK DWsJfHs0CvL8KDhsJQ6Be4ABtjEp1zISaJ9Q02tmxJpwl0rxwhvh1kfee9bUYBSs2Obg HtAXPTm0y1UvgGIjxbRXseXXjAxYtTq9p18lgV3Sr2xQ9g05GmT4iQEAsFyIlb/RlU8/ Eal2yz3wBImy7DvfwitMljCQms2wctLgt0ic2uSSo9sznSjPPNraOgPixIXiTNm8afrV 6p+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850066; x=1720454866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XF99cI8EMXtHQdN2r/6udNjoGMUqreNEU/+MKGXXDD0=; b=gdw7bR6QmHbygVZmHdLw0Ux4WeTN/4v2o5AgA3su/EagUOYPP/XHbMTAyjF49F2h/N SE6Tm9SOjPeeKc0ltPwkreVLYX+eWc8izC/7Qg0/lqWFZ2AoEhkbk0h8bKg9MjUyc/iy hQqdCBblykpNIvYwDp4/HKxhp9+o7F7l2BZBAwW3HPJc3fVzxbq7yRWOy+8+lrjYHUIO iIHLSyS1qYkdKZoCWEB3HXpu03EwtVFn6ScPry5Ixpi8OxHg3bu2ZxIuyHRZNp8lxjj8 ep41u8vC00WZmStUqVWFq0xj5drLXtZ/VjXsOcPdJcZexLzP0yrjv6qRwaylQ0bRTtwJ TQ2g== X-Gm-Message-State: AOJu0Yy6MAt90lJTfbEXWU3wJufbMxPICSQP9Tm5JG4q5cxhOYIAKMpz Co5FDgYeIpmE0enOdetspaXZPzlpBQywkD3ysGu5aj4No3iTDzH22GB7hc13FCmuO5HshE7F5WG +2lU= X-Received: by 2002:a05:6512:3c9f:b0:52e:7a8c:35a0 with SMTP id 2adb3069b0e04-52e82651c44mr5297140e87.7.1719850066523; Mon, 01 Jul 2024 09:07:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/29] hw/misc: In STM32L4x5 EXTI, correct configurable interrupts Date: Mon, 1 Jul 2024 17:07:28 +0100 Message-Id: <20240701160729.1910763-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12b.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: Inès Varhol The implementation of configurable interrupts (interrupts supporting edge selection) was incorrectly expecting alternating input levels : this commits adds a new status field `irq_levels` to actually detect edges. Signed-off-by: Inès Varhol Message-id: 20240629110800.539969-2-ines.varhol@telecom-paris.fr Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/misc/stm32l4x5_exti.h | 2 ++ hw/misc/stm32l4x5_exti.c | 28 +++++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/hw/misc/stm32l4x5_exti.h b/include/hw/misc/stm32l4x5_exti.h index be961d2f01f..55f763fa376 100644 --- a/include/hw/misc/stm32l4x5_exti.h +++ b/include/hw/misc/stm32l4x5_exti.h @@ -45,6 +45,8 @@ struct Stm32l4x5ExtiState { uint32_t swier[EXTI_NUM_REGISTER]; uint32_t pr[EXTI_NUM_REGISTER]; + /* used for edge detection */ + uint32_t irq_levels[EXTI_NUM_REGISTER]; qemu_irq irq[EXTI_NUM_INTERRUPT_OUT_LINES]; }; diff --git a/hw/misc/stm32l4x5_exti.c b/hw/misc/stm32l4x5_exti.c index 495a0004ab4..6a2ec62d785 100644 --- a/hw/misc/stm32l4x5_exti.c +++ b/hw/misc/stm32l4x5_exti.c @@ -88,6 +88,7 @@ static void stm32l4x5_exti_reset_hold(Object *obj, ResetType type) s->ftsr[bank] = 0x00000000; s->swier[bank] = 0x00000000; s->pr[bank] = 0x00000000; + s->irq_levels[bank] = 0x00000000; } } @@ -102,27 +103,23 @@ static void stm32l4x5_exti_set_irq(void *opaque, int irq, int level) /* Shift the value to enable access in x2 registers. */ irq %= EXTI_MAX_IRQ_PER_BANK; + if (level == extract32(s->irq_levels[bank], irq, 1)) { + /* No change in IRQ line state: do nothing */ + return; + } + s->irq_levels[bank] = deposit32(s->irq_levels[bank], irq, 1, level); + /* If the interrupt is masked, pr won't be raised */ if (!extract32(s->imr[bank], irq, 1)) { return; } - if (((1 << irq) & s->rtsr[bank]) && level) { - /* Rising Edge */ - s->pr[bank] |= 1 << irq; - qemu_irq_pulse(s->irq[oirq]); - } else if (((1 << irq) & s->ftsr[bank]) && !level) { - /* Falling Edge */ + if ((level && extract32(s->rtsr[bank], irq, 1)) || + (!level && extract32(s->ftsr[bank], irq, 1))) { + s->pr[bank] |= 1 << irq; qemu_irq_pulse(s->irq[oirq]); } - /* - * In the following situations : - * - falling edge but rising trigger selected - * - rising edge but falling trigger selected - * - no trigger selected - * No action is required - */ } static uint64_t stm32l4x5_exti_read(void *opaque, hwaddr addr, @@ -255,8 +252,8 @@ static void stm32l4x5_exti_init(Object *obj) static const VMStateDescription vmstate_stm32l4x5_exti = { .name = TYPE_STM32L4X5_EXTI, - .version_id = 1, - .minimum_version_id = 1, + .version_id = 2, + .minimum_version_id = 2, .fields = (VMStateField[]) { VMSTATE_UINT32_ARRAY(imr, Stm32l4x5ExtiState, EXTI_NUM_REGISTER), VMSTATE_UINT32_ARRAY(emr, Stm32l4x5ExtiState, EXTI_NUM_REGISTER), @@ -264,6 +261,7 @@ static const VMStateDescription vmstate_stm32l4x5_exti = { VMSTATE_UINT32_ARRAY(ftsr, Stm32l4x5ExtiState, EXTI_NUM_REGISTER), VMSTATE_UINT32_ARRAY(swier, Stm32l4x5ExtiState, EXTI_NUM_REGISTER), VMSTATE_UINT32_ARRAY(pr, Stm32l4x5ExtiState, EXTI_NUM_REGISTER), + VMSTATE_UINT32_ARRAY(irq_levels, Stm32l4x5ExtiState, EXTI_NUM_REGISTER), VMSTATE_END_OF_LIST() } }; From patchwork Mon Jul 1 16:07:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 808843 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp1650088wrr; Mon, 1 Jul 2024 09:09:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBTXGMCVgZdFBwMqpEx7GIj7zQmDi3v6F0etj7uy/Il1BIlVsIdtn7tWwaJ2MfjTZkLWaZuJYMOsggrvRXsWoN X-Google-Smtp-Source: AGHT+IFjLUW40eWF5OkrZrsq9ZdZjqaJTuanEIxc9vcb85aJV3inMaK1qdIES7TsKua7OIgLTFGN X-Received: by 2002:ad4:5aaa:0:b0:6b0:77fb:8f24 with SMTP id 6a1803df08f44-6b5b70bcbc0mr75937266d6.17.1719850182677; Mon, 01 Jul 2024 09:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719850182; cv=none; d=google.com; s=arc-20160816; b=RmAvKW84UTaR5gOUE324hcgMz23XeHhW/EJKnQtYMj5mafjgzFitxpCdqzEgsZHaLC 8HhjpaHRzfRixVqaZQiEiVFYTM/tFpgxBbxXDTpdKqOm7GaorvIqoSHodwEQLxcp9nt2 eDvfiLm1APy7+peJ4VBOCW10h01gWt2568LDkE/VGPmF2EAbPoZvzNUToQSiY4hKYPdT zm2fiM7VUHxxK0BSkWtq473qiiNPErQelTSQHkbVPT7CiGWlUN6q5MqvDXW5z9TwP17O F9sn9ZqOMEIkT32JUQ6Uff/LvmpiymGXDYgFCABcC+KlS0rVi+jKGOiVz4s8kVkyTTqA QZSQ== 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:to:from :dkim-signature; bh=jDxsxwb6wke90AJTR7bX+v27HwUxef5Wp/hVnhRyzbY=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XsA0Z7S4zhXKeOHyhyCW8bj2XDzw+7hzoD2S0r2bF7ao7pa+6ty02Qp1d+eXYqo4Dv CkghRidlceAlWx92Go+oJWWRu1soL0nnZdFv7jGS2HFN0OQWeGPu5xDiW3cxjSHbQK3f YRNtDXFSFMwSFJ9APtEY/EaqnxeKH6YXe2MdQqB3ownFKvJxRfQN7C6UOAvBX90RzYiD B4mCZIKr4VD7pvVlGiVHPZzRCN6H2k7ODFCnvr/VleQl7BPftayKNgk0GJq0E0rZiRNK qU1WJtpPDH/fiukP1G7357Uh5+FGT0DPineyQp0YNtx5VahtBeo5yLtmv6e3EC04cXpz ZPmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WVRt26Jw; 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 6a1803df08f44-6b59e613b8fsi84494736d6.532.2024.07.01.09.09.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2024 09:09:42 -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=WVRt26Jw; 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 1sOJZk-0001rE-2M; Mon, 01 Jul 2024 12:08:21 -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 1sOJZI-0000wj-5U for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:54 -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 1sOJZE-0005V6-DM for qemu-devel@nongnu.org; Mon, 01 Jul 2024 12:07:51 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-424a3ccd0c0so23522725e9.1 for ; Mon, 01 Jul 2024 09:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719850067; x=1720454867; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jDxsxwb6wke90AJTR7bX+v27HwUxef5Wp/hVnhRyzbY=; b=WVRt26Jwrr5RVBjnVcHP0r2HRnMgK2xzX66Hw+dlMB3IGXxebtC86e7NVjudUe7nP/ DBBgSvCsE7GBCOM3r8q1er3p7KkMzLeeHOUH1VImAo2eNVGvd40Uyt416Cz7+DMCbOZR i0yrJNBpnMsuPCTdZVtfqKDy5hKBNnojlrNwoqNaww0C/TIyV4jZxW58QpTZa1anXalj njdiLfGAwh58q/ymBobhuw7DefXyvZ7tvhHh4Igd+1RnYu6KT4fC8VDcQiZXb2Oi8LhI NTaMVYWw66OwhfPcrOAVcOAK/bOhTn5renqIzfdIPiOJCHzotAxbTvyWF4vi1MOQsBYn 3tWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719850067; x=1720454867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jDxsxwb6wke90AJTR7bX+v27HwUxef5Wp/hVnhRyzbY=; b=bcR8am2+50IGCXHVGnNfgEwFODTBu4hlR43cReDAqAgbqSfypPaD2aomcrxceGoKr+ XPCRa03vkL4g1xvcWLfvewxLclGxAtk7BzNV9vGh41KlgaavSvdkt//m93tgluXPb8qB cmoSGukTjq93UiCp02w94qXbfH4pYO/9mvGef2AyomDaRvk4nT9JYKYlq9GTqfkW9/BK itRKEQjNuKJ1TpDWP0Ty5vyLKZ3SRKyQozzX2p/5JS/TaY7W3c27ykS9vro6Sg4Il6ij G6vp4tNw5149jXoPwz4Eu7NViCC0IyK2XF5l2f5NHCef0aSWlowGw3D4fx8iz0QmTTYQ 7H2g== X-Gm-Message-State: AOJu0Yz8McT3TIXNe+DEgqgV3Sr++6QObkqlb3Fd2BwdNjXIx9vPIN2c qG5TGm3Ywfx1hcyeyLxwGJo21PjTfb1MOAN9yONDdoG2zAAIXIh+xey2Yy5HGmije4LQCD5F0KR gL9E= X-Received: by 2002:a05:600c:6a8d:b0:425:77b4:366d with SMTP id 5b1f17b1804b1-4257a02f3f6mr41316475e9.11.1719850067025; Mon, 01 Jul 2024 09:07:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256af557fesm161952135e9.11.2024.07.01.09.07.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 09:07:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 29/29] tests/qtest: Ensure STM32L4x5 EXTI state is correct at the end of QTests Date: Mon, 1 Jul 2024 17:07:29 +0100 Message-Id: <20240701160729.1910763-30-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701160729.1910763-1-peter.maydell@linaro.org> References: <20240701160729.1910763-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@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 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: Inès Varhol EXTI's new field `irq_levels` tracks irq levels between tests when using `global_qtest`. This happens in `stm32l4x5_exti-test.c`, `stm32l4x5_syscfg-test.c` and `stm32l4x5_gpio-test.c` (`dm163.c` doesn't use `global_qtest`). To ensure that `irq_levels` has the same value before and after each QTest, this commit toggles back the irq lines that were changed at the end of each problematic test. Most QTests were already doing this. Signed-off-by: Inès Varhol Message-id: 20240629110800.539969-3-ines.varhol@telecom-paris.fr Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- tests/qtest/stm32l4x5_exti-test.c | 8 ++++++++ tests/qtest/stm32l4x5_syscfg-test.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/qtest/stm32l4x5_exti-test.c b/tests/qtest/stm32l4x5_exti-test.c index 7092860b9b7..7e39c992fd3 100644 --- a/tests/qtest/stm32l4x5_exti-test.c +++ b/tests/qtest/stm32l4x5_exti-test.c @@ -448,6 +448,9 @@ static void test_masked_interrupt(void) g_assert_cmphex(exti_readl(EXTI_PR1), ==, 0x00000000); /* Check that the interrupt isn't pending in NVIC */ g_assert_false(check_nvic_pending(EXTI1_IRQ)); + + /* Clean EXTI */ + exti_set_irq(1, 0); } static void test_interrupt(void) @@ -498,6 +501,9 @@ static void test_interrupt(void) /* Clean NVIC */ unpend_nvic_irq(EXTI1_IRQ); g_assert_false(check_nvic_pending(EXTI1_IRQ)); + + /* Clean EXTI */ + exti_set_irq(1, 0); } static void test_orred_interrupts(void) @@ -531,6 +537,8 @@ static void test_orred_interrupts(void) unpend_nvic_irq(EXTI5_9_IRQ); g_assert_false(check_nvic_pending(EXTI5_9_IRQ)); + + exti_set_irq(i, 0); } } diff --git a/tests/qtest/stm32l4x5_syscfg-test.c b/tests/qtest/stm32l4x5_syscfg-test.c index 1cdf8f05c80..258417cd889 100644 --- a/tests/qtest/stm32l4x5_syscfg-test.c +++ b/tests/qtest/stm32l4x5_syscfg-test.c @@ -221,10 +221,10 @@ static void test_interrupt(void) g_assert_true(get_irq(1)); /* Clean the test */ - syscfg_writel(SYSCFG_EXTICR1, 0x00000000); syscfg_set_irq(0, 0); /* irq 15 is high at reset because GPIOA15 is high at reset */ syscfg_set_irq(17, 0); + syscfg_writel(SYSCFG_EXTICR1, 0x00000000); } static void test_irq_pin_multiplexer(void)