From 07d491dedeb2add92cd243d0995bd59520577a45 Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Sun, 28 Dec 2014 21:13:52 +0000 Subject: [PATCH 1/6] r245508 modified the NFS client's Setattr RPC to use VA_UTIMES_NULL to indicate whether it should set the time to the current tod on the server. This had the side effect of making the NFS client use the client's timestamp for exclusive create, starting with FreeBSD9.2. Unfortunately a bug in some Solaris NFS servers causes these servers to return NFS_OK to the Setattr RPC done during exclusive create, but not actually set the file's mode, leaving the file's mode == 0. This patch restores the NFS client's behaviour to use the server's tod for the exclusive open's Setattr RPC, to avoid the Solaris server bug and to restore the pre-FreeBSD9.2 NFS behaviour. Discussed on: freebsd-fs PR: 186293 MFC after: 3 months --- sys/fs/nfsclient/nfs_clport.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index efdc812610d..d3bac30bdc7 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -1096,9 +1096,16 @@ nfscl_checksattr(struct vattr *vap, struct nfsvattr *nvap) * us to do a SETATTR RPC. FreeBSD servers store the verifier * in atime, but we can't really assume that all servers will * so we ensure that our SETATTR sets both atime and mtime. + * Set the VA_UTIMES_NULL flag for this case, so that + * the server's time will be used. This is needed to + * work around a bug in some Solaris servers, where + * setting the time TOCLIENT causes the Setattr RPC + * to return NFS_OK, but not set va_mode. */ - if (vap->va_mtime.tv_sec == VNOVAL) + if (vap->va_mtime.tv_sec == VNOVAL) { vfs_timestamp(&vap->va_mtime); + vap->va_vaflags |= VA_UTIMES_NULL; + } if (vap->va_atime.tv_sec == VNOVAL) vap->va_atime = vap->va_mtime; return (1); From 782feef3f378262468976e1707feb04b7c196b8a Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Sun, 28 Dec 2014 21:33:41 +0000 Subject: [PATCH 2/6] Update comments (r4 is not used anywhere), use non-profiling entry macros. --- sys/arm/arm/cpu_asm-v6.S | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/arm/arm/cpu_asm-v6.S b/sys/arm/arm/cpu_asm-v6.S index c7104a36fb6..b99401fb452 100644 --- a/sys/arm/arm/cpu_asm-v6.S +++ b/sys/arm/arm/cpu_asm-v6.S @@ -37,14 +37,16 @@ /* * Define cache functions used by startup code, which counts on the fact that - * only r0-r4,r12 (ip) are modified and no stack space is used. This set - * of function must be called with interrupts disabled and don't follow - * ARM ABI (cannot be called form C code. - * Moreover, it works only with caches integrated to CPU (accessible via CP15). + * only r0-r3,r12 (ip) are modified and no stack space is used. These functions + * must be called with interrupts disabled. Moreover, these work only with + * caches integrated to CPU (accessible via CP15); systems with an external L2 + * cache controller such as a PL310 need separate calls to that device driver + * to affect L2 caches. This is not a factor during early kernel startup, as + * any external L2 cache controller has not been enabled yet. */ /* Invalidate D cache to PoC. (aka all cache levels)*/ -ASENTRY(dcache_inv_poc_all) +ASENTRY_NP(dcache_inv_poc_all) mrc CP15_CLIDR(r0) ands r0, r0, #0x07000000 mov r0, r0, lsr #23 /* Get LoC (naturally aligned) */ @@ -96,7 +98,7 @@ ASENTRY(dcache_inv_poc_all) END(dcache_inv_poc_all) /* Invalidate D cache to PoU. (aka L1 cache only)*/ -ASENTRY(dcache_inv_pou_all) +ASENTRY_NP(dcache_inv_pou_all) mrc CP15_CLIDR(r0) ands r0, r0, #0x07000000 mov r0, r0, lsr #26 /* Get LoUU (naturally aligned) */ @@ -147,7 +149,7 @@ ASENTRY(dcache_inv_pou_all) END(dcache_inv_pou_all) /* Write back and Invalidate D cache to PoC. */ -ASENTRY(dcache_wbinv_poc_all) +ASENTRY_NP(dcache_wbinv_poc_all) mrc CP15_CLIDR(r0) ands r0, r0, #0x07000000 mov r0, r0, lsr #23 /* Get LoC (naturally aligned) */ From 393677427cdd7d4fa1f7e3854606f507602302bb Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sun, 28 Dec 2014 21:36:20 +0000 Subject: [PATCH 3/6] Don't use a sub-device/-vendor wildcard for probing MCS9922 as other chips with the same device and vendor IDs actually may provide different functionality. While at it, canonicalize the description to match other MosChip UARTs. PR: 186891 MFC after: 3 days --- sys/dev/uart/uart_bus_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index 748d18afc78..b16abf9a649 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -137,8 +137,8 @@ static const struct pci_id pci_ns8250_ids[] = { "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9904, 0xa000, 0x1000, "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, -{ 0x9710, 0x9922, 0xffff, 0, - "MosChip MCS9922 Multi I/O Controller", 0x10 }, +{ 0x9710, 0x9922, 0xa000, 0x1000, + "MosChip MCS9922 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From db39fc2a01d09a346954a665b1c1ee0d819bf986 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 29 Dec 2014 00:10:43 +0000 Subject: [PATCH 4/6] In contrib/binutils/bfd/elf32-ppc.c, avoid warnings about case values not being in the enumerated type 'enum elf_ppc_reloc_type', by casting the switch argument to int. MFC after: 3 days --- contrib/binutils/bfd/elf32-ppc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c index 31c90df1ff8..0441fe2bf6b 100644 --- a/contrib/binutils/bfd/elf32-ppc.c +++ b/contrib/binutils/bfd/elf32-ppc.c @@ -6185,7 +6185,7 @@ ppc_elf_relocate_section (bfd *output_bfd, howto = NULL; if (r_type < R_PPC_max) howto = ppc_elf_howto_table[r_type]; - switch (r_type) + switch ((int) r_type) { default: (*_bfd_error_handler) From f83577167c89aff02b68c7c9022006cb45a30df1 Mon Sep 17 00:00:00 2001 From: Bryan Venteicher Date: Mon, 29 Dec 2014 00:35:44 +0000 Subject: [PATCH 5/6] Remove dev/virtio/virtio.h include from BERI VirtIO This header file contains prototypes and defines that only make sense to the guest VirtIO device drivers. Reviewed by: br --- sys/dev/beri/virtio/network/if_vtbe.c | 3 ++- sys/dev/beri/virtio/virtio.c | 1 - sys/dev/beri/virtio/virtio_block.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/beri/virtio/network/if_vtbe.c b/sys/dev/beri/virtio/network/if_vtbe.c index a08a8a2918c..01e4be973a0 100644 --- a/sys/dev/beri/virtio/network/if_vtbe.c +++ b/sys/dev/beri/virtio/network/if_vtbe.c @@ -82,7 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include #include #include "pio_if.h" diff --git a/sys/dev/beri/virtio/virtio.c b/sys/dev/beri/virtio/virtio.c index cb7c2934d22..6921c8a874e 100644 --- a/sys/dev/beri/virtio/virtio.c +++ b/sys/dev/beri/virtio/virtio.c @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include diff --git a/sys/dev/beri/virtio/virtio_block.c b/sys/dev/beri/virtio/virtio_block.c index 12b6e0edc9e..b763cb927c1 100644 --- a/sys/dev/beri/virtio/virtio_block.c +++ b/sys/dev/beri/virtio/virtio_block.c @@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include +#include #include #include "pio_if.h" From 8763c089ab0dae864a1a30cd4d8b0d5ee993c3f8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 29 Dec 2014 09:24:21 +0000 Subject: [PATCH 6/6] Use -Wl, to pass options to the linker for PowerPC's boot1.chrp. MFC after: 3 days --- sys/boot/powerpc/boot1.chrp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/boot/powerpc/boot1.chrp/Makefile b/sys/boot/powerpc/boot1.chrp/Makefile index 4255cdb1dee..c350e5cb25d 100644 --- a/sys/boot/powerpc/boot1.chrp/Makefile +++ b/sys/boot/powerpc/boot1.chrp/Makefile @@ -15,7 +15,7 @@ MAN= CFLAGS= -ffreestanding -msoft-float -Os \ -I${.CURDIR}/../../common -I${.CURDIR}/../../../ \ -D_STANDALONE -LDFLAGS=-nostdlib -static -N +LDFLAGS=-nostdlib -static -Wl,-N .include "${.CURDIR}/../Makefile.inc" .PATH: ${.CURDIR}/../../../libkern ${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR}