From patchwork Wed Jun 28 06:32:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 697213 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp4181066wrm; Tue, 27 Jun 2023 23:33:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7bygtfjsmYCdAGBLuwBXZhp+1RHIZEUiYpbA7y/DboX2OvwaC+jx32ix0OpFtGx58V/ISo X-Received: by 2002:a05:620a:31a4:b0:767:1b8b:91a1 with SMTP id bi36-20020a05620a31a400b007671b8b91a1mr1714358qkb.33.1687934002937; Tue, 27 Jun 2023 23:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687934002; cv=none; d=google.com; s=arc-20160816; b=EvNRrDVQrl1Nyiyzdob08jQEYOUpPGFr8taUwy1caKnFvxJzrYON0cKrOLMRQaOGYn MXfWf0RG7nhjT0FCOEKI6VT2YmKxobJy+1F39YOrQsO2tQMJ5rrmEBsQ+xO9mAJFom1M 581961kyXSiaHuSkBneQ0Ut0RqMl5EdHi5my5rU2XQlMfyJweg7asx9GUbX+TnVs/fC8 AaSJX/vdTQyoGH4ZSg5Y7NKHHfwLDc5VSnWoly0V31NhbbCc4+60CXOsFGg/x1f7c/dM O16su5Wmxu1konwphvsLSXa/3Th+uqn5VF0JZrkiihNqY9lVSai3wz+/GnzWja4jykKr bA5w== 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:cc:to :from:dkim-signature; bh=vqa+ZGVYzTSloicqLfBGr7JloKck/QuzhKdmQMoQ3mA=; fh=w8WbWO/y/5d1qF1XZLs1bnXIhHguLPbKmLY20PMg0gU=; b=GiXcVT6D2fmGnfBPLNLl1rLk/DaJJi66Y+4mKMuwCQ0IXsNLoUZ5SGovnM16SVaQ4z 9pEIUBaj3Tf89jce3g48MxL3+Y3PfFOU8wtYZsSONg92rZ/dNRraSVOZ+oTCJfR4Eeqn 4/vSxJUYPhkURg7YF15fcL0Zycl7+SdqGkwjmqCYCUrVH8SY2YMtmfxKhdDKR3WkGzoy MWf2arl/FChgVxtCoPtiGLcRai2t8kg46pZU1As/F02f+UM8helPnwPWLthqUvZo2zUo 1L5kVm+ahO8EoAIei8XPxInqqwdCextU7EFHOXJggwYRlin3n41T1rm7JQ9EYNBqqbqG 3Z7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dARUKh/C"; 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 x27-20020a05620a099b00b00765a67d852fsi3134778qkx.379.2023.06.27.23.33.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 23:33:22 -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="dARUKh/C"; 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 1qEOjR-0002ej-WB; Wed, 28 Jun 2023 02:32:50 -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 1qEOjQ-0002e4-7Z for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:32:48 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEOjO-0002lA-0Q for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:32:47 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-313e1c27476so504963f8f.1 for ; Tue, 27 Jun 2023 23:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687933964; x=1690525964; 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=vqa+ZGVYzTSloicqLfBGr7JloKck/QuzhKdmQMoQ3mA=; b=dARUKh/CXDtLhKtLIuiR5DRrt+r07BFg451cIqaxTuEAvmbiZFpY/Tyn3m0M5kacEL KmS9l0Ukml2wOdjdguSmSubqw1h36EKZjg7GZohm3/8yBX5VPRXFXn08CmCbu0+Zy1U4 PUK2X2v4r5DCbD1ncTdBkZW8O22NVqVnYmj6JnqQtcTztgPS5J48aPpQWAEmo539ieW0 sJJBetwj0FFEl5hSb99NKm61i3agAn+dm5HaMTtRA/o/ZoILptpzX9fHtPwogNC37hPC igWLcQlX03bgE6XqX4ehSphxAo6//pp+4PmWcLmMlz3cML8EISRoFIi/4CeecVm3V1B0 7IYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687933964; x=1690525964; 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=vqa+ZGVYzTSloicqLfBGr7JloKck/QuzhKdmQMoQ3mA=; b=DyR4SK1jT4Cv79ml5luV6X4j2ymXsvokPiu0PhbqYn82pUwLkNbZL7iVy9kkFvv9+N wIVejScOovAZrd7A63yukkSGbgXp10zcFLRavJQDnVw4akcR6IIwA4+fyg8opellCA7H goEOZdVSCicZNhrC6E1ZAgPBDxlK87OOx51ajoPeNe0hBQbYOEqMzHzWcBOZWmCaesqg pETl2+Hy76yQBmBXJOjuQGBAQw3BSD6Eo8GLPLtldbU5JhyV6Z1KsFjX36jIuVSG05EL 1LH4BZxYLU2th3HAW1Iy4qxxgbQUzr7nSlCYogIyLwU4VZPeQVw6UORaUtjg9Yz+jaCC nZSA== X-Gm-Message-State: AC+VfDwPiViqr9J+Ff2IC9Hqkrrud3tEy5luWR4a7K/+EpR56PQRDtnt KmXQY6jFUL2MkyhqK3cbmP9uA/BGjtQZbPWRvYM= X-Received: by 2002:adf:de0e:0:b0:311:3ce9:c9fa with SMTP id b14-20020adfde0e000000b003113ce9c9famr549065wrm.3.1687933964381; Tue, 27 Jun 2023 23:32:44 -0700 (PDT) Received: from m1x-phil.lan ([176.187.207.229]) by smtp.gmail.com with ESMTPSA id g11-20020a7bc4cb000000b003fbab76165asm2172185wmk.48.2023.06.27.23.32.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 23:32:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Daniel Henrique Barboza , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PATCH v2 1/4] target/riscv: Remove unused 'instmap.h' header in translate.c Date: Wed, 28 Jun 2023 08:32:31 +0200 Message-Id: <20230628063234.32544-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230628063234.32544-1-philmd@linaro.org> References: <20230628063234.32544-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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, T_SCC_BODY_TEXT_LINE=-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- target/riscv/translate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 98d54c5617..c0379af418 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -30,7 +30,6 @@ #include "exec/log.h" #include "semihosting/semihost.h" -#include "instmap.h" #include "internals.h" #define HELPER_H "helper.h" From patchwork Wed Jun 28 06:32:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 697216 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp4181357wrm; Tue, 27 Jun 2023 23:34:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5e8QIW05ITe32d+OU+pUqD/O58AL6lyWkbqNp7AZGOMCkgDZ9NYCqd6tHR7bOlvgW8QZKN X-Received: by 2002:a05:620a:3725:b0:765:9c48:a933 with SMTP id de37-20020a05620a372500b007659c48a933mr325541qkb.36.1687934061404; Tue, 27 Jun 2023 23:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687934061; cv=none; d=google.com; s=arc-20160816; b=BS0OUxyAvVI/kb8W3b+J7QYVsWHVYsVBlTyinY9sm+Emu3ue4lM0hWYXF7Ub8Hm+7S RlfSr/njbpdaCablqx72FTmx8Qs+qcxdS5+GvcgKEHKYB+Avezz6zrrXY+UucCQtpjwT mi+ZtRo0vtouO5pFXPB+8DK+EYDEE7DcOWIifiJksu57ToMU4JBNO5vWZ1h19pVu7jkN yN1D9jWMVz9DCfbNK0KvcEDJ0SvznZR1Hn+zJTb/bIlkIzcjpZjUKxWwywhjSQFe7cec KlqEmzabcSWS3MxfuekTM6fe627CwRjhD7stSQoP2iY5jrIq69g9EFdjtEuNu9inqUJh +pzQ== 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:cc:to :from:dkim-signature; bh=O0cRK8tGjtjZxpS34d3FV4u4gabHFwB+aSZ5fuDgNn0=; fh=w8WbWO/y/5d1qF1XZLs1bnXIhHguLPbKmLY20PMg0gU=; b=FCp6NsjLw0yhNO2Z5L7eedJxPDr2yhz7CvHnq5GArU765lROlUiN+q8t5ZTGt2QMQJ 4Z/GNzNjo4yqWVjZYMDQt3GHejC8piAAv+sFKNODRnp6dLXLbp40TOBoAYKTsZv8Hzh4 oFJ9Rae30tKjGyp5EcnyvWEl3EaK5buR+WTZHw5m3K4Z1jOhTi0VsXJTUwhr+x1heN6V 4ThMHiCYAoJquZxEzzb5FIYFYOIoP2k+wUneDugilHrR9ydLfPiX72geyUVOh9/mPGwO jJr/zfW2WjyBve2X8YYa/Th4JeZWOfCYVnEChWww3C/RmtktBJ8uERvVVR5zH8An80PN dFyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hSH7ahh6; 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 1-20020ac85741000000b003ff25501b95si2543579qtx.531.2023.06.27.23.34.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 23:34: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=hSH7ahh6; 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 1qEOjX-0002fZ-3v; Wed, 28 Jun 2023 02:32: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 1qEOjV-0002fF-Rx for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:32:53 -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 1qEOjU-0002ut-57 for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:32:53 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fa99742bd1so29200535e9.3 for ; Tue, 27 Jun 2023 23:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687933970; x=1690525970; 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=O0cRK8tGjtjZxpS34d3FV4u4gabHFwB+aSZ5fuDgNn0=; b=hSH7ahh6XuwUwLYDK/dH6lHy0Ub7fB10ajM7djIF0+u6RPIqLk4gfxkXG8SGe2sjCX WtAJ1nCr4DA8NkS5xGoMw8VGVbmxWb33WY/zDulqtrgQ4z6Ir5dqlltHxtDcrQm0fphX nmhAK/22F4kh/zQE+RfFoWg0i+C997jFGXiV4K/2w+Ef4altFDHLhQNMXrlCoUvHtpc0 0Dq9Y4X+IE00xG5NZVIvaM/yJOhp5+a9OcHbIQumcW/UVeF4ItoNNm9dwQdF1JPHF7C2 9Dk7oYiRLUEQd+vVJWO097KAYLUtVm0GrH/zaCsPqq06a44W56nPfKqxeITpHGYJNWVa m+MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687933970; x=1690525970; 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=O0cRK8tGjtjZxpS34d3FV4u4gabHFwB+aSZ5fuDgNn0=; b=LgwnT/UZ8b72ZkY2xgx95UZdvdJSJx9R1me4m5A8hlmmQgplcTcnh6D0gGhH+DbbzS Ha3Pj0d2GCurtoZ4pK1Hj4y7bvSpkKPAqmYxC+2sG/t1vsTO4IBQ1NzbjXTGbuud2FEJ dCgPjHBTgGtp/UPRSi7TZ/eQBYuxWOy6JG6vM/dcCExUixxaDO7ZDPXzmXN5qamFm93s mmrE34JBVl92WFDFP17gPtTl+LB3S3Wx8/P7/CCFrXW6ydgei3FarMq4pxRkOXKI+QZr ul/V3zHUmVerq4bis7UAgZpQj0AjPhXn9GhgjKXprjeBW2UVheEW2DqnNWLMpdWsPpmN 74ng== X-Gm-Message-State: AC+VfDymWfrBV1mSkwPXX2c5xqSLWxnbWlj6r+I+SDUwZkkNrFTusSah 8fw3CujNrb3kxeCRkugbQWL6lUC8aCcaUqXiSMs= X-Received: by 2002:a05:600c:2945:b0:3f9:b31d:5689 with SMTP id n5-20020a05600c294500b003f9b31d5689mr18756638wmd.36.1687933970256; Tue, 27 Jun 2023 23:32:50 -0700 (PDT) Received: from m1x-phil.lan ([176.187.207.229]) by smtp.gmail.com with ESMTPSA id p2-20020adfe602000000b00307c8d6b4a0sm12326202wrm.26.2023.06.27.23.32.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 23:32:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Daniel Henrique Barboza , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PATCH v2 2/4] target/riscv: Restrict sysemu specific header to user emulation Date: Wed, 28 Jun 2023 08:32:32 +0200 Message-Id: <20230628063234.32544-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230628063234.32544-1-philmd@linaro.org> References: <20230628063234.32544-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@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, T_SCC_BODY_TEXT_LINE=-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 8 +++++--- target/riscv/cpu_helper.c | 2 ++ target/riscv/csr.c | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index fb8458bf74..d9a3684b3e 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -23,9 +23,13 @@ #include "qemu/log.h" #include "cpu.h" #include "cpu_vendorid.h" +#ifndef CONFIG_USER_ONLY #include "pmu.h" -#include "internals.h" #include "time_helper.h" +#include "sysemu/kvm.h" +#include "kvm_riscv.h" +#endif +#include "internals.h" #include "exec/exec-all.h" #include "qapi/error.h" #include "qapi/visitor.h" @@ -33,8 +37,6 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "fpu/softfloat-helpers.h" -#include "sysemu/kvm.h" -#include "kvm_riscv.h" #include "tcg/tcg.h" /* RISC-V CPU definitions */ diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 55c36025d7..3c28396eaf 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -28,7 +28,9 @@ #include "tcg/tcg-op.h" #include "trace.h" #include "semihosting/common-semi.h" +#ifndef CONFIG_USER_ONLY #include "sysemu/cpu-timers.h" +#endif #include "cpu_bits.h" #include "debug.h" #include "tcg/oversized-guest.h" diff --git a/target/riscv/csr.c b/target/riscv/csr.c index ea7585329e..e5737dcf58 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -21,8 +21,10 @@ #include "qemu/log.h" #include "qemu/timer.h" #include "cpu.h" +#ifndef CONFIG_USER_ONLY #include "pmu.h" #include "time_helper.h" +#endif #include "qemu/main-loop.h" #include "exec/exec-all.h" #include "exec/tb-flush.h" From patchwork Wed Jun 28 06:32:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 697214 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp4181245wrm; Tue, 27 Jun 2023 23:33:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7E470KcgyL/88ruhMPemFXxN9tF94agQMihVu2MXu1ErsJCcAYv8qBGryogMKFEdXcVy7b X-Received: by 2002:a05:622a:1486:b0:3f9:af04:e9ef with SMTP id t6-20020a05622a148600b003f9af04e9efmr46667734qtx.34.1687934036973; Tue, 27 Jun 2023 23:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687934036; cv=none; d=google.com; s=arc-20160816; b=FU4dFyyHQttMqGxRVs7cFcRbE2vjbkhZvV9c21ioB7vW3bgBrYih+yukCP3uLioJze UFEqawlh/E3IVUyIuh6ZPo8vE39K/KIzzAViiGanSVRmAgevOyADtv4+QVfbmZl2olki AuWXIMvJOqkbuqTUEXcWpO2s8gA4gWww6rvyesQBQRWNETI5acc1UUcKWCmDNyzsUlgG Ilj/zw1TnVpqdrEDVjtG/cBvzp/lhAjEp7NBB/XH0AqlDeeLwniheoPQ7txCrX4KcVp2 XyHJU92ugnjyy9A/XXrYVHYng3uPXOB9n3I4icz9bEycTdhL/AaLtkXewCNIh4aPevAt /wWw== 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:cc:to :from:dkim-signature; bh=E9sCTggNurZWXESMN+if2ZIuv9/6vPN9d2Ktd0eVqSU=; fh=w8WbWO/y/5d1qF1XZLs1bnXIhHguLPbKmLY20PMg0gU=; b=OEb3bVWIJZcbULOc2KYj/eV5hnCVTkZ6X/hf7eRM3iYVJp09PYmfWZ5qdGN49WfivV 1CWr/ZeKFwWznTTB7BQrfs2ryHpSS1gQvkK/J1AgsM4iMmR1qz3pokmvja39f4e1dBTd 6WsMD4O/qZpEzsf2akQ75K0wP6SZ7cLe4QQMBHXrIzt9kDRhszNWxMn5wQUo+/JsEn1/ tlYWq5ogFkCW1LhLJl1bzzFJvyjHYCuFKb7VHUK+6x1AdhQhaZNLuK1xCkc0T2Z0dfFn o/ZjXaxFA1DhqRjEhHxFM6HlfOuJ+UdSLy0daNYoo+1GSNvY8Ev8ue01Ib2NONYoK6CT CogQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gtVJdoC0; 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 c15-20020ac87dcf000000b003ef63934bcbsi3058666qte.424.2023.06.27.23.33.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 23:33: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=gtVJdoC0; 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 1qEOjd-0002gc-MN; Wed, 28 Jun 2023 02:33:01 -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 1qEOjb-0002gI-V3 for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:33:00 -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 1qEOja-0002wV-81 for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:32:59 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fa99b57a38so29997755e9.0 for ; Tue, 27 Jun 2023 23:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687933976; x=1690525976; 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=E9sCTggNurZWXESMN+if2ZIuv9/6vPN9d2Ktd0eVqSU=; b=gtVJdoC0cncKhmmHWybUb/1rphAKZXI8pMfRNpI6R00p14vCl554G8lSpin+j5E1+N mzVTnxWtv6aynUELLt1kYHfjzJla+627dDkUWX0I49Hhbi+pdI7RzE1lvtaQzIp4A/vj f4QU5634OJXonZ4DRZMI/zam6WZqNdCbgnbPzmLQSYBmIgJotNHI/k1TstfbRDTQIGd9 uw5j7AEWWHgsdSuXZ52D4b32M8y8rw+Uh0j8gFOJtcEQ0v39lnNiMH54to3g5NIjrr59 ZJQz82tU7atfg2kXQBWOQMS40b2XzKABBzkh4i4Dx3c0/22ceXXb1KqiDgk5/lOCOA5d Xy1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687933976; x=1690525976; 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=E9sCTggNurZWXESMN+if2ZIuv9/6vPN9d2Ktd0eVqSU=; b=CAdYLVaX7I5BHF101Gy1l+T/HDfjh6YXHkv5hcYAdJmJggTZLo3QFn7TX7i63MHvmJ AMI9DtAOojk0E2k7tXG/NwQuWBJ+7urh1iCGVMFnJJSzJKemKO1ys4ZYgZK+iaay+ylu I+JNjJ6aMETTTQHNNk4BaC6u8yME/gYHKycFjBtzjcB0AQGjwK8lpWGVtJPzRwU1OUhR xq/tFUFjVZUsfrT9aEuoQQLFNJNv8iZckFv10stlL6rrrQRxnRwNwVjPtP1s089uFgQV PZ6vk6Ag0cjt5I+6axHkgTuTSv2lWYLHmAMww4emt/r0Oa2rD4HnQ1Sf2CAn+2JQPold tQHg== X-Gm-Message-State: AC+VfDzw151AruUJf3qxgb/geEgQgGXtlW+B/lPLWL/3Pwnn4jgELEKB 11V6acD/zzDhjy8VD+dFRuE3emClOxGZI4mlPRk= X-Received: by 2002:a05:600c:2184:b0:3fa:770c:5918 with SMTP id e4-20020a05600c218400b003fa770c5918mr11954741wme.9.1687933976509; Tue, 27 Jun 2023 23:32:56 -0700 (PDT) Received: from m1x-phil.lan ([176.187.207.229]) by smtp.gmail.com with ESMTPSA id e10-20020a056000194a00b0031134bcdacdsm12446215wry.42.2023.06.27.23.32.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 23:32:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Daniel Henrique Barboza , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PATCH v2 3/4] target/riscv: Restrict 'rv128' machine to TCG accelerator Date: Wed, 28 Jun 2023 08:32:33 +0200 Message-Id: <20230628063234.32544-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230628063234.32544-1-philmd@linaro.org> References: <20230628063234.32544-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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 We only build for 32/64-bit hosts, so TCG is required for 128-bit targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index d9a3684b3e..5762ff68b4 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -476,6 +476,7 @@ static void rv64_veyron_v1_cpu_init(Object *obj) #endif } +#ifdef CONFIG_TCG static void rv128_base_cpu_init(Object *obj) { if (qemu_tcg_mttcg_enabled()) { @@ -494,7 +495,10 @@ static void rv128_base_cpu_init(Object *obj) set_satp_mode_max_supported(RISCV_CPU(obj), VM_1_10_SV57); #endif } -#else +#endif + +#else /* !TARGET_RISCV64 */ + static void rv32_base_cpu_init(Object *obj) { CPURISCVState *env = &RISCV_CPU(obj)->env; @@ -576,7 +580,7 @@ static void rv32_imafcu_nommu_cpu_init(Object *obj) cpu->cfg.ext_icsr = true; cpu->cfg.pmp = true; } -#endif +#endif /* !TARGET_RISCV64 */ #if defined(CONFIG_KVM) static void riscv_host_cpu_init(Object *obj) @@ -1951,8 +1955,10 @@ static const TypeInfo riscv_cpu_type_infos[] = { DEFINE_CPU(TYPE_RISCV_CPU_SHAKTI_C, rv64_sifive_u_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_THEAD_C906, rv64_thead_c906_cpu_init), DEFINE_CPU(TYPE_RISCV_CPU_VEYRON_V1, rv64_veyron_v1_cpu_init), +#ifdef CONFIG_TCG DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE128, rv128_base_cpu_init), -#endif +#endif /* CONFIG_TCG */ +#endif /* TARGET_RISCV64 */ }; DEFINE_TYPES(riscv_cpu_type_infos) From patchwork Wed Jun 28 06:32:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 697212 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp4181059wrm; Tue, 27 Jun 2023 23:33:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vRO1LokFJcS4QtImnPjlDhaQivVZZznCd17glPJVwk44tPHUhw2aaa/eSTIo4M00ZvHI4 X-Received: by 2002:a05:622a:44b:b0:3fd:e363:ad44 with SMTP id o11-20020a05622a044b00b003fde363ad44mr37179852qtx.30.1687934002107; Tue, 27 Jun 2023 23:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687934002; cv=none; d=google.com; s=arc-20160816; b=oPtws+PIWX+gqrYvPUQ3bWxSfgddTDh5KP8qSO/8gZgRQyARAITnK89sYAQ795oGZn XLZaHPy0ZixcGv77FFt3pFhaGfSKlVY2fJODGTh73jjTTsTOFOi9BE/d1hGd85RPD3sY Ge7Htr0l7HaSfD60Gwn3fIGkb47NFs1uK/Q6zzlDyQS2SSShfONFS2VXXQ9w3/kwlp7A sLt1/htmqDwd4P95jpGvjIYvxYuj/LUX6kfT8C5oMTfPmFTT2vP+O7WBsyVPgMlHWU62 o7TJxv+H5jkaCKGom1ZpURkUMN8tmOWMIPjhGC/ny3zROCDiiV1sKVrci7NiV1MF3q8z ZxVw== 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:cc:to :from:dkim-signature; bh=qC/1GiJPfuuKIOYH9GpoitlcBjboxKTENlQqXK5RUaI=; fh=w8WbWO/y/5d1qF1XZLs1bnXIhHguLPbKmLY20PMg0gU=; b=NAdHqiyj4DR7Et8rzmoaBCMdZ62VFLu8ruIGsGT9LD8IfbDpx/XH+IGecyWSFkOq+7 6sVYh3COFcNso6RlPbX4Oa7CxcldTZFD81hyLG5jizcLzT697Bs5iutXVdQtOxWeaVTW nHrS21m4YK9rua1OxFuljRUgtni5pMTtXl0UXnEoF7Z7ttiuNNv+U0EYB+kjhKyPO37o qDHl/9dK31xhPwjxltNs84twsMtQ2kO37wIg1sTMpab64VhZurzIAKoo2cg6kVrVPk9u T88y9wPmw/G4m6zAbxdpV/Ut6Pq88fs5ZrU/AcDzXrR+goO935/REoIJgwr/QsbYKr2P F8Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qQtobIVJ; 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 c14-20020a05622a024e00b00400a783f75bsi3161439qtx.420.2023.06.27.23.33.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2023 23:33:22 -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=qQtobIVJ; 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 1qEOjp-0002iL-An; Wed, 28 Jun 2023 02:33:14 -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 1qEOji-0002hI-8n for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:33:07 -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 1qEOjg-0002zj-IQ for qemu-devel@nongnu.org; Wed, 28 Jun 2023 02:33:06 -0400 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b44eddb52dso83313161fa.3 for ; Tue, 27 Jun 2023 23:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687933982; x=1690525982; 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=qC/1GiJPfuuKIOYH9GpoitlcBjboxKTENlQqXK5RUaI=; b=qQtobIVJv9S5GZA1akR2od2AX88CrH4D/lYGqelS3VnwsIwBtaBxz3EMSmC1OqcQaN toTS/oOTAsMCVHlKgWV2AhMewHv7QirzBfb0andM+4I6k6P6Gj2xvEDvV1dJaS8DQGML yVesjJwcMGMRxO5P9cOzyPK5RfdY87A0ISWXnLSf8PEpfEQYj2b1r8FZRlxE2heGYYSa oiQkDgDzoLFL6YFGaWDoLtJAu5LMJPUvKaMiJqJXKxGUuVqsoDz9uq+XDPxuVrplpdkg H50RONCYa6/rzFf6ScRDlVQtm3vKu6fYV/muf5J3mOmiPclJozBSD4VhXNYqz5nJesL5 zDPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687933982; x=1690525982; 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=qC/1GiJPfuuKIOYH9GpoitlcBjboxKTENlQqXK5RUaI=; b=CCVXVXPKV7wUVzClH29BUryum69nQfUMID76lIvfKeSQ+/qkfRkfAgV1/JxcSYeaaP mOXsXCSJQyKcjHlzvhdIRGvf58D5G2KB04YTFgSsB61dhEZYrq2g8ZvhPindA1YTGBMI vTAbP9LXxao1na14JKz9Knc1t7nkGPwmTI3xCrJGehuPhP7QoWpuUlygBthOzCXqpHhG miA8YQKOGWzvVN/Lbz7KLqyxGzB0DroKmk7RoKliWFSZGcA1uWcBE3dQgFw2TKRCzz5J n2FVcisV71IKW8T3LPhT8fHVQRZoaradGyeECHzOmdv26YiWUD9OUW+xU5M9zRJBkTT4 yWtQ== X-Gm-Message-State: AC+VfDz6AVdq1hTJuN7eUL2zdQLNsYyQ68B6BeuBA785TdUJHfbXzk1I BHPEvtNfuk46NMTBevfd+YCqXQz0aVhgMg/PCIc= X-Received: by 2002:a05:651c:10c:b0:2b6:a55c:fd72 with SMTP id a12-20020a05651c010c00b002b6a55cfd72mr4449500ljb.37.1687933982566; Tue, 27 Jun 2023 23:33:02 -0700 (PDT) Received: from m1x-phil.lan ([176.187.207.229]) by smtp.gmail.com with ESMTPSA id n23-20020a7bcbd7000000b003f9b19caabesm12837214wmi.37.2023.06.27.23.33.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 23:33:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Daniel Henrique Barboza , qemu-riscv@nongnu.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PATCH v2 4/4] target/riscv: Restrict riscv_cpu_do_interrupt() to sysemu Date: Wed, 28 Jun 2023 08:32:34 +0200 Message-Id: <20230628063234.32544-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230628063234.32544-1-philmd@linaro.org> References: <20230628063234.32544-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=philmd@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, T_SCC_BODY_TEXT_LINE=-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org riscv_cpu_do_interrupt() is not reachable on user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.h | 5 +++-- target/riscv/cpu_helper.c | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index cc20ee25a7..ab6aa7e3ea 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -409,7 +409,6 @@ extern const char * const riscv_int_regnamesh[]; extern const char * const riscv_fpr_regnames[]; const char *riscv_cpu_get_trap_name(target_ulong cause, bool async); -void riscv_cpu_do_interrupt(CPUState *cpu); int riscv_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, DumpState *s); int riscv_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, @@ -442,6 +441,7 @@ void riscv_cpu_validate_set_extensions(RISCVCPU *cpu, Error **errp); #define cpu_mmu_index riscv_cpu_mmu_index #ifndef CONFIG_USER_ONLY +void riscv_cpu_do_interrupt(CPUState *cpu); void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, @@ -465,7 +465,8 @@ void riscv_cpu_set_aia_ireg_rmw_fn(CPURISCVState *env, uint32_t priv, void *rmw_fn_arg); RISCVException smstateen_acc_ok(CPURISCVState *env, int index, uint64_t bit); -#endif +#endif /* !CONFIG_USER_ONLY */ + void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv); void riscv_translate_init(void); diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 3c28396eaf..3f5ba2b4ef 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -1580,7 +1580,6 @@ static target_ulong riscv_transformed_insn(CPURISCVState *env, return xinsn; } -#endif /* !CONFIG_USER_ONLY */ /* * Handle Traps @@ -1590,8 +1589,6 @@ static target_ulong riscv_transformed_insn(CPURISCVState *env, */ void riscv_cpu_do_interrupt(CPUState *cs) { -#if !defined(CONFIG_USER_ONLY) - RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; bool write_gva = false; @@ -1784,6 +1781,6 @@ void riscv_cpu_do_interrupt(CPUState *cs) env->two_stage_lookup = false; env->two_stage_indirect_lookup = false; -#endif - cs->exception_index = RISCV_EXCP_NONE; /* mark handled to qemu */ } + +#endif /* !CONFIG_USER_ONLY */