From nobody Sun Nov 24 08:39:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1724800901; cv=none; d=zohomail.com; s=zohoarc; b=kBlY6Ehz2h3UG+TvJNSNPyr2uISNjzSIUdWhXFMKC43JGGKqYi7BGhuYxck93fXxxxeu28Hyi2w4N1LIgHhgesC763YUpM9lh0Fj7TSMN0HiTtz0EJYqaJfb8JJucfZSEOzoHS6cWVnXJpzPi76qhjTR6ujSKkx1+9xIt0TrNbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724800901; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aoOLJ1vSDf5p0Vfqc4dUxk3Eqww8q10OxxejFUrpUPs=; b=I9Q5bmORPz1yBSBD/xwgpzQaFMPv1P5icMbLLIzL7J2ZQvYBXvqRGDzJXh0hD0BZryv3gdR5qFJwoVIbOjA21nETe595XgzKOjHsj7D2JpUor8f+NZGHaNinfxMofHF7uuEnxY4K6wp2EbMSugCsoGGoDY+FbtdwP9tyE4htxK0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17248009019854.276340952910573; Tue, 27 Aug 2024 16:21:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sj5TA-0002xE-OE; Tue, 27 Aug 2024 19:19:24 -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 1sj5T5-0002eL-Vr for qemu-devel@nongnu.org; Tue, 27 Aug 2024 19:19:20 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sj5T1-0000pY-0I for qemu-devel@nongnu.org; Tue, 27 Aug 2024 19:19:19 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-204f52fe74dso3053445ad.1 for ; Tue, 27 Aug 2024 16:19:14 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-203b0ee6179sm57785155ad.92.2024.08.27.16.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 16:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1724800753; x=1725405553; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aoOLJ1vSDf5p0Vfqc4dUxk3Eqww8q10OxxejFUrpUPs=; b=g02zzFLx8gobhKqyCSiJCa/Ics2Mmrgrrknk1YTPScxC9ZL9RTFj7n3SNoWQaYjpHf Mh7RwIniAWG0yku071ms0MYbPrA/YIdK6M3Pz8C0YSb2+PEnwEQ9wzJRPLsxYyujK0cz JB0zY2rYLQkrWVLoMqDX9WK6+sp99HyOx+NQvjk/Z2L9DCW8BVNQmn7m20Ycy1ZPxQRe 1KHc6JNQ6Q0ftH3IJvzU7vaRjnLiXyYJ6+nSmhBaT7FKhIGyWGbCqrWgP7E17fqAfcHQ YMD8RfIDZkxwBrSBk3Lhj6Hj5IyRcbfCb5d+3wydD+uAI7I0x7X1hKkWK599MzwnriWV Az2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724800753; x=1725405553; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aoOLJ1vSDf5p0Vfqc4dUxk3Eqww8q10OxxejFUrpUPs=; b=bZ2ccBiOUg18VksvDC8tYSzJbPOBSntFUQlPMCv0OKUjErL+9xubUWWjSnxKyujljZ +URW30S3VWoWXP5ZdJKRxJoFDLqCJ15HWFFyPQ17v96CdAErPE/tgmq9sjzBoRvBC6/h hmT9lSYos4XNM26UHL89SiZLpIIenR3nNog2vAU7VvTXTGoXcCTt3n0cFrc9frreIjlI vHgpHVo3IbRBuYaJoDpj4IPIGmZWnZz989rjrUPKlyWYDYrcMwLpJMOyxMfY8GtBmj7e a07oyjNegmoWX20CZpGaJGBLUlXQK/+f/oUKzsvsYpa2uxPEWDD3c5jvGAVdjH/rn40G TsTQ== X-Forwarded-Encrypted: i=1; AJvYcCVaXrwAMc1WtwAqvZbBbAt8Xo36ha3djFRO+0Dadsl5PjU35wLAXEBDDxRPidNwX6mREg6ykPzxHESZ@nongnu.org X-Gm-Message-State: AOJu0Yzf2GEdVwQseoLYhttgmMSLCSuqijA8xEgoVErOvOtCFI+mWM4w 8hDFuYWTSMoPthJ1L+8xtH2g8gmN7KOeFeazbDwxLrbenGld1+kYkDO0iaRquH0= X-Google-Smtp-Source: AGHT+IHYn6KHMObEsNpk0qA0CvpN+9r3ZY99LW+rC3IeZwuu6QTa8zcxOY2GH8u/15ySi+pEiABONQ== X-Received: by 2002:a17:902:c40c:b0:203:a12e:faa7 with SMTP id d9443c01a7336-204f9b9ccbfmr5322005ad.27.1724800753332; Tue, 27 Aug 2024 16:19:13 -0700 (PDT) From: Deepak Gupta To: qemu-riscv@nongnu.org, qemu-devel@nongnu.org Cc: palmer@dabbelt.com, Alistair.Francis@wdc.com, laurent@vivier.eu, bmeng.cn@gmail.com, liwei1518@gmail.com, dbarboza@ventanamicro.com, zhiwei_liu@linux.alibaba.com, jim.shu@sifive.com, andy.chiu@sifive.com, kito.cheng@sifive.com, Deepak Gupta Subject: [PATCH v10 02/21] linux-user/riscv: set priv for qemu-user and defaults for *envcfg Date: Tue, 27 Aug 2024 16:18:46 -0700 Message-ID: <20240827231906.553327-3-debug@rivosinc.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240827231906.553327-1-debug@rivosinc.com> References: <20240827231906.553327-1-debug@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=debug@rivosinc.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @rivosinc-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1724800902510116600 Content-Type: text/plain; charset="utf-8" set priv to be PRV_U for qemu-user on riscv. And set default value for *envcfg CSR. Signed-off-by: Deepak Gupta --- linux-user/riscv/cpu_loop.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 52c49c2e42..7a68e8717b 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -32,6 +32,10 @@ void cpu_loop(CPURISCVState *env) int trapnr; target_ulong ret; =20 + env->priv =3D PRV_U; + env->senvcfg =3D 0; + env->menvcfg =3D 0; + for (;;) { cpu_exec_start(cs); trapnr =3D cpu_exec(cs); --=20 2.44.0