arch = VIR_ARCH_X86_64;
} else if (STREQ(ut.machine, "arm64")) {
arch = VIR_ARCH_AARCH64;
+ } else if (STREQ(ut.machine, "loongarch64")) {
+ arch = VIR_ARCH_LOONGARCH64;
} else {
/* Otherwise assume the canonical name */
if ((arch = virArchFromString(ut.machine)) == VIR_ARCH_NONE) {
prefix = "clock";
else if (ARCH_IS_S390(arch))
prefix = "cpu MHz dynamic";
+ else if (ARCH_IS_LOONGARCH(arch))
+ prefix = "CPU MHz";
if (!prefix) {
VIR_WARN("%s is not supported by the %s parser",
char *str;
char *endptr;
- if (!(str = STRSKIP(line, "address sizes")))
+ if (!(str = STRCASESKIP(line, "address sizes")))
continue;
/* Skip the colon. */
{
g_autoptr(FILE) cpuinfo = NULL;
- if (!(ARCH_IS_X86(hostArch) || ARCH_IS_SH4(hostArch))) {
+ if (!(ARCH_IS_X86(hostArch) || ARCH_IS_SH4(hostArch) ||
+ ARCH_IS_LOONGARCH(hostArch))) {
/* Ensure size is set to 0 as physical address size is unknown */
*size = 0;
return 0;
#elif !defined(WIN32) && \
(defined(__x86_64__) || \
defined(__i386__) || \
- defined(__amd64__))
+ defined(__amd64__) || \
+ defined(__loongarch__))
return virSysinfoReadDMI();
#else /* WIN32 || not supported arch */
/*