Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp700844pxb; Thu, 2 Sep 2021 13:00:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn5lnTK7dRSqZ8FizFJaWRUNf66cAybFHMQYlbybmJQuHidazslaibl5GSiU40/8IUrfe+ X-Received: by 2002:a17:906:d1d1:: with SMTP id bs17mr5500380ejb.198.1630612838777; Thu, 02 Sep 2021 13:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630612838; cv=none; d=google.com; s=arc-20160816; b=mFvaW8aErccMmUdt9TFdd3flyPRrktbVBmcyz5y2KaxkkmXlwaF2hSMkVQghuEqYZG sv9nWngiTF5UtvBtRH8+ArFiDKj8AGjhfxhFKlFvYyze1D4oKRbn67fmiamIy3Fp6pQK 4/7YsaNNqexGtw1vhADAznu2lTOlNCXbx3MjQ4QtZfz1jNrn0IxdOIstR0MUaPPcZ8uk 4KLVhlNu2EWXbBoIA+HYagPIl0eZrl+oDrgrnk/C06cvBjBP4oIJAnC+ThIz4NASjE5v pnb0WX3+t2MXIabv3eSwJ3Q0uXQ/SPLIwvAxC0cZgUAMclC0x+bo6G57JfMke/a7vWva 2EIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1bF0+pdPFV1oPqtHYhh2gb/KkOQLq0K7gX0PwtmmkGA=; b=H5awdQsVqKQntUWzBGilcfUIismLLxlHyW++aXX1OwueeB48fa0z51Orcthntj4I3z gj8HhtlCwOIMHI6DNxOmcxxaDfNhFmbzFwZql/qk9Qlfpzrxeoz1LhdSOarvfxe+y+CP Gp83YAmo0dvY8c2mBMjE9FCUvEPlUbQITdHpi4fGxk8I+oFb17ZrR1J2N0bUh1wti5TE bESO9H5Hs6f8w4CwyyyJdrSEz3vwi38OG/yFMNuveXaqp62N/gr6iWc3DW2U+4QsMzD9 RTGn+LSALHwbSWkck+cSLlqhpD0IhMMxyDAeMPqod1yx9f9VpS4pUTzf7tCdHGILdRxP 2TeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iGKkNJW1; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si2960837edr.441.2021.09.02.13.00.15; Thu, 02 Sep 2021 13:00:38 -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=@redhat.com header.s=mimecast20190719 header.b=iGKkNJW1; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238117AbhIBMcN (ORCPT + 99 others); Thu, 2 Sep 2021 08:32:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49639 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234094AbhIBMcM (ORCPT ); Thu, 2 Sep 2021 08:32:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630585874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1bF0+pdPFV1oPqtHYhh2gb/KkOQLq0K7gX0PwtmmkGA=; b=iGKkNJW1LysqKv0d01S2ie3jo4e9FI+rss9lrkG2wV89kYI980/O8mT5cA+O2iENiSPPTe T+UHSjfzbEKMh5TBoC1JuxS9paSTV/JVfYT/fWH6rTYw3bAb35j3y2wNX6XTFOQBvKI+AP JhsYP6gONzunUMONih4YkEeqYXKCzBI= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-BKvZI8PHMga7wwwDqJsRJQ-1; Thu, 02 Sep 2021 08:31:13 -0400 X-MC-Unique: BKvZI8PHMga7wwwDqJsRJQ-1 Received: by mail-wr1-f71.google.com with SMTP id d10-20020adffbca000000b00157bc86d94eso477678wrs.20 for ; Thu, 02 Sep 2021 05:31:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1bF0+pdPFV1oPqtHYhh2gb/KkOQLq0K7gX0PwtmmkGA=; b=lZj4qclYmVbHmqgE8rJB6GL4qlCi6y7axCoruvH8TkzyyytBSL5udM5dBVBlUhj9xn Dk4Ei9ZjE/lVtSoj0lpaNi07/4W1S6EOLdu326G5vaT6IayTJY80L2xqJ4Md7woGicW0 fasi65OkrHTjVTsDwnXbo71oEfuhpjJVPg29fuF8TOS2eshd/MMmVpC4Yrip05R5MWrB NUwav9j7hhAgmHzBUp4pew3u2E/3VQfNqnTwbxsxfjWntcx6xoAKNNB5Lyme9+uo/7+F OvMp8+2rRbzyujszAnybFjBiJu1Qr7ATk6tGc8eiK/sEvQADj35fZdRkc65LruoCcQkg JVyQ== X-Gm-Message-State: AOAM531L2vgMc2U5JbQ9slpIpPfv3jfNZofbjljPTe/g++PKoIDYP78Z iTzPZsjj2PKV42QGUrxBYQ9C+UvdqoCPx2u/azCbROZ4sivJsHAdClnBkCrRL4t2xu9TDsrRi6y fupxuCJxgBtabM6htNxZMK3pW X-Received: by 2002:a5d:6cc9:: with SMTP id c9mr3459267wrc.12.1630585872056; Thu, 02 Sep 2021 05:31:12 -0700 (PDT) X-Received: by 2002:a5d:6cc9:: with SMTP id c9mr3459246wrc.12.1630585871881; Thu, 02 Sep 2021 05:31:11 -0700 (PDT) Received: from gator (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id x21sm1539270wmi.15.2021.09.02.05.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 05:31:11 -0700 (PDT) Date: Thu, 2 Sep 2021 14:31:10 +0200 From: Andrew Jones To: Oliver Upton Cc: Raghavendra Rao Ananta , kvm@vger.kernel.org, Will Deacon , Catalin Marinas , Peter Shier , linux-kernel@vger.kernel.org, Marc Zyngier , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 02/12] KVM: arm64: selftests: Add write_sysreg_s and read_sysreg_s Message-ID: <20210902123110.royrzw4dsykkrcjx@gator> References: <20210901211412.4171835-1-rananta@google.com> <20210901211412.4171835-3-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01, 2021 at 11:06:10PM +0000, Oliver Upton wrote: > On Wed, Sep 01, 2021 at 03:48:40PM -0700, Raghavendra Rao Ananta wrote: > > On Wed, Sep 1, 2021 at 3:08 PM Oliver Upton wrote: > > > > > > On Wed, Sep 01, 2021 at 09:28:28PM +0000, Oliver Upton wrote: > > > > On Wed, Sep 01, 2021 at 09:14:02PM +0000, Raghavendra Rao Ananta wrote: > > > > > For register names that are unsupported by the assembler or the ones > > > > > without architectural names, add the macros write_sysreg_s and > > > > > read_sysreg_s to support them. > > > > > > > > > > The functionality is derived from kvm-unit-tests and kernel's > > > > > arch/arm64/include/asm/sysreg.h. > > > > > > > > > > Signed-off-by: Raghavendra Rao Ananta > > > > > > > > Would it be possible to just include ? See > > > > tools/arch/arm64/include/asm/sysreg.h > > > > > > Geez, sorry for the noise. I mistakenly searched from the root of my > > > repository, not the tools/ directory. > > > > > No worries :) > > > > > In any case, you could perhaps just drop the kernel header there just to > > > use the exact same source for kernel and selftest. > > > > > You mean just copy/paste the entire header? There's a lot of stuff in > > there which we > > don't need it (yet). > > Right. It's mostly register definitions, which I don't think is too high > of an overhead. Don't know where others stand, but I would prefer a > header that is equivalent between kernel & selftests over a concise > header. > Until now we haven't needed the sys_reg(...) type of definitions for sysregs in selftests. In case we did, we defined the registers we needed for get/set_one_reg by their parts, e.g. #define ID_AA64DFR0_EL1 3, 0, 0, 5, 0 allowing us to choose how we use them, ARM64_SYS_REG(...) vs. sys_reg(...). Bringing over sysreg.h is probably a good idea though. If we do, then I'd suggest we define a new macro that allows us to convert a SYS_* register definition from sysreg.h into an ARM64_SYS_REG definition for get/set_one_reg in order to avoid redundant definitions. Thanks, drew