Re: [PATCH] hvf: guard xgetbv call.

2021-01-12 Thread Richard Henderson
On 1/11/21 9:49 PM, Roman Bolshakov wrote: >> I would have xgetbv and all of the cpuid values cached at startup, and all >> three places would read global variables. >> > > It makes sense, thanks for the clarification. > > Do you think it should be part of the change Hill is doing or it might > b

Re: [PATCH] hvf: guard xgetbv call.

2021-01-11 Thread Roman Bolshakov
On Mon, Jan 11, 2021 at 07:06:22AM -1000, Richard Henderson wrote: > On 1/10/21 6:31 PM, Roman Bolshakov wrote: > >> Also, if we're going to put this some place common, forcing the caller to > >> do > >> the cpuid that feeds this, then we should probably make all of the startup > >> cpuid stuff co

Re: [PATCH] hvf: guard xgetbv call.

2021-01-11 Thread Richard Henderson
On 1/10/21 6:31 PM, Roman Bolshakov wrote: >> Also, if we're going to put this some place common, forcing the caller to do >> the cpuid that feeds this, then we should probably make all of the startup >> cpuid stuff common as well. >> > > I proposed the version because all callers of xgetbv instru

Re: [PATCH] hvf: guard xgetbv call.

2021-01-10 Thread Roman Bolshakov
On Sun, Jan 10, 2021 at 08:38:36AM -1000, Richard Henderson wrote: > On 1/10/21 8:34 AM, Richard Henderson wrote: > > On 1/9/21 3:46 PM, Roman Bolshakov wrote: > >> +static int xgetbv(uint32_t cpuid_ecx, uint32_t idx, uint64_t *xcr) > >> { > >> -uint32_t eax, edx; > >> +uint32_t xcrl, xcrh

Re: [PATCH] hvf: guard xgetbv call.

2021-01-10 Thread Richard Henderson
On 1/10/21 8:34 AM, Richard Henderson wrote: > On 1/9/21 3:46 PM, Roman Bolshakov wrote: >> +static int xgetbv(uint32_t cpuid_ecx, uint32_t idx, uint64_t *xcr) >> { >> -uint32_t eax, edx; >> +uint32_t xcrl, xcrh; >> >> -__asm__ volatile ("xgetbv" >> - : "=a" (eax),

Re: [PATCH] hvf: guard xgetbv call.

2021-01-10 Thread Richard Henderson
On 1/9/21 3:46 PM, Roman Bolshakov wrote: > +static int xgetbv(uint32_t cpuid_ecx, uint32_t idx, uint64_t *xcr) > { > -uint32_t eax, edx; > +uint32_t xcrl, xcrh; > > -__asm__ volatile ("xgetbv" > - : "=a" (eax), "=d" (edx) > - : "c" (xcr)); >

Re: [PATCH] hvf: guard xgetbv call.

2021-01-09 Thread Roman Bolshakov
On Sat, Jan 09, 2021 at 11:42:18AM +, Peter Maydell wrote: > On Sat, 9 Jan 2021 at 05:49, Roman Bolshakov wrote: > > > > On Fri, Dec 18, 2020 at 06:13:47PM -0800, Hill Ma wrote: > > > This prevents illegal instruction on cpus do not support xgetbv. > > > > > > Buglink: https://bugs.launchpad.n

Re: [PATCH] hvf: guard xgetbv call.

2021-01-09 Thread Peter Maydell
On Sat, 9 Jan 2021 at 05:49, Roman Bolshakov wrote: > > On Fri, Dec 18, 2020 at 06:13:47PM -0800, Hill Ma wrote: > > This prevents illegal instruction on cpus do not support xgetbv. > > > > Buglink: https://bugs.launchpad.net/qemu/+bug/1758819 > > Signed-off-by: Hill Ma > > --- > > target/i386/h

Re: [PATCH] hvf: guard xgetbv call.

2021-01-08 Thread Roman Bolshakov
On Fri, Dec 18, 2020 at 06:13:47PM -0800, Hill Ma wrote: > This prevents illegal instruction on cpus do not support xgetbv. > > Buglink: https://bugs.launchpad.net/qemu/+bug/1758819 > Signed-off-by: Hill Ma > --- > target/i386/hvf/x86_cpuid.c | 11 --- > 1 file changed, 8 insertions(+),

[PATCH] hvf: guard xgetbv call.

2020-12-19 Thread Hill Ma
This prevents illegal instruction on cpus do not support xgetbv. Buglink: https://bugs.launchpad.net/qemu/+bug/1758819 Signed-off-by: Hill Ma --- target/i386/hvf/x86_cpuid.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target/i386/hvf/x86_cpuid.c b/target/i386/