From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7EDDEB8FA5 for ; Wed, 6 Sep 2023 07:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232939AbjIFHCB (ORCPT ); Wed, 6 Sep 2023 03:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbjIFHCA (ORCPT ); Wed, 6 Sep 2023 03:02:00 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B808E45 for ; Wed, 6 Sep 2023 00:01:55 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31ad9155414so2598696f8f.3 for ; Wed, 06 Sep 2023 00:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1693983713; x=1694588513; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=7a/rYlLL01jELhspFfU/LX4lJTwK+IpYr9KpIjgxodg=; b=CXDgB5fIUUXU9JDvrWiRksAZXazJ3wpi4PixjFkGD0V3IKnzrS3y4qCs+Cguox/kXB 0qlKVtEtVxeAIP5AXbtx7AB3rjY3iFEJRcFuaFLugqGOj24qHF/gRMsVIE8Oj0+b1PT8 v62168zbbc8DzKFNEXPd9soU3UyjMAmpr3c+gbai7SFGkgjrkxENgGsIs0DZFtZDE1u4 mJqW1MmqA5N7HvpJ10n8iSMUy5ZDnOMFklWbDIi4h73lizQLD0NvLNGoTdVzCXHS1INe EMPG3GzTp1Ja0+z8OF5W6FCegJqKdHOIc7S2oZgMp62/9tNTszzhUt9rXc03xeHhWL7a Rf3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693983713; x=1694588513; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7a/rYlLL01jELhspFfU/LX4lJTwK+IpYr9KpIjgxodg=; b=CaeeEkpohhdvoY01YbfuCA6VWYGtCbF/CHWSF6UOnqGEdbZE2v1NeyfkPrOADEXOOq 8taSXExGffbFHxqGQW0+Ea9uxcegvk4P6Md86isLBDrv9L6l8Yib2ygBGdr81x6ZBIgy NIMAlHv52PSCjJBvdIFZs/e9bLRLf8NrSvc4N6uDpaW4B6YHMbSeXBXmrZxtgND+1Snj pat8eBn+e96SiJPtctTRMDyEyiySIJhISX/07BaIUQYnm6sbV2Ao1HOeIMN35lXD7smC dx5p4MA+9xoTDNe5DqDBWp5QTHGK4Hxsvoi7VgQlDFOl6LuH5mJQfv7z4MImcaOv84x3 lsuw== X-Gm-Message-State: AOJu0Yyh3oc5vLR2DEv17jHciNXe0z/fRAQsxbrKYkfkWZJ8RlVxPX6K Tv1CtV0WQ7G5thVHtb2AMbjWxw== X-Google-Smtp-Source: AGHT+IH5D+U+nZV7Ok6E7RGjtfz50olmDnpckxh8umsRSqUfH3ZIM1q14NQMvG0C714ykQWhmjyeJw== X-Received: by 2002:adf:e7d0:0:b0:31c:8151:86a9 with SMTP id e16-20020adfe7d0000000b0031c815186a9mr1273125wrn.67.1693983713483; Wed, 06 Sep 2023 00:01:53 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id l5-20020a5d4805000000b003197c7d08ddsm19530729wrq.71.2023.09.06.00.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Sep 2023 00:01:52 -0700 (PDT) Date: Wed, 6 Sep 2023 09:01:51 +0200 From: Andrew Jones To: Haibo Xu Cc: Haibo Xu , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Shuah Khan , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Anup Patel , Atish Patra , Guo Ren , Conor Dooley , Daniel Henrique Barboza , Greentime Hu , Sean Christopherson , Ricardo Koller , Vishal Annapurve , Aaron Lewis , David Matlack , Vitaly Kuznetsov , Ackerley Tng , Mingwei Zhang , Vipin Sharma , Lei Wang , Like Xu , Peter Gonda , Maxim Levitsky , Thomas Huth , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , David Woodhouse , Michal Luczaj , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org Subject: Re: [PATCH v2 2/8] KVM: arm64: selftest: Split arch_timer test code Message-ID: <20230906-3f0318fa20365f9211998bae@orel> References: <20230904-11e853ffe3d8e9cf9ec6079d@orel> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Wed, Sep 06, 2023 at 11:44:26AM +0800, Haibo Xu wrote: > On Wed, Sep 6, 2023 at 10:14 AM Haibo Xu wrote: > > > > On Mon, Sep 4, 2023 at 9:24 PM Andrew Jones wrote: ... > > > > + > > > > +enum guest_stage { > > > > + GUEST_STAGE_VTIMER_CVAL=1, > > > > + GUEST_STAGE_VTIMER_TVAL, > > > > + GUEST_STAGE_PTIMER_CVAL, > > > > + GUEST_STAGE_PTIMER_TVAL, > > > > + GUEST_STAGE_MAX, > > > > +}; > > > > > > This enum also belongs in aarch64/arch_timer.c > > > > > > > Yes, it should be in aarch64/arch_timer.c > > > > After moving the above enum definition to aarch64/arch_timer.c, the > below errors was reported > while compiling kvm/arch_timer.o > > include/timer_test.h:37:26: error: field ‘guest_stage’ has incomplete type > 37 | enum guest_stage guest_stage; > | ^~~~~~~~~~~ > > Since kvm/arch_timer.c was independent of kvm/aarch64/arch_timer.c > during OBJ compiling, > I think it may be not possible to move the enum definition to > aarch64/arch_timer.c > > If we keep the definition in this header file, we can enclose it with > #ifdef __aarch64__ for aarch64 only. > Let's change struct test_vcpu_shared_data to struct test_vcpu_shared_data { int nr_iter; int guest_stage; uint64_t xcnt; }; and then let the aarch64 code treat guest_stage as an enum and the riscv code can completely ignore it (no need to create an unused enum). Thanks, drew