x86: Add a cpuid command

It is useful to obtain the results of cpuid queries, so add a command
for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/test/cmd/Makefile b/test/cmd/Makefile
index dbee9b2..302c748 100644
--- a/test/cmd/Makefile
+++ b/test/cmd/Makefile
@@ -12,6 +12,7 @@
 obj-$(CONFIG_CMD_PAUSE) += test_pause.o
 endif
 obj-y += exit.o mem.o
+obj-$(CONFIG_X86) += cpuid.o
 obj-$(CONFIG_CMD_ADDRMAP) += addrmap.o
 obj-$(CONFIG_CMD_BDI) += bdinfo.o
 obj-$(CONFIG_CMD_FDT) += fdt.o
diff --git a/test/cmd/cpuid.c b/test/cmd/cpuid.c
new file mode 100644
index 0000000..e07f5fd
--- /dev/null
+++ b/test/cmd/cpuid.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Tests for cpuid command
+ *
+ * Copyright 2024 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#include <test/cmd.h>
+#include <test/ut.h>
+
+static int cmd_test_cpuid(struct unit_test_state *uts)
+{
+	ut_assertok(run_commandf("cpuid 1"));
+	ut_assert_nextline("eax 00060fb1");
+	ut_assert_nextline("ebx 00000800");
+	ut_assert_nextline("ecx 80002001");
+	ut_assert_nextline("edx 078bfbfd");
+
+	return 0;
+}
+CMD_TEST(cmd_test_cpuid, UTF_CONSOLE);