Fix logic around AMD/Intel cases.

If the support is Ignored, then the call is still executed. We
simply rely on it to fall through to the int3. Therefore, we
must also bail on the vendor check.

PiperOrigin-RevId: 292620558
This commit is contained in:
Adin Scannell
2020-01-31 14:45:47 -08:00
committed by gVisor bot
parent 6c3072243d
commit 04cccaaeee
+4 -2
View File
@@ -102,7 +102,8 @@ TEST(Syscall32Bit, Int80) {
}
TEST(Syscall32Bit, Sysenter) {
if (PlatformSupport32Bit() == PlatformSupport::Allowed &&
if ((PlatformSupport32Bit() == PlatformSupport::Allowed ||
PlatformSupport32Bit() == PlatformSupport::Ignored) &&
GetCPUVendor() == CPUVendor::kAMD) {
// SYSENTER is an illegal instruction in compatibility mode on AMD.
EXPECT_EXIT(ExitGroup32(kSysenter, kExitCode),
@@ -133,7 +134,8 @@ TEST(Syscall32Bit, Sysenter) {
}
TEST(Syscall32Bit, Syscall) {
if (PlatformSupport32Bit() == PlatformSupport::Allowed &&
if ((PlatformSupport32Bit() == PlatformSupport::Allowed ||
PlatformSupport32Bit() == PlatformSupport::Ignored) &&
GetCPUVendor() == CPUVendor::kIntel) {
// SYSCALL is an illegal instruction in compatibility mode on Intel.
EXPECT_EXIT(ExitGroup32(kSyscall, kExitCode),