Skip to content

Commit 18d49ec

Browse files
committed
Merge tag 'for-linus-4.19d-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Juergen writes: "xen: Two small fixes for xen drivers." * tag 'for-linus-4.19d-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: issue warning message when out of grant maptrack entries xen/x86/vpmu: Zero struct pt_regs before calling into sample handling code
2 parents a83f87c + d59f532 commit 18d49ec

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

arch/x86/xen/pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ static void xen_convert_regs(const struct xen_pmu_regs *xen_regs,
478478
irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id)
479479
{
480480
int err, ret = IRQ_NONE;
481-
struct pt_regs regs;
481+
struct pt_regs regs = {0};
482482
const struct xen_pmu_data *xenpmu_data = get_xenpmu_data();
483483
uint8_t xenpmu_flags = get_xenpmu_flags();
484484

drivers/xen/grant-table.c

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,18 +1040,33 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
10401040
return ret;
10411041

10421042
for (i = 0; i < count; i++) {
1043-
/* Retry eagain maps */
1044-
if (map_ops[i].status == GNTST_eagain)
1045-
gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref, map_ops + i,
1046-
&map_ops[i].status, __func__);
1047-
1048-
if (map_ops[i].status == GNTST_okay) {
1043+
switch (map_ops[i].status) {
1044+
case GNTST_okay:
1045+
{
10491046
struct xen_page_foreign *foreign;
10501047

10511048
SetPageForeign(pages[i]);
10521049
foreign = xen_page_foreign(pages[i]);
10531050
foreign->domid = map_ops[i].dom;
10541051
foreign->gref = map_ops[i].ref;
1052+
break;
1053+
}
1054+
1055+
case GNTST_no_device_space:
1056+
pr_warn_ratelimited("maptrack limit reached, can't map all guest pages\n");
1057+
break;
1058+
1059+
case GNTST_eagain:
1060+
/* Retry eagain maps */
1061+
gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref,
1062+
map_ops + i,
1063+
&map_ops[i].status, __func__);
1064+
/* Test status in next loop iteration. */
1065+
i--;
1066+
break;
1067+
1068+
default:
1069+
break;
10551070
}
10561071
}
10571072

0 commit comments

Comments
 (0)