Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/arch Pull up following revision(s) (requested by naka...



details:   https://anonhg.NetBSD.org/src/rev/85b91d8e4d6a
branches:  netbsd-8
changeset: 851133:85b91d8e4d6a
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Nov 21 11:01:02 2017 +0000

description:
Pull up following revision(s) (requested by nakayama in ticket #359):
        sys/arch/amd64/include/i82093reg.h: revision 1.9
        sys/arch/x86/x86/ioapic.c: revision 1.54
        sys/arch/i386/include/i82093reg.h: revision 1.11
Don't write a 1 to the read only RIRR bit in the IOAPIC redirection
register to fix "tlp0: filter setup and transmit timeout" observed
on Hyper-V VMs with the Legacy Network Adapter.
>From OpenBSD via PR kern/49323:
 https://marc.info/?l=openbsd-cvs&m=146718035432599&w=2
Modified files:
sys/arch/amd64/amd64: ioapic.c
sys/arch/amd64/include: i82093reg.h
Log message:
Don't write a 1 to the RIRR bit in the IOAPIC redirection register. This bit
is R/O, and although it should not matter what value is written there,
Hyper-V's emulated IOAPIC interprets a write of 1 in some unexpected way and
subsequently blocks interrupt delivery. This primarily manifests itself as
de(4) timeouts when using Hyper-V VMs with the "Legacy Network Adapter"
interface.
Tested both amd64 and i386 on Client Hyper-V on Windows 10.

diffstat:

 sys/arch/amd64/include/i82093reg.h |  5 +++--
 sys/arch/i386/include/i82093reg.h  |  5 +++--
 sys/arch/x86/x86/ioapic.c          |  7 ++++---
 3 files changed, 10 insertions(+), 7 deletions(-)

diffs (87 lines):

diff -r b4f735552809 -r 85b91d8e4d6a sys/arch/amd64/include/i82093reg.h
--- a/sys/arch/amd64/include/i82093reg.h        Tue Nov 21 10:54:18 2017 +0000
+++ b/sys/arch/amd64/include/i82093reg.h        Tue Nov 21 11:01:02 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: i82093reg.h,v 1.8 2017/05/23 08:54:38 nonaka Exp $ */
+/*      $NetBSD: i82093reg.h,v 1.8.2.1 2017/11/21 11:01:02 martin Exp $ */
 
 #include <x86/i82093reg.h>
 
@@ -57,6 +57,7 @@
        movq    IOAPIC_SC_DATA(%rdi),%r15                       ;\
        movl    (%r15),%esi                                     ;\
        orl     $IOAPIC_REDLO_MASK,%esi                         ;\
+       andl    $~IOAPIC_REDLO_RIRR,%esi                        ;\
        movl    %esi,(%r15)                                     ;\
        movq    IS_PIC(%r14),%rdi                               ;\
        ioapic_asm_unlock(num)
@@ -73,7 +74,7 @@
        movq    IOAPIC_SC_DATA(%rdi),%r13                       ;\
        movl    %esi, (%r15)                                    ;\
        movl    (%r13),%r12d                                    ;\
-       andl    $~IOAPIC_REDLO_MASK,%r12d                       ;\
+       andl    $~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%r12d   ;\
        movl    %esi,(%r15)                                     ;\
        movl    %r12d,(%r13)                                    ;\
        movq    IS_PIC(%r14),%rdi                               ;\
diff -r b4f735552809 -r 85b91d8e4d6a sys/arch/i386/include/i82093reg.h
--- a/sys/arch/i386/include/i82093reg.h Tue Nov 21 10:54:18 2017 +0000
+++ b/sys/arch/i386/include/i82093reg.h Tue Nov 21 11:01:02 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: i82093reg.h,v 1.10 2017/05/23 08:54:39 nonaka Exp $ */
+/*      $NetBSD: i82093reg.h,v 1.10.2.1 2017/11/21 11:01:02 martin Exp $ */
 
 #include <x86/i82093reg.h>
 
@@ -48,6 +48,7 @@
        movl    IOAPIC_SC_DATA(%edi),%ebx                       ;\
        movl    (%ebx),%esi                                     ;\
        orl     $IOAPIC_REDLO_MASK,%esi                         ;\
+       andl    $~IOAPIC_REDLO_RIRR,%esi                        ;\
        movl    %esi,(%ebx)                                     ;\
        movl    IS_PIC(%ebp),%edi                               ;\
        ioapic_asm_unlock(num)
@@ -71,7 +72,7 @@
        movl    IOAPIC_SC_DATA(%edi),%eax                       ;\
        movl    %esi, (%ebx)                                    ;\
        movl    (%eax),%edx                                     ;\
-       andl    $~IOAPIC_REDLO_MASK,%edx                        ;\
+       andl    $~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%edx    ;\
        movl    %esi, (%ebx)                                    ;\
        movl    %edx,(%eax)                                     ;\
        movl    IS_PIC(%ebp),%edi                               ;\
diff -r b4f735552809 -r 85b91d8e4d6a sys/arch/x86/x86/ioapic.c
--- a/sys/arch/x86/x86/ioapic.c Tue Nov 21 10:54:18 2017 +0000
+++ b/sys/arch/x86/x86/ioapic.c Tue Nov 21 11:01:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ioapic.c,v 1.52 2015/07/27 15:45:20 msaitoh Exp $      */
+/*     $NetBSD: ioapic.c,v 1.52.10.1 2017/11/21 11:01:02 martin Exp $  */
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.52 2015/07/27 15:45:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.52.10.1 2017/11/21 11:01:02 martin Exp $");
 
 #include "opt_ddb.h"
 
@@ -508,6 +508,7 @@
        flags = ioapic_lock(sc);
        redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
        redlo |= IOAPIC_REDLO_MASK;
+       redlo &= ~IOAPIC_REDLO_RIRR;
        ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
        ioapic_unlock(sc, flags);
 }
@@ -548,7 +549,7 @@
 
        flags = ioapic_lock(sc);
        redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
-       redlo &= ~IOAPIC_REDLO_MASK;
+       redlo &= ~(IOAPIC_REDLO_MASK | IOAPIC_REDLO_RIRR);
        ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
        ioapic_unlock(sc, flags);
 }



Home | Main Index | Thread Index | Old Index