From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qioKI0hmwWMEBRYAWB0awg (envelope-from ) for ; Fri, 13 Jan 2023 09:10:16 -0500 Received: by simark.ca (Postfix, from userid 112) id 815B71E128; Fri, 13 Jan 2023 09:10:16 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=syrmia.com header.i=@syrmia.com header.a=rsa-sha256 header.s=selector1 header.b=jlX/7o/S; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A183B1E112 for ; Fri, 13 Jan 2023 09:10:15 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 129683858425 for ; Fri, 13 Jan 2023 14:10:14 +0000 (GMT) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2095.outbound.protection.outlook.com [40.107.247.95]) by sourceware.org (Postfix) with ESMTPS id 956D33858C39 for ; Fri, 13 Jan 2023 14:10:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 956D33858C39 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-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VNCH7V6/2+6Lcl2hiJ0/+pMKoigOdofmhcV4hwdpmlGo30pHh1CQ1PW5ullJDGY+TbC582v/pwCjdZVcGR2c4gxlzF4fTL6DwdugHcOWto+1o57RH57Qf8pR/vyZAu9nv58AuGAjAyiN7NN5mhSDd/T4EU5lv5ACt+nZGZZz5Iv+oVmFmuCbDB+A2xatqmGCE+U+s/sA32M26zxb6cJfi/wkp4faCcyP6vKnC3MHFy1wexsFJE6IwMEEjALohycCa0YTC2rOOzr/nTYOIzIVERi8u/56Bwdw5xLMXQKwc9if1UEBZlJwKpC5NEqkg1mPrr1vcR4vBiefEZ9WHvngDg== 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=xDORhis120i2aJd38uzupSzABC7q863jNXOCy3J4nxE=; b=VVliA/PUcq+87PdUSABxJsGKMgK9p4oj7EwcYOLuF/aLq8/WdcPhOctonOfM7ttz+QbgKzPI5aB3gyOaDt9pQzrXVXN0I0kMu0W6iNEGN/9osKt7UbFAPiNoOZJqJXM1zrSLzy2343VMGy3uaZI3Srso/wG0cuWs0M40vvqCzvKbJCQcfefHqxvGvZfgs5QXY0tfwIPh9G9WkTaSpHE2igWRFHaEKOLykMqsaB9g8XJs26/eOSxhpom9ran4ORYnQ8L+siSP6pet2CMfowsujK7L4pVzLLWgf1awtjd3OWPtClUFqsYkGCG5E4lZahar24hMdF09aFGsjynSyPiyEw== 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=xDORhis120i2aJd38uzupSzABC7q863jNXOCy3J4nxE=; b=jlX/7o/SnJbJK11WrA05ElIrcv383AOFKo0Bi8QtTohCcGT5bXgzdrKsWNCI1iNx2KovER6v24h16O/NVvJNM3T15Pi7iWYJtwlp2JWxeKoS21OXw3N7D75YLjnWxOIRu3G1rCcNRmqP0GRHO67d5v9O4Q5/ozU9sW0hrX/6fFE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=syrmia.com; Received: from VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) by PA4PR03MB7024.eurprd03.prod.outlook.com (2603:10a6:102:e4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 14:09:58 +0000 Received: from VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::e495:bd2:f20b:f510]) by VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::e495:bd2:f20b:f510%4]) with mapi id 15.20.5986.018; Fri, 13 Jan 2023 14:09:58 +0000 Message-ID: Date: Fri, 13 Jan 2023 15:09:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v5 4/4] sim: mips: Add simulator support for mips32r6/mips64r6 To: Mike Frysinger Cc: gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu , Faraz Shahbazker References: <20220202101725.23671-1-Dragan.Mladjenovic@syrmia.com> <20220202101725.23671-5-Dragan.Mladjenovic@syrmia.com> <5c3f02e8-737d-c992-f321-abbe7a60e249@syrmia.com> Content-Language: en-US From: Dragan Mladjenovic In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: VI1PR0202CA0006.eurprd02.prod.outlook.com (2603:10a6:803:14::19) To VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR03MB4208:EE_|PA4PR03MB7024:EE_ X-MS-Office365-Filtering-Correlation-Id: c0a53255-8ad7-4258-0507-08daf56fda25 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: glzRzpfJAbXrixdYOs7PkvFcSCVL8sgMO03CoBqcqL6WT0o5Df9Ff43/cElxvKwnnD5o2Tyj9DqH/9IixEGtvnYt+JCpWuRY6hdQoHDhVDkVg8NSK2hw0tiJ9jlfw0KQm4QUHlaiA/1WD0Re24RqK7ZDp8YIIu3fNPLHDi3K6qiL4LdKh+xjvXoxpqHFsErSKqmRfKUkpCVGR7PAMdbv9vtFdESeOOGeeSOat6lGRg7hhE4llX/By/pn2uFDGsMrz95I2YoCPOecXDPlHOroWaj7jjZBzkY/6HFkQfld5Ev/SxQZN/FIShczrTDInFw4e4LdHsUnrGxJFRT7tH2s9Lp+fc0gzNoeZu/q6+ASW3JdCJZcIh9mMermPf/0EwbznReRuMlCmjjN8wrrkEob/enRdXaVvzmT/IlPR3+dkAlZLhtxIUNjpZiUuUPSVBpWUTb2+txiRIiDdeZryb6Xr7mFwDLA4mgzG4unmAYOvZkl9V4uwUyPGYqFmwRu3mtii2t3dAP6SA3GcqpkP7nX5/beG9mAYyw2nXqF9ZqZauQlApDdSAkVFAuH7pFAWmzrdotS6aQnb/JZDDKnPOLUvhzrb+uMtRQ/xIz30J+bgc10TSmXSoUu8kENp38816rTPzuz4F4dRzf7gL1DGpTHZw7uN3VE1XwpVFPu3IWiR6bd0So5agMkSYHM+lRyD0IHLlnH8Den5h5w70v3W02n09XLUkyVLHVjCEyKCZNI1xQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR03MB4208.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(136003)(39840400004)(396003)(366004)(346002)(451199015)(6486002)(26005)(8936002)(186003)(5660300002)(2616005)(54906003)(38100700002)(8676002)(6916009)(316002)(4326008)(41300700001)(66556008)(66476007)(36756003)(6512007)(66946007)(478600001)(2906002)(53546011)(31696002)(86362001)(31686004)(6506007)(6666004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N3dOZjhBYlJNeTdTWm5rQTd2eVFGZU84THlUeDN5UU5xcldlekw2RDIrMmkv?= =?utf-8?B?TlJwRE94ZHZqY0JycG9tN3NrR2x4SDZsY3ZYWVpaeWF3Q2RFKzdiRHM1emcr?= =?utf-8?B?dklKeTlhak9mcjhETEMyTUxqenJoTEdnTUlEL2FtL25vVmR5Z1RqNlNjR2Rt?= =?utf-8?B?dVZIeEp1LysvM1pqWTMwS01FdjhXR0xuRmt2RFpSYU5JZzlFb0lwNHpCZkZo?= =?utf-8?B?bmdvSUpWV2xZOUdYakxCQktqVENPVHRvRWtkUWFZS0hkcDZWSWFQL25OTWIy?= =?utf-8?B?ZXdpS2UzcDVjOS9jbVVzeGxLSnNqYU9WazVSQVh3QzBRL0tTalFpVzJVTkcx?= =?utf-8?B?TlhCNTZ0Z05ueXFpTkJhSjA2L0YxclB0SmhTM1VQeGhRaGZUOXBPZlBrRTRt?= =?utf-8?B?eGEvazE2WHprS3p1Q3MyQjZVRFZrdGtPeGJRYk5SWjNwYmxxQ3gxVkhWR21L?= =?utf-8?B?VzA0S0JMcXFLL3ducmFDK2QwWTZJSnVjUzNSVmZiSmRjaG1XRDFxNUpseXBK?= =?utf-8?B?eStmWDFtUDJTSURUbmNBNjZqR3RSYlNwbko4Y1M3VVRNMWxLN2RZWVJvR3hR?= =?utf-8?B?TVNTTkp5aUNCNkoyVHdoOTFTakRhRkxGYkRzT2pKTExpSHpHUCszajkrMXV3?= =?utf-8?B?VGVrK3phV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B?eHc4cUVHWWtHTGp3NXBSTm9xMk9SclhldVNMa2NpVEtPcWZadTNnNlc4NVg0?= =?utf-8?B?WFpudHloUWZXMzd0V3gxdHFsbmk5MWdybFV3QTV2aG13bFZvVkRwTTNXZFZx?= =?utf-8?B?NWNld2JUR2xZTnNnRjlZY3UzWmNKLzRzbkFoZDVrQ2lWVFJwUDBuV28vTTNF?= =?utf-8?B?ZnpIUE5BQlJWQzVxNmowMzR2eEpZdEllWjVVYWRHQ3FxSHlhdUF1dk1HOW0x?= =?utf-8?B?cktRV3IvbG90STIwNWNoVkxNd2NqZ09tMmlXdW5DeTBOKzFHenhta1NYMG5y?= =?utf-8?B?WmNMd0xEM2RXTllxakszSFppZTVJVE8rTGRubTdBS2dtK3dDczgzeUU4MitF?= =?utf-8?B?cDFkRGR5MGR3U25CVU1iL0NRYVpKVVhHdkEyb0tDR0ZRVmg1Qm45ZmlnNXZs?= =?utf-8?B?cDJMRXNsME5YMlRUSVNkbCtZQ21zUTdVS2gzWXFPM1pCWnBtaGhBNEo0c2I4?= =?utf-8?B?TTJkdHhxZ2VlZmF0cHhkTXpRMTB3WERnb2ptQkY0MkZhMlFhUVgyaU54QzNN?= =?utf-8?B?czlLR0c4SkJOWkNKdERxKzRUa2l3VDVpVHZoRFhpK1NvUzJPVzhuWHdhVkxt?= =?utf-8?B?bWc9PQ==?= X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0a53255-8ad7-4258-0507-08daf56fda25 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4208.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 14:09:57.9036 (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: x0WoPNFDhuDHyPknzMFSPsnRKBRFP+aOlsUV95hzf73uQuf2l8p+AQn0IDI/W8hkuoW3f0HSvza4Teu4R/OrmVKhoOZRYKNYyPgjm8tsu6o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7024 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 28-Dec-22 01:12, Mike Frysinger wrote: > On 27 Dec 2022 20:35, Dragan Mladjenovic wrote: >> On 25-Dec-22 01:26, Mike Frysinger wrote: >>> On 02 Feb 2022 11:17, Dragan Mladjenovic wrote: >>>> --- a/sim/mips/configure.ac >>>> +++ b/sim/mips/configure.ac >>>> @@ -216,6 +227,7 @@ if test ${sim_gen} = MULTI; then >>>> #include "sim-main.h" >>>> #include "multi-include.h" >>>> #include "elf-bfd.h" >>>> +#include "elfxx-mips.h" >>>> #include "elf/mips.h" >>>> >>>> #define SD sd >>>> @@ -235,7 +247,11 @@ sim_engine_run (SIM_DESC sd, >>>> & EF_MIPS_ARCH_ASE_MICROMIPS) >>>> mach = bfd_mach_mips_micromips; >>>> else >>>> - mach = STATE_ARCHITECTURE (SD)->mach; >>>> + { >>>> + mach = _bfd_elf_mips_mach (elf_elfheader (STATE_PROG_BFD (sd))->e_flags); >>>> + if (!mach) >>>> + mach = STATE_ARCHITECTURE (SD)->mach; >>>> + } >>> >>> why do you need this logic in the main engine run routine ? why isn't the >>> STATE_ARCHITECTURE value already set to the correct value ? if it isn't set >>> correctly all the time, this can lead to incorrect behavior elsewhere when >>> code checks it. >>> >>> when the sim is opened, the bfd_mach is either explicitly passed in (which >>> gdb does), or initialized with a call to the bfd library APIs. see the >>> sim/common/sim-utils.c:sim_analyze_program code. >> >> Sorry but the exact reason for doing so eludes me. It is done on >> internal jump for gdb 8 to gdb 10, permissibly to allow running >> binary even whet set arch forces older mips isa, but I see little >> use of that outside of testsuite maybe. > > i'd argue that if you load a binary for one ISA, then force the runtime > to use a different one, and the result crashes, then the sim is WAI. it > should behave as real hardware does, and if you load a binary that needs > a newer ISA than a CPU provides, it won't work. > > do you know if there's a testsuite, sim or gdb, that exercises this ? > -mike Hi, Sorry for the late reply. I couldn't find any. Best regards, Dragan