Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1535480ybm; Thu, 23 May 2019 02:43:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzm3s/XXLdRi0HjxhNEkQ0YlNKKMlIKfa9sy4tjcUUvTDTxihnY9IzJ31otJecmeoT0eQ+0 X-Received: by 2002:aa7:8157:: with SMTP id d23mr75299496pfn.92.1558604606798; Thu, 23 May 2019 02:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558604606; cv=none; d=google.com; s=arc-20160816; b=YkuFl8wpoUs9X1YrBqY6kbAKaVxWspgO2Pp5v5tZOFf+eWzPdKbb2ycnp8P/hJHU1s ibnFJOGjXzV0e1o5Lvh441ynbYrMjVhglGwUHmEPuZG1BnTaqplJV8vclY2ZcDkWDSFj PlMV6XHfhxztx/SnNReaLdy1KHJUvK78YaGHVNdLdIkjt3KiaMEK9J3Hh/SXMvl/17UV 1dTDY7i+UeAAv3Yel0552htkU4RKn0vpWoup1QFjyTpd0KbBy2sHttPqXcUjTkNYUenq sxhilZr+NI0p/TT02pwSdb34vuZblhsmHLbQIMAtfgu+A3RbI6/FK1xC+6ltvh345Vmr lVbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZI/orkfJ2FCGESWq3rg5fB3l8B/qVh+076Ny4S07EEY=; b=XgwafwxIX4KEbbV5LLarn7qf+0HvMIt1xlnrTUZcL3RcoV65qCAM+iZhWmg/3FRC+n F13Bqo8FbSvRGjToLt6/AOAVS3E1NGASLQOVOs6WQNcCW4vQJOOV2b0/EhSc2/u3n+JO USYVXXfEDUpNgiSEoCy2rbx5xN53q8CMUBV6GzI3F9f7K3p8Uu5hLzWNfdIYd15zo90f Mw129t/qFyrJ5u3yyPwb9o68gKO9p+vd3UddWb2kicSzMTvS1ZPn6xl8zRW9j0jdZNcd NSHsEP2c2d2F2bMBFEwigOmwKxzCcr5QpWlHdOhXdpJTiLCOFVXqr4KWRTa+DCB0a1Ip I4YA== 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 m189si31585338pfm.17.2019.05.23.02.43.11; Thu, 23 May 2019 02:43:26 -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 S1730034AbfEWJlG (ORCPT + 99 others); Thu, 23 May 2019 05:41:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39916 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfEWJlG (ORCPT ); Thu, 23 May 2019 05:41:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 187FB3086228; Thu, 23 May 2019 09:41:06 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DDF21802F; Thu, 23 May 2019 09:41:04 +0000 (UTC) Date: Thu, 23 May 2019 11:41:02 +0200 From: Andrew Jones To: Thomas Huth Cc: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: selftests: Wrap vcpu_nested_state_get/set functions with x86 guard Message-ID: <20190523094102.cn2xpnofhl2fltcc@kamzik.brq.redhat.com> References: <20190523093114.18182-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190523093114.18182-1-thuth@redhat.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 23 May 2019 09:41:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 23, 2019 at 11:31:14AM +0200, Thomas Huth wrote: > 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. > > 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 cf62de377310..633b22df46a4 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -1248,6 +1248,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) > { > @@ -1279,6 +1280,7 @@ int vcpu_nested_state_set(struct kvm_vm *vm, uint32_t vcpuid, > > return ret; > } > +#endif > > /* > * VM VCPU System Regs Get > -- > 2.21.0 > Reviewed-by: Andrew Jones