summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/32bit.cc
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-01-31 14:44:50 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-31 14:45:47 -0800
commit04cccaaeeed22a28a42fc4c1406b43a966a5d886 (patch)
tree22b75aa7a95cb97bdf8b820fc1d451a40448167c /test/syscalls/linux/32bit.cc
parent6c3072243dfbf70062de5f610e14fd6ed2ce5f32 (diff)
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
Diffstat (limited to 'test/syscalls/linux/32bit.cc')
-rw-r--r--test/syscalls/linux/32bit.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/syscalls/linux/32bit.cc b/test/syscalls/linux/32bit.cc
index 2751fb4e7..9883aef61 100644
--- a/test/syscalls/linux/32bit.cc
+++ b/test/syscalls/linux/32bit.cc
@@ -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),