From e42a9b3011f96ad26f4a19db77ac44cad31a4290 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sun, 18 Dec 2016 16:53:26 +0100 Subject: Uplift Armband to Fuel Newton [ Dan Andresan ] - puppet: database: Fix Percona XtraBackup sync [ Alexandru Avadanii ] - disable all plugins; - re-enable remote tracking; - remove "Revert: Point to specific snapshot ..."; - patch context adjustments; - obsolete "kernel-bump", linux-image-lts-xenial is now the default; - network-checker iface state check now fixed upstream [1]; - fuel-nailgun-agent hugepage size should also check /proc/meminfo; - fuel-nailgun-agent CPU detection for AArch64; - nova AArch64 hugepage support is now upstream; - obsolete Cirros Test VM direct kernel boot (by switch to AAVMF): * f-l/0001-upload_cirros-Add-direct-kernel-boot-support.patch * f-w/0001-direct-kernel-boot-for-cirros.patch - rework m1.micro RAM size patch after puppet manifest split upstream; - re-enable arch-agnostic plugins which were rebased in Fuel@OPNFV: * f_yardstick-pluginbuild * f_congress-pluginbuild - do NOT retire MySQL SST provider patch series (nack: ARMBAND-186), rebase (and keep for now) MySQL SST provider patches, as trying to use xtrabackup-v2 revelead a regression since Colorado.3.0, and these patches simplify troubleshooting a lot; - AArch64: nova: libvirt: Use host-model cpu (ARMBAND-193); - AArch64: nova: libvirt: Use pointer_model instead of use_usb_tablet; - m1.micro RAM size insufficient for TestVM with AAVMF (s/128/256/) - switch Cirros TestVM to AAVMF from direct kernel boot; - backport nova libvirt driver fix for deleting instances booted with AAVMF firmware from [2]; TODO (later): - Include ISO build time fixes for cirros_testvm in Armband package; TODO (ODL, later): - test & revise leveldb patching; - bring back Qugga patching for arm64; - configure systemd service to automatically respawn; [1] https://review.openstack.org/#/c/417373/ [2] https://review.openstack.org/#/c/357190/ JIRA: ARMBAND-29 JIRA: ARMBAND-32 JIRA: ARMBAND-63 JIRA: ARMBAND-88 JIRA: ARMBAND-116 JIRA: ARMBAND-118 JIRA: ARMBAND-186 JIRA: ARMBAND-193 JIRA: ARMBAND-194 JIRA: ARMBAND-195 JIRA: ARMBAND-196 JIRA: ARMBAND-197 Change-Id: Ia99022e364e61245d109cabab9d0ed7157b4d2f5 Signed-off-by: Alexandru Avadanii Signed-off-by: Dan Andresan --- .../0003-AArch64-Add-CPU-details-detection.patch | 130 +++++++++++++++++++++ ...ch64-Read-hugepage-size-from-proc-meminfo.patch | 30 +++++ 2 files changed, 160 insertions(+) create mode 100644 patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch create mode 100644 patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch (limited to 'patches/fuel-nailgun-agent') diff --git a/patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch b/patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch new file mode 100644 index 00000000..89f4aeb4 --- /dev/null +++ b/patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch @@ -0,0 +1,130 @@ +From: Alexandru Avadanii +Date: Sun, 15 Jan 2017 08:09:10 +0100 +Subject: [PATCH] AArch64: Add CPU details detection + +[ Alexandru Avadanii ] +Based on Stan's previous patch for ohai, extend fuel-nailgun-agent +to properly support AArch64 CPUs. + +[ Stanislaw Kardach ] +There is currently little human readable detail in /proc/cpuinfo on +arm64 so this patch tries to enchance this information by parsing the +DMI data (using `dmidecode`) and fail gracefully to empty strings +if no information could not be read from there. By no means this +parsing is to be taken as a standardised way of discovering an +arm64 CPU, it is just a suggestion. + +Signed-off-by: Stanislaw Kardach +Signed-off-by: Alexandru Avadanii +--- + agent | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 90 insertions(+) + +diff --git a/agent b/agent +index 0c56264..eeb4d26 100755 +--- a/agent ++++ b/agent +@@ -340,6 +340,15 @@ class NodeAgent + end + + def _get_detailed_cpuinfo ++ case `uname -m` ++ when /aarch64.*/ ++ _get_detailed_cpuinfo_for_arm64 ++ else # default to x86 ++ _get_detailed_cpuinfo_for_x86 ++ end ++ end ++ ++ def _get_detailed_cpuinfo_for_x86 + real = {} + info = {} + info[:total] = 0 +@@ -371,6 +380,87 @@ class NodeAgent + info + end + ++ def _get_detailed_cpuinfo_for_arm64 ++ cpu_implementers = { ++ "0x41" => "ARM", ++ "0x53" => "Samsung", ++ "0x51" => "Qualcom", ++ "0x43" => "Cavium", ++ "0x50" => "APM" ++ } ++ core_models = { ++ "0xd04" => "cortex-a35", ++ "0xd03" => "cortex-a53", ++ "0xd07" => "cortex-a57", ++ "0xd08" => "cortex-a72", ++ "0x001" => "exynos-m1", ++ "0x800" => "qdf24xx", ++ "0x0a1" => "thunderx", ++ "0x000" => "xgene1", ++ "0xd07.0xd03" => "cortex-a57.cortex-a53", ++ "0xd08.0xd03" => "cortex-a72.cortex-a53" ++ } ++ cpuinfo = {} ++ real_cpus = {} ++ cpu_number = -1 ++ current_cpu = nil ++ `dmidecode -t 4 -q`.each_line do |line| ++ case line ++ when /Processor Information/ ++ cpu_number +=1 ++ real_cpus[cpu_number] = {} ++ when /\s*Manufacturer:\s(.+)/ ++ real_cpus[cpu_number][:vendor_id] = $1 ++ when /\s*Family:\s(.+)/ ++ real_cpus[cpu_number][:family] = $1 ++ when /\s*Max Speed:\s(.+)\s*MHz/ ++ real_cpus[cpu_number][:mhz] = $1.strip ++ when /\s*Core Enabled:\s(.+)/ ++ real_cpus[cpu_number][:cores] = $1 ++ end ++ end ++ ++ cpu_number = 0 ++ File.open("/proc/cpuinfo").each do |line| ++ case line ++ when /processor\s+:\s(.+)/ ++ cpuinfo[$1] = {} ++ current_cpu = $1 ++ cpu_number += 1 ++ phys_id = File.read( ++ "/sys/devices/system/cpu/cpu%d/topology/physical_package_id" % ++ $1).strip ++ i = phys_id.to_i ++ cpuinfo[$1][:core_id] = ++ File.read("/sys/devices/system/cpu/cpu%d/topology/core_id" % ++ $1).strip rescue "" ++ cpuinfo[$1][:physical_id] = phys_id if not phys_id.empty? ++ if real_cpus[i].nil? ++ i = 0 ++ end ++ if not real_cpus[i].nil? ++ cpuinfo[$1][:family] = real_cpus[i][:family] rescue "" ++ cpuinfo[$1][:cores] = real_cpus[i][:cores] rescue "" ++ cpuinfo[$1][:mhz] = real_cpus[i][:mhz] rescue "" ++ end ++ when /CPU implementer\s+:\s(.+)/ ++ cpuinfo[current_cpu][:vendor_id] = cpu_implementers[$1] ++ cpuinfo[current_cpu][:vendor_id] ||= real_cpus[cpuinfo[current_cpu][:physical_id].to_i][:vendor_id] rescue nil ++ cpuinfo[current_cpu][:vendor_id] ||= real_cpus[0][:vendor_id] rescue nil ++ cpuinfo[current_cpu][:vendor_id] ||= $1 ++ when /CPU part\s+:\s(.+)/ ++ cpuinfo[current_cpu][:model] = $1 ++ cpuinfo[current_cpu][:model_name] = core_models[$1] ++ cpuinfo[current_cpu][:model_name] ||= "" ++ when /Features\s+:\s(.+)/ ++ cpuinfo[current_cpu][:flags] = $1.split(' ') ++ end ++ end ++ cpuinfo[:total] = cpu_number ++ cpuinfo[:real] = real_cpus.keys.length ++ cpuinfo ++ end ++ + def _get_blkdev_info + info = {} + if File.directory?('/sys/block/') diff --git a/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch b/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch new file mode 100644 index 00000000..de0ca78a --- /dev/null +++ b/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch @@ -0,0 +1,30 @@ +From: Alexandru Avadanii +Date: Sun, 15 Jan 2017 08:14:12 +0100 +Subject: [PATCH] AArch64: Read hugepage size from /proc/meminfo + +This method should be arch-indepedent, provided /proc/meminfo +reports the correct information. + +Signed-off-by: Alexandru Avadanii +--- + agent | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/agent b/agent +index eeb4d26..d514de6 100755 +--- a/agent ++++ b/agent +@@ -1399,6 +1399,13 @@ class NodeAgent + def supported_hugepages + return [2048, 1048576] if _get_detailed_cpuinfo['0'][:flags].include?('pdpe1gb') + return [2048] if _get_detailed_cpuinfo['0'][:flags].include?('pse') ++ # AArch64 does not expose CPU flags, but we can rely on /proc/meminfo ++ File.open('/proc/meminfo').each do |l| ++ case l.strip ++ when /Hugepagesize:\s+(\d+)\s+kB/ ++ return [$1.to_i()] ++ end ++ end + [] + end + -- cgit 1.2.3-korg