1. 06 3月, 2018 2 次提交
    • G
      spapr: fix missing CPU core nodes in DT when running with TCG · b1a568c1
      Greg Kurz 提交于
      Commit 5d0fb150 "spapr: consolidate the VCPU id numbering logic
      in a single place" introduced a helper to detect thread0 of a virtual
      core based on its VCPU id. This is used to create CPU core nodes in
      the DT, but it is broken in TCG.
      
      $ qemu-system-ppc64 -nographic -accel tcg -machine dumpdtb=dtb.bin \
                          -smp cores=16,maxcpus=16,threads=1
      $ dtc -f -O dts dtb.bin | grep POWER8
                      PowerPC,POWER8@0 {
                      PowerPC,POWER8@8 {
      
      instead of the expected 16 cores that we get with KVM:
      
      $ dtc -f -O dts dtb.bin | grep POWER8
                      PowerPC,POWER8@0 {
                      PowerPC,POWER8@8 {
                      PowerPC,POWER8@10 {
                      PowerPC,POWER8@18 {
                      PowerPC,POWER8@20 {
                      PowerPC,POWER8@28 {
                      PowerPC,POWER8@30 {
                      PowerPC,POWER8@38 {
                      PowerPC,POWER8@40 {
                      PowerPC,POWER8@48 {
                      PowerPC,POWER8@50 {
                      PowerPC,POWER8@58 {
                      PowerPC,POWER8@60 {
                      PowerPC,POWER8@68 {
                      PowerPC,POWER8@70 {
                      PowerPC,POWER8@78 {
      
      This happens because spapr_get_vcpu_id() maps VCPU ids to
      cs->cpu_index in TCG mode. This confuses the code in
      spapr_is_thread0_in_vcore(), since it assumes thread0 VCPU
      ids to have a spapr->vsmt spacing.
      
          spapr_get_vcpu_id(cpu) % spapr->vsmt == 0
      
      Actually, there's no real reason to expose cs->cpu_index instead
      of the VCPU id, since we also generate it with TCG. Also we already
      set it explicitly in spapr_set_vcpu_id(), so there's no real reason
      either to call kvm_arch_vcpu_id() with KVM.
      
      This patch unifies spapr_get_vcpu_id() to always return the computed
      VCPU id both in TCG and KVM. This is one step forward towards KVM<->TCG
      migration.
      
      Fixes: 5d0fb150Reported-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      b1a568c1
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · f2bb2d14
      Peter Maydell 提交于
      Pull request
      
      Mostly patches that are only indirectly related to the block layer, but I've
      reviewed them and there is no maintainer.
      
      # gpg: Signature made Mon 05 Mar 2018 09:39:50 GMT
      # gpg:                using RSA key 9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/block-pull-request:
        README: Document 'git-publish' workflow
        Add a git-publish configuration file
        tests/libqos: Check for valid dev pointer when looking for PCI devices
        util/uri.c: wrap single statement blocks with braces {}
        util/uri.c: remove brackets that wrap `return` statement's content.
        util/uri.c: Coding style check, Only whitespace involved
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f2bb2d14
  2. 05 3月, 2018 37 次提交
  3. 03 3月, 2018 1 次提交