Re: [PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-23 Thread Jan Beulich
On 23.04.2024 12:27, Andrew Cooper wrote: > On 23/04/2024 10:17 am, Jan Beulich wrote: >> On 22.04.2024 20:14, Andrew Cooper wrote: >>> --- /dev/null >>> +++ b/xen/arch/x86/x86_emulate/decode-lite.c >>> @@ -0,0 +1,245 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-only */ >>> + >>> +#include

Re: [PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-23 Thread Andrew Cooper
On 23/04/2024 10:17 am, Jan Beulich wrote: > On 22.04.2024 20:14, Andrew Cooper wrote: >> --- /dev/null >> +++ b/xen/arch/x86/x86_emulate/decode-lite.c >> @@ -0,0 +1,245 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> + >> +#include "private.h" >> + >> +#define Imm8 (1 << 0) >> +#define

Re: [PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-23 Thread Jan Beulich
On 22.04.2024 20:14, Andrew Cooper wrote: > In order to relocate all IP-relative fields in an alternative replacement > block, we need to decode the instructions enough to obtain their length and > any relative fields. > > Full x86_decode() is far too heavyweight, so introduce a minimal form

[PATCH 1/6] x86: Introduce x86_decode_lite()

2024-04-22 Thread Andrew Cooper
In order to relocate all IP-relative fields in an alternative replacement block, we need to decode the instructions enough to obtain their length and any relative fields. Full x86_decode() is far too heavyweight, so introduce a minimal form which can make several simplifying assumptions. This