Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp100726pxb; Wed, 8 Sep 2021 18:41:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxokTYovCNIVlbaTWKrUCqSt//oI6pOcXxwLX4yvUY1jZHfu4dtCAqj7vTRNk68DfZyqbb4 X-Received: by 2002:a92:8743:: with SMTP id d3mr351343ilm.237.1631151694664; Wed, 08 Sep 2021 18:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631151694; cv=none; d=google.com; s=arc-20160816; b=pwRiGRQAuN1wUIc4vZVd1REikFA61c1u5Rv1OcS+AZKUhbEO9O9iORjhy3kDu+h0fM ehMA3X68Op54jPDWpOAAFrLkpf38Ya41KGUsd6euq+h8leYYR32eN5CLeIZ/nnrmIjJx 2cOQI2EjspB75kC3LpsboklW/AyeyNvjfh1aQ49tSmnNOKDfTDFwlXOI0XvjYrZ0I1QC WEa7QOGIbC37oECeV1cjSF2uMADROtglHRnC2NlOqhVngAQxkXpTrjig8qVSTX2Jvq4m YQhKMq16MZivY/MARTjlgAKgXeR6zelBfLiSXGZV+LX4QjXgaXG41NjSu3Sh6h1tx2Se pVpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=zNHqAFnuHiggwZ7jn9N18KxilmXmaHVrWak3lSk+d74=; b=hDoAD45s9IITwORl4jEP4k9F0mRbsjLt783f1+OfiIvbzH3ILxHLncVOGHCXa0oAI+ +muhnLR1d7ptNHLdMR20FBYmpfT5W7NdJtJvIz/lk420MW30BCYV3ewRswHYSEv0UNe1 TKaeoL44vMUC3bzqlGXt9pXUDGSTBtpPwq1Zmrd+LFjvmuK18DjrCl5wmFRuzPhz5pdi ah5KTYWSr5K49Qv0aVVOfYoZqMrlObTympIEOPkJ3vEB5WHxX+/9X5gpStSSMINngSMy ns2jlft+FuVP6KNivmdiFxJz8EdjKCuqH2tiYKlP4Axzq3m8AK+7gZViHpx88QS8bU4p Gpqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rKFntGWT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si334388ilh.125.2021.09.08.18.41.23; Wed, 08 Sep 2021 18:41:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rKFntGWT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349577AbhIIBjt (ORCPT + 99 others); Wed, 8 Sep 2021 21:39:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349333AbhIIBjn (ORCPT ); Wed, 8 Sep 2021 21:39:43 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1FDC06175F for ; Wed, 8 Sep 2021 18:38:35 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 63-20020a250d42000000b0059dc43162c9so344060ybn.23 for ; Wed, 08 Sep 2021 18:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=zNHqAFnuHiggwZ7jn9N18KxilmXmaHVrWak3lSk+d74=; b=rKFntGWT7Zlr1j69UYRUvBr32BT0o9bmx5mTs/dXAaJ7tGkNGtdvXB7ckiyofZChKV 7n52lUMs/NChF+8iAfWGVFmty6jb+kLonv/JDmnQso092hq5b3v+Rn6dR2u9pNlcJb32 vyDtjMYhsYXNh/ccaY792PP4q4YjoqfVydlQw2NSiNBjJlVPLuidRcTObpascm5hLwn3 x8aviO8LNf3odytaZJ7XuCObuChS5xmrQQIOr/xsJeiFeAvbvOMUF3HZBZV0Zp5KrxTi 9xnbF76qFJKkIoIsC7tdccHakdVT2nlJz/kVIfoAIwNxLcl0JHNmxQ0Th6vOjH+sHCwy lJTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=zNHqAFnuHiggwZ7jn9N18KxilmXmaHVrWak3lSk+d74=; b=X9EeLOc+X/aq0bQ0muNdo1dLtXoFDBJuLneiivu5Vhg+Y1dAVaA5qdhDrCeG6ZIm7a 6K5z3yHMRUj4HVRBQccHG2qCREKQZvw5B55orabTwUD912r4BQr8n/bLB1qdM6QhCW+L lpjCCDpbqGA4T1kgxL09ENnam8yYtoatpI7U8nxxKKnWbceziniGsV9GVAVEfRqCsDQe 3r4MBKmmRozQowFv6ZpVBiCVjAT/0zGa3OazcwqQwsyF8mfkRIGC5qu40qri3psfd0zs lXTbYG9T+fzsnaNmYUo8zRgpCFE6P70UaumpJn8R+WsicP1eRln0q19Ld6IIZzYeUIRz 6WYQ== X-Gm-Message-State: AOAM530xdSm+2jBSTijvWJAPVYzVgt/QdI5bo5dy05WVHL05oK03p1QI aEkvRIS3dhRD4QOSNwe3nc4SgL8FH3Ly X-Received: from rananta-virt.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1bcc]) (user=rananta job=sendgmr) by 2002:a25:1845:: with SMTP id 66mr543521yby.396.1631151514456; Wed, 08 Sep 2021 18:38:34 -0700 (PDT) Date: Thu, 9 Sep 2021 01:38:04 +0000 In-Reply-To: <20210909013818.1191270-1-rananta@google.com> Message-Id: <20210909013818.1191270-5-rananta@google.com> Mime-Version: 1.0 References: <20210909013818.1191270-1-rananta@google.com> X-Mailer: git-send-email 2.33.0.153.gba50c8fa24-goog Subject: [PATCH v4 04/18] KVM: arm64: selftests: Introduce ARM64_SYS_KVM_REG From: Raghavendra Rao Ananta To: Paolo Bonzini , Marc Zyngier , Andrew Jones , James Morse , Alexandru Elisei , Suzuki K Poulose Cc: Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Oliver Upton , Reiji Watanabe , Jing Zhang , Raghavendra Rao Anata , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the inclusion of sysreg.h, that brings in system register encodings, it would be redundant to re-define register encodings again in processor.h to use it with ARM64_SYS_REG for the KVM functions such as set_reg() or get_reg(). Hence, add helper macro, ARM64_SYS_KVM_REG, that converts SYS_* definitions in sysreg.h into ARM64_SYS_REG definitions. Signed-off-by: Raghavendra Rao Ananta --- .../selftests/kvm/include/aarch64/processor.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/kvm/include/aarch64/processor.h b/tools/testing/selftests/kvm/include/aarch64/processor.h index bed4ffa70905..ac8b63f8aab7 100644 --- a/tools/testing/selftests/kvm/include/aarch64/processor.h +++ b/tools/testing/selftests/kvm/include/aarch64/processor.h @@ -26,6 +26,20 @@ #define ID_AA64DFR0_EL1 3, 0, 0, 5, 0 +/* + * ARM64_SYS_KVM_REG(sys_reg_id): Helper macro to convert + * SYS_* register definitions in sysreg.h to use in KVM + * calls such as get_reg() and set_reg(). + */ +#define ARM64_SYS_KVM_REG(sys_reg_id) \ +({ \ + ARM64_SYS_REG(sys_reg_Op0(sys_reg_id), \ + sys_reg_Op1(sys_reg_id), \ + sys_reg_CRn(sys_reg_id), \ + sys_reg_CRm(sys_reg_id), \ + sys_reg_Op2(sys_reg_id)); \ +}) + /* * Default MAIR * index attribute -- 2.33.0.153.gba50c8fa24-goog