[Top][All Lists]

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

Re: [PATCH 10/29] tcg_funcs: Add tlb_flush to TCGModuleOps

From: Richard Henderson
Subject: Re: [PATCH 10/29] tcg_funcs: Add tlb_flush to TCGModuleOps
Date: Wed, 29 Sep 2021 06:35:45 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/29/21 3:09 AM, Gerd Hoffmann wrote:
TODO: Not sure whenever "check function pointer before call" or
"function pointers to stubs" is better.  Right now the patch has both
which clearly doesn't make sense.  Comments on that are welcome.

I guess I don't mind either way, but we do need to pick one.

--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -25,6 +25,7 @@
  #include "exec/cpu_ldst.h"
  #include "sysemu/cpu-timers.h"
+#include "tcg/tcg-module.h"

Surely not required here.

+ * tlb_flush:
+ * @cpu: CPU whose TLB should be flushed
+ *
+ * Flush the entire TLB for the specified CPU. Most CPU architectures
+ * allow the implementation to drop entries from the TLB at any time
+ * so this is generally safe. If more selective flushing is required
+ * use one of the other functions for efficiency.
+ */
+void tlb_flush(CPUState *cpu);
  #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)

Going too far here, since CONFIG_USER_ONLY always uses TCG, never uses modules, and does not implement a softmmu tlb that requires flushing. I think you can just change the ifdef to remove the CONFIG_TCG check.

Alternately, we could keep this slight inefficiency to fix...

+/* This is a wrapper for common code that can not use CONFIG_SOFTMMU */
+void tcg_flush_softmmu_tlb(CPUState *cs)
+    tlb_flush(cs);

... this bit of silliness.


reply via email to

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