Bug #77357 [Fbk->Csd]: base64_encode / base64_decode doest not work on nested VM

From: Date: Fri, 04 Jan 2019 08:09:19 +0000
Subject: Bug #77357 [Fbk->Csd]: base64_encode / base64_decode doest not work on nested VM
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218786@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77357&edit=1 ID: 77357 Updated by: nikic@php.net Reported by: hsiangjen at gmail dot com Summary: base64_encode / base64_decode doest not work on nested VM -Status: Feedback +Status: Closed Type: Bug Package: *General Issues Operating System: Windows 2012R2 PHP Version: 7.3.0 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: Thanks for the confirmation! Previous Comments: ------------------------------------------------------------------------ [2019-01-04 02:38:57] hsiangjen at gmail dot com It works for snapshot build revision r5a361c3. Thank you very much for your quick response. ------------------------------------------------------------------------ [2019-01-03 09:28:24] nikic@php.net I've committed a possible fix at https://github.com/php/php-src/commit/5a361c3a54c055cdf7088e76aa8efa159334e096. If you could try a snapshot build with this change (once it is available at https://windows.php.net/snapshots/), that would be great. ------------------------------------------------------------------------ [2019-01-03 09:19:37] nikic@php.net Okay, I think I see what the issue is. We're not using CPUID correctly. Here is (what I guess) is happening: * We're calling CPUID with EAX 7, which is above the maximum basic CPUID level of 4 supported by your CPU. * Per Intel instruction set reference, "If a value entered for CPUID.EAX is higher than the maximum input value for basic or extended function for that processor then the data for the highest basic information leaf is returned." * This means we get back the level 4 information. * AVX2 support if bit 5 of EBX at level 7, while bits 0-11 of EBX at level 4 are the System Cache Coherence Size minus one. As this is probably a power of 2 >= 64, bit 5 will be set. We should not be calling CPUID with values above the maximum basic function. ------------------------------------------------------------------------ [2019-01-03 09:08:02] spam2 at rhsoft dot net https://superuser.com/questions/453786/how-do-i-get-avx-support-in-qemu is about AVX not passed to the guest which in fact happens on your guest given "Instructions sets MMX, SSE, SSE2, SSE3, EM64T, VT-x" but in that case PHP must not use the instructions ------------------------------------------------------------------------ [2019-01-03 09:01:14] hsiangjen at gmail dot com Thank you for the help. I guess since I am under KVM virtual machine enviornment. The CPU AVX instruction does not passvia to the guest level by default. I will bootup a Linux guest machine to try it also. Maybe the isseu is like this: https://superuser.com/questions/453786/how-do-i-get-avx-support-in-qemu ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=77357 -- Edit this bug report at https://bugs.php.net/bug.php?id=77357&edit=1

« previous php.bugs (#218786) next »