|
| From: | Richard Henderson |
| Subject: | Re: [PATCH v14 02/26] target/loongarch: Add core definition |
| Date: | Sun, 9 Jan 2022 10:49:29 -0800 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 1/9/22 1:25 AM, WANG Xuerui wrote:
Aren't we capable of page sizes up to 64KiB? Minimal feasible page size is indeed 16KiB though (due to cache aliasing, although 4KiB pages are supported in hardware, they don't work in practice).+#define TARGET_PAGE_BITS 14
You must use the minimal page size here. 64k pages would be handled solely within tlb_fill, as multiples of the minimal page size.
+static bool loongarch_cpu_has_work(CPUState *cs) +{ + return true;Note: this is only applicable to CONFIG_USER_ONLY, and needs to be changed in the following commits adding system emulation. To better convey your intention it may be better to use an #ifdef guard, something like this:#ifndef CONFIG_USER_ONLY #error System emulation TODO #else return true; #endif(I'm not sure if this is okay in QEMU coding style, so please correct me if this isn't the case.)
Prefer positive tests over negative tests, so
#ifdef CONFIG_USER_ONLY
return true;
#else
#error
#endif
Do you support the SPW extension in this series? If not you probably don't want to set this bit.+ data = FIELD_DP32(data, CPUCFG2, LSPW, 1);
Correct, you can't expose features that you don't implement.
Similarly, do we explain every field with comments *here*? I think if fields are named according to the manuals, people will naturally look up names there so there's no worry for misunderstanding.+ uint64_t lladdr; /* LL virtual address compared against SC */+ uint64_t llval;
These two fields are not architectural, so they do require explanation. Not that there aren't other targets that lack this documentation...
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |