1 Star 0 Fork 38

xisme/qemu-kvm_src-anolis

forked from src-anolis-os/qemu-kvm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
kvm-setup 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
#! /bin/bash
kvm_setup_powerpc () {
if grep '^platform[[:space:]]*:[[:space:]]*PowerNV' /proc/cpuinfo > /dev/null; then
# PowerNV platform, which is KVM HV capable
if [ -z "$SUBCORES" ]; then
SUBCORES=1
fi
# Step 1. Load the KVM HVmodule
if ! modprobe -b kvm_hv; then
return
fi
# On POWER8 a host core can only run threads of a single
# guest, meaning that SMT must be disabled on the host in
# order to run KVM guests. (Also applieds to POWER7, but we
# don't support that).
#
# POWER9 doesn't have this limitation (though it will for hash
# guests on radix host when that's implemented). So, only set
# up subcores and disable SMT for POWER*.
if grep '^cpu[[:space:]]*:[[:space:]]*POWER8' /proc/cpuinfo > /dev/null; then
# Step 2. Configure subcore mode
/usr/sbin/ppc64_cpu --subcores-per-core=$SUBCORES
# Step 3. Disable SMT (multithreading)
/usr/sbin/ppc64_cpu --smt=off
fi
fi
}
kvm_setup_s390x () {
if grep -q "^features.*sie" /proc/cpuinfo; then
modprobe kvm
fi
}
case $(uname -m) in
ppc64|ppc64le)
kvm_setup_powerpc
;;
s390x)
kvm_setup_s390x
;;
esac
exit 0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xisme/qemu-kvm_src-anolis.git
git@gitee.com:xisme/qemu-kvm_src-anolis.git
xisme
qemu-kvm_src-anolis
qemu-kvm_src-anolis
vtkm_support_csv

搜索帮助

371d5123 14472233 46e8bd33 14472233