From: David Hildenbrand Subject: [kvm-unit-tests PATCH v1 2/2] s390x: use inline assembly to test for addressing exceptions Date: Mon, 26 Jun 2017 18:15:09 +0200 Message-ID: <20170626161509.18873-3-david@redhat.com> References: <20170626161509.18873-1-david@redhat.com> Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Thomas Huth , david@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47868 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752230AbdFZQPU (ORCPT ); Mon, 26 Jun 2017 12:15:20 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 6382AC054C5A for ; Mon, 26 Jun 2017 16:15:20 +0000 (UTC) In-Reply-To: <20170626161509.18873-1-david@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: GCC is free to generate multiple stores instead of just one (e.g. observed by switching to -O0), making the test fail. Make sure we really only have one store. Signed-off-by: David Hildenbrand --- s390x/selftest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/selftest.c b/s390x/selftest.c index 87eb934..1c8d16a 100644 --- a/s390x/selftest.c +++ b/s390x/selftest.c @@ -33,7 +33,7 @@ static void test_pgm_int(void) check_pgm_int_code(PGM_INT_CODE_OPERATION); expect_pgm_int(); - *((unsigned int*)-1) = 1; + asm volatile(" stg %0,0(%0)\n" : : "r"(-1)); check_pgm_int_code(PGM_INT_CODE_ADDRESSING); } -- 2.9.4