From owner-freebsd-current@freebsd.org Tue Jul 3 19:32:04 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C59BA1040D58 for ; Tue, 3 Jul 2018 19:32:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7FE94299; Tue, 3 Jul 2018 19:32:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (static-71-168-218-4.cmdnnj.fios.verizon.net [71.168.218.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 3FCB4168F6; Tue, 3 Jul 2018 19:32:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: atomic changes break drm-next-kmod? From: Jung-uk Kim To: John Baldwin , Niclas Zeising , "O. Hartmann" , FreeBSD Current References: <20180703170223.266dbf5b@thor.intern.walstatt.dynvpn.de> <94747acc-dbf4-69db-aa19-687155f66dbf@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=jkim@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJBztUBCAChqNyGqmFuNo0U7MBzsD+q/G6Cv0l7LGVrOAsgh34M8wIWhD+tztDWMVfn AhxNDd0ceCj2bYOe67sTQxAScEcbt2FfvPOLp9MEXb9qohZj172Gwkk7dnhOhZZKhVGVZKM4 NcsuBDUzgf4f3Vdzj4wg6WlqplnTZo8lPE4hZWvZHoFIyunPTJWenybeV1xnxK7J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3s6ufTRncvq14fEOxCNq1Rf4Q 9P+tOFa8GZfKDGB2BFGIrW7uT5mlmKdK1vO6ZIA930y5kUsnCmBUEBJkE2ciSQk01aB/1o62 Q3Gk/F6BwtNY9OXiqF7AcAo+K/BMIaqb26QKeh+IIgK1NN9dQiq3ByTbl4zpGZa6MmsnnRTu mzGKt2nkz7vBzH6+hZp1OzGZikgjjhYWVFoJo1dvf/rv4obs0ZJEqFPQs/1Qa1dbkKBv6odB XJpPH0ssOluTY24d1XxTiKTwmWvHeQkOKRAIfD7VTtF4TesoZYkf7hsh3e3VwXhptSLFnEOi WwYofg== Message-ID: Date: Tue, 3 Jul 2018 15:32:03 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <94747acc-dbf4-69db-aa19-687155f66dbf@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2018 19:32:05 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 07/03/2018 15:23, Jung-uk Kim wrote: > On 07/03/2018 15:02, John Baldwin wrote: >> On 7/3/18 11:28 AM, Niclas Zeising wrote: >>> On 07/03/18 17:02, O. Hartmann wrote: >>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 >>>> >>>> Am Tue, 3 Jul 2018 10:19:57 -0400 Michael Butler >>>> schrieb: >>>> >>>>> It seems recent changes (SVN r335873?) may have broken >>>>> drm-next-kmod .. >>>>> >>>>> --- i915_drv.o --- In file included from i915_drv.c:30: In >>>>> file included from >>>>> /usr/ports/graphics/drm-next-kmod/work/kms-drm-a753215/linuxkpi/gp lv2/include/linux/acpi.h:26: >>>>> >>>>> >>>>> In file included from >>>>> /usr/ports/graphics/drm-next-kmod/work/kms-drm-a753215/linuxkpi/gp lv2/include/linux/device.h:4: >>>>> >>>>> >>>>> In file included from >>>>> /usr/src/sys/compat/linuxkpi/common/include/linux/device.h:35: >>>>> >>>>> >>>>> In file included from >>>>> /usr/src/sys/compat/linuxkpi/common/include/linux/types.h:37: >>>>> >>>>> >>>>> In file included from /usr/src/sys/sys/systm.h:44: >>>>> ./machine/atomic.h:450:29: error: invalid operand for >>>>> instruction ATOMIC_ASM(clear, long, "andq %1,%0", "ir", >>>>> ~v); ^ :1:7: note: instantiated into assembly >>>>> here andq $9223372036854775807,40672(%r14) >>>>> ^~~~~~~~~~~~~~~~~~~~~ 1 error generated. *** [i915_drv.o] >>>>> Error code 1 >>>>> >>>>> make[3]: stopped in >>>>> /usr/ports/graphics/drm-next-kmod/work/kms-drm-a753215/i915 >>>>> >>>>> >>>>> - --- i915_gem.o --- >>>>> In file included from i915_gem.c:28: In file included from >>>>> >>>>> /usr/ports/graphics/drm-next-kmod/work/kms-drm-a753215/include/drm /drmP.h:38: >>>>> >>>>> >>>>> In file included from /usr/src/sys/sys/malloc.h:42: >>>>> In file included from /usr/src/sys/sys/systm.h:44: >>>>> ./machine/atomic.h:449:29: error: invalid operand for >>>>> instruction ATOMIC_ASM(set, long, "orq %1,%0", "ir", >>>>> v); ^ :1:6: note: instantiated into assembly >>>>> here orq $-9223372036854775808,40672(%r14) >>>>> ^~~~~~~~~~~~~~~~~~~~~~ 1 error generated. *** [i915_gem.o] >>>>> Error code 1 >>>>> >>>>> _______________________________________________ >>>>> freebsd-current@freebsd.org mailing list >>>>> https://lists.freebsd.org/mailman/listinfo/freebsd-current >>>>> To unsubscribe, send any mail to >>>>> "freebsd-current-unsubscribe@freebsd.org" >>>> >>>> >>>> It breaks also graphics/drm-stable-kmod (see PR 229484, >>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229484, >>>> same error as you described above) and also >>>> emulators/virtualbox-ose-kmod. As long as CURRENT revision >>>> is < r335873, those kmod compile well. >>> >>> We are looking into why both the drm ports fail. Regards >>> >> >> I haven't yet tested an amd64 kernel with this, but I think this >> change to sys/amd64/include/atomic.h might fix it: >> >> Index: atomic.h >> =================================================================== >> >> >> - --- atomic.h (revision 335896) >> +++ atomic.h (working copy) @@ -446,10 +446,10 @@ >> ATOMIC_ASM(clear, int, "andl %1,%0", "ir", ~ >> ATOMIC_ASM(add, int, "addl %1,%0", "ir", v); >> ATOMIC_ASM(subtract, int, "subl %1,%0", "ir", v); >> >> -ATOMIC_ASM(set, long, "orq %1,%0", "ir", v); >> -ATOMIC_ASM(clear, long, "andq %1,%0", "ir", ~v); >> -ATOMIC_ASM(add, long, "addq %1,%0", "ir", v); >> -ATOMIC_ASM(subtract, long, "subq %1,%0", "ir", v); >> +ATOMIC_ASM(set, long, "orq %1,%0", "er", v); >> +ATOMIC_ASM(clear, long, "andq %1,%0", "er", ~v); >> +ATOMIC_ASM(add, long, "addq %1,%0", "er", v); >> +ATOMIC_ASM(subtract, long, "subq %1,%0", "er", v); >> >> #define ATOMIC_LOADSTORE(TYPE) \ ATOMIC_LOAD(TYPE); \ > > Isn't "Z" better than "e" in this case? Never mind, brain fart. These instructions are sign-extended. Sorry for the noise. Jung-uk Kim -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAls7zy8ACgkQfJ+WJvzb 8UYiOgf+PSb+Mv7UGCTUlftCiRmYYOW6ElMZSdr4tPinMocn4b/V9KJDqKOgO1SX B2KCQHgSYt4Y+STiSrcCdhIkqCeIxdqJGHdTNpnpiUm7C+B50MrKgZo6n1xnlcCM d4thqf0T/ZMaVaVEkZ42FTnmdXFo0L3jHNCHHYrpnXXXfRLJF6j5Q5Uetr1GEUJX rpV2NIXMdk308qy4EvagLd0DEtT85QAjuG124nKh5FoSFD+5wBGFVrQWk4v4LVyd rzBNM55JbTlEIFASlFjpiWJVhGvDzNVwN9XRxacYVgfEv23AMEibqhK12V48Lto/ X1/qHA0T9HC+gu/Eol+53AtU/P8ZyQ== =cHxX -----END PGP SIGNATURE-----