qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] disas/riscv: Guard dec->cfg dereference for host disasse


From: Richard Henderson
Subject: Re: [PATCH 1/1] disas/riscv: Guard dec->cfg dereference for host disassemble
Date: Fri, 6 Dec 2024 07:36:41 -0600
User-agent: Mozilla Thunderbird

On 12/5/24 22:39, LIU Zhiwei wrote:

Both zcmt and zcmp are not compatible with Zcd, as they reuse some encodings 
from c.fsdsp.

Ok, fair.  A comment about conflicts at that point may help.


Zimop or Zcmop also overlap with other isa extensions, as they are maybe-ops. 
Other extensions
such as zicfiss will reuse their encodings.

I think we had better disassemble them to zicifss if it has been implemented on 
the target cpu. Otherwise
we disassemble them to maybe-ops.

My point is that they are only belong to zimop until they are assigned, like 
zicifss.
At that point they *have* a defined meaning in the standard isa.

So, yes, disassemble as zicifss, but always, not "if it has been implemented in the target cpu".

+        if (((i == 0) || cfg) && guard_func(cfg)) {

This should be i == 0 || (cfg && guard_func(cfg)).

OK. Although I think they are both right.

 i = 0
 cfg = NULL

   (0 == 0 || NULL) && guard_func(NULL)
-> (true || false) && guard_func(NULL)
-> true && guard_func(NULL)
-> guard_func(NULL)
-> boom.

Or are you saying it won't go boom because we happen to know the 0th guard_func only returns true? There's still no reason to call it...


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]