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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DF94DC433F5 for ; Thu, 2 Dec 2021 13:13:06 +0000 (UTC) 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:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kowQACnXKaM6Zhp87w1CY30ni0DPjFA7a70oaypyq2A=; b=sCx4FH2+FS2fNbeOjE9mcP8mEY ZPhVbuQ01yOSMWpuZjrRQUB0Frok6bH0P43vbg2JCcSpdin6j4vH6sHZKf/pEtFbiTjCMj8308AR9 DLriQjFXcTKZ/qLbO3iZVhQM4+YujEQ9digKWBtZh+2ZsGGWiXcZN5k3Srw11KFmTLh79w7HP2qJ4 96wTViR7LLsfP9KaDhvdxTUfmBtCRKBAwsBkQ2RypfmNsU8mPmpSx8hRv1pZY4ebcHSi4HN7WfT0g DH+Bg+a9V3xOtJumLP2+e2vZG7Wy+0yw0vt9b3/L0dhzgM63yz3/e4+J/ob8e8fe8rRKtuO/B0e/4 Y0y9C0zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1msls8-00CQTQ-5U; Thu, 02 Dec 2021 13:11:36 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1msls4-00CQSd-E2 for linux-arm-kernel@lists.infradead.org; Thu, 02 Dec 2021 13:11:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638450691; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ORZwySvXsS7bVMV6iSSKGBVEj6KTyOWMLSUM7WG+EM=; b=CtM7bNFm1bMCYK6mSnvMSdQj6h9KG8gqZG5c9BMdf6lTS9jBnzGCavUlZPUEk4Ao641gKJ v4vuYacmLhhhvoPbQThKen1R5kopNmieAyNl+V6ooCGqqa7ATrtoigzNMAS0ev4gxoouam vlMbIlTf2LXxAcH9bzIlvni1kGiob2I= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-331-ycZi66hCNtKBX1HK2KcdAg-1; Thu, 02 Dec 2021 08:11:30 -0500 X-MC-Unique: ycZi66hCNtKBX1HK2KcdAg-1 Received: by mail-wm1-f72.google.com with SMTP id b142-20020a1c8094000000b0033f27b76819so11110558wmd.4 for ; Thu, 02 Dec 2021 05:11:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+ORZwySvXsS7bVMV6iSSKGBVEj6KTyOWMLSUM7WG+EM=; b=y9njvKW8+mGR/WLlwQFyI8uqqiQ0zo/a2WV4QmW9c2mImOsA7Ea6TREd6f9Dhd5VA3 jdd1Bzm6hhZk0m+BPtT9K5heqV2b/8LAVnyxcMGOYCZjzT/pRgGpmcTx6dNjp8SnLF92 iq+JVaIjHLO30AUUpouDe/xn+svHgOEUjfgQCQbBo6oy9sz3Rxz6VbJm5KlZUtAjAFx2 W2pF4uuNaWIPRtuci5+IhjTCHiUFZ75EY5ECYuBkCDnhayJK3w3Q9Y6nktFQn7zR3obK DMhRWD7VvEncKitGGPqr1uvkbCgwr5TOQimjESJKGePHojXK8CtbvGbL/UYiENywODhg 5krA== X-Gm-Message-State: AOAM533chcbOp78wm0qM5nNm6alx0K5xScGeRU9Lk2db9oASt6AUDeMP 5Z+RQfc48aoIDoHTnGX97QnuTfmIIn12dNVmk5syNThxRXF2pJN2Fjz8aVMnMz3p3UIU+t65/ax 1UGAnK0OA0R625CZyfW4QXLj3fAM4nrgt4wo= X-Received: by 2002:adf:dc47:: with SMTP id m7mr14456749wrj.576.1638450689186; Thu, 02 Dec 2021 05:11:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRywFER8Vz2gbwjUzZSItMbLcPLhaPUjX8ZwPMMxFDRKOO8TYuB0M5JAWiIxd6BSWzMOBhjg== X-Received: by 2002:adf:dc47:: with SMTP id m7mr14456719wrj.576.1638450689005; Thu, 02 Dec 2021 05:11:29 -0800 (PST) Received: from ?IPv6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id h22sm2174819wmq.14.2021.12.02.05.11.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Dec 2021 05:11:28 -0800 (PST) Subject: Re: [RFC PATCH v3 12/29] KVM: arm64: Make ID_DFR1_EL1 writable To: Reiji Watanabe Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Will Deacon , Andrew Jones , Peng Liang , Peter Shier , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata References: <20211117064359.2362060-1-reijiw@google.com> <20211117064359.2362060-13-reijiw@google.com> <44073484-639e-3d23-2068-ae5c2cac3276@redhat.com> From: Eric Auger Message-ID: <7a2ef550-eadb-7fa3-8aa4-f666a14d6efa@redhat.com> Date: Thu, 2 Dec 2021 14:11:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eauger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211202_051132_584124_56BF17E9 X-CRM114-Status: GOOD ( 18.93 ) 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 On 11/30/21 6:39 AM, Reiji Watanabe wrote: > Hi Eric, > > On Thu, Nov 25, 2021 at 12:30 PM Eric Auger wrote: >> >> Hi Reiji, >> >> On 11/17/21 7:43 AM, Reiji Watanabe wrote: >>> This patch adds id_reg_info for ID_DFR1_EL1 to make it writable >>> by userspace. >>> >>> Signed-off-by: Reiji Watanabe >>> --- >>> arch/arm64/kvm/sys_regs.c | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c >>> index fbd335ac5e6b..dda7001959f6 100644 >>> --- a/arch/arm64/kvm/sys_regs.c >>> +++ b/arch/arm64/kvm/sys_regs.c >>> @@ -859,6 +859,11 @@ static struct id_reg_info id_dfr0_el1_info = { >>> .get_reset_val = get_reset_id_dfr0_el1, >>> }; >>> >>> +static struct id_reg_info id_dfr1_el1_info = { >>> + .sys_reg = SYS_ID_DFR1_EL1, >>> + .ftr_check_types = S_FCT(ID_DFR1_MTPMU_SHIFT, FCT_LOWER_SAFE), >> what about the 0xF value which indicates the MTPMU is not implemented? > > The field is treated as a signed field. > So, 0xf(== -1) is handled correctly. > (Does it answer your question?) yes thanks Eric > > Thanks, > Reiji > >> >> Eric >>> +}; >>> + >>> /* >>> * An ID register that needs special handling to control the value for the >>> * guest must have its own id_reg_info in id_reg_info_table. >>> @@ -869,6 +874,7 @@ static struct id_reg_info id_dfr0_el1_info = { >>> #define GET_ID_REG_INFO(id) (id_reg_info_table[IDREG_IDX(id)]) >>> static struct id_reg_info *id_reg_info_table[KVM_ARM_ID_REG_MAX_NUM] = { >>> [IDREG_IDX(SYS_ID_DFR0_EL1)] = &id_dfr0_el1_info, >>> + [IDREG_IDX(SYS_ID_DFR1_EL1)] = &id_dfr1_el1_info, >>> [IDREG_IDX(SYS_ID_AA64PFR0_EL1)] = &id_aa64pfr0_el1_info, >>> [IDREG_IDX(SYS_ID_AA64PFR1_EL1)] = &id_aa64pfr1_el1_info, >>> [IDREG_IDX(SYS_ID_AA64DFR0_EL1)] = &id_aa64dfr0_el1_info, >>> >> > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel