Sun Feb 27 19:22:12 2022 UTC ()
mips: Redefine BDSYNC as sync on Octeon, not syncw.

BDSYNC is used for membar_sync, which is supposed to be a full
sequential consistency barrier, which is not provided by syncw, so
this is necessary for correctness.

BDSYNC is not used for anything else, so this can't hurt performance,
except where it was necessary for correctness anyway or where the
semantic choice of membar_sync was too strong anyway.


(riastradh)
diff -r1.67 -r1.68 src/sys/arch/mips/include/asm.h

cvs diff -r1.67 -r1.68 src/sys/arch/mips/include/asm.h (expand / switch to unified diff)

--- src/sys/arch/mips/include/asm.h 2022/02/27 19:22:02 1.67
+++ src/sys/arch/mips/include/asm.h 2022/02/27 19:22:12 1.68
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: asm.h,v 1.67 2022/02/27 19:22:02 riastradh Exp $ */ 1/* $NetBSD: asm.h,v 1.68 2022/02/27 19:22:12 riastradh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell. 8 * Ralph Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -564,27 +564,27 @@ _C_LABEL(x): @@ -564,27 +564,27 @@ _C_LABEL(x):
564#define REG_SCALESHIFT 3 564#define REG_SCALESHIFT 3
565#endif 565#endif
566 566
567#if (MIPS1 + MIPS2) > 0 567#if (MIPS1 + MIPS2) > 0
568#define NOP_L nop 568#define NOP_L nop
569#else 569#else
570#define NOP_L /* nothing */ 570#define NOP_L /* nothing */
571#endif 571#endif
572 572
573/* compiler define */ 573/* compiler define */
574#if defined(__OCTEON__) 574#if defined(__OCTEON__)
575 /* early cnMIPS have erratum which means 2 */ 575 /* early cnMIPS have erratum which means 2 */
576#define LLSCSYNC sync 4; sync 4 576#define LLSCSYNC sync 4; sync 4
577#define BDSYNC sync 4 /* sync 4 == syncw - sync all writes */ 577#define BDSYNC sync
578#define BDSYNC_ACQ sync 578#define BDSYNC_ACQ sync
579#define SYNC_ACQ sync 579#define SYNC_ACQ sync
580#define SYNC_REL sync 580#define SYNC_REL sync
581#define BDSYNC_PLUNGER sync 4 581#define BDSYNC_PLUNGER sync 4
582#define SYNC_PLUNGER sync 4 582#define SYNC_PLUNGER sync 4
583#elif __mips >= 3 || !defined(__mips_o32) 583#elif __mips >= 3 || !defined(__mips_o32)
584#define LLSCSYNC sync 584#define LLSCSYNC sync
585#define BDSYNC sync 585#define BDSYNC sync
586#define BDSYNC_ACQ sync 586#define BDSYNC_ACQ sync
587#define SYNC_ACQ sync 587#define SYNC_ACQ sync
588#define SYNC_REL sync 588#define SYNC_REL sync
589#define BDSYNC_PLUNGER nop 589#define BDSYNC_PLUNGER nop
590#define SYNC_PLUNGER /* nothing */ 590#define SYNC_PLUNGER /* nothing */