Skip to contentSkip to conversation

KVM uq/master changes for 2013-03-14

GIT PULL Applied Paolo Bonzini 3 participants 6 messages Mar 11, 2014

lore
Share & tools
lore
#0 lore raw

The following changes since commit 9fbee91a131a05e443d7108d7fbdf3ca91020290:

Merge remote-tracking branch 'remotes/kvm/uq/master' into staging (2014-02-27 16:00:31 +0000)

are available in the git repository at:

git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master

for you to fetch changes up to b0f15a5d5628994c71a6f428f360a5a537ad3b39:

target-i386: bugfix of Intel MPX (2014-03-11 11:49:00 +0100)

Thanks,

Paolo

----------------------------------------------------------------
Liu, Jinsong (1):
target-i386: bugfix of Intel MPX

Marcelo Tosatti (2):
kvm-all: exit in case max vcpus exceeded
file_ram_alloc: unify mem-path,mem-prealloc error handling

 exec.c            | 14 ++++++++++----
 kvm-all.c         |  3 +--
 target-i386/cpu.c |  2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

[Qemu-devel] [PULL 2/3] file_ram_alloc: unify mem-path, mem-prealloc error handling

From: Marcelo Tosatti <[email protected]>

-mem-prealloc asks to preallocate memory residing on -mem-path path.

Currently QEMU exits in case:

- Memory file has been created but allocation via explicit write fails.

And it fallbacks to malloc in case:
- Querying huge page size fails.
- Lack of sync MMU support.
- Open fails.
- mmap fails.

Have the same behaviour for all cases: fail in case -mem-path and -mem-prealloc are specified for regions where the requested size is suitable for hugepages.

---
 exec.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
exec.c +10 -4
index b69fd29..f47b2b1 100644
@@ -1031,7 +1031,7 @@ static void *file_ram_alloc(RAMBlock *block,
 
     hpagesize = gethugepagesize(path);
     if (!hpagesize) {
-        return NULL;
+        goto error;
     }
 
     if (memory < hpagesize) {
@@ -1040,7 +1040,7 @@ static void *file_ram_alloc(RAMBlock *block,
 
     if (kvm_enabled() && !kvm_has_sync_mmu()) {
         fprintf(stderr, "host lacks kvm mmu notifiers, -mem-path unsupported\n");
-        return NULL;
+        goto error;
     }
 
     /* Make name safe to use with mkstemp by replacing '/' with '_'. */
@@ -1058,7 +1058,7 @@ static void *file_ram_alloc(RAMBlock *block,
     if (fd < 0) {
         perror("unable to create backing store for hugepages");
         g_free(filename);
-        return NULL;
+        goto error;
     }
     unlink(filename);
     g_free(filename);
@@ -1078,7 +1078,7 @@ static void *file_ram_alloc(RAMBlock *block,
     if (area == MAP_FAILED) {
         perror("file_ram_alloc: can't mmap RAM pages");
         close(fd);
-        return (NULL);
+        goto error;
     }
 
     if (mem_prealloc) {
@@ -1122,6 +1122,12 @@ static void *file_ram_alloc(RAMBlock *block,
 
     block->fd = fd;
     return area;
+
+error:
+    if (mem_prealloc) {
+        exit(1);
+    }
+    return NULL;
 }
 #else
 static void *file_ram_alloc(RAMBlock *block,
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 3/3] target-i386: bugfix of Intel MPX

In reply to Paolo Bonzini

From: "Liu, Jinsong" <[email protected]>

The correct size of cpuid 0x0d sub-leaf 4 is 0x40, not 0x10. This is confirmed by Anvin H Peter and Mallick Asit K.

Cc H. Peter Anvin <[email protected]>
Cc Asit K Mallick <[email protected]>
---
 target-i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +1 -1
index 0e8812a..9f69d7e 100644
@@ -339,7 +339,7 @@ static const ExtSaveArea ext_save_areas[] = {
     [3] = { .feature = FEAT_7_0_EBX, .bits = CPUID_7_0_EBX_MPX,
             .offset = 0x3c0, .size = 0x40  },
     [4] = { .feature = FEAT_7_0_EBX, .bits = CPUID_7_0_EBX_MPX,
-            .offset = 0x400, .size = 0x10  },
+            .offset = 0x400, .size = 0x40  },
 };
 
 const char *get_register_name_32(unsigned int reg)
Signature · 1 line
1.8.3.1
#3 lore raw

Re: [Qemu-devel] [PULL 3/3] target-i386: bugfix of Intel MPX

Am 11.03.2014 11:50, schrieb Paolo Bonzini:

Quoted 5 lines

From: "Liu, Jinsong" <[email protected]>

The correct size of cpuid 0x0d sub-leaf 4 is 0x40, not 0x10. This is confirmed by Anvin H Peter and Mallick Asit K.

Quoted 7 lines
Cc H. Peter Anvin <[email protected]>
Cc Asit K Mallick <[email protected]>

---

Something's weird with the Sob here FWIW. Paolo's should be last, not the contributor's.

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#4 lore raw

[Qemu-devel] [PULL 1/3] kvm-all: exit in case max vcpus exceeded

In reply to Paolo Bonzini

From: Marcelo Tosatti <[email protected]>

Rather than fall back to TCG (so the user has to discover whats happening, in case of no access to qemu stdout/stderr).

---
 kvm-all.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kvm-all.c +1 -2
index fd8157a..f299532 100644
@@ -1420,11 +1420,10 @@ int kvm_init(void)
                     nc->name, nc->num, soft_vcpus_limit);
 
             if (nc->num > hard_vcpus_limit) {
-                ret = -EINVAL;
                 fprintf(stderr, "Number of %s cpus requested (%d) exceeds "
                         "the maximum cpus supported by KVM (%d)\n",
                         nc->name, nc->num, hard_vcpus_limit);
-                goto err;
+                exit(1);
             }
         }
         nc++;
Signature · 1 line
1.8.3.1
#5 lore raw
In reply to Paolo Bonzini
Quoted 4 lines · Paolo Bonzini

The following changes since commit 9fbee91a131a05e443d7108d7fbdf3ca91020290:

Merge remote-tracking branch 'remotes/kvm/uq/master' into staging (2014-02-27 16:00:31 +0000)

Quoted 8 lines

are available in the git repository at:

git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master

for you to fetch changes up to b0f15a5d5628994c71a6f428f360a5a537ad3b39:

target-i386: bugfix of Intel MPX (2014-03-11 11:49:00 +0100)

Applied, thanks.

-- PMM