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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 7D7E8C433E0 for ; Mon, 25 Jan 2021 13:21:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27D7222B37 for ; Mon, 25 Jan 2021 13:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbhAYNVM (ORCPT ); Mon, 25 Jan 2021 08:21:12 -0500 Received: from foss.arm.com ([217.140.110.172]:47250 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbhAYNQm (ORCPT ); Mon, 25 Jan 2021 08:16:42 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B11A311FB; Mon, 25 Jan 2021 05:15:56 -0800 (PST) Received: from [10.57.40.145] (unknown [10.57.40.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 427C83F66E; Mon, 25 Jan 2021 05:15:53 -0800 (PST) Subject: Re: [PATCH v5 13/21] arm64: Allow ID_AA64MMFR1_EL1.VH to be overridden from the command line To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Mark Rutland , David Brazdil , Alexandru Elisei , Ard Biesheuvel , Jing Zhang , Ajay Patil , Prasad Sodagudi , Srinivas Ramana , James Morse , Julien Thierry , kernel-team@android.com References: <20210125105019.2946057-1-maz@kernel.org> <20210125105019.2946057-14-maz@kernel.org> From: Suzuki K Poulose Message-ID: Date: Mon, 25 Jan 2021 13:15:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210125105019.2946057-14-maz@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/21 10:50 AM, Marc Zyngier wrote: > As we want to be able to disable VHE at runtime, let's match > "id_aa64mmfr1.vh=" from the command line as an override. > This doesn't have much effect yet as our boot code doesn't look > at the cpufeature, but only at the HW registers. > > Signed-off-by: Marc Zyngier > Acked-by: David Brazdil > --- > arch/arm64/include/asm/cpufeature.h | 2 ++ > arch/arm64/kernel/cpufeature.c | 5 ++++- > arch/arm64/kernel/idreg-override.c | 11 +++++++++++ > 3 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > index 4179cfc8ed57..b0ed37da4067 100644 > --- a/arch/arm64/include/asm/cpufeature.h > +++ b/arch/arm64/include/asm/cpufeature.h > @@ -818,6 +818,8 @@ static inline unsigned int get_vmid_bits(u64 mmfr1) > return 8; > } > > +extern struct arm64_ftr_override id_aa64mmfr1_override; > + > u32 get_kvm_ipa_limit(void); > void dump_cpu_features(void); > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 4b84a1e1dc51..c1d6712c4249 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -557,6 +557,8 @@ static const struct arm64_ftr_bits ftr_raz[] = { > > #define ARM64_FTR_REG(id, table) ARM64_FTR_REG_OVERRIDE(id, table, &no_override) > > +struct arm64_ftr_override id_aa64mmfr1_override; Does this need to be ro_after_init ? Otherwise, looks good to me: Acked-by: Suzuki K Poulose 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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 3E06CC433E0 for ; Mon, 25 Jan 2021 13:16:02 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 80C7922583 for ; Mon, 25 Jan 2021 13:16:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80C7922583 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B63124B5D4; Mon, 25 Jan 2021 08:16:00 -0500 (EST) 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 fkqCCvBgwvXK; Mon, 25 Jan 2021 08:15:58 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id EC0264B5E5; Mon, 25 Jan 2021 08:15:58 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6386D4B5DE for ; Mon, 25 Jan 2021 08:15:58 -0500 (EST) 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 y+roAg939pPa for ; Mon, 25 Jan 2021 08:15:57 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4A3364B5D4 for ; Mon, 25 Jan 2021 08:15:57 -0500 (EST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B11A311FB; Mon, 25 Jan 2021 05:15:56 -0800 (PST) Received: from [10.57.40.145] (unknown [10.57.40.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 427C83F66E; Mon, 25 Jan 2021 05:15:53 -0800 (PST) Subject: Re: [PATCH v5 13/21] arm64: Allow ID_AA64MMFR1_EL1.VH to be overridden from the command line To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org References: <20210125105019.2946057-1-maz@kernel.org> <20210125105019.2946057-14-maz@kernel.org> From: Suzuki K Poulose Message-ID: Date: Mon, 25 Jan 2021 13:15:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210125105019.2946057-14-maz@kernel.org> Content-Language: en-GB Cc: Prasad Sodagudi , Srinivas Ramana , kernel-team@android.com, Catalin Marinas , Ajay Patil , Will Deacon , Ard Biesheuvel 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On 1/25/21 10:50 AM, Marc Zyngier wrote: > As we want to be able to disable VHE at runtime, let's match > "id_aa64mmfr1.vh=" from the command line as an override. > This doesn't have much effect yet as our boot code doesn't look > at the cpufeature, but only at the HW registers. > > Signed-off-by: Marc Zyngier > Acked-by: David Brazdil > --- > arch/arm64/include/asm/cpufeature.h | 2 ++ > arch/arm64/kernel/cpufeature.c | 5 ++++- > arch/arm64/kernel/idreg-override.c | 11 +++++++++++ > 3 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > index 4179cfc8ed57..b0ed37da4067 100644 > --- a/arch/arm64/include/asm/cpufeature.h > +++ b/arch/arm64/include/asm/cpufeature.h > @@ -818,6 +818,8 @@ static inline unsigned int get_vmid_bits(u64 mmfr1) > return 8; > } > > +extern struct arm64_ftr_override id_aa64mmfr1_override; > + > u32 get_kvm_ipa_limit(void); > void dump_cpu_features(void); > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 4b84a1e1dc51..c1d6712c4249 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -557,6 +557,8 @@ static const struct arm64_ftr_bits ftr_raz[] = { > > #define ARM64_FTR_REG(id, table) ARM64_FTR_REG_OVERRIDE(id, table, &no_override) > > +struct arm64_ftr_override id_aa64mmfr1_override; Does this need to be ro_after_init ? Otherwise, looks good to me: Acked-by: Suzuki K Poulose _______________________________________________ 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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 470C8C433DB for ; Mon, 25 Jan 2021 13:19:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DEBA222B37 for ; Mon, 25 Jan 2021 13:19:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEBA222B37 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hTx0vqASAR0TQBG/yN1JQyj+b7OC22Xpunjh4eppczQ=; b=1vCqPVFGHvY/ABFtt1vVULWRu em65MhpMACPVauICSEGq4u+NfDT0/2ry1ZLliduUjbG1e+zu4WQ5ICewx/Fod+FcB/3tCmtKtbF3I DdXNZPe/mFOvYSAe8Yc2XfPfDngGNcieHwRe+nApSrlyyuf7zezVN2/cQ61XshyakOmq1dDJKb60+ 6YUboLScmFz6VoKJ4BoMuv1kv9f9JHtp4dQu3zVuKUc5Msyrc+w+c7ASdpTsJ4reukv+YJyyVLmKF zE3TxlB0ps0ssfVzSjInKnh3TxVnHJMKAKJbgIqvS9rWnFtcsIEFU7sv6sif2s+EpGKK4Wgcq/BE0 WUuPs0rLw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l41iq-0005lH-Vy; Mon, 25 Jan 2021 13:16:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l41io-0005ke-US for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2021 13:15:59 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B11A311FB; Mon, 25 Jan 2021 05:15:56 -0800 (PST) Received: from [10.57.40.145] (unknown [10.57.40.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 427C83F66E; Mon, 25 Jan 2021 05:15:53 -0800 (PST) Subject: Re: [PATCH v5 13/21] arm64: Allow ID_AA64MMFR1_EL1.VH to be overridden from the command line To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org References: <20210125105019.2946057-1-maz@kernel.org> <20210125105019.2946057-14-maz@kernel.org> From: Suzuki K Poulose Message-ID: Date: Mon, 25 Jan 2021 13:15:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210125105019.2946057-14-maz@kernel.org> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_081559_026851_97BE15DD X-CRM114-Status: GOOD ( 20.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Jing Zhang , Prasad Sodagudi , Srinivas Ramana , kernel-team@android.com, Catalin Marinas , Alexandru Elisei , James Morse , Ajay Patil , David Brazdil , Will Deacon , Ard Biesheuvel , Julien Thierry Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 1/25/21 10:50 AM, Marc Zyngier wrote: > As we want to be able to disable VHE at runtime, let's match > "id_aa64mmfr1.vh=" from the command line as an override. > This doesn't have much effect yet as our boot code doesn't look > at the cpufeature, but only at the HW registers. > > Signed-off-by: Marc Zyngier > Acked-by: David Brazdil > --- > arch/arm64/include/asm/cpufeature.h | 2 ++ > arch/arm64/kernel/cpufeature.c | 5 ++++- > arch/arm64/kernel/idreg-override.c | 11 +++++++++++ > 3 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > index 4179cfc8ed57..b0ed37da4067 100644 > --- a/arch/arm64/include/asm/cpufeature.h > +++ b/arch/arm64/include/asm/cpufeature.h > @@ -818,6 +818,8 @@ static inline unsigned int get_vmid_bits(u64 mmfr1) > return 8; > } > > +extern struct arm64_ftr_override id_aa64mmfr1_override; > + > u32 get_kvm_ipa_limit(void); > void dump_cpu_features(void); > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 4b84a1e1dc51..c1d6712c4249 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -557,6 +557,8 @@ static const struct arm64_ftr_bits ftr_raz[] = { > > #define ARM64_FTR_REG(id, table) ARM64_FTR_REG_OVERRIDE(id, table, &no_override) > > +struct arm64_ftr_override id_aa64mmfr1_override; Does this need to be ro_after_init ? Otherwise, looks good to me: Acked-by: Suzuki K Poulose _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel