Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1398525

Re: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if TIMINCA is zero

From Jarod Wilson <jarod@redhat.com>
Newsgroups linux.kernel
Subject Re: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if TIMINCA is zero
Date 2016-05-10 23:10 +0200
Message-ID <rxn4K-2dm-9@gated-at.bofh.it> (permalink)
References <rvTV8-2Ma-17@gated-at.bofh.it> <rvXFo-6JF-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, May 06, 2016 at 11:43:17PM +0000, Rustad, Mark D wrote:
> Denys Vlasenko <dvlasenk@redhat.com> wrote:
> 
> >Users report that under VMWare, er32(TIMINCA) returns zero.
> >This causes division by zero at init time as follows:
> >
> > ==>            incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
> >                for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
> >                        /* latch SYSTIMH on read of SYSTIML */
> >                        systim_next = (cycle_t)er32(SYSTIML);
> >                        systim_next |= (cycle_t)er32(SYSTIMH) << 32;
> >
> >                        time_delta = systim_next - systim;
> >                        temp = time_delta;
> > ====>                  rem = do_div(temp, incvalue);
> >
> >This change makes kernel survive this, and users report that
> >NIC does work after this change.
> >
> >Since on real hardware incvalue is never zero, this should not affect
> >real hardware use case.
...
> I seem to recall that this was rejected before because it really is VMWare's
> bug and, if they fix it, any existing VMs that use this will just work.
> Changing the driver will only fix it for vms that install a new driver. I
> don't object to doing it, it just seems like not the most effective place to
> address the issue.

You could also have people who never update VMWare, for whom a kernel
work-around would be better. I think it'd be best to address it both at
the driver level and the emulated hardware level, to improve things for
the most possible users. Those who update neither hypervisor or
kernel/driver, well, they reap what they sow.

-- 
Jarod Wilson
jarod@redhat.com

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] e1000e: prevent division by zero if TIMINCA is zero Denys Vlasenko <dvlasenk@redhat.com> - 2016-05-06 21:50 +0200
  Re: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if  TIMINCA is zero "Rustad, Mark D" <mark.d.rustad@intel.com> - 2016-05-07 01:50 +0200
    Re: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if  TIMINCA is zero Jarod Wilson <jarod@redhat.com> - 2016-05-10 23:10 +0200
      Re: [Intel-wired-lan] [PATCH] e1000e: prevent division by zero if TIMINCA is zero Mark D Rustad <mrustad@gmail.com> - 2016-05-11 06:10 +0200

csiph-web