Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1998376ybm; Thu, 23 May 2019 09:44:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyU0BzhDgTuGnPBmL+VgZ/qjODqbO2ub7vnlw7xWN6+FMb0dT8Hf6JUlIx+JX551azEC9X2 X-Received: by 2002:a17:902:aa0a:: with SMTP id be10mr35766330plb.293.1558629887939; Thu, 23 May 2019 09:44:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558629887; cv=none; d=google.com; s=arc-20160816; b=GRYdUZflWyveuR9X9ZHX9sBqxLaZmxhhbsZawud7HgqMwUSapruOw1fDwtCn+kWuGK Nlw03E58WoY9P0CULFM0riTFCEy++9Ncrnw9npkVHnpteWIgxlGSPprwHKmDjtW9QPJJ ow9csw7Hl+JEoKO4dJnGCG/3fvY26rej8FZbH+Glk8XMwJ4v6sp26c7zapXv6a9TIGEc 4c/HTbGgvbGsmTvmwdMBEYsov3rYpXsRgsGo8dJl7u89lvk1tajjx4xNlpUeAJZmeKT3 JaVVRMsNU90RMf32oILxdH1P5b2Zg9BIP68i2LmLLZCIc9SzmzLNwsRRNcaeg69ptqMu 0n1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ChtyQzH2Iq2/iWPxc3JShQ5gCPH2u8KOFlV3mDRPoWs=; b=L16dd05l9oVJ5dIiq/H2Zn1e9/ZjFPfcmrIDTpgIE5gP6gdPLaria+xGlSCzZf5AA8 sWW5BZfoP9bwVEYlrlORQZ/DSf5TJBlNDizBiE8uZIxaIIEx8Q+JE5EigNoCXQLTwTjp 7wuhJWsTSYxQiBFTrErboBc5LJ30vssaec2y4T+EJLNZ9E8f3DAZbGpaR+DOcxPfQgjO 3EnOB92N7XIprc3FozS3I8gyeL16wEY1L0q32u2hvmDg4nH9PcEgCL7xajfcCN0Ou17o o9wFINzcIxPgdXTmKBckTBcKI/+bfoG7WdFqdFFoFcjMjDfoNJ/+hCjTGWCT0KYfr6q4 cX5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si1317723pje.28.2019.05.23.09.44.32; Thu, 23 May 2019 09:44:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731332AbfEWQnU (ORCPT + 99 others); Thu, 23 May 2019 12:43:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35308 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730980AbfEWQnU (ORCPT ); Thu, 23 May 2019 12:43:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C289B3092673; Thu, 23 May 2019 16:43:19 +0000 (UTC) Received: from thuth.com (ovpn-116-94.ams2.redhat.com [10.36.116.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FBFE6090E; Thu, 23 May 2019 16:43:17 +0000 (UTC) From: Thomas Huth To: Christian Borntraeger , Janosch Frank , kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Shuah Khan , David Hildenbrand , Cornelia Huck , Andrew Jones , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-s390@vger.kernel.org Subject: [PATCH 1/9] KVM: selftests: Wrap vcpu_nested_state_get/set functions with x86 guard Date: Thu, 23 May 2019 18:43:01 +0200 Message-Id: <20190523164309.13345-2-thuth@redhat.com> In-Reply-To: <20190523164309.13345-1-thuth@redhat.com> References: <20190523164309.13345-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 23 May 2019 16:43:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org struct kvm_nested_state is only available on x86 so far. To be able to compile the code on other architectures as well, we need to wrap the related code with #ifdefs. Reviewed-by: Andrew Jones Signed-off-by: Thomas Huth --- tools/testing/selftests/kvm/include/kvm_util.h | 2 ++ tools/testing/selftests/kvm/lib/kvm_util.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h index 8c6b9619797d..a5a4b28f14d8 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -118,10 +118,12 @@ void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_vcpu_events *events); void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_vcpu_events *events); +#ifdef __x86_64__ void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_nested_state *state); int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_nested_state *state, bool ignore_error); +#endif const char *exit_reason_str(unsigned int exit_reason); diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index e9113857f44e..ba1359ac504f 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -1250,6 +1250,7 @@ void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, ret, errno); } +#ifdef __x86_64__ void vcpu_nested_state_get(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_nested_state *state) { @@ -1281,6 +1282,7 @@ int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid, return ret; } +#endif /* * VM VCPU System Regs Get -- 2.21.0