From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2093.outbound.protection.outlook.com [40.107.247.93]) by sourceware.org (Postfix) with ESMTPS id BEE2C385DC33 for ; Wed, 14 Feb 2024 14:50:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BEE2C385DC33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=Syrmia.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Syrmia.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BEE2C385DC33 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.247.93 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1707922204; cv=pass; b=CwXrzRj/N5MoBO3wZCQETOoGHVRQ8htbATlXPChalWxG7r7J1mG0oVWcx51wIz91pIimfC7tViMlUmh2dcEbta7AL8gxQwB8kCMKXLml74RsP6emxHQiaI5KQXELLc8vtuBR2hEtrWXC5BZvUmRyHUtBrKFx2ZVO81U8eYx/oMc= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1707922204; c=relaxed/simple; bh=TkSUSefUCV8/nN+5V3XZSFBYwegxeZ7eW2oVq0dJGVI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=H0+kC1wPVzy9WFaC3dubTn/s1XK1zPzt4pkC3pzLTlhUBoX0HiaETbvYsuosXLiH4DSKezVOZ3qhbO3f3pUBa5UVGfvEkQ6AOIxSxtcJanzHOIpUaxtAOXRXda+d6/e/uRNf8/F+LeG41aFJT6B9CcYlR2ZCmQXn2EaD+3uSd+c= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B9VxUHMl0h3Iwi5YfUzmADCoU7tB0EImHj58NVwJP8j2BjjP+IbcpFn7UOzG0MLmRWlccamzS7pwyrHj7AwjsjYpIcWYpl86nAN8h4nkgAcZTIyVVT8znxddneeoVEUPi/xeyEzvsY0iBUl5M3OQ6TgbQ24SPgZGuQE3Ev5mnmXLwzTHYFcDWahE3SoWyQ+WcPuur8JWwKrUtoSCWZXPyRnw7cMP8WZdgrdJUm9CCfeowoRrI3D0Uris51iwzu3juAaVR2zGFep5MjHDPNPfhDelt0GQLjwCaDbsd2EOIDZT7F0d4iryrfmhl2RXJA9WVvPVKmZiofzu5LfQu/DoTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xHb2DsQmDrMNbCpfx417+BBPTtkrfCdbYwJjk1vOq00=; b=O9Rm5nS50qpnbI4rje8lR7I8LOKZkdHLvma1e6ggFHJnKB6ZjxZPkxYYnpMKyUWwRbQdk2Zyj1b6cSgx7duSik/VPh0lDXzOAYxTXgKiRn7C0Opq3f/GWdW7+7dJAopGDqi5DFSebpznWZsET2mwPopohRDNQzOn2qVqnukBsFyf3M+nAxPpgIYNK/nn6+gTZyiU6ums/4LWUaw8qaSwEXYT+kdbTVez6Qa8jPaPGoQC6nkulZr02qaBaRcxKlQS6UL8bNiiFstsqVGjzFZfH/9uFCPT5fXrdpkikuvtdHj2iH3OR4mGw4CKhzBP3LcKJZrKY+xWrgR17GZZxe4sTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=syrmia.com; dmarc=pass action=none header.from=syrmia.com; dkim=pass header.d=syrmia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrmia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xHb2DsQmDrMNbCpfx417+BBPTtkrfCdbYwJjk1vOq00=; b=E/5L0PVSPuiL43LiP8I4uUAfR8Hvg0SykcFDsPHgVPuzDAlv7CD+nWA61BqNnmHHHXAr93H7hOy9kq+RnVDptxTS2CHgsHc+AFQFgOldilFeLdFWUrDYvnd+lipn1yReAzSspKO9SKpgvTvA81NFGoM3TIgoHTZ3yIFoqanym6Q= Received: from AS8PR03MB9698.eurprd03.prod.outlook.com (2603:10a6:20b:61e::8) by DBBPR03MB7066.eurprd03.prod.outlook.com (2603:10a6:10:205::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39; Wed, 14 Feb 2024 14:50:00 +0000 Received: from AS8PR03MB9698.eurprd03.prod.outlook.com ([fe80::f06b:6555:5f32:e5e7]) by AS8PR03MB9698.eurprd03.prod.outlook.com ([fe80::f06b:6555:5f32:e5e7%3]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 14:49:59 +0000 From: Milos Kalicanin To: Simon Marchi , "gdb-patches@sourceware.org" CC: Andrew Burgess , "Maciej W . Rozycki" , Chao-ying Fu , Djordje Todorovic , Dragan Mladjenovic , "simon.marchi@sourceware.org" Subject: Re: [PATCH^3] gdb: mips: Add MIPSR6 support Thread-Topic: [PATCH^3] gdb: mips: Add MIPSR6 support Thread-Index: AQHaU44kV0QhQpOyWEGgITcjILrYyLD3jbeAgAj2MaeABomZgIAC4fD0 Date: Wed, 14 Feb 2024 14:49:59 +0000 Message-ID: References: <8f767550-7aec-40b9-b4a9-7b71de718792@simark.ca> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=Syrmia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS8PR03MB9698:EE_|DBBPR03MB7066:EE_ x-ms-office365-filtering-correlation-id: 78a8526c-f26a-4d61-7399-08dc2d6c37f1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sry3KVO+FP7XkAASQa2Ul55sz5oIQo3Vvi+VeBduHbb/SvRyPXiLK+ug/qZeHMvwqILJx+WyE/7pOwi59AGEbcrWkBkVDyN+lyE8Hs6hYcKmejcM4vQPViaYzqznuwObPDCrvOvwFbOvmWg9PmcpftZPKdqO4144TZBofojWbDw4/J77MHWzKoKj/kfBkT49BwKkGVKR/63qMAJooVNr1uWD/4D/8trBXKycbl1PchVpG/m6B1xRh2n1bPCzrhR0vo+dF7JKC//ECIUkvBoVFRfZ/pGxuihK3pJ4Dvm8rcve8AZ6ld4QRBPO0jTvluawnJTmaEgaI2PpELmGKvePxvJDjvAx7XkeBku1Qn7nXGYHshudBpo8JCXZLKjOJbT1muiT3pyvwKRr1rbQVps6sVTMQoRv2aCNCpGTjvL9mjtwYHRVg1G5/2/s3dRINWWy+6jLm41fiVk1HpFeT61/eskGgTxdXHqLkWIBaVHWZ7NGbn3Z/AQFwq3RS5Uo3TdQOxubJy2ELf2h62qY5jwHRXxdIndYnin4k7Mva+/jcUSDGy+pjzzYT5OA9LGSOEzGQ0LZpLYvDJqsWV5RfEGDVHvKqCdDCUniTVLOK30hX0BVeQeaReRWHmEr0kilga85 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9698.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(346002)(376002)(136003)(39840400004)(366004)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(66446008)(66946007)(91956017)(76116006)(64756008)(316002)(66476007)(54906003)(110136005)(41300700001)(66899024)(66556008)(55016003)(2906002)(5660300002)(8936002)(52536014)(4326008)(8676002)(478600001)(9686003)(71200400001)(38070700009)(6506007)(53546011)(7696005)(33656002)(86362001)(83380400001)(26005)(122000001)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?w0RKNP/W4+L8ObFVwMhgUjpp7/vn56tKc3nkn5prdsag/WOB8/yCzbbj?= =?Windows-1252?Q?wYHZjjweKyOCytaNiX9m1vkU2afGvLKOPZTBH/7CjR0TcC0taDBdHXjK?= =?Windows-1252?Q?ToEitAprZok/pLdVIg59TLRzcdrTySkVdYrGKWUEoLP2CLQZrdaAIL8p?= =?Windows-1252?Q?T/Xynb8qu5M5BVPELwPUUXkJPKnM55zaU9T/zWoTJrC2DNSh0dAqxYqc?= =?Windows-1252?Q?ZHHK629OtgMzHvP7jYseu4UAJ3vawPoBMTCOI6Qb4kBI7KdZ7rUj0Xo+?= =?Windows-1252?Q?FhouqnRGBzTMB1kT4WXyCgAg9qOZQJ7JtIp5OZwyLNo8M1/XUQYMKtNH?= =?Windows-1252?Q?ntDHUkMzxfaTlcE7CE3Ivw14lqSO941mBeTlQdezDqM8uSefCdMGNVR4?= =?Windows-1252?Q?p88J+PtZuKWMFENhRsB38c8nz4EgVlqqRGSmNuKYRwiR3X45IZ6LZbGC?= =?Windows-1252?Q?5jRXpe5po/4NDppaqOy054ArNH8m4rWarGECOL0ViZcZbmZpFkGjTNUz?= =?Windows-1252?Q?/B5QewzWEAU2PoO6k8r8fXcPrInHkmhdHbMt7Piw+0zvgeyRN8ol3B27?= =?Windows-1252?Q?40lQhElkWidJMPcbFr6cbbm8zBEDMhxvYh/TBnS9L4khD4J0KBxYcSa0?= =?Windows-1252?Q?NYi5O3Bm+7AsYGLRP9hAuy3eV8I/iIStzTPTKaX1RpTDad6XGd/l/Nnr?= =?Windows-1252?Q?/33T+/ok4tHoC2+eJ77ZSIYSvujPRt37UpmMwzN1FE2uq6dMfi4tmNWa?= =?Windows-1252?Q?luPkA3odR6jTLXx45gATcFjk/NVxwtmvrYl8c9Zkt/m5SzB9pzsI5iUf?= =?Windows-1252?Q?Ew9T4QKPSXC3tdt9xCOCrJYqwGEA6XpkQuP5zXy4EtToYMEwXTehOBU1?= =?Windows-1252?Q?zyclq/LYlQ8ZQK42GN8zMk2fJhIZvx323MT+kvvhpwVOvcjxbqp+r3De?= =?Windows-1252?Q?J1NFYD4a82W4zfDABHtDwvqJqW2yZpg1U53uyNj1665UQiU/pCk4v90y?= =?Windows-1252?Q?CTkVSG6s95gxjVjiNSFg/Dce4S1p4/EtBJvI9ElzmcQ4Joia/umsMcus?= =?Windows-1252?Q?b6jv5omHUFXaAcjh/zpn2k0Y4ZblWm5LjO+bEGuT5l10LQfFMGW76XPW?= =?Windows-1252?Q?OO3GrTTvF93ZGPuZtj8TI8ZQcn2nPgM8BzW7wKvKWjMFkuCojmR4Rkh0?= =?Windows-1252?Q?Fx2Q7tNpc2kbQMRw0F4+zLQZNjs6aWVdNBK8+zw3yt3/r0DX3DQ1kUoQ?= =?Windows-1252?Q?G0HPFWHM2z29PfNAtsrXycN/4EEqwjPWlSfgtMNgq0h6pMY0Cfy3+LOQ?= =?Windows-1252?Q?XQk5gqjzGwvYnea0NtRGUy/8GEwegIkznox10aQbPmOx2DDz9N4MbkWm?= =?Windows-1252?Q?dSJUQkkmrAkr4TwwHrzxC4MHRHIKFHRi2kinygQ5/1ppF8svrSBCv/mZ?= =?Windows-1252?Q?mKmNh21nfGk3PXSS3Jxp56pJ8jyjh2HMmEtFCQFEfzWwxgKUYObwrqXr?= =?Windows-1252?Q?AXpPyFVtyXww8Ap2BEhrEmR4gXurEr+HaP4vW1mEUh791bPhRZuk2Jvk?= =?Windows-1252?Q?2mXdScHNplKz0NEjYVRok0CjppepcREMb4xnhr4M07Hq8GkpdDeofph3?= =?Windows-1252?Q?QixDnkoVHLJkV454LsbOmOwki+R1pIJ4+4RFi0JGLBdZVKmHtlc48AP0?= =?Windows-1252?Q?mjXdhHudSXVL3azC70ri5z7iTTt5HNbr?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9698.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78a8526c-f26a-4d61-7399-08dc2d6c37f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Feb 2024 14:49:59.7770 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 19214a73-c1ab-4e19-8f59-14bdcb09a66e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: W8N2e00FU/HPLEOhjSLKLD/MrI/q0d9VIp7ez8wBc55PHHdA/VkBxlx7m7e3q3WEp7ihEX8Sd5OMyCTs4EBzGBfo0ZaWpr40NklOZUgfb0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB7066 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Ok, so the idea is basically to single step the whole binary until the program exits? Essentialy. > Some more nits I found while reading the .c file from the test: ... I've sent a new update. Hope it's close enough now. > Finally, I built myself a mip64r6el buildroot image > (qemu_mips64r6el_malta_defconfig). I'd really like to try to test it, > if only to learn and document how to run the testsuite against an > buildroot qemu image. When I try to build the test file using the > cross-compiler, I get: > > $ mips64el-buildroot-linux-gnu-gcc -march=3Dmips64r6 mips-64-r6.c > mips-64-r6.c: In function =91test_r6_fpu=92: > mips-64-r6.c:900:3: error: the register =91$f6=92 cannot be clobbered in = =91asm=92 for > the current target > 900 | asm( > | ^~~ > > Is this expected? This is the line I've been using to run tests: $ DEJAGNU=3D$BUILD_DIR/binutils-gdb-build/gdb/testsuite/site.exp make check= -gdb RUNTESTFLAGS=3D" CFLAGS_FOR_TARGET=3D'-march=3Dmips64r6 -mabi=3D64' --= target_board=3Dmips-sim-mti64_64" TESTS=3D"gdb.arch/mips-64-r6.exp" with target-triple =3D=3D mips-img-elf and target-alias =3D=3D mips-img-elf i.e. codescape's "mips-img-elf-gcc" baremetal compiler. Did you verify that built test binary is release 6 ? Some linker scripts have hardcoded release 2 so you may need to change it. And is target built as -mhard-float ? Eventually, I'll test with mips64el-buildroot-linux-gnu-gcc also and inform= you in a few days. Best Regards, Milos ________________________________________ From: Simon Marchi Sent: Monday, February 12, 2024 6:38 PM To: Milos Kalicanin; gdb-patches@sourceware.org Cc: Andrew Burgess; Maciej W . Rozycki; Chao-ying Fu; Djordje Todorovic; Dr= agan Mladjenovic; simon.marchi@sourceware.org Subject: Re: [PATCH^3] gdb: mips: Add MIPSR6 support On 2024-02-08 09:23, Milos Kalicanin wrote: > Thanks for reply, Simon. Your suggestions will be applied soon. > > Speaking of test mechanic: > It's quite simple. Pseudocode follows: > -put breakpoint on each test function (test_r6_r6, test_r6, test_r6_llsc_= dp...) > -single step using gdb command 'stepi', checking response: > if (response =3D=3D gdb_prompt) or (response =3D=3D 'breakpoint h= it'): > proceed further > elseif (response =3D=3D exited abnormally) > test failure > elseif (response =3D=3D exited normally) > tests passed successfully > else > tests failure > -previous loop is constrained with timeout Ok, so the idea is basically to single step the whole binary until the program exits? When you send a new version, I'll see if I can make the expect code a bit nicer. This is a bit arcane if you're not used to tcl/expect/dejagnu. Some more nits I found while reading the .c file from the test: - Indentation should be two spaces. - Return type of functions on its own line. - `(void)` instead of `()` for functions without parameters, in C. - main function is missing the return type. - stdio.h include appears to be unused (haven't really checked, but my editor says so) - use /* */ for comments, not //, wrapped at 80 columns ideally. - I think that comments at the right of the line are fine for very short comments like `/* BOVC */`, but longer comments should go on the previous line. - space before parenthesis in function calls (including asm() calls, they are not functions, but they kinda look like functions). In theory, `xstr (...)` too. Here's how you can format things so it fits the style: int test_r6_64 (void) { volatile int err =3D 0; asm (".set push \n\t" ".set noreorder \n\t" ".data \n\t" "d0: .dword 0 \n\t" "dval: .dword 0xaa55bb66cc77dd88 \n\t" ... "move %[err], $11 \n\t" ".set pop \n\t" : [err] "+r" (err) /* outputs */ : /* inputs */ : "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", "$11" /* clobbers */ ); return err; } Here, the "clobbers" line didn't really need to be wrapped, it would fit on one line, but I broke it just to show how I would format it, if it needed to be broken (other instances in the file have longer lines). It's not the end of the world if the formatting isn't perfect, but those guidelines should get you pretty close. Finally, I built myself a mip64r6el buildroot image (qemu_mips64r6el_malta_defconfig). I'd really like to try to test it, if only to learn and document how to run the testsuite against an buildroot qemu image. When I try to build the test file using the cross-compiler, I get: $ mips64el-buildroot-linux-gnu-gcc -march=3Dmips64r6 mips-64-r6.c mips-64-r6.c: In function =91test_r6_fpu=92: mips-64-r6.c:900:3: error: the register =91$f6=92 cannot be clobbered in = =91asm=92 for the current target 900 | asm( | ^~~ Is this expected? >> /* * Any test_r6_* function returns non-zero =3D> failure */ #define >> EXPECT(X) if ((X)) abort (); > > In inline asm, register $11 or [err] identifies instruction currently > being tested. If any instruction's output is wrong, program jumps to > epilog saving non-zero exit status and signaling failure. If all > instructions are tested and returned expected result, output register > [err] is set to 0, signaling success. Ack, thanks. Simon