From owner-freebsd-amd64@freebsd.org Tue Jun 19 05:44:46 2018 Return-Path: Delivered-To: freebsd-amd64@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 5B05A1021A8C for ; Tue, 19 Jun 2018 05:44:46 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6DB026C130 for ; Tue, 19 Jun 2018 05:44:45 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mailman.ysv.freebsd.org (Postfix) id 297F61021A87; Tue, 19 Jun 2018 05:44:45 +0000 (UTC) Delivered-To: amd64@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 16DF41021A85 for ; Tue, 19 Jun 2018 05:44:45 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x236.google.com (mail-yw0-x236.google.com [IPv6:2607:f8b0:4002:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 960086C12F for ; Tue, 19 Jun 2018 05:44:44 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x236.google.com with SMTP id t198-v6so6476949ywc.3 for ; Mon, 18 Jun 2018 22:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/Gu8mj7iAvWYJXrPQpMy6WE4jBtcm6EQAcCR74dWm2s=; b=F+3kUyu/DZqiZbPWzYgc4aD/ZPEpMUIM1mdmQQm0p07zdmqdVlppbIadM0c02ViVZb fkA0CJgahHk3b3CLZa0CrUBN9E5RXckjrt3DTaV8Kyqae6QoI83lLIBy7mwmPWWVmW57 /cCQukhVRq5/N48xGS5fdiQFUOjteU2pC145s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/Gu8mj7iAvWYJXrPQpMy6WE4jBtcm6EQAcCR74dWm2s=; b=hLzguhZ1UGmpQrJ79fUtmTNNBC/1iF7P7/2PmbNDa0J5Lkpd+YuFjjEfgtYnASf5cp g/CqbzKME2Vw+b7u5FjxWYvBpjz9bS62evNCyNHxbj/YHnTLrEBnr7OS27ICOEXkGa3+ J14qRjiyICxzonPBWe07S5XOgJUXBQW7yx7erx7d97I02VyfgYktkXCSz1t/Eossa61I PfMrNeJXPcgUFLys/MafOSHO3C+i+qBRqcQAaO3olKQokxzfJnJcosX9m0mAliAadHYE RPq6dZQuyqeCKKSIJcopQacWFfGkWOI0RmBn3cckV4A/bEsick3UqG9rZBdLaDI94B/X g2ww== X-Gm-Message-State: APt69E0uDt+kuNwDgcPN1FmUoAoVL2kS2dCnOaiC9VssipasDWJ8ffyI zc+rmSrFmW2dWdlypmAeuYkzNHO4rDZdesLjBONXCg== X-Google-Smtp-Source: ADUXVKKOMXYLTREOh+SBFA/+DBVleJHqabFYFrfch5h1YgSiVacooM/pwgNDGRp2ZRcMsFRr8D4Co6Ide5YLwWRVMRc= X-Received: by 2002:a0d:cf01:: with SMTP id r1-v6mr7164640ywd.162.1529387083966; Mon, 18 Jun 2018 22:44:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 22:44:13 -0700 (PDT) In-Reply-To: References: <20180613103535.GP2493@kib.kiev.ua> From: Eitan Adler Date: Mon, 18 Jun 2018 22:44:13 -0700 Message-ID: Subject: Re: Ryzen public erratas To: Konstantin Belousov Cc: "current@freebsd.org" , amd64@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 05:44:46 -0000 On 13 June 2018 at 04:16, Eitan Adler wrote: > On 13 June 2018 at 03:35, Konstantin Belousov wrote: >> Today I noted that AMD published the public errata document for Ryzens, >> https://developer.amd.com/wp-content/resources/55449_1.12.pdf >> >> Some of the issues listed there looks quite relevant to the potential >> hangs that some people still experience with the machines. I wrote >> a script which should apply the recommended workarounds to the erratas >> that I find interesting. >> >> To run it, kldload cpuctl, then apply the latest firmware update to your >> CPU, then run the following shell script. Comments indicate the errata >> number for the workarounds. >> >> Please report the results. If the script helps, I will code the kernel >> change to apply the workarounds. >> >> #!/bin/sh >> >> # Enable workarounds for erratas listed in >> # https://developer.amd.com/wp-content/resources/55449_1.12.pdf >> >> # 1057, 1109 >> sysctl machdep.idle_mwait=0 >> sysctl machdep.idle=hlt > > > Is this needed if it was previously machdep.idle: acpi ? This might explain why I've never seen the lockup issues mentioned by other people. What would cause my machine to differ from others? -- Eitan Adler From owner-freebsd-amd64@freebsd.org Tue Jun 19 09:50:39 2018 Return-Path: Delivered-To: freebsd-amd64@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 C9B0A100B8A5 for ; Tue, 19 Jun 2018 09:50:38 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 4F52776C7A for ; Tue, 19 Jun 2018 09:50:38 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 132DF100B89C; Tue, 19 Jun 2018 09:50:38 +0000 (UTC) Delivered-To: amd64@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 CABBA100B899; Tue, 19 Jun 2018 09:50:37 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43B3476C72; Tue, 19 Jun 2018 09:50:37 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr0-x235.google.com with SMTP id k16-v6so19853487wro.0; Tue, 19 Jun 2018 02:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=0Wp5VQsuPD7xbwaRE3E/GHIynVmYv6qJosAEgIvbcDY=; b=ADMhe9e/7BDZHBiWI2My4cG8Vx3Ya/nMCyaSzmWlJgesDDHUFmImqpxo01RXg1VN5t cp//KruysAIzRi7iveb+9wv6s717YQ+oO9nL4XOX55lTv2YEfxcUm0IrMo8M3dDwqEVH 2PZ4YbswgxD7y2zZaYjE62isxiE7jFn/s3c1RLnrrXu8D4y4OV79qh8Xea7dAKJU0khp inzuBdbXnFC78bPwPUjZu3AsU3Lhbvp8HkSvbTHuvtWYMLfOuYy5Q1yoHpMfZkZdBQe1 1GSBYp/zD9A4QxImVkRtPeenuplGsJ38x4xv4rUbyReIheezE+LhkvDFh//qVyMdbQI/ Q9fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=0Wp5VQsuPD7xbwaRE3E/GHIynVmYv6qJosAEgIvbcDY=; b=F0Svl5GFQLh6fV/FxUVuKwWApEFvjVCY+N+LHSmUN82txVqEXfh7X2XiQOrKsF+3Wl 2+1x0EZBn+6t4fLaKJzoPkwYfwJ+ji55Q4bcskW+UFrFRktfbwqfBvtzNLsKjhMuwZp+ qWUoaM4ptfQn2ZehfRUfG+BaU4BHkBdi7wt/V1fZTKn9ykuVhH8VepMp5KCFeoJcKIIL 8OMU5bvMCht/byrKdQyrTzyMuHsyzTDGsVVvclvx0tMNhWuSncrYPnDlQKrLM6nRc5Aa GtAnbLMy3KVEyQHHJSY8stwXNGcgvBUp+VJ9eRZHj9qaZY0sp+K47kYTF/rTMS9G0rMQ WeTQ== X-Gm-Message-State: APt69E3YCKVhlMfIae+2PDDjJqEi+OZY7l5VExTRpgJ2RBNmpKbNrFRl WK15y/9aksks4sf/aabuEnvmSw== X-Google-Smtp-Source: ADUXVKJubZ0H6mPZH4uzjeW7DGvNVedZfkJHoVgDeTlMu32MmCW2MViAS3EPT+s1riXxSjoSRfiu+w== X-Received: by 2002:a5d:4049:: with SMTP id w9-v6mr13829408wrp.96.1529401836319; Tue, 19 Jun 2018 02:50:36 -0700 (PDT) Received: from ernst.home (p5B02381D.dip0.t-ipconnect.de. [91.2.56.29]) by smtp.gmail.com with ESMTPSA id b80-v6sm11902855wmf.2.2018.06.19.02.50.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jun 2018 02:50:35 -0700 (PDT) Date: Tue, 19 Jun 2018 11:50:30 +0200 From: Gary Jennejohn To: Eitan Adler Cc: Konstantin Belousov , amd64@freebsd.org, "current@freebsd.org" Subject: Re: Ryzen public erratas Message-ID: <20180619115030.5491af33@ernst.home> In-Reply-To: References: <20180613103535.GP2493@kib.kiev.ua> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 09:50:39 -0000 On Mon, 18 Jun 2018 22:44:13 -0700 Eitan Adler wrote: > On 13 June 2018 at 04:16, Eitan Adler wrote: > > On 13 June 2018 at 03:35, Konstantin Belousov wrote: > >> Today I noted that AMD published the public errata document for Ryzens, > >> https://developer.amd.com/wp-content/resources/55449_1.12.pdf > >> > >> Some of the issues listed there looks quite relevant to the potential > >> hangs that some people still experience with the machines. I wrote > >> a script which should apply the recommended workarounds to the erratas > >> that I find interesting. > >> > >> To run it, kldload cpuctl, then apply the latest firmware update to your > >> CPU, then run the following shell script. Comments indicate the errata > >> number for the workarounds. > >> > >> Please report the results. If the script helps, I will code the kernel > >> change to apply the workarounds. > >> > >> #!/bin/sh > >> > >> # Enable workarounds for erratas listed in > >> # https://developer.amd.com/wp-content/resources/55449_1.12.pdf > >> > >> # 1057, 1109 > >> sysctl machdep.idle_mwait=0 > >> sysctl machdep.idle=hlt > > > > > > Is this needed if it was previously machdep.idle: acpi ? > > This might explain why I've never seen the lockup issues mentioned by > other people. What would cause my machine to differ from others? > I had sysctl machdep.idle_mwait=1 and machdep.idle=acpi before applying the shell script. I had multiple lockups every week, sometimes multiple lockups per day. With the idle settings from the script it still locks up, but not as often. I suspect I also need to update the CPU firmware, although I expect that the new BIOS version I installed last week would have done that already. -- Gary Jennejohn