diff mbox series

[24/24] target/ppc: Restrict ppc_cpu_tlb_fill to TCG

Message ID 20210518201146.794854-25-richard.henderson@linaro.org
State Superseded
Headers show
Series target/ppc: Clean up mmu translation | expand

Commit Message

Richard Henderson May 18, 2021, 8:11 p.m. UTC
This function is used by TCGCPUOps, and is thus TCG specific.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/ppc/mmu_helper.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.25.1

Comments

Bruno Piazera Larsen May 20, 2021, 1:18 p.m. UTC | #1
On 18/05/2021 17:11, Richard Henderson wrote:
> This function is used by TCGCPUOps, and is thus TCG specific.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>   target/ppc/mmu_helper.c | 2 ++

>   1 file changed, 2 insertions(+)

>

> diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c

> index 2535ea1836..78e6f7496b 100644

> --- a/target/ppc/mmu_helper.c

> +++ b/target/ppc/mmu_helper.c

> @@ -2964,6 +2964,7 @@ hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)

>       return -1;

>   }

>   

> +#ifdef CONFIG_TCG

>   bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,

>                         MMUAccessType access_type, int mmu_idx,

>                         bool probe, uintptr_t retaddr)

> @@ -2984,3 +2985,4 @@ bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,

>       raise_exception_err_ra(&cpu->env, cs->exception_index,

>                              cpu->env.error_code, retaddr);

>   }

> +#endif


This patch makes it look like we would compile mmu_helper.c after all. 
Is that it? That looks like the simplest solution (ifdef'ing away all 
helpers) but I thought mmu_helper was supposed to have all TCG-only code 
relating to MMU.

-- 

Bruno Piazera Larsen
Instituto de Pesquisas ELDORADO 
<https://www.eldorado.org.br/?utm_campaign=assinatura_de_e-mail&utm_medium=email&utm_source=RD+Station>
Departamento Computação Embarcada
Analista de Software Trainee
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 18/05/2021 17:11, Richard Henderson
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20210518201146.794854-25-richard.henderson@linaro.org">
      <pre class="moz-quote-pre" wrap="">This function is used by TCGCPUOps, and is thus TCG specific.

Signed-off-by: Richard Henderson <a class="moz-txt-link-rfc2396E" href="mailto:richard.henderson@linaro.org">&lt;richard.henderson@linaro.org&gt;</a>

---
 target/ppc/mmu_helper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index 2535ea1836..78e6f7496b 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -2964,6 +2964,7 @@ hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     return -1;
 }
 
+#ifdef CONFIG_TCG
 bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,
                       MMUAccessType access_type, int mmu_idx,
                       bool probe, uintptr_t retaddr)
@@ -2984,3 +2985,4 @@ bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,
     raise_exception_err_ra(&amp;cpu-&gt;env, cs-&gt;exception_index,
                            cpu-&gt;env.error_code, retaddr);
 }
+#endif</pre>
    </blockquote>
    <p>This patch makes it look like we would compile mmu_helper.c after
      all. Is that it? That looks like the simplest solution (ifdef'ing
      away all helpers) but I thought mmu_helper was supposed to have
      all TCG-only code relating to MMU. <br>
    </p>
    <p>-- </p>
    <div class="moz-signature">Bruno Piazera Larsen<br>
      <a
href="https://www.eldorado.org.br/?utm_campaign=assinatura_de_e-mail&amp;utm_medium=email&amp;utm_source=RD+Station">Instituto
        de Pesquisas ELDORADO</a><br>
      Departamento Computação Embarcada<br>
      Analista de Software Trainee<br>
      <a href="https://www.eldorado.org.br/disclaimer.html">Aviso Legal
        - Disclaimer</a></div>
  </body>
</html>
Richard Henderson May 20, 2021, 2:52 p.m. UTC | #2
On 5/20/21 8:18 AM, Bruno Piazera Larsen wrote:
>> +#ifdef CONFIG_TCG

>>   bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,

>>                         MMUAccessType access_type, int mmu_idx,

>>                         bool probe, uintptr_t retaddr)

>> @@ -2984,3 +2985,4 @@ bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,

>>       raise_exception_err_ra(&cpu->env, cs->exception_index,

>>                              cpu->env.error_code, retaddr);

>>   }

>> +#endif

> 

> This patch makes it look like we would compile mmu_helper.c after all. Is that 

> it? That looks like the simplest solution (ifdef'ing away all helpers) but I 

> thought mmu_helper was supposed to have all TCG-only code relating to MMU.


Yes, we will always compile mmu_helper.c. -- it was always going to have the 
stuff for gdbstub.

It was exc_helper which I was hoping for tcg-only (but then we decided that 
ifdefs were going to be the short-term solution).


r~
Bruno Piazera Larsen May 20, 2021, 5:13 p.m. UTC | #3
On 20/05/2021 11:52, Richard Henderson wrote:
> On 5/20/21 8:18 AM, Bruno Piazera Larsen wrote:

>>> +#ifdef CONFIG_TCG

>>>   bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,

>>>                         MMUAccessType access_type, int mmu_idx,

>>>                         bool probe, uintptr_t retaddr)

>>> @@ -2984,3 +2985,4 @@ bool ppc_cpu_tlb_fill(CPUState *cs, vaddr 

>>> eaddr, int size,

>>>       raise_exception_err_ra(&cpu->env, cs->exception_index,

>>>                              cpu->env.error_code, retaddr);

>>>   }

>>> +#endif

>>

>> This patch makes it look like we would compile mmu_helper.c after 

>> all. Is that it? That looks like the simplest solution (ifdef'ing 

>> away all helpers) but I thought mmu_helper was supposed to have all 

>> TCG-only code relating to MMU.

>

> Yes, we will always compile mmu_helper.c. -- it was always going to 

> have the stuff for gdbstub.

>

> It was exc_helper which I was hoping for tcg-only (but then we decided 

> that ifdefs were going to be the short-term solution).

>

Ah, it was just me misremembering then. Well, with this patch and the 
final bits that I hadn't sent with v2 (I didn't want to change 
meson.build without fully supporting disable-tcg) everything is 
compiling, but tests are... spotty, at best

The check-acceptance group of tests only had one test that was passed, 
the tests/acceptance/machine_ppc.py:PpcMachine.test_ppc64_pseries, all 
the others either timed out or failed, and make check got up to 
prom-env-test, which failed and left the whole thing hanging. The fail 
was: ../../tests/qtest/prom-env-test.c:43:check_guest_memory: assertion 
failed (signature == MAGIC): (0x00000000 == 0xcafec0de)

I bring this up because I don't know how much shoul dbe working and how 
much is TCG-only testing which shouldn't be running and we should 
disable for the final patch

-- 
Bruno Piazera Larsen
Instituto de Pesquisas ELDORADO 
<https://www.eldorado.org.br/?utm_campaign=assinatura_de_e-mail&utm_medium=email&utm_source=RD+Station>
Departamento Computação Embarcada
Analista de Software Trainee
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 20/05/2021 11:52, Richard Henderson
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:a363c75c-5b50-5119-f67b-9b860def2151@linaro.org">On
      5/20/21 8:18 AM, Bruno Piazera Larsen wrote:
      <br>
      <blockquote type="cite">
        <blockquote type="cite">+#ifdef CONFIG_TCG
          <br>
            bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,
          <br>
                                  MMUAccessType access_type, int
          mmu_idx,
          <br>
                                  bool probe, uintptr_t retaddr)
          <br>
          @@ -2984,3 +2985,4 @@ bool ppc_cpu_tlb_fill(CPUState *cs,
          vaddr eaddr, int size,
          <br>
                raise_exception_err_ra(&amp;cpu-&gt;env,
          cs-&gt;exception_index,
          <br>
                                       cpu-&gt;env.error_code, retaddr);
          <br>
            }
          <br>
          +#endif
          <br>
        </blockquote>
        <br>
        This patch makes it look like we would compile mmu_helper.c
        after all. Is that it? That looks like the simplest solution
        (ifdef'ing away all helpers) but I thought mmu_helper was
        supposed to have all TCG-only code relating to MMU.
        <br>
      </blockquote>
      <br>
      Yes, we will always compile mmu_helper.c. -- it was always going
      to have the stuff for gdbstub.
      <br>
      <br>
      It was exc_helper which I was hoping for tcg-only (but then we
      decided that ifdefs were going to be the short-term solution).
      <br>
      <br>
    </blockquote>
    <p>Ah, it was just me misremembering then. Well, with this patch and
      the final bits that I hadn't sent with v2 (I didn't want to change
      meson.build without fully supporting disable-tcg) everything is
      compiling, but tests are... spotty, at best</p>
    <p>The check-acceptance group of tests only had one test that was
      passed, the
      tests/acceptance/machine_ppc.py:PpcMachine.test_ppc64_pseries, all
      the others either timed out or failed, and make check got up to
      prom-env-test, which failed and left the whole thing hanging. The
      fail was: ../../tests/qtest/prom-env-test.c:43:check_guest_memory:
      assertion failed (signature == MAGIC): (0x00000000 == 0xcafec0de)<br>
    </p>
    <p>I bring this up because I don't know how much shoul dbe working
      and how much is TCG-only testing which shouldn't be running and we
      should disable for the final patch<br>
    </p>
    <div class="moz-signature">-- <br>
      Bruno Piazera Larsen<br>
      <a
href="https://www.eldorado.org.br/?utm_campaign=assinatura_de_e-mail&amp;utm_medium=email&amp;utm_source=RD+Station">Instituto
        de Pesquisas ELDORADO</a><br>
      Departamento Computação Embarcada<br>
      Analista de Software Trainee<br>
      <a href="https://www.eldorado.org.br/disclaimer.html">Aviso Legal
        - Disclaimer</a></div>
  </body>
</html>
diff mbox series

Patch

diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index 2535ea1836..78e6f7496b 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -2964,6 +2964,7 @@  hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     return -1;
 }
 
+#ifdef CONFIG_TCG
 bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,
                       MMUAccessType access_type, int mmu_idx,
                       bool probe, uintptr_t retaddr)
@@ -2984,3 +2985,4 @@  bool ppc_cpu_tlb_fill(CPUState *cs, vaddr eaddr, int size,
     raise_exception_err_ra(&cpu->env, cs->exception_index,
                            cpu->env.error_code, retaddr);
 }
+#endif