aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-23 07:32:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-23 07:32:19 -0400
commit18d49ec3c62f46d7225f822e112742fbe0daf94b (patch)
treef2f55388d9300d8510d8fafb7a75b9d68a92b53c
parenta83f87c1d2a93a8fd2413ce8f410b69848db0fd5 (diff)
parentd59f532480f5231bf62615a9287e05b78225fb05 (diff)
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
-rw-r--r--arch/x86/xen/pmu.c2
-rw-r--r--drivers/xen/grant-table.c27
2 files changed, 22 insertions, 7 deletions
diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c
index 7d00d4ad44d4..95997e6c0696 100644
--- a/arch/x86/xen/pmu.c
+++ b/arch/x86/xen/pmu.c
@@ -478,7 +478,7 @@ static void xen_convert_regs(const struct xen_pmu_regs *xen_regs,
478irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id) 478irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id)
479{ 479{
480 int err, ret = IRQ_NONE; 480 int err, ret = IRQ_NONE;
481 struct pt_regs regs; 481 struct pt_regs regs = {0};
482 const struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); 482 const struct xen_pmu_data *xenpmu_data = get_xenpmu_data();
483 uint8_t xenpmu_flags = get_xenpmu_flags(); 483 uint8_t xenpmu_flags = get_xenpmu_flags();
484 484
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index 7bafa703a992..84575baceebc 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1040,18 +1040,33 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
1040 return ret; 1040 return ret;
1041 1041
1042 for (i = 0; i < count; i++) { 1042 for (i = 0; i < count; i++) {
1043 /* Retry eagain maps */ 1043 switch (map_ops[i].status) {
1044 if (map_ops[i].status == GNTST_eagain) 1044 case GNTST_okay:
1045 gnttab_retry_eagain_gop(GNTTABOP_map_grant_ref, map_ops + i, 1045 {
1046 &map_ops[i].status, __func__);
1047
1048 if (map_ops[i].status == GNTST_okay) {
1049 struct xen_page_foreign *foreign; 1046 struct xen_page_foreign *foreign;
1050 1047
1051 SetPageForeign(pages[i]); 1048 SetPageForeign(pages[i]);
1052 foreign = xen_page_foreign(pages[i]); 1049 foreign = xen_page_foreign(pages[i]);
1053 foreign->domid = map_ops[i].dom; 1050 foreign->domid = map_ops[i].dom;
1054 foreign->gref = map_ops[i].ref; 1051 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;
1055 } 1070 }
1056 } 1071 }
1057 1072