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 X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A93AC433F5 for ; Thu, 9 Sep 2021 03:02:40 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 68A4060EE1 for ; Thu, 9 Sep 2021 03:02:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 68A4060EE1 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B65764B10A; Wed, 8 Sep 2021 23:02:38 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c0bHGn45iw2F; Wed, 8 Sep 2021 23:02:37 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AE1EE4B0C5; Wed, 8 Sep 2021 23:02:37 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 17DA84B0C5 for ; Wed, 8 Sep 2021 23:02:36 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wSGnKZWmsAah for ; Wed, 8 Sep 2021 23:02:34 -0400 (EDT) Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id CDF094AC80 for ; Wed, 8 Sep 2021 23:02:34 -0400 (EDT) Received: by mail-il1-f174.google.com with SMTP id h29so473556ila.2 for ; Wed, 08 Sep 2021 20:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lS2TfPmFq21WQA7kbI98jf7rDXgRBmsiJwAOxbyrVAE=; b=E1i9dzXY8FPZ0L+1tJuVo2J7zoe5PQ5Nbe26IR98lKFC/EFy7vzC7ItaFodLhxWHl5 BC4MTyEER+lWdRHF8GluZ4XPAsX77Y+uxxjgW7B0b6PFqGUtBUANxTpziKk66rKP/ew6 VcaQtkDrk4p2eK7xJNcdBzliel9JDBPZ7I3YlVvLU8hPNUntp+0+M05YxBLrcpplsf3q cZgexH9nLdpb6A98a4Aenh2/cOrv6xIM7meGszXq9kjMA7T7kfXMkRpLzHb+lIpMG+1O VO5oLmDy9I5apJ/bpHQNuvc1a4GjsOk3zXsn4WiD+2QmOwTV1OD9GvzLQOqKkP7Dx9lC zgrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lS2TfPmFq21WQA7kbI98jf7rDXgRBmsiJwAOxbyrVAE=; b=8RpDznq1rsvQD22AY3FTUGMsCWC3s7Ahc6JVhIc3ut/VrSCPL/C1qap66fZXlCOUp8 jNTlIE28UecsAWLV8p3G8def1KTbk85XA2+mLc+s0VQsZz2WGDhALxFEUf/tgb4AKI7v VmnQDH4ySIalFiKHiooR1fO6SxO28KGZZMeQVynmZZCxW0pUdDZaQVm8E+bK2InAbhOP 05C3xi+1vOxx6SkfVkL4B0n9DX/qNfv0I9tEutFwuzmSNtRt2i23tu4FJw+8E8Jpomxk CSG+0eW5cHYME5eaL4Js9tl9viOaGEsd4JcLHi91tUMovb6HVNhmNc8455BtbsPd1nVE jq7A== X-Gm-Message-State: AOAM531UTaINRkkfn9oSsvXmscko/4K1O4f37g/mRYGYfeoiOgQiiFqe GMLeKv9fFKnyN3yW9tb8+2sfXQ== X-Google-Smtp-Source: ABdhPJxnO3Xpf1rxt3cvGCIm05a/BPHERWpzorX/jlAxyWQB/SDLCIR3d7u6J9mGOmi/1JVTQda6Jw== X-Received: by 2002:a92:c605:: with SMTP id p5mr594556ilm.53.1631156554045; Wed, 08 Sep 2021 20:02:34 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id s1sm282250iln.12.2021.09.08.20.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 20:02:33 -0700 (PDT) Date: Thu, 9 Sep 2021 03:02:29 +0000 From: Oliver Upton To: Raghavendra Rao Ananta Subject: Re: [PATCH v4 04/18] KVM: arm64: selftests: Introduce ARM64_SYS_KVM_REG Message-ID: References: <20210909013818.1191270-1-rananta@google.com> <20210909013818.1191270-5-rananta@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210909013818.1191270-5-rananta@google.com> Cc: kvm@vger.kernel.org, Will Deacon , Marc Zyngier , Peter Shier , linux-kernel@vger.kernel.org, Catalin Marinas , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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)); \ > +}) > + 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 -- Thanks, Oliver _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F37A1C433F5 for ; Thu, 9 Sep 2021 03:04:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B42FA61181 for ; Thu, 9 Sep 2021 03:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B42FA61181 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LYDIM88k8ieaLReUsU6f4zbOu3xfzQem9ZUVC53Off8=; b=lAVV9hDOz8jTlq f+afeMJHaU6nyCMlo2ypuOC0RYsYHRCJbkKIckczj69mniaCiVHB+eCyBKtFk879KfNfqtJ4TGzbI WktDpZX2WcQoFTqbw0azJcjuqAC9w1EYi0cijmR9rx72mBd/OhMtmOAAAYThcTRKIndPEC26/AgC6 vTZu6m8IbyDMKOfptD5qcaxH63n5BY+QRLppZt5mYM7YOb9MNEZjQYKLmn8999ICtw7qzr311Hbfi imIQHVbkoQVAe92dQcxy91IORyok65T6n1wtj6McdVJekT3gh6z3i246aRSQBgLHgHoPIkawBH2S8 K+Zel3hRNX/vXX8IrQkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOAKl-0087gp-Ct; Thu, 09 Sep 2021 03:02:39 +0000 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mOAKh-0087gA-4I for linux-arm-kernel@lists.infradead.org; Thu, 09 Sep 2021 03:02:36 +0000 Received: by mail-il1-x136.google.com with SMTP id u17so443667ilm.13 for ; Wed, 08 Sep 2021 20:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lS2TfPmFq21WQA7kbI98jf7rDXgRBmsiJwAOxbyrVAE=; b=E1i9dzXY8FPZ0L+1tJuVo2J7zoe5PQ5Nbe26IR98lKFC/EFy7vzC7ItaFodLhxWHl5 BC4MTyEER+lWdRHF8GluZ4XPAsX77Y+uxxjgW7B0b6PFqGUtBUANxTpziKk66rKP/ew6 VcaQtkDrk4p2eK7xJNcdBzliel9JDBPZ7I3YlVvLU8hPNUntp+0+M05YxBLrcpplsf3q cZgexH9nLdpb6A98a4Aenh2/cOrv6xIM7meGszXq9kjMA7T7kfXMkRpLzHb+lIpMG+1O VO5oLmDy9I5apJ/bpHQNuvc1a4GjsOk3zXsn4WiD+2QmOwTV1OD9GvzLQOqKkP7Dx9lC zgrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lS2TfPmFq21WQA7kbI98jf7rDXgRBmsiJwAOxbyrVAE=; b=2SeHp7cEKwNszKzqhJ1NTR+n4oeFJ85wDBqAC4To4zanoPk3aN9mB8+PwgC+SwmDIg i9eiPhGwE6XEk/0a23KZ5WFEIkN4QjjDsF5naPG3EBln9DakyQtLBj+8YRNRin5MwiEl X+JaVIt5LiNqJM2d0iAr5LIMsJf7aN70nv7FhRbC0crfu1MX5JfwZYztBDMcK+uZmYVF VtHV9JbiP4gCAZa8uxiu6Jxvu+oGOVWdl/x64YOFkEOS2AUJ0u+U0CuU9epqA1YHmo0+ 3GDZpONVUwXMWlJfleXrao94PVo+kOeh6omY3PQjXnmYIzYm5HMiMFG7NjFUNr2Q1fvM 8T2A== X-Gm-Message-State: AOAM530Gr13UvP1unn+adcSeVs/smCdSiKesMut2GshFx1BUrVuBkBCk UJFPUigtaBDft0l1D/vtAuqYSg== X-Google-Smtp-Source: ABdhPJxnO3Xpf1rxt3cvGCIm05a/BPHERWpzorX/jlAxyWQB/SDLCIR3d7u6J9mGOmi/1JVTQda6Jw== X-Received: by 2002:a92:c605:: with SMTP id p5mr594556ilm.53.1631156554045; Wed, 08 Sep 2021 20:02:34 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id s1sm282250iln.12.2021.09.08.20.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 20:02:33 -0700 (PDT) Date: Thu, 9 Sep 2021 03:02:29 +0000 From: Oliver Upton To: Raghavendra Rao Ananta 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 Subject: Re: [PATCH v4 04/18] KVM: arm64: selftests: Introduce ARM64_SYS_KVM_REG Message-ID: References: <20210909013818.1191270-1-rananta@google.com> <20210909013818.1191270-5-rananta@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210909013818.1191270-5-rananta@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210908_200235_230595_7A54FDCF X-CRM114-Status: GOOD ( 20.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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)); \ > +}) > + 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 -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12F18C433EF for ; Thu, 9 Sep 2021 03:02:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFC8D60EE1 for ; Thu, 9 Sep 2021 03:02:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347815AbhIIDDo (ORCPT ); Wed, 8 Sep 2021 23:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231898AbhIIDDn (ORCPT ); Wed, 8 Sep 2021 23:03:43 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E373FC061575 for ; Wed, 8 Sep 2021 20:02:34 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id a20so460433ilq.7 for ; Wed, 08 Sep 2021 20:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lS2TfPmFq21WQA7kbI98jf7rDXgRBmsiJwAOxbyrVAE=; b=E1i9dzXY8FPZ0L+1tJuVo2J7zoe5PQ5Nbe26IR98lKFC/EFy7vzC7ItaFodLhxWHl5 BC4MTyEER+lWdRHF8GluZ4XPAsX77Y+uxxjgW7B0b6PFqGUtBUANxTpziKk66rKP/ew6 VcaQtkDrk4p2eK7xJNcdBzliel9JDBPZ7I3YlVvLU8hPNUntp+0+M05YxBLrcpplsf3q cZgexH9nLdpb6A98a4Aenh2/cOrv6xIM7meGszXq9kjMA7T7kfXMkRpLzHb+lIpMG+1O VO5oLmDy9I5apJ/bpHQNuvc1a4GjsOk3zXsn4WiD+2QmOwTV1OD9GvzLQOqKkP7Dx9lC zgrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lS2TfPmFq21WQA7kbI98jf7rDXgRBmsiJwAOxbyrVAE=; b=o2/OIRxjGxcb6eeNpWKsyjxNyx8862VSGX3PtbzcR02XQ+QEj02SE9Iq7LJhAi6wxZ kL9EJmONDX4kcJmfUm3D9/92btaI12s3+0YV0GjuZMZMpzFhbJcHyTaiI7DD1c1HMWF+ WGEjd8juqSTe7AAln31M003U4XDbrtKO3Ng+KW0fMzk3pCNK87FulHiTNDYJqCbCTLt0 VJc3EkXN3exE0eLUALD36wDSW+TOTQlfINj9rwBuqlkKtsaJUnCBmFSd+oQxS5ss6Fm2 EOh3DocT/E6oBp0f0NlpLYa5uOmN/c09LvDjIi+5g4zTDfgUkemQsu+tAtzk7JvgsPfC /Kgg== X-Gm-Message-State: AOAM5329YV5PUPshVNykG081109stzNDKGca//ND4bkYnTXEuPD6Rrgo gMxO3XJlOewo/4/5Cf8IkkPYxw== X-Google-Smtp-Source: ABdhPJxnO3Xpf1rxt3cvGCIm05a/BPHERWpzorX/jlAxyWQB/SDLCIR3d7u6J9mGOmi/1JVTQda6Jw== X-Received: by 2002:a92:c605:: with SMTP id p5mr594556ilm.53.1631156554045; Wed, 08 Sep 2021 20:02:34 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id s1sm282250iln.12.2021.09.08.20.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 20:02:33 -0700 (PDT) Date: Thu, 9 Sep 2021 03:02:29 +0000 From: Oliver Upton To: Raghavendra Rao Ananta 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 Subject: Re: [PATCH v4 04/18] KVM: arm64: selftests: Introduce ARM64_SYS_KVM_REG Message-ID: References: <20210909013818.1191270-1-rananta@google.com> <20210909013818.1191270-5-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210909013818.1191270-5-rananta@google.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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)); \ > +}) > + 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 -- Thanks, Oliver