Xen patches

- bug fixes for mapcache and ioreq handling
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEE+AwAYwjiLP2KkueYDPVXL9f7Va8FAmHyt4IACgkQDPVXL9f7
 Va8SVgf+N6uOYoCVooWFk5H6MpXPRGLNw7YB1L5bR1T8DmXef+149p3NaqYuD3Kr
 Fz+6Kc1xpRivtfz7psy6ME+VVLQaCL5pYDYvoWBW/EPDJaBIGe6oednY4N0KEPZH
 4AqyuLwNZ+xPhv78YMnjmvF6foIiuO712yAwlG7oi+E+wp25SlKi6DaWHlY2U4/F
 hRC4CS3fJKUONn+s511EdSYhjZVqC0+Dp5pyAPGShyp7AMFQUV7mKl+lC2E3/gWo
 Qudq/VqX/k4dlLt1zudh/qQTUxJA+nddM1a7grvXmgZL0nngdvKyXQHTOv60HYgF
 yFC5OkHu9XohxYaY8gQYNreYiqCxeQ==
 =p6C5
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20220127' into staging

Xen patches

- bug fixes for mapcache and ioreq handling

# gpg: Signature made Thu 27 Jan 2022 15:17:22 GMT
# gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [unknown]
# gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
#      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF

* remotes/aperard/tags/pull-xen-20220127:
  xen-mapcache: Avoid entry->lock overflow
  xen-hvm: Allow disabling buffer_io_timer

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2022-01-28 11:05:28 +00:00
commit b367db4812
2 changed files with 11 additions and 3 deletions

View File

@ -1087,10 +1087,11 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
}
}
static int handle_buffered_iopage(XenIOState *state)
static bool handle_buffered_iopage(XenIOState *state)
{
buffered_iopage_t *buf_page = state->buffered_io_page;
buf_ioreq_t *buf_req = NULL;
bool handled_ioreq = false;
ioreq_t req;
int qw;
@ -1144,9 +1145,10 @@ static int handle_buffered_iopage(XenIOState *state)
assert(!req.data_is_ptr);
qatomic_add(&buf_page->read_pointer, qw + 1);
handled_ioreq = true;
}
return req.count;
return handled_ioreq;
}
static void handle_buffered_io(void *opaque)

View File

@ -52,7 +52,7 @@ typedef struct MapCacheEntry {
hwaddr paddr_index;
uint8_t *vaddr_base;
unsigned long *valid_mapping;
uint8_t lock;
uint32_t lock;
#define XEN_MAPCACHE_ENTRY_DUMMY (1 << 0)
uint8_t flags;
hwaddr size;
@ -355,6 +355,12 @@ tryagain:
if (lock) {
MapCacheRev *reventry = g_malloc0(sizeof(MapCacheRev));
entry->lock++;
if (entry->lock == 0) {
fprintf(stderr,
"mapcache entry lock overflow: "TARGET_FMT_plx" -> %p\n",
entry->paddr_index, entry->vaddr_base);
abort();
}
reventry->dma = dma;
reventry->vaddr_req = mapcache->last_entry->vaddr_base + address_offset;
reventry->paddr_index = mapcache->last_entry->paddr_index;