Cran
; Hernandez Miramontes, Jose Miguel
*Cc:* Kinney, Michael D
*Subject:* RE: [edk2-devel] CpuDeadLoop() is optimized by compiler
Right. But if you break in with debugger, you can still skip over the
jmp instruction and continue.
I agree XIP does not allow variable value to be updated, but we
31, 2023 1:31 AM
To: Kinney, Michael D ; Andrew (EFI) Fish
; edk2-devel-groups-io ; Rebecca Cran
; Hernandez Miramontes, Jose Miguel
Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
Mike,
This is not friendly for XIP code. With XIP code, the global variable is not
able to be
-groups-io ; Rebecca Cran ;
Hernandez Miramontes, Jose Miguel
Cc: Kinney, Michael D
Subject: RE: [edk2-devel] CpuDeadLoop() is optimized by compiler
Does using a static volatile global instead of a volatile local work?
Mike
From: Ni, Ray
Sent: Monday, October 30, 2023 7:52 PM
To: Andrew
2.groups.io>>;
Rebecca Cran mailto:rebe...@bsdio.com>>
Cc: Ni, Ray mailto:ray...@intel.com>>; Kinney, Michael D
mailto:michael.d.kin...@intel.com>>
Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
I don't think the atomic is going to help. The compiler ho
t find a dead-loop intrinsic function in MSVC.
Any better idea?
Thanks,
Ray
*From:* Andrew (EFI) Fish
*Sent:* Friday, May 19, 2023 8:42 AM
*To:* devel@edk2.groups.io; Kinney, Michael D
*Cc:* Ni, Ray ; Rebecca Cran
*Subject:* Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
Mike,
So
ter idea?
>>
>> Thanks,
>>
>> Ray
>>
>> *From:* Andrew (EFI) Fish
>> *Sent:* Friday, May 19, 2023 8:42 AM
>> *To:* devel@edk2.groups.io; Kinney, Michael D
>> *Cc:* Ni, Ray ; Rebecca Cran
>> *Subject:* Re: [edk2-devel] CpuDeadLoop()
I've submitted a bug report at
https://developercommunity.visualstudio.com/t/x64-codegen-with-optimizations-wrong-for/10369557
.
--
Rebecca Cran
On 5/19/23 09:31, Rebecca Cran wrote:
Just to add more data, I also tried with "volatile sig_atomic_t" as
someone suggested and both "/volatile:i
Thanks,
Ray
*From:* Andrew (EFI) Fish
*Sent:* Friday, May 19, 2023 8:42 AM
*To:* devel@edk2.groups.io; Kinney, Michael D
*Cc:* Ni, Ray ; Rebecca Cran
*Subject:* Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
Mike,
Sorry static was just to scope the name to the file since it is a lib
ps.io; Kinney, Michael D
CC: Rebecca Cran
Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
I think all the options we considered are workarounds. These might break again
if compiler is “cleverer” in future. Unless some Cxx spec clearly guarantees
that.
I like Mike’s idea to use ass
-loop intrinsic function in MSVC.
Any better idea?
Thanks,
Ray
From: Andrew (EFI) Fish
Sent: Friday, May 19, 2023 8:42 AM
To: devel@edk2.groups.io; Kinney, Michael D
Cc: Ni, Ray ; Rebecca Cran
Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
Mike,
Sorry static was just to
f...@apple.com>>
> Sent: Thursday, May 18, 2023 1:45 PM
> To: edk2-devel-groups-io <mailto:devel@edk2.groups.io>>; Andrew Fish <mailto:af...@apple.com>>
> Cc: Kinney, Michael D <mailto:michael.d.kin...@intel.com>>; Ni, Ray <mailto:ray...@intel.com>
0_1
ret
Mike
From: Andrew (EFI) Fish
Sent: Thursday, May 18, 2023 1:45 PM
To: edk2-devel-groups-io ; Andrew Fish
Cc: Kinney, Michael D ; Ni, Ray ;
Rebecca Cran
Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
Whoops wrong compiler. Here is an update. I added the flags so this
gt;>> When deadloop is entered, developer can not change value of mDeadLoopCount,
>>> but they can use debugger to force exit loop and return from function.
>>>
>>> Mike
>>>
>>>
>>> From: Andrew (EFI) Fish mailto:af...@apple.com>>
>>
ilto:af...@apple.com>>
>> Sent: Thursday, May 18, 2023 10:09 AM
>> To: Kinney, Michael D > <mailto:michael.d.kin...@intel.com>>
>> Cc: edk2-devel-groups-io > <mailto:devel@edk2.groups.io>>; Ni, Ray > <mailto:ray...@intel.com>>; Rebecca
Rebecca,
It looks like VC++ is trying to honor the volatile by reading the variable,
incase that has side effects. But the loop is not checking the value of the
variable and it is just doing an unconditional jump. This is why I think it is
likely a compiler bug. Since the compiler emitted a har
When I use CpuDeadLoop for debugging on Aarch64 I have symbols loaded so I can
just do ‘set Index=1’ and resume, but it sounds like the issue is that people
want to sometimes debug without symbols/source, and the generated assembly is
making that difficult.
Rebecca
On Thu, May 18, 2023, at 9:3
, May 18, 2023 10:09 AM
> To: Kinney, Michael D <mailto:michael.d.kin...@intel.com>>
> Cc: edk2-devel-groups-io <mailto:devel@edk2.groups.io>>; Ni, Ray <mailto:ray...@intel.com>>; Rebecca Cran <mailto:rebe...@bsdio.com>>
> Subject: Re: [edk2-devel]
May 18, 2023 10:09 AM
> To: Kinney, Michael D
> Cc: edk2-devel-groups-io ; Ni, Ray ;
> Rebecca Cran
> Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
>
> Mike,
>
> Good point, that is why we are using the stack ….
>
> The only other thing I can think of i
mDeadLoopCount, but
they can use debugger to force exit loop and return from function.
Mike
From: Andrew (EFI) Fish
Sent: Thursday, May 18, 2023 10:09 AM
To: Kinney, Michael D
Cc: edk2-devel-groups-io ; Ni, Ray ;
Rebecca Cran
Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
ney, Michael D
> wrote:
>
> Static global will not work for XIP
>
> Mike
>
> From: Andrew (EFI) Fish
> Sent: Thursday, May 18, 2023 9:49 AM
> To: edk2-devel-groups-io ; Kinney, Michael D
>
> Cc: Ni, Ray ; Rebecca Cran
> Subject: Re: [edk2-devel]
Static global will not work for XIP
Mike
From: Andrew (EFI) Fish
Sent: Thursday, May 18, 2023 9:49 AM
To: edk2-devel-groups-io ; Kinney, Michael D
Cc: Ni, Ray ; Rebecca Cran
Subject: Re: [edk2-devel] CpuDeadLoop() is optimized by compiler
Mike,
I pinged some compiler experts to see if our
Mike,
I pinged some compiler experts to see if our code is correct, or if the
compiler has an issue. Seems to be trending compiler issue right now, but I’ve
NOT gotten feedback from anyone on the spec committee yet.
If we move Index to a static global that would likely work around the compiler
Hi Ray,
So the code generated does deadloop, but is just not easy to resume from as we
have been able to do in the past.
We use CpuDeadloop() for 2 purposes. One is a terminal condition with no
reason to ever continue.
The 2nd is a debug aide for developers to halt the system at a specific
l
On Thu, May 18, 2023 at 10:59 AM Ni, Ray wrote:
>
> Hi,
>
> Starting from certain version of Visual Studio C compiler (I don’t have the
> exact version. I am using VS2019), CpuDeadLoop is now optimized quite well by
> compiler.
>
>
>
> The optimization is so “good” that it becomes harder for dev
Hi,
Starting from certain version of Visual Studio C compiler (I don't have the
exact version. I am using VS2019), CpuDeadLoop is now optimized quite well by
compiler.
The optimization is so "good" that it becomes harder for developers to break
out of the deadloop.
I copied the assembly instru
25 matches
Mail list logo