Module Name:    src
Committed By:   snj
Date:           Wed Jan  3 19:58:14 UTC 2018

Modified Files:
        src/sys/arch/amd64/include [netbsd-7]: i82093reg.h
        src/sys/arch/i386/include [netbsd-7]: i82093reg.h
        src/sys/arch/x86/x86 [netbsd-7]: ioapic.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1527):
        sys/arch/amd64/include/i82093reg.h: revision 1.9
        sys/arch/i386/include/i82093reg.h: revision 1.11
        sys/arch/x86/x86/ioapic.c: revision 1.54
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


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.58.1 src/sys/arch/amd64/include/i82093reg.h
cvs rdiff -u -r1.8 -r1.8.58.1 src/sys/arch/i386/include/i82093reg.h
cvs rdiff -u -r1.48 -r1.48.8.1 src/sys/arch/x86/x86/ioapic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/include/i82093reg.h
diff -u src/sys/arch/amd64/include/i82093reg.h:1.5 src/sys/arch/amd64/include/i82093reg.h:1.5.58.1
--- src/sys/arch/amd64/include/i82093reg.h:1.5	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/amd64/include/i82093reg.h	Wed Jan  3 19:58:14 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.5 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.5.58.1 2018/01/03 19:58:14 snj Exp $ */
 
 #include <x86/i82093reg.h>
 
@@ -50,6 +50,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)
@@ -66,7 +67,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				;\

Index: src/sys/arch/i386/include/i82093reg.h
diff -u src/sys/arch/i386/include/i82093reg.h:1.8 src/sys/arch/i386/include/i82093reg.h:1.8.58.1
--- src/sys/arch/i386/include/i82093reg.h:1.8	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/i386/include/i82093reg.h	Wed Jan  3 19:58:14 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.8 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.8.58.1 2018/01/03 19:58:14 snj Exp $ */
 
 #include <x86/i82093reg.h>
 
@@ -41,6 +41,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)
@@ -64,7 +65,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				;\

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.48 src/sys/arch/x86/x86/ioapic.c:1.48.8.1
--- src/sys/arch/x86/x86/ioapic.c:1.48	Fri Jun 28 14:31:49 2013
+++ src/sys/arch/x86/x86/ioapic.c	Wed Jan  3 19:58:14 2018
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.48 2013/06/28 14:31:49 jakllsch Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.48.8.1 2018/01/03 19:58:14 snj 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.48 2013/06/28 14:31:49 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.48.8.1 2018/01/03 19:58:14 snj Exp $");
 
 #include "opt_ddb.h"
 
@@ -506,6 +506,7 @@ ioapic_hwmask(struct pic *pic, int pin)
 	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);
 }
@@ -546,7 +547,7 @@ ioapic_hwunmask(struct pic *pic, int pin
 
 	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);
 }

Reply via email to