Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pIDJO-0006yK-JC for mharc-qemu-trivial@gnu.org; Wed, 18 Jan 2023 13:37:27 -0500 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 1pIDJF-0006uu-04 for qemu-trivial@nongnu.org; Wed, 18 Jan 2023 13:37:17 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIDJD-00055H-FC for qemu-trivial@nongnu.org; Wed, 18 Jan 2023 13:37:16 -0500 Received: by mail-pf1-x434.google.com with SMTP id w2so11519705pfc.11 for ; Wed, 18 Jan 2023 10:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dDaCUfUgdAQIteC/9iGEwgmtWI88IUGOoB20m9fBcnc=; b=ynAyhyVVH9qkV/R546Q00OK8lFIOlu1NA5bl0gK3ZPncBZm5onB3T5XExBspqOj0je 0bFrJsUe89uVsu9gkHyr9nBgmxmVAdguIPVV89aYt3bPXFeepDpoZYXbX6PerUSzXRPb 5kgg2yqxKtSCKgML/SH1gRbfgcY51kYYuyRM3jSr4uRX1ll0ES/GHgnJp0RuDhL1RmSM DGxdOljdYzyD+JUkRUdDs5cNWl0Cg4MBv0SFwwowWcxWYeyWHMzEi0O9lh9GTnWVdZhm bo+ItA2oFVgDX9A2bMatSUfjUuXLaUaCqhGfWHR39mfXM6+U+KKQRAonWRliUuOJe/Kp JNsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dDaCUfUgdAQIteC/9iGEwgmtWI88IUGOoB20m9fBcnc=; b=j4UDeT89EegokhtK3qI3AvWXTdN8vtKgZURTg+2y5HXiGMmh9pkNSJb9MEiGozkfm1 L4K62pRRL8t8sMTw0sQ4TU87Py6islDBMxKHJ0m2AxVK1g1KwiwAKVGm1/90L+V+OkUF a/IJJPG1YteIy844CkHRlNigLYAh2Ehq1JSDStd2iaLr9gT8l1ugLShBQB0N9w2r708M k3VCJKbju6AmYaJbstWmhIIQ6PmEJUJjoniPUaGM1eASIf5AnctuRgExcun4PwzYWu7s b6hSVqLOOgRMjtUh541Ie264sZDrkxzQ9AdC/d/CyVehxBkmu5n/EuD3XI41thaQ02Ow j2dA== X-Gm-Message-State: AFqh2kqvYP1AK393hM8fOe+n7LrpoJQxoBAzk+b2e37lT3XYHmYakiNu 7MA+0FJcC53hKhdOw9uy0vtUEQ== X-Google-Smtp-Source: AMrXdXtP9tg2YJ+yG//i8ipE7GZFP8WoTTWHwqeBJCRape+Ojq1yM4fxKQfJwaZ5vo/ARviLMWs9Xg== X-Received: by 2002:a05:6a00:4289:b0:583:319a:4425 with SMTP id bx9-20020a056a00428900b00583319a4425mr8371713pfb.29.1674067026171; Wed, 18 Jan 2023 10:37:06 -0800 (PST) Received: from [192.168.5.146] (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id i6-20020aa796e6000000b005884d68d54fsm18797610pfq.1.2023.01.18.10.37.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 10:37:05 -0800 (PST) Message-ID: <226e6b9f-b95f-0198-fb45-eb3407d015d6@linaro.org> Date: Wed, 18 Jan 2023 08:37:01 -1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] target/tricore: Remove unused fields from CPUTriCoreState To: Bastian Koppelmann Cc: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , qemu-devel@nongnu.org, qemu-trivial@nongnu.org References: <20230117184217.83305-1-philmd@linaro.org> <6da18e97-c80e-1ac2-edca-34fb243edd81@linaro.org> <20230118090319.32n4uto7ogy3gfr6@schnipp.zuhause> Content-Language: en-US From: Richard Henderson In-Reply-To: <20230118090319.32n4uto7ogy3gfr6@schnipp.zuhause> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 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, NICE_REPLY_A=-0.089, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2023 18:37:19 -0000 On 1/17/23 23:03, Bastian Koppelmann wrote: > I'm not sure of the purpose of the hflags. I assume they are hidden flags that > hold some hidden state of the emulated CPU. However are privilege levels really > hidden state? At least in the TriCore any guest software can read PSW at any > privilege level and see its own privilige level. Is there a typical usecase when > I would use hflags? I'm sure env->hflags was copied from i386 or mips. It would be used to cache cpu state that is not easy to recompute. There doesn't seem to be any of that in TriCore. > I do wonder why there is the extra step via the flags of a TranslationBlock. Why > can't we sync directly using CPUState? We need the data in the TranslationBlock in order for the data to be hashed and compared, so that we do not attempt to run the same code with the wrong privilege. > I first thought to differentiated the > TranslationBlocks for the different privilege level. However isn't that done > using the softmmu_idx? No, it's not. The only thing that's used to select TranslationBlocks is the data retrieved by cpu_get_tb_cpu_state. > Yes, everything runs in the highest privilege mode. I'll look into properly > implementing privilege levels, but for now we can remove this dead code. Ok. r~