]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Merge remote-tracking branch 'hyperv/hyperv-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Apr 2021 08:12:04 +0000 (18:12 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Apr 2021 08:12:04 +0000 (18:12 +1000)
1  2 
arch/x86/hyperv/hv_init.c
arch/x86/kernel/cpu/mshyperv.c
drivers/clocksource/hyperv_timer.c
drivers/hv/vmbus_drv.c
include/linux/hyperv.h

Simple merge
Simple merge
index a02b0a224807e870cd31c5f7436b5e774d1eafea,ce94f78eb85135a935ede06591e56a9f9bf3bf4b..977fd05ac35f62e1db380a8f289f475b52109355
@@@ -418,6 -472,30 +472,30 @@@ static struct clocksource hyperv_cs_ms
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
  };
  
 -      pv_ops.time.sched_clock = sched_clock;
+ /*
+  * Reference to pv_ops must be inline so objtool
+  * detection of noinstr violations can work correctly.
+  */
+ #ifdef CONFIG_GENERIC_SCHED_CLOCK
+ static __always_inline void hv_setup_sched_clock(void *sched_clock)
+ {
+       /*
+        * We're on an architecture with generic sched clock (not x86/x64).
+        * The Hyper-V sched clock read function returns nanoseconds, not
+        * the normal 100ns units of the Hyper-V synthetic clock.
+        */
+       sched_clock_register(sched_clock, 64, NSEC_PER_SEC);
+ }
+ #elif defined CONFIG_PARAVIRT
+ static __always_inline void hv_setup_sched_clock(void *sched_clock)
+ {
+       /* We're on x86/x64 *and* using PV ops */
++      paravirt_set_sched_clock(sched_clock);
+ }
+ #else /* !CONFIG_GENERIC_SCHED_CLOCK && !CONFIG_PARAVIRT */
+ static __always_inline void hv_setup_sched_clock(void *sched_clock) {}
+ #endif /* CONFIG_GENERIC_SCHED_CLOCK */
  static bool __init hv_init_tsc_clocksource(void)
  {
        u64             tsc_msr;
index b341b144bde8de038ad653183e375bf432e8659f,51c40d5e3c8ac8c3921debf6c12219177e95a1c0..004c3390c15f8e3e2311c10489454a2fb7fd4c64
@@@ -1391,9 -1399,7 +1399,8 @@@ static irqreturn_t vmbus_percpu_isr(in
  static void hv_kmsg_dump(struct kmsg_dumper *dumper,
                         enum kmsg_dump_reason reason)
  {
 +      struct kmsg_dump_iter iter;
        size_t bytes_written;
-       phys_addr_t panic_pa;
  
        /* We are only interested in panics. */
        if ((reason != KMSG_DUMP_PANIC) || (!sysctl_record_panic_msg))
         * Write dump contents to the page. No need to synchronize; panic should
         * be single-threaded.
         */
 -      kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE,
 +      kmsg_dump_rewind(&iter);
 +      kmsg_dump_get_buffer(&iter, false, hv_panic_page, HV_HYP_PAGE_SIZE,
                             &bytes_written);
-       if (bytes_written)
-               hyperv_report_panic_msg(panic_pa, bytes_written);
+       if (!bytes_written)
+               return;
+       /*
+        * P3 to contain the physical address of the panic page & P4 to
+        * contain the size of the panic data in that page. Rest of the
+        * registers are no-op when the NOTIFY_MSG flag is set.
+        */
+       hv_set_register(HV_REGISTER_CRASH_P0, 0);
+       hv_set_register(HV_REGISTER_CRASH_P1, 0);
+       hv_set_register(HV_REGISTER_CRASH_P2, 0);
+       hv_set_register(HV_REGISTER_CRASH_P3, virt_to_phys(hv_panic_page));
+       hv_set_register(HV_REGISTER_CRASH_P4, bytes_written);
+       /*
+        * Let Hyper-V know there is crash data available along with
+        * the panic message.
+        */
+       hv_set_register(HV_REGISTER_CRASH_CTL,
+              (HV_CRASH_CTL_CRASH_NOTIFY | HV_CRASH_CTL_CRASH_NOTIFY_MSG));
  }
  
  static struct kmsg_dumper hv_kmsg_dumper = {
Simple merge