From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2AC933858C78 for ; Tue, 12 Dec 2023 17:24:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2AC933858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2AC933858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702401848; cv=none; b=HOLU5G7ufl3Vv6rEkL9caOKW24N5CV+PvpkvOXKLyiYvFev07zrKIjF9qPT+eNk952swqU+FPmIesKVRkIIemqxlcRj+boz1EkHJKX3SvwCJo4VIc/2J3yl4ac2f68aZsIWdirzbAkZT39F58Wpkc8ROxWMhScBC5CPEJdvyb9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702401848; c=relaxed/simple; bh=rySjn1ur9tqC2YnuLqcgugmpYz0QflrMKHf7jy3piAU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=L5QyHxZTBl+ztma9wKVq83RGaU8Aa9oBlVZTwAGBJR1hJgkBFui6ZhkpVHAltDwFbbumfbwFQOzgqwKOjlrMTFbjryOlLaQo3+WFtVUa+9GwMIdyGZL3ovVzcXiD0JrRITGbpJO0hHf24F1zuvlzD+fgptXjU/q0+t/kj0IFqmM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702401846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DNsuomOsvUBWQzzNDxnNY2fzWln/uhVGtozRFpffc/8=; b=VXfk62PbmfvWqZuTjlWJQ04Em9DDLCycUUQrYzFOHvMtPO2vL7xkzFzVUpAaGvxxEgl2eB PajcccYIs7pHO6XwKgWQH6x9G6X73tYqP1Kq0t0tmG74lur/QCB1GvmPLK5SNXXfFqpEoi 0V8mFpR0Rwe/fXwGU5lLnhK4lzGU1sA= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-UdOdFIBsMdSGsix_VzTM7g-1; Tue, 12 Dec 2023 12:24:05 -0500 X-MC-Unique: UdOdFIBsMdSGsix_VzTM7g-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-33608b00a04so3221242f8f.1 for ; Tue, 12 Dec 2023 09:24:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702401844; x=1703006644; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DNsuomOsvUBWQzzNDxnNY2fzWln/uhVGtozRFpffc/8=; b=n0jKi6x8jxgqRyGI/yHpOUKOi1h5QxAG/pZP0zRgjr3cFKGjiLD3iteHr9HHplEcAc RrSR8NYID1g/MY32lv1bTdrI8XP9VdCazUVLDvoCq1lwtgJ5zTrjZHSoiuI3j6KV58/G 2FddCgWrOxrmDZQqwgEhTNytgQ/MuVDdrmAhlx1FiFKXo3uipl9D6syJiXpnRRYp4nTN Ojz7NilFN6Dqpgc3vfrCe2en+WAszBJRm8ZJH15L6aWxY2+qELzm+QcEF/F8x8M0QZHh Ms1GZLKFWnDoaIlU0xBXXn40pC9KXo3mmqCiIv5LlD1BbyK1+0yOdc1XidZa6DyQHU6T tDDQ== X-Gm-Message-State: AOJu0YzqIdROcp/cCpRY0IggKouBtJmZnW6sZEc8kgRudb3wcKEMbp7I MOruhsmqsrGvd8OUDsa1eE2QsX3zMTOTBEA4wG+BBFSngJm6J5DO+t2BXUsF7cmp0w6GS1+jPL0 XGR058nV41WjslmIbnpQ/zA== X-Received: by 2002:a05:600c:221a:b0:40c:33be:d193 with SMTP id z26-20020a05600c221a00b0040c33bed193mr3998459wml.78.1702401844212; Tue, 12 Dec 2023 09:24:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0lo9/9GoXwZh3DrOeki1vffdUd2e+wCjqv4MI6TaMdBxYHfPPhqC0Hvv7LBjfCuJn0KNCkQ== X-Received: by 2002:a05:600c:221a:b0:40c:33be:d193 with SMTP id z26-20020a05600c221a00b0040c33bed193mr3998452wml.78.1702401843821; Tue, 12 Dec 2023 09:24:03 -0800 (PST) Received: from localhost (105.226.159.143.dyn.plus.net. [143.159.226.105]) by smtp.gmail.com with ESMTPSA id iv20-20020a05600c549400b0040c4afa027csm6185625wmb.13.2023.12.12.09.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:24:03 -0800 (PST) From: Andrew Burgess To: Mike Frysinger , jaydeep.patil@imgtec.com Cc: gdb-patches@sourceware.org, joseph.faulls@imgtec.com, bhushan.attarde@imgtec.com Subject: Re: [PATCH v2 1/3] [sim/riscv] Add basic semi-hosting support In-Reply-To: References: <20231030130042.1472535-1-jaydeep.patil@imgtec.com> <20231030130042.1472535-2-jaydeep.patil@imgtec.com> Date: Tue, 12 Dec 2023 17:24:02 +0000 Message-ID: <87y1dze3m5.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: Mike Frysinger writes: > On 30 Oct 2023 13:00, jaydeep.patil@imgtec.com wrote: >> Added support for basic semi-hosting calls OPEN, EXIT and GET_CMDLINE. > > what host environment are you implementing ? none of the syscalls you've > defined match what have long been in the riscv libgloss port. those are > the only ones i'd really expect at this point to be wired up. This would be the RISC-V semihosting target, which is included in newlib (since 2020), but is separate to libgloss. Where libgloss syscalls use ecall, the semihosting uses ebreak with two specific nop instructions (one before, one after the ebreak). Do you see any reason why we can't support both of these syscall libraries? Potentially we could have a switch to select between them, but I'm inclined to say we should just support both until someone comes with a use-case where supporting both is a bad idea... But maybe you have some deeper insights here. > >> Added gdb.arch/riscv-exit-getcmd.c to test it. >> --- >> gdb/testsuite/gdb.arch/riscv-exit-getcmd.c | 26 +++ >> gdb/testsuite/gdb.arch/riscv-exit-getcmd.exp | 27 +++ >> sim/riscv/riscv-sim.h | 32 +++ >> sim/riscv/sim-main.c | 230 ++++++++++++++++++- > > you're missing sim/ tests. gdb tests are great, but not sufficient. 100% agree with this. Thanks, Andrew > >> @@ -990,6 +1209,7 @@ execute_one (SIM_CPU *cpu, unsigned_word iw, const struct riscv_opcode *op) >> case INSN_CLASS_A: >> return execute_a (cpu, iw, op); >> case INSN_CLASS_I: >> + case INSN_CLASS_ZICSR: >> return execute_i (cpu, iw, op); > > seems unrelated to this patch > -mike