- riscv64
- s390x
- armvl7, arm64
+- loongarch64
LXC also supports at least the following C standard libraries:
;;
--arch | -a )
# https://github.com/lxc/lxc/blob/stable-4.0/src/tests/arch_parse.c#L37
- COMPREPLY=( $( compgen -W 'arm armel armhf armv7l athlon i386 i486 i586 i686 linux32 mips mipsel ppc powerpc x86 aarch64 amd64 arm64 linux64 mips64 mips64el ppc64 ppc64el ppc64le powerpc64 riscv64 s390x x86_64' -- "${cur}" ) )
+ COMPREPLY=( $( compgen -W 'arm armel armhf armv7l athlon i386 i486 i586 i686 linux32 mips mipsel ppc powerpc x86 aarch64 amd64 arm64 linux64 loongarch64 mips64 mips64el ppc64 ppc64el ppc64le powerpc64 riscv64 s390x x86_64' -- "${cur}" ) )
return
;;
--elevated-privileges | -e )
char *name;
unsigned long per;
} pername[] = {
- { "arm", PER_LINUX32 },
- { "armel", PER_LINUX32 },
- { "armhf", PER_LINUX32 },
- { "armv7l", PER_LINUX32 },
- { "athlon", PER_LINUX32 },
- { "i386", PER_LINUX32 },
- { "i486", PER_LINUX32 },
- { "i586", PER_LINUX32 },
- { "i686", PER_LINUX32 },
- { "linux32", PER_LINUX32 },
- { "mips", PER_LINUX32 },
- { "mipsel", PER_LINUX32 },
- { "ppc", PER_LINUX32 },
- { "powerpc", PER_LINUX32 },
- { "x86", PER_LINUX32 },
- { "aarch64", PER_LINUX },
- { "amd64", PER_LINUX },
- { "arm64", PER_LINUX },
- { "linux64", PER_LINUX },
- { "mips64", PER_LINUX },
- { "mips64el", PER_LINUX },
- { "ppc64", PER_LINUX },
- { "ppc64el", PER_LINUX },
- { "ppc64le", PER_LINUX },
- { "powerpc64", PER_LINUX },
- { "riscv64", PER_LINUX },
- { "s390x", PER_LINUX },
- { "x86_64", PER_LINUX },
+ { "arm", PER_LINUX32 },
+ { "armel", PER_LINUX32 },
+ { "armhf", PER_LINUX32 },
+ { "armv7l", PER_LINUX32 },
+ { "athlon", PER_LINUX32 },
+ { "i386", PER_LINUX32 },
+ { "i486", PER_LINUX32 },
+ { "i586", PER_LINUX32 },
+ { "i686", PER_LINUX32 },
+ { "linux32", PER_LINUX32 },
+ { "mips", PER_LINUX32 },
+ { "mipsel", PER_LINUX32 },
+ { "ppc", PER_LINUX32 },
+ { "powerpc", PER_LINUX32 },
+ { "x86", PER_LINUX32 },
+ { "aarch64", PER_LINUX },
+ { "amd64", PER_LINUX },
+ { "arm64", PER_LINUX },
+ { "linux64", PER_LINUX },
+ { "loongarch64", PER_LINUX },
+ { "mips64", PER_LINUX },
+ { "mips64el", PER_LINUX },
+ { "ppc64", PER_LINUX },
+ { "ppc64el", PER_LINUX },
+ { "ppc64le", PER_LINUX },
+ { "powerpc64", PER_LINUX },
+ { "riscv64", PER_LINUX },
+ { "s390x", PER_LINUX },
+ { "x86_64", PER_LINUX },
};
for (size_t i = 0; i < ARRAY_SIZE(pername); i++) {
lxc_seccomp_arch_mipsel64n32,
lxc_seccomp_arch_s390x,
lxc_seccomp_arch_s390,
+ lxc_seccomp_arch_loongarch64,
lxc_seccomp_arch_unknown = 999,
};
return lxc_seccomp_arch_s390x;
else if (strnequal(uts.machine, "s390", 4))
return lxc_seccomp_arch_s390;
+ else if (strnequal(uts.machine, "loongarch64", 11))
+ return lxc_seccomp_arch_loongarch64;
return lxc_seccomp_arch_unknown;
}
case lxc_seccomp_arch_s390:
arch = SCMP_ARCH_S390;
break;
+#endif
+#ifdef SCMP_ARCH_LOONGARCH64
+ case lxc_seccomp_arch_loongarch64:
+ arch = SCMP_ARCH_LOONGARCH64;
+ break;
#endif
default:
return NULL;
cur_rule_arch = lxc_seccomp_arch_s390;
}
+#endif
+#ifdef SCMP_ARCH_LOONGARCH64
+ else if (strequal(line, "[loongarch64]") ||
+ strequal(line, "[LOONGARCH64]")) {
+ if (native_arch != lxc_seccomp_arch_loongarch64) {
+ cur_rule_arch = lxc_seccomp_arch_unknown;
+ continue;
+ }
+
+ cur_rule_arch = lxc_seccomp_arch_loongarch64;
+ }
#endif
else {
goto bad_arch;
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_keyctl 5241
#endif
+ #elif defined __loongarch64
+ #define __NR_keyctl 219
#else
#define -1
#warning "__NR_keyctl not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64
#define __NR_memfd_create 5314
#endif
+ #elif defined __loongarch64
+ #define __NR_memfd_create 279
#else
#define -1
#warning "__NR_memfd_create not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_pivot_root 5151
#endif
+ #elif defined __loongarch64
+ #define __NR_pivot_root 41
#else
#define -1
#warning "__NR_pivot_root not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_setns 5303
#endif
+ #elif defined __loongarch64
+ #define __NR_setns 268
#else
#define -1
#warning "__NR_setns not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_sethostname 5165
#endif
+ #elif defined __loongarch64
+ #define __NR_sethostname 161
#else
#define -1
#warning "__NR_sethostname not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_signalfd4 5283
#endif
+ #elif defined __loongarch64
+ #define __NR_signalfd4 74
#else
#define -1
#warning "__NR_signalfd4 not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_unshare 5262
#endif
+ #elif defined __loongarch64
+ #define __NR_unshare 97
#else
#define -1
#warning "__NR_unshare not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_bpf 5315
#endif
+ #elif defined __loongarch64
+ #define __NR_bpf 280
#else
#define -1
#warning "__NR_bpf not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_faccessat 5259
#endif
+ #elif defined __loongarch64
+ #define __NR_faccessat 48
#else
#define -1
#warning "__NR_faccessat not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_seccomp 5312
#endif
+ #elif defined __loongarch64
+ #define __NR_seccomp 277
#else
#define -1
#warning "__NR_seccomp not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_gettid 5178
#endif
+ #elif defined __loongarch64
+ #define __NR_gettid 178
#else
#define -1
#warning "__NR_gettid not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_execveat 5316
#endif
+ #elif defined __loongarch64
+ #define __NR_execveat 281
#else
#define -1
#warning "__NR_execveat not defined for your architecture"
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_personality (132 + 5000)
#endif
+ #elif defined __loongarch64
+ #define __NR_personality 92
#else
#define -1
#warning "__NR_personality not defined for your architecture"
#endif
static const char *const arches[] = {
- "arm", "armel", "armhf", "armv7l", "athlon", "i386", "i486",
- "i586", "i686", "linux32", "mips", "mipsel", "ppc", "powerpc",
- "x86", "aarch64", "amd64", "arm64", "linux64", "mips64", "mips64el",
- "ppc64", "ppc64el", "ppc64le", "powerpc64", "riscv64", "s390x", "x86_64",
+ "arm", "armel", "armhf", "armv7l", "athlon", "i386", "i486",
+ "i586", "i686", "linux32", "mips", "mipsel", "ppc", "powerpc",
+ "x86", "aarch64", "amd64", "arm64", "linux64", "loongarch64", "mips64",
+ "mips64el", "ppc64", "ppc64el", "ppc64le", "powerpc64", "riscv64", "s390x",
+ "x86_64",
};
static bool parse_valid_architectures(void)