From patchwork Thu Apr 30 15:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11520673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77C7A139A for ; Thu, 30 Apr 2020 15:24:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56E8620873 for ; Thu, 30 Apr 2020 15:24:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y/c6lPLR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727060AbgD3PYu (ORCPT ); Thu, 30 Apr 2020 11:24:50 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:55094 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726955AbgD3PYt (ORCPT ); Thu, 30 Apr 2020 11:24:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588260288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OqZ66/q53T5tsOQUwEg0/wWd28TgA4UfMH3dvKqQtN0=; b=Y/c6lPLRKV4odE6sD94A3AR7cg9QlIKzFBz5v8UZgY9rNU6Fw7PXDTh06SFTxrHCtj0Gks HiWTiFf3OPFUcsvGkyqCnEp92h6ezUykXHcx8RwYK2xSxZem4QMZEb4jOYTZDrcRIwLBQZ xioS69kQd0WY5TRnvx68kHtNqKkMKC8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-yb3pGOD9O2WgbJYKJkPe0w-1; Thu, 30 Apr 2020 11:24:46 -0400 X-MC-Unique: yb3pGOD9O2WgbJYKJkPe0w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59E42468; Thu, 30 Apr 2020 15:24:45 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-172.ams2.redhat.com [10.36.113.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CBED5EDE3; Thu, 30 Apr 2020 15:24:43 +0000 (UTC) From: David Hildenbrand To: kvm@vger.kernel.org Cc: Paolo Bonzini , Thomas Huth , Janosch Frank , linux-s390@vger.kernel.org, Christian Borntraeger , Janosch Frank , Cornelia Huck , David Hildenbrand Subject: [kvm-unit-tests PULL 05/17] s390x/smp: fix detection of "running" Date: Thu, 30 Apr 2020 17:24:18 +0200 Message-Id: <20200430152430.40349-6-david@redhat.com> In-Reply-To: <20200430152430.40349-1-david@redhat.com> References: <20200430152430.40349-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Christian Borntraeger On s390x hosts with a single CPU, the smp test case hangs (loops). The check if our restart has finished is wrong. Sigp sense running status checks if the CPU is currently backed by a real CPU. This means that on single CPU hosts a sigp sense running will never claim that a target is running. We need to check for not being stopped instead. Reviewed-by: Janosch Frank Reviewed-by: Cornelia Huck Signed-off-by: Christian Borntraeger Message-Id: <20200330084911.34248-2-borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand --- lib/s390x/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/s390x/smp.c b/lib/s390x/smp.c index 3f86243..203792a 100644 --- a/lib/s390x/smp.c +++ b/lib/s390x/smp.c @@ -128,7 +128,7 @@ static int smp_cpu_restart_nolock(uint16_t addr, struct psw *psw) * The order has been accepted, but the actual restart may not * have been performed yet, so wait until the cpu is running. */ - while (!smp_cpu_running(addr)) + while (smp_cpu_stopped(addr)) mb(); cpu->active = true; return 0;