stable 0.10.5
This commit is contained in:
parent
7bfaaeea5b
commit
a3a6d37506
|
@ -1 +1 @@
|
||||||
qemu-kvm-*.tar.gz
|
qemu-kvm-0.10.5.tar.gz
|
||||||
|
|
|
@ -1,96 +0,0 @@
|
||||||
From 3b92e958482155404cfd134a9608041eed69622a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Avi Kivity <avi@redhat.com>
|
|
||||||
Date: Fri, 20 Mar 2009 18:26:12 +0000
|
|
||||||
Subject: [STABLE][PATCH 1/4] Use vectored aiocb storage to store vector translation state
|
|
||||||
|
|
||||||
Now that we have a dedicated acb pool for vector translation acbs, we can
|
|
||||||
store the vector translation state in the acbs instead of in an external
|
|
||||||
structure.
|
|
||||||
|
|
||||||
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
||||||
|
|
||||||
---
|
|
||||||
block.c | 29 ++++++++++++++---------------
|
|
||||||
1 files changed, 14 insertions(+), 15 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/block.c b/block.c
|
|
||||||
index b12318f..689ea37 100644
|
|
||||||
--- a/block.c
|
|
||||||
+++ b/block.c
|
|
||||||
@@ -1332,31 +1332,32 @@ char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn)
|
|
||||||
/**************************************************************/
|
|
||||||
/* async I/Os */
|
|
||||||
|
|
||||||
-typedef struct VectorTranslationState {
|
|
||||||
+typedef struct VectorTranslationAIOCB {
|
|
||||||
+ BlockDriverAIOCB common;
|
|
||||||
QEMUIOVector *iov;
|
|
||||||
uint8_t *bounce;
|
|
||||||
int is_write;
|
|
||||||
BlockDriverAIOCB *aiocb;
|
|
||||||
- BlockDriverAIOCB *this_aiocb;
|
|
||||||
-} VectorTranslationState;
|
|
||||||
+} VectorTranslationAIOCB;
|
|
||||||
|
|
||||||
-static void bdrv_aio_cancel_vector(BlockDriverAIOCB *acb)
|
|
||||||
+static void bdrv_aio_cancel_vector(BlockDriverAIOCB *_acb)
|
|
||||||
{
|
|
||||||
- VectorTranslationState *s = acb->opaque;
|
|
||||||
+ VectorTranslationAIOCB *acb
|
|
||||||
+ = container_of(_acb, VectorTranslationAIOCB, common);
|
|
||||||
|
|
||||||
- bdrv_aio_cancel(s->aiocb);
|
|
||||||
+ bdrv_aio_cancel(acb->aiocb);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bdrv_aio_rw_vector_cb(void *opaque, int ret)
|
|
||||||
{
|
|
||||||
- VectorTranslationState *s = opaque;
|
|
||||||
+ VectorTranslationAIOCB *s = (VectorTranslationAIOCB *)opaque;
|
|
||||||
|
|
||||||
if (!s->is_write) {
|
|
||||||
qemu_iovec_from_buffer(s->iov, s->bounce, s->iov->size);
|
|
||||||
}
|
|
||||||
qemu_vfree(s->bounce);
|
|
||||||
- s->this_aiocb->cb(s->this_aiocb->opaque, ret);
|
|
||||||
- qemu_aio_release(s->this_aiocb);
|
|
||||||
+ s->common.cb(s->common.opaque, ret);
|
|
||||||
+ qemu_aio_release(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
|
|
||||||
@@ -1368,11 +1369,9 @@ static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
|
|
||||||
int is_write)
|
|
||||||
|
|
||||||
{
|
|
||||||
- VectorTranslationState *s = qemu_mallocz(sizeof(*s));
|
|
||||||
- BlockDriverAIOCB *aiocb = qemu_aio_get_pool(&vectored_aio_pool, bs,
|
|
||||||
- cb, opaque);
|
|
||||||
+ VectorTranslationAIOCB *s = qemu_aio_get_pool(&vectored_aio_pool, bs,
|
|
||||||
+ cb, opaque);
|
|
||||||
|
|
||||||
- s->this_aiocb = aiocb;
|
|
||||||
s->iov = iov;
|
|
||||||
s->bounce = qemu_memalign(512, nb_sectors * 512);
|
|
||||||
s->is_write = is_write;
|
|
||||||
@@ -1384,7 +1383,7 @@ static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
|
|
||||||
s->aiocb = bdrv_aio_read(bs, sector_num, s->bounce, nb_sectors,
|
|
||||||
bdrv_aio_rw_vector_cb, s);
|
|
||||||
}
|
|
||||||
- return aiocb;
|
|
||||||
+ return &s->common;
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockDriverAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num,
|
|
||||||
@@ -1560,7 +1559,7 @@ static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num,
|
|
||||||
|
|
||||||
void bdrv_init(void)
|
|
||||||
{
|
|
||||||
- aio_pool_init(&vectored_aio_pool, sizeof(BlockDriverAIOCB),
|
|
||||||
+ aio_pool_init(&vectored_aio_pool, sizeof(VectorTranslationAIOCB),
|
|
||||||
bdrv_aio_cancel_vector);
|
|
||||||
|
|
||||||
bdrv_register(&bdrv_raw);
|
|
||||||
--
|
|
||||||
1.6.0.6
|
|
||||||
|
|
|
@ -1,137 +0,0 @@
|
||||||
From b591f5930d0eaa93690c5a7acf95e4f5a3e04e06 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Avi Kivity <avi@redhat.com>
|
|
||||||
Date: Fri, 20 Mar 2009 18:26:16 +0000
|
|
||||||
Subject: [STABLE][PATCH 2/4] Move block dma helpers aiocb to store dma state
|
|
||||||
|
|
||||||
Use the dedicated dma aiocb to store intermediate state for dma block
|
|
||||||
transactions.
|
|
||||||
|
|
||||||
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
||||||
|
|
||||||
---
|
|
||||||
dma-helpers.c | 37 ++++++++++++++++++++-----------------
|
|
||||||
1 files changed, 20 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dma-helpers.c b/dma-helpers.c
|
|
||||||
index 19fa4f0..96a120c 100644
|
|
||||||
--- a/dma-helpers.c
|
|
||||||
+++ b/dma-helpers.c
|
|
||||||
@@ -39,6 +39,7 @@ void qemu_sglist_destroy(QEMUSGList *qsg)
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
+ BlockDriverAIOCB common;
|
|
||||||
BlockDriverState *bs;
|
|
||||||
BlockDriverAIOCB *acb;
|
|
||||||
QEMUSGList *sg;
|
|
||||||
@@ -48,13 +49,13 @@ typedef struct {
|
|
||||||
target_phys_addr_t sg_cur_byte;
|
|
||||||
QEMUIOVector iov;
|
|
||||||
QEMUBH *bh;
|
|
||||||
-} DMABlockState;
|
|
||||||
+} DMAAIOCB;
|
|
||||||
|
|
||||||
static void dma_bdrv_cb(void *opaque, int ret);
|
|
||||||
|
|
||||||
static void reschedule_dma(void *opaque)
|
|
||||||
{
|
|
||||||
- DMABlockState *dbs = (DMABlockState *)opaque;
|
|
||||||
+ DMAAIOCB *dbs = (DMAAIOCB *)opaque;
|
|
||||||
|
|
||||||
qemu_bh_delete(dbs->bh);
|
|
||||||
dbs->bh = NULL;
|
|
||||||
@@ -63,7 +64,7 @@ static void reschedule_dma(void *opaque)
|
|
||||||
|
|
||||||
static void continue_after_map_failure(void *opaque)
|
|
||||||
{
|
|
||||||
- DMABlockState *dbs = (DMABlockState *)opaque;
|
|
||||||
+ DMAAIOCB *dbs = (DMAAIOCB *)opaque;
|
|
||||||
|
|
||||||
dbs->bh = qemu_bh_new(reschedule_dma, dbs);
|
|
||||||
qemu_bh_schedule(dbs->bh);
|
|
||||||
@@ -71,11 +72,12 @@ static void continue_after_map_failure(void *opaque)
|
|
||||||
|
|
||||||
static void dma_bdrv_cb(void *opaque, int ret)
|
|
||||||
{
|
|
||||||
- DMABlockState *dbs = (DMABlockState *)opaque;
|
|
||||||
+ DMAAIOCB *dbs = (DMAAIOCB *)opaque;
|
|
||||||
target_phys_addr_t cur_addr, cur_len;
|
|
||||||
void *mem;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
+ dbs->acb = NULL;
|
|
||||||
dbs->sector_num += dbs->iov.size / 512;
|
|
||||||
for (i = 0; i < dbs->iov.niov; ++i) {
|
|
||||||
cpu_physical_memory_unmap(dbs->iov.iov[i].iov_base,
|
|
||||||
@@ -85,10 +87,9 @@ static void dma_bdrv_cb(void *opaque, int ret)
|
|
||||||
qemu_iovec_reset(&dbs->iov);
|
|
||||||
|
|
||||||
if (dbs->sg_cur_index == dbs->sg->nsg || ret < 0) {
|
|
||||||
- dbs->acb->cb(dbs->acb->opaque, ret);
|
|
||||||
+ dbs->common.cb(dbs->common.opaque, ret);
|
|
||||||
qemu_iovec_destroy(&dbs->iov);
|
|
||||||
- qemu_aio_release(dbs->acb);
|
|
||||||
- qemu_free(dbs);
|
|
||||||
+ qemu_aio_release(dbs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -112,11 +113,11 @@ static void dma_bdrv_cb(void *opaque, int ret)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dbs->is_write) {
|
|
||||||
- bdrv_aio_writev(dbs->bs, dbs->sector_num, &dbs->iov,
|
|
||||||
- dbs->iov.size / 512, dma_bdrv_cb, dbs);
|
|
||||||
+ dbs->acb = bdrv_aio_writev(dbs->bs, dbs->sector_num, &dbs->iov,
|
|
||||||
+ dbs->iov.size / 512, dma_bdrv_cb, dbs);
|
|
||||||
} else {
|
|
||||||
- bdrv_aio_readv(dbs->bs, dbs->sector_num, &dbs->iov,
|
|
||||||
- dbs->iov.size / 512, dma_bdrv_cb, dbs);
|
|
||||||
+ dbs->acb = bdrv_aio_readv(dbs->bs, dbs->sector_num, &dbs->iov,
|
|
||||||
+ dbs->iov.size / 512, dma_bdrv_cb, dbs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -125,10 +126,10 @@ static BlockDriverAIOCB *dma_bdrv_io(
|
|
||||||
BlockDriverCompletionFunc *cb, void *opaque,
|
|
||||||
int is_write)
|
|
||||||
{
|
|
||||||
- DMABlockState *dbs = qemu_malloc(sizeof(*dbs));
|
|
||||||
+ DMAAIOCB *dbs = qemu_aio_get_pool(&dma_aio_pool, bs, cb, opaque);
|
|
||||||
|
|
||||||
+ dbs->acb = NULL;
|
|
||||||
dbs->bs = bs;
|
|
||||||
- dbs->acb = qemu_aio_get_pool(&dma_aio_pool, bs, cb, opaque);
|
|
||||||
dbs->sg = sg;
|
|
||||||
dbs->sector_num = sector_num;
|
|
||||||
dbs->sg_cur_index = 0;
|
|
||||||
@@ -137,7 +138,7 @@ static BlockDriverAIOCB *dma_bdrv_io(
|
|
||||||
dbs->bh = NULL;
|
|
||||||
qemu_iovec_init(&dbs->iov, sg->nsg);
|
|
||||||
dma_bdrv_cb(dbs, 0);
|
|
||||||
- return dbs->acb;
|
|
||||||
+ return &dbs->common;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -157,12 +158,14 @@ BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
|
|
||||||
|
|
||||||
static void dma_aio_cancel(BlockDriverAIOCB *acb)
|
|
||||||
{
|
|
||||||
- DMABlockState *dbs = (DMABlockState *)acb->opaque;
|
|
||||||
+ DMAAIOCB *dbs = container_of(acb, DMAAIOCB, common);
|
|
||||||
|
|
||||||
- bdrv_aio_cancel(dbs->acb);
|
|
||||||
+ if (dbs->acb) {
|
|
||||||
+ bdrv_aio_cancel(dbs->acb);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
void dma_helper_init(void)
|
|
||||||
{
|
|
||||||
- aio_pool_init(&dma_aio_pool, sizeof(BlockDriverAIOCB), dma_aio_cancel);
|
|
||||||
+ aio_pool_init(&dma_aio_pool, sizeof(DMAAIOCB), dma_aio_cancel);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
1.6.0.6
|
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
From 2df6efa1790a7a2894707257d2fe67b8d1cfb13a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Avi Kivity <avi@redhat.com>
|
|
||||||
Date: Sat, 28 Mar 2009 16:11:20 +0000
|
|
||||||
Subject: [STABLE][PATCH 3/4] Fix vectored aio bounce handling immediate errors
|
|
||||||
|
|
||||||
If a bounced vectored aio fails immediately (the inner aio submission
|
|
||||||
returning NULL) then the bounce handler erronously returns an aio
|
|
||||||
request which will never be completed (and which crashes when cancelled).
|
|
||||||
|
|
||||||
Fix by detecting that the inner request has failed and propagating the
|
|
||||||
error.
|
|
||||||
|
|
||||||
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
||||||
|
|
||||||
---
|
|
||||||
block.c | 5 +++++
|
|
||||||
1 files changed, 5 insertions(+), 0 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/block.c b/block.c
|
|
||||||
index 689ea37..b68a8da 100644
|
|
||||||
--- a/block.c
|
|
||||||
+++ b/block.c
|
|
||||||
@@ -1383,6 +1383,11 @@ static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
|
|
||||||
s->aiocb = bdrv_aio_read(bs, sector_num, s->bounce, nb_sectors,
|
|
||||||
bdrv_aio_rw_vector_cb, s);
|
|
||||||
}
|
|
||||||
+ if (!s->aiocb) {
|
|
||||||
+ qemu_vfree(s->bounce);
|
|
||||||
+ qemu_aio_release(s);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
return &s->common;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
1.6.0.6
|
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
From eaa874771bb83df639e2937884240a6b05622e3f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Avi Kivity <avi@redhat.com>
|
|
||||||
Date: Sat, 28 Mar 2009 16:11:25 +0000
|
|
||||||
Subject: [STABLE][PATCH 4/4] Fix DMA API when handling an immediate error from block layer
|
|
||||||
|
|
||||||
The block layer may signal an immediate error on an asynchronous request
|
|
||||||
by returning NULL. The DMA API did not handle this correctly, returning
|
|
||||||
an AIO request which would never complete (and which would crash if
|
|
||||||
cancelled).
|
|
||||||
|
|
||||||
Fix by detecting the failure and propagating it.
|
|
||||||
|
|
||||||
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
||||||
|
|
||||||
---
|
|
||||||
dma-helpers.c | 27 +++++++++++++++++++++------
|
|
||||||
1 files changed, 21 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/dma-helpers.c b/dma-helpers.c
|
|
||||||
index 96a120c..1469e34 100644
|
|
||||||
--- a/dma-helpers.c
|
|
||||||
+++ b/dma-helpers.c
|
|
||||||
@@ -70,20 +70,26 @@ static void continue_after_map_failure(void *opaque)
|
|
||||||
qemu_bh_schedule(dbs->bh);
|
|
||||||
}
|
|
||||||
|
|
||||||
-static void dma_bdrv_cb(void *opaque, int ret)
|
|
||||||
+static void dma_bdrv_unmap(DMAAIOCB *dbs)
|
|
||||||
{
|
|
||||||
- DMAAIOCB *dbs = (DMAAIOCB *)opaque;
|
|
||||||
- target_phys_addr_t cur_addr, cur_len;
|
|
||||||
- void *mem;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- dbs->acb = NULL;
|
|
||||||
- dbs->sector_num += dbs->iov.size / 512;
|
|
||||||
for (i = 0; i < dbs->iov.niov; ++i) {
|
|
||||||
cpu_physical_memory_unmap(dbs->iov.iov[i].iov_base,
|
|
||||||
dbs->iov.iov[i].iov_len, !dbs->is_write,
|
|
||||||
dbs->iov.iov[i].iov_len);
|
|
||||||
}
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void dma_bdrv_cb(void *opaque, int ret)
|
|
||||||
+{
|
|
||||||
+ DMAAIOCB *dbs = (DMAAIOCB *)opaque;
|
|
||||||
+ target_phys_addr_t cur_addr, cur_len;
|
|
||||||
+ void *mem;
|
|
||||||
+
|
|
||||||
+ dbs->acb = NULL;
|
|
||||||
+ dbs->sector_num += dbs->iov.size / 512;
|
|
||||||
+ dma_bdrv_unmap(dbs);
|
|
||||||
qemu_iovec_reset(&dbs->iov);
|
|
||||||
|
|
||||||
if (dbs->sg_cur_index == dbs->sg->nsg || ret < 0) {
|
|
||||||
@@ -119,6 +125,11 @@ static void dma_bdrv_cb(void *opaque, int ret)
|
|
||||||
dbs->acb = bdrv_aio_readv(dbs->bs, dbs->sector_num, &dbs->iov,
|
|
||||||
dbs->iov.size / 512, dma_bdrv_cb, dbs);
|
|
||||||
}
|
|
||||||
+ if (!dbs->acb) {
|
|
||||||
+ dma_bdrv_unmap(dbs);
|
|
||||||
+ qemu_iovec_destroy(&dbs->iov);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
static BlockDriverAIOCB *dma_bdrv_io(
|
|
||||||
@@ -138,6 +149,10 @@ static BlockDriverAIOCB *dma_bdrv_io(
|
|
||||||
dbs->bh = NULL;
|
|
||||||
qemu_iovec_init(&dbs->iov, sg->nsg);
|
|
||||||
dma_bdrv_cb(dbs, 0);
|
|
||||||
+ if (!dbs->acb) {
|
|
||||||
+ qemu_aio_release(dbs);
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
return &dbs->common;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
1.6.0.6
|
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
From 2ced1d80f01645885ac2e28107f724886eb1cd5a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jochen Roth <jroth@linux.vnet.ibm.com>
|
|
||||||
Date: Thu, 12 Mar 2009 14:19:19 +0100
|
|
||||||
Subject: [PATCH] kvm: testsuite: compile fix - avoid raw string literal
|
|
||||||
|
|
||||||
This patch fixes compilation problems of kvm-userspace on current gcc
|
|
||||||
4.4 compilers which implement the following standard:
|
|
||||||
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
|
|
||||||
|
|
||||||
Signed-off-by: Jochen Roth <jroth@linux.vnet.ibm.com>
|
|
||||||
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
||||||
---
|
|
||||||
user/test/x86/apic.c | 32 ++++++++++++++++----------------
|
|
||||||
user/test/x86/vmexit.c | 2 +-
|
|
||||||
2 files changed, 17 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
Index: qemu-kvm-0.10.4/kvm/user/test/x86/apic.c
|
|
||||||
===================================================================
|
|
||||||
--- qemu-kvm-0.10.4.orig/kvm/user/test/x86/apic.c
|
|
||||||
+++ qemu-kvm-0.10.4/kvm/user/test/x86/apic.c
|
|
||||||
@@ -54,14 +54,14 @@ asm (
|
|
||||||
"push %r9 \n\t"
|
|
||||||
"push %r8 \n\t"
|
|
||||||
#endif
|
|
||||||
- "push %"R"di \n\t"
|
|
||||||
- "push %"R"si \n\t"
|
|
||||||
- "push %"R"bp \n\t"
|
|
||||||
- "push %"R"sp \n\t"
|
|
||||||
- "push %"R"bx \n\t"
|
|
||||||
- "push %"R"dx \n\t"
|
|
||||||
- "push %"R"cx \n\t"
|
|
||||||
- "push %"R"ax \n\t"
|
|
||||||
+ "push %"R "di \n\t"
|
|
||||||
+ "push %"R "si \n\t"
|
|
||||||
+ "push %"R "bp \n\t"
|
|
||||||
+ "push %"R "sp \n\t"
|
|
||||||
+ "push %"R "bx \n\t"
|
|
||||||
+ "push %"R "dx \n\t"
|
|
||||||
+ "push %"R "cx \n\t"
|
|
||||||
+ "push %"R "ax \n\t"
|
|
||||||
#ifdef __x86_64__
|
|
||||||
"mov %rsp, %rdi \n\t"
|
|
||||||
"callq *8*16(%rsp) \n\t"
|
|
||||||
@@ -70,14 +70,14 @@ asm (
|
|
||||||
"calll *4+4*8(%esp) \n\t"
|
|
||||||
"add $4, %esp \n\t"
|
|
||||||
#endif
|
|
||||||
- "pop %"R"ax \n\t"
|
|
||||||
- "pop %"R"cx \n\t"
|
|
||||||
- "pop %"R"dx \n\t"
|
|
||||||
- "pop %"R"bx \n\t"
|
|
||||||
- "pop %"R"bp \n\t"
|
|
||||||
- "pop %"R"bp \n\t"
|
|
||||||
- "pop %"R"si \n\t"
|
|
||||||
- "pop %"R"di \n\t"
|
|
||||||
+ "pop %"R "ax \n\t"
|
|
||||||
+ "pop %"R "cx \n\t"
|
|
||||||
+ "pop %"R "dx \n\t"
|
|
||||||
+ "pop %"R "bx \n\t"
|
|
||||||
+ "pop %"R "bp \n\t"
|
|
||||||
+ "pop %"R "bp \n\t"
|
|
||||||
+ "pop %"R "si \n\t"
|
|
||||||
+ "pop %"R "di \n\t"
|
|
||||||
#ifdef __x86_64__
|
|
||||||
"pop %r8 \n\t"
|
|
||||||
"pop %r9 \n\t"
|
|
||||||
Index: qemu-kvm-0.10.4/kvm/user/test/x86/vmexit.c
|
|
||||||
===================================================================
|
|
||||||
--- qemu-kvm-0.10.4.orig/kvm/user/test/x86/vmexit.c
|
|
||||||
+++ qemu-kvm-0.10.4/kvm/user/test/x86/vmexit.c
|
|
||||||
@@ -31,7 +31,7 @@ int main()
|
|
||||||
|
|
||||||
t1 = rdtsc();
|
|
||||||
for (i = 0; i < N; ++i)
|
|
||||||
- asm volatile ("push %%"R"bx; cpuid; pop %%"R"bx"
|
|
||||||
+ asm volatile ("push %%"R "bx; cpuid; pop %%"R "bx"
|
|
||||||
: : : "eax", "ecx", "edx");
|
|
||||||
t2 = rdtsc();
|
|
||||||
printf("vmexit latency: %d\n", (int)((t2 - t1) / N));
|
|
|
@ -1,45 +0,0 @@
|
||||||
From 7a53bcbef278b4191d5cb497ef2b81509a00f670 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mark McLoughlin <markmc@redhat.com>
|
|
||||||
Date: Wed, 13 May 2009 12:59:47 +0100
|
|
||||||
Subject: [PATCH 1/1] Fix load_linux reset handling fix
|
|
||||||
|
|
||||||
This fix on the stable branch:
|
|
||||||
|
|
||||||
commit 2da1e398641d9fccf683645c808dee0d088f84cf
|
|
||||||
Author: Glauber Costa <glommer@redhat.com>
|
|
||||||
Date: Fri May 8 02:22:13 2009 -0300
|
|
||||||
|
|
||||||
reset state for load_linux
|
|
||||||
|
|
||||||
Caused -kernel to break.
|
|
||||||
|
|
||||||
The problem is that we're passing the ROM's ram_addr_t to
|
|
||||||
load_linux() rather than its target_phys_addr_t. We also
|
|
||||||
need to register the memory before trying to write to
|
|
||||||
it.
|
|
||||||
|
|
||||||
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
|
||||||
---
|
|
||||||
hw/pc.c | 4 ++--
|
|
||||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/hw/pc.c b/hw/pc.c
|
|
||||||
index 062c306..e69a1f7 100644
|
|
||||||
--- a/hw/pc.c
|
|
||||||
+++ b/hw/pc.c
|
|
||||||
@@ -954,10 +954,10 @@ vga_bios_error:
|
|
||||||
offset = option_rom_start;
|
|
||||||
if (linux_boot) {
|
|
||||||
option_rom_offset = qemu_ram_alloc(TARGET_PAGE_SIZE);
|
|
||||||
- load_linux(option_rom_offset,
|
|
||||||
- kernel_filename, initrd_filename, kernel_cmdline);
|
|
||||||
cpu_register_physical_memory(option_rom_start, TARGET_PAGE_SIZE,
|
|
||||||
option_rom_offset);
|
|
||||||
+ load_linux(option_rom_start,
|
|
||||||
+ kernel_filename, initrd_filename, kernel_cmdline);
|
|
||||||
offset += TARGET_PAGE_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
1.6.2.2
|
|
||||||
|
|
|
@ -18,10 +18,11 @@ Signed-off-by: Glauber Costa <glommer@redhat.com>
|
||||||
qemu/hw/pc.c | 2 +-
|
qemu/hw/pc.c | 2 +-
|
||||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||||
|
|
||||||
diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
Index: qemu-kvm-0.10.5/hw/pc.c
|
||||||
--- qemu-kvm-0.10.4.orig/hw/pc.c 2009-05-12 22:48:08.000000000 +0100
|
===================================================================
|
||||||
+++ qemu-kvm-0.10.4/hw/pc.c 2009-05-12 22:48:46.000000000 +0100
|
--- qemu-kvm-0.10.5.orig/hw/pc.c
|
||||||
@@ -927,7 +927,7 @@ vga_bios_error:
|
+++ qemu-kvm-0.10.5/hw/pc.c
|
||||||
|
@@ -925,7 +925,7 @@ vga_bios_error:
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
/* Round up vga bios size to the next 2k boundary */
|
/* Round up vga bios size to the next 2k boundary */
|
||||||
|
@ -30,4 +31,3 @@ diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
||||||
option_rom_start = 0xc0000 + vga_bios_size;
|
option_rom_start = 0xc0000 + vga_bios_size;
|
||||||
|
|
||||||
/* setup basic memory access */
|
/* setup basic memory access */
|
||||||
Only in qemu-kvm-0.10.4/hw: pc.c.orig
|
|
||||||
|
|
|
@ -31,10 +31,11 @@ git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6896 c046a42c-6fe2-441c-8c8
|
||||||
hw/pc.c | 29 +++++++++++++++++++----------
|
hw/pc.c | 29 +++++++++++++++++++----------
|
||||||
1 files changed, 19 insertions(+), 10 deletions(-)
|
1 files changed, 19 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
Index: qemu-kvm-0.10.5/hw/pc.c
|
||||||
--- qemu-kvm-0.10.4.orig/hw/pc.c 2009-05-12 17:16:34.000000000 +0100
|
===================================================================
|
||||||
+++ qemu-kvm-0.10.4/hw/pc.c 2009-05-12 22:46:38.000000000 +0100
|
--- qemu-kvm-0.10.5.orig/hw/pc.c
|
||||||
@@ -820,7 +820,7 @@ static void pc_init1(ram_addr_t ram_size
|
+++ qemu-kvm-0.10.5/hw/pc.c
|
||||||
|
@@ -818,7 +818,7 @@ static void pc_init1(ram_addr_t ram_size
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int ret, linux_boot, i;
|
int ret, linux_boot, i;
|
||||||
|
@ -43,7 +44,7 @@ diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
||||||
ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
|
ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
|
||||||
int bios_size, isa_bios_size, vga_bios_size;
|
int bios_size, isa_bios_size, vga_bios_size;
|
||||||
int pci_option_rom_offset;
|
int pci_option_rom_offset;
|
||||||
@@ -832,6 +832,7 @@ static void pc_init1(ram_addr_t ram_size
|
@@ -830,6 +830,7 @@ static void pc_init1(ram_addr_t ram_size
|
||||||
int index;
|
int index;
|
||||||
BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
|
BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
|
||||||
BlockDriverState *fd[MAX_FD];
|
BlockDriverState *fd[MAX_FD];
|
||||||
|
@ -51,7 +52,7 @@ diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
||||||
|
|
||||||
if (ram_size >= 0xe0000000 ) {
|
if (ram_size >= 0xe0000000 ) {
|
||||||
above_4g_mem_size = ram_size - 0xe0000000;
|
above_4g_mem_size = ram_size - 0xe0000000;
|
||||||
@@ -907,7 +908,7 @@ static void pc_init1(ram_addr_t ram_size
|
@@ -905,7 +906,7 @@ static void pc_init1(ram_addr_t ram_size
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +61,7 @@ diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
||||||
/* VGA BIOS load */
|
/* VGA BIOS load */
|
||||||
if (cirrus_vga_enabled) {
|
if (cirrus_vga_enabled) {
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_CIRRUS_FILENAME);
|
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_CIRRUS_FILENAME);
|
||||||
@@ -925,12 +926,21 @@ vga_bios_error:
|
@@ -923,12 +924,21 @@ vga_bios_error:
|
||||||
fprintf(stderr, "qemu: could not load VGA BIOS '%s'\n", buf);
|
fprintf(stderr, "qemu: could not load VGA BIOS '%s'\n", buf);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +84,7 @@ diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
||||||
/* map the last 128KB of the BIOS in ISA space */
|
/* map the last 128KB of the BIOS in ISA space */
|
||||||
isa_bios_size = bios_size;
|
isa_bios_size = bios_size;
|
||||||
if (isa_bios_size > (128 * 1024))
|
if (isa_bios_size > (128 * 1024))
|
||||||
@@ -951,14 +961,14 @@ vga_bios_error:
|
@@ -949,14 +959,14 @@ vga_bios_error:
|
||||||
ram_addr_t option_rom_offset;
|
ram_addr_t option_rom_offset;
|
||||||
int size, offset;
|
int size, offset;
|
||||||
|
|
||||||
|
@ -91,17 +92,17 @@ diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
||||||
+ offset = option_rom_start;
|
+ offset = option_rom_start;
|
||||||
if (linux_boot) {
|
if (linux_boot) {
|
||||||
option_rom_offset = qemu_ram_alloc(TARGET_PAGE_SIZE);
|
option_rom_offset = qemu_ram_alloc(TARGET_PAGE_SIZE);
|
||||||
load_linux(option_rom_offset,
|
|
||||||
kernel_filename, initrd_filename, kernel_cmdline);
|
|
||||||
- cpu_register_physical_memory(0xd0000, TARGET_PAGE_SIZE,
|
- cpu_register_physical_memory(0xd0000, TARGET_PAGE_SIZE,
|
||||||
+ cpu_register_physical_memory(option_rom_start, TARGET_PAGE_SIZE,
|
+ cpu_register_physical_memory(option_rom_start, TARGET_PAGE_SIZE,
|
||||||
option_rom_offset);
|
option_rom_offset);
|
||||||
|
load_linux(0xd0000,
|
||||||
|
kernel_filename, initrd_filename, kernel_cmdline, below_4g_mem_size);
|
||||||
- offset = TARGET_PAGE_SIZE;
|
- offset = TARGET_PAGE_SIZE;
|
||||||
+ offset += TARGET_PAGE_SIZE;
|
+ offset += TARGET_PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < nb_option_roms; i++) {
|
for (i = 0; i < nb_option_roms; i++) {
|
||||||
@@ -968,13 +978,13 @@ vga_bios_error:
|
@@ -966,13 +976,13 @@ vga_bios_error:
|
||||||
option_rom[i]);
|
option_rom[i]);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -117,7 +118,7 @@ diff -urp qemu-kvm-0.10.4.orig/hw/pc.c qemu-kvm-0.10.4/hw/pc.c
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
size = (size + 4095) & ~4095;
|
size = (size + 4095) & ~4095;
|
||||||
@@ -982,9 +992,8 @@ vga_bios_error:
|
@@ -980,9 +990,8 @@ vga_bios_error:
|
||||||
initialization, and (optionally) marked readonly by the BIOS
|
initialization, and (optionally) marked readonly by the BIOS
|
||||||
before INT 19h. See the PNPBIOS specification, appendix B.
|
before INT 19h. See the PNPBIOS specification, appendix B.
|
||||||
DDIM support is mandatory for proper PCI expansion ROM support. */
|
DDIM support is mandatory for proper PCI expansion ROM support. */
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
From 3b944bee95c6a5ee561acfc4c4d75d8cc971a567 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Avi Kivity <avi@redhat.com>
|
|
||||||
Date: Sun, 3 May 2009 17:04:04 +0300
|
|
||||||
Subject: [PATCH STABLE 3/3] kvm: Trim cpu features not supported by kvm
|
|
||||||
|
|
||||||
Remove cpu features that are not supported by kvm from the cpuid features
|
|
||||||
reported to the guest.
|
|
||||||
|
|
||||||
Signed-off-by: Avi Kivity <avi@redhat.com>
|
|
||||||
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
||||||
Signed-off-by: Glauber Costa <glommer@redhat.com>
|
|
||||||
---
|
|
||||||
target-i386/helper.c | 31 ++++++++++++++++++++++++++++++-
|
|
||||||
1 files changed, 30 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/target-i386/helper.c b/target-i386/helper.c
|
|
||||||
index 1433857..6af5d23 100644
|
|
||||||
--- a/target-i386/helper.c
|
|
||||||
+++ b/target-i386/helper.c
|
|
||||||
@@ -93,6 +93,21 @@ static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void kvm_trim_features(uint32_t *features, uint32_t supported,
|
|
||||||
+ const char *names[])
|
|
||||||
+{
|
|
||||||
+ int i;
|
|
||||||
+ uint32_t mask;
|
|
||||||
+
|
|
||||||
+ for (i = 0; i < 32; ++i) {
|
|
||||||
+ mask = 1U << i;
|
|
||||||
+ if ((*features & mask) && !(supported & mask)) {
|
|
||||||
+ printf("Processor feature %s not supported by kvm\n", names[i]);
|
|
||||||
+ *features &= ~mask;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
typedef struct x86_def_t {
|
|
||||||
const char *name;
|
|
||||||
uint32_t level;
|
|
||||||
@@ -1672,7 +1687,21 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
|
|
||||||
#ifdef USE_KQEMU
|
|
||||||
kqemu_init(env);
|
|
||||||
#endif
|
|
||||||
- if (kvm_enabled())
|
|
||||||
+ if (kvm_enabled()) {
|
|
||||||
kvm_init_vcpu(env);
|
|
||||||
+ kvm_trim_features(&env->cpuid_features,
|
|
||||||
+ kvm_arch_get_supported_cpuid(env, 1, R_EDX),
|
|
||||||
+ feature_name);
|
|
||||||
+ kvm_trim_features(&env->cpuid_ext_features,
|
|
||||||
+ kvm_arch_get_supported_cpuid(env, 1, R_ECX),
|
|
||||||
+ ext_feature_name);
|
|
||||||
+ kvm_trim_features(&env->cpuid_ext2_features,
|
|
||||||
+ kvm_arch_get_supported_cpuid(env, 0x80000001, R_EDX),
|
|
||||||
+ ext2_feature_name);
|
|
||||||
+ kvm_trim_features(&env->cpuid_ext3_features,
|
|
||||||
+ kvm_arch_get_supported_cpuid(env, 0x80000001, R_ECX),
|
|
||||||
+ ext3_feature_name);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return env;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
1.5.6.6
|
|
||||||
|
|
43
qemu.spec
43
qemu.spec
|
@ -1,7 +1,7 @@
|
||||||
Summary: QEMU is a FAST! processor emulator
|
Summary: QEMU is a FAST! processor emulator
|
||||||
Name: qemu
|
Name: qemu
|
||||||
Version: 0.10.4
|
Version: 0.10.5
|
||||||
Release: 5%{?dist}
|
Release: 1%{?dist}
|
||||||
# Epoch because we pushed a qemu-1.0 package
|
# Epoch because we pushed a qemu-1.0 package
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
License: GPLv2+ and LGPLv2+ and BSD
|
License: GPLv2+ and LGPLv2+ and BSD
|
||||||
|
@ -23,19 +23,10 @@ Patch8: 08-vnc-acl-mgmt.patch
|
||||||
|
|
||||||
Patch9: kvm-upstream-ppc.patch
|
Patch9: kvm-upstream-ppc.patch
|
||||||
Patch10: qemu-fix-debuginfo.patch
|
Patch10: qemu-fix-debuginfo.patch
|
||||||
Patch11: qemu-fix-gcc.patch
|
Patch11: qemu-roms-more-room.patch
|
||||||
Patch12: qemu-roms-more-room.patch
|
Patch12: qemu-roms-more-room-fix-vga-align.patch
|
||||||
Patch13: qemu-roms-more-room-fix-vga-align.patch
|
Patch13: qemu-bios-bigger-roms.patch
|
||||||
Patch14: qemu-bios-bigger-roms.patch
|
Patch14: qemu-kvm-fix-kerneldir-includes.patch
|
||||||
Patch15: qemu-kvm-fix-kerneldir-includes.patch
|
|
||||||
Patch16: qemu-fix-load-linux.patch
|
|
||||||
Patch17: qemu-dma-aio-cancellation1.patch
|
|
||||||
Patch18: qemu-dma-aio-cancellation2.patch
|
|
||||||
Patch19: qemu-dma-aio-cancellation3.patch
|
|
||||||
Patch20: qemu-dma-aio-cancellation4.patch
|
|
||||||
Patch21: qemu-make-x86-cpuid-feature-names-available-in-file-scope.patch
|
|
||||||
Patch22: qemu-fix-x86-feature-modifications-for-features-that-set.patch
|
|
||||||
Patch23: qemu-trim-cpu-features-not-supported-by-kvm.patch
|
|
||||||
|
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
@ -231,15 +222,6 @@ such as kvmtrace and kvm_stat.
|
||||||
%patch12 -p1
|
%patch12 -p1
|
||||||
%patch13 -p1
|
%patch13 -p1
|
||||||
%patch14 -p1
|
%patch14 -p1
|
||||||
%patch15 -p1
|
|
||||||
%patch16 -p1
|
|
||||||
%patch17 -p1
|
|
||||||
%patch18 -p1
|
|
||||||
%patch19 -p1
|
|
||||||
%patch20 -p1
|
|
||||||
%patch21 -p1
|
|
||||||
#%patch22 -p1
|
|
||||||
#%patch23 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# systems like rhel build system does not have a recent enough linker so
|
# systems like rhel build system does not have a recent enough linker so
|
||||||
|
@ -482,6 +464,19 @@ fi
|
||||||
%{_mandir}/man1/qemu-img.1*
|
%{_mandir}/man1/qemu-img.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun May 31 2009 Glauber Costa <glommer@redhat.com> - 2:0.10.5-1
|
||||||
|
- Update to 0.10.5, and remove already upstream patches
|
||||||
|
qemu-fix-gcc.patch
|
||||||
|
qemu-fix-load-linux.patch
|
||||||
|
qemu-dma-aio-cancellation1.patch
|
||||||
|
qemu-dma-aio-cancellation2.patch
|
||||||
|
qemu-dma-aio-cancellation3.patch
|
||||||
|
qemu-dma-aio-cancellation4.patch
|
||||||
|
+ all cpuid trimming
|
||||||
|
|
||||||
|
Conflicts:
|
||||||
|
qemu-roms-more-room.patch
|
||||||
|
|
||||||
* Mon May 18 2009 Glauber Costa <glommer@redhat.com> - 2:0.10.4-5
|
* Mon May 18 2009 Glauber Costa <glommer@redhat.com> - 2:0.10.4-5
|
||||||
- Backport cpuid trimming from upstream (#499596)
|
- Backport cpuid trimming from upstream (#499596)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue