Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp693754pxb; Thu, 9 Sep 2021 09:51:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHfow9sdhymakC2dHchGYCl2HhxIXFdEzT5+QoR2KL0uQJAiiOR1i2+jJG0IB1Mg9ZXZaB X-Received: by 2002:a05:6402:1d95:: with SMTP id dk21mr4140568edb.347.1631206291210; Thu, 09 Sep 2021 09:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631206291; cv=none; d=google.com; s=arc-20160816; b=DcnHRGg8J5awWRiFjYNvI8v1fRCzcdYae/8dVVTYBEDilwfFE+bWfX7lBS9KVyVSyN Pie2g+Af6x1gNDh8AiQqwdMiaZvkaP8jfNu1n5PYO8jKQsVxAsykdSyeVfdBlJTPcZxj UstKMtiMU60cRjEfPqqcuOBnfu5OIYsybrmRYmAuW7zegjHk8oSV+97sK8TkM1WZqDPH fPBVERsw/faLqOp+LCQjmObPoKPQ5Tkkk7aVQhuq6vmdPnLTfww8h/HpIInTJS+7LcFn yFuyZ1nCRGeRPuwL3ATqI7yFtL5TDVFx+CRIzYZs6uufoDPKizQ0tXCH4K4E8FSV5YyB +mmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=s+RgoVMQufwJ1iQH8D3qsEs6NeJAccH1we8wbejIgaA=; b=B6sXDT+wBFMw9cQ8koRPnQS6F9REC9SiMQRZiYjV8gmFwY603n4PdeXYlAY6yGzmWP 1103TxLrr9E75H4d12/3zsY76ri9w/Uri1yNExKPzPEv2p1hr7cuKmCvtixkirxMYAXs /mxkiEyJ1ijk5hjkoeri27aoEmSxYqBZPraa6zjjD03f3NqEYfqjIQoNIe+MTUW4ZG5a dXGEd5C5q4F6a68VkJ7HqQR5U8vOy+LRut1rVwN70Bfp8b/5XYKHRL/oj3Ac0QWJf+B9 /x21QR8saZ2/+MAnb/Zgnpg+XbUYGvoGXCXvIkIiE3Y6BTaxEmqb2lYRx4d3GHUxu7sz CRKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cKYHvkvu; 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 cc9si3781470edb.38.2021.09.09.09.51.06; Thu, 09 Sep 2021 09:51:31 -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=cKYHvkvu; 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 S239072AbhIIQuZ (ORCPT + 99 others); Thu, 9 Sep 2021 12:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238377AbhIIQuY (ORCPT ); Thu, 9 Sep 2021 12:50:24 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65E8BC061757 for ; Thu, 9 Sep 2021 09:49:11 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id v17so5149946ybs.9 for ; Thu, 09 Sep 2021 09:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s+RgoVMQufwJ1iQH8D3qsEs6NeJAccH1we8wbejIgaA=; b=cKYHvkvuT7X76SxD/wV7YqPOMI1NJnCntmtpLCPUNYxyJ9kJmg1gz9JmPF8j6aZWCp HkUfLN6kOAf5LDuVEu+pXws7bQINvVC+T+LEEAor5KfA35yFRFVrURB3lc2+sX6+x8GM PzsCJaynqKz2jVTUHEL0fGsZpjHslFS5xMQwWj93foGhmNCnNL6CCsOiBH8anvLtHz0n yLWSMLlZi5dJczkFF96IfwEUwqoGsDFhBEfhAkmfrxcGIuKY48mSwUmU5GT/8Nob6l5I bZNfoDgt9wxtcx2nSN/Z0cTmkA7ttTgOGC2d2uM3N1eo3Mwa//VA8lA6J54Xcww3kP3h HU6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s+RgoVMQufwJ1iQH8D3qsEs6NeJAccH1we8wbejIgaA=; b=iEm4w8zOjovRyh/ZVVCKxrg4/6aiDiJgu4u0OHZ6LTB7T1cWjDIqZq6KVtVaUxN4GA 9yRNzfH+eCDpxvODP4HU4aXNmGX5GIOJ0zGXQ/E1n3OtVt9FPkfMWSOHpZL7otPBYYqw sUkrPHIU8eUVTXLCw6uFa+YBqYDbIGniIRQpytLgBu6oU2vLuU63LlfMuYVK+LeRNGVO CAa3yaP9U63Z80THx1VsYlRyoJbnyC32MP1e+FDjzjAblTeJotT3G+pikBH5FNKclZY6 5h9YiwHuxpfe5mCPylIKs7k2nT4pyAqpgxv0CLhlwyyagCXXkOT64RMOwl4hWCkc61bR kjCA== X-Gm-Message-State: AOAM533iL4E8wLvg9rS87HOJkUc2Zp7k5HDDv6uGv1UO4a/YCFX8AqLH nrB77vmuXHuWn5Z2pAOWvkePaW4ifWs8cRWyaLGYAw== X-Received: by 2002:a25:c504:: with SMTP id v4mr4742567ybe.308.1631206150502; Thu, 09 Sep 2021 09:49:10 -0700 (PDT) MIME-Version: 1.0 References: <20210909013818.1191270-1-rananta@google.com> <20210909013818.1191270-5-rananta@google.com> In-Reply-To: From: Raghavendra Rao Ananta Date: Thu, 9 Sep 2021 09:48:58 -0700 Message-ID: Subject: Re: [PATCH v4 04/18] KVM: arm64: selftests: Introduce ARM64_SYS_KVM_REG To: Oliver Upton Cc: Paolo Bonzini , Marc Zyngier , Andrew Jones , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Peter Shier , Ricardo Koller , Reiji Watanabe , Jing Zhang , 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 On Wed, Sep 8, 2021 at 8:02 PM Oliver Upton wrote: > > Hi Raghu, > > On Thu, Sep 09, 2021 at 01:38:04AM +0000, Raghavendra Rao Ananta wrote: > > 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) \ > > nit: KVM_ARM64_SYS_REG() perhaps? Dunno which is more readable. > > > +({ \ > > + 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)); \ > > +}) > > + > Heh, I came up with the logic faster than picking a name for the macro. I guess KVM_ARM64_SYS_REG may be more readable, just for the fact that it begins with KVM_. I'll change it. Regards, Raghavendra > Could you also switch all current users of ARM64_SYS_REG() in the KVM > selftests directory in this commit? You can also drop the system > register encodings defined in processor.h > I did that in a separate patch, but I can squash it here to avoid confusion. Regards, Raghavendra > -- > Thanks, > Oliver