qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [PATCH v3 18/27] target/arm: Restrict semi-hosting to TCG


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-arm] [PATCH v3 18/27] target/arm: Restrict semi-hosting to TCG
Date: Mon, 1 Jul 2019 18:10:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 7/1/19 5:38 PM, Philippe Mathieu-Daudé wrote:
> On 7/1/19 5:25 PM, Peter Maydell wrote:
>> On Mon, 1 Jul 2019 at 14:26, Philippe Mathieu-Daudé <address@hidden> wrote:
>>>
>>> Per Peter Maydell:
>>>
>>>   Semihosting hooks either SVC or HLT instructions, and inside KVM
>>>   both of those go to EL1, ie to the guest, and can't be trapped to
>>>   KVM.
>>>
>>> Let check_for_semihosting() return False when not running on TCG.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>>> ---
>>> v3: inline call to g_assert_not_reached if !TCG
>>> ---
>>>  target/arm/Makefile.objs | 2 +-
>>>  target/arm/cpu.h         | 7 +++++++
>>>  target/arm/helper.c      | 4 +++-
>>>  3 files changed, 11 insertions(+), 2 deletions(-)
>>
>>> diff --git a/target/arm/helper.c b/target/arm/helper.c
>>> index 49a0f05cd1..1b4da7aa45 100644
>>> --- a/target/arm/helper.c
>>> +++ b/target/arm/helper.c
>>> @@ -20,7 +20,6 @@
>>>  #include "qemu/qemu-print.h"
>>>  #include "exec/exec-all.h"
>>>  #include "exec/cpu_ldst.h"
>>> -#include "arm_ldst.h"
>>>  #include <zlib.h> /* For crc32 */
>>>  #include "hw/semihosting/semihost.h"
>>>  #include "sysemu/cpus.h"
>>> @@ -29,6 +28,9 @@
>>>  #include "qapi/qapi-commands-target.h"
>>>  #include "qapi/error.h"
>>>  #include "qemu/guest-random.h"
>>> +#ifdef CONFIG_TCG
>>> +#include "arm_ldst.h"
>>> +#endif
>>
>> Should this ifdeffing of the arm_ldst.h include have gone in
>> another patch? It doesn't seem related to the change described
>> in the commit message.
> 
> Surely patch 22 "Move M profile routines to m_helper.c"

The ifdef belongs to this patch, but some part of this patch slipped to
"Move M profile routines to m_helper.c" while rebasing:

-- >8 --
@@ -10401,6 +8260,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState
*cs)

 static inline bool check_for_semihosting(CPUState *cs)
 {
+#ifdef CONFIG_TCG
     /* Check whether this exception is a semihosting call; if so
      * then handle it and return true; otherwise return false.
      */
@@ -10476,6 +8336,9 @@ static inline bool check_for_semihosting(CPUState
*cs)
         env->regs[0] = do_arm_semihosting(env);
         return true;
     }
+#else
+    return false;
+#endif
 }
---

check_for_semihosting() is the only code using the ldst API.

Thanks for noticing this,

Phil.



reply via email to

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