Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp863505img; Thu, 21 Mar 2019 10:30:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5aJ8LztYJE1JQ1GCx9OqJ6/TARM1hoDAP6HUZn/niPpnLL+tpEdwiBslTRuNPneJofuqd X-Received: by 2002:a62:39c2:: with SMTP id u63mr4356127pfj.11.1553189413096; Thu, 21 Mar 2019 10:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553189413; cv=none; d=google.com; s=arc-20160816; b=Ny0TIYw7aKhGNiY753rhGzVC0MPRZnQfaxNsis10RegwL/PUPgu2lsN/OHEs68WxeK jrB8ZVsXefOGCnYIJ4kBlYnX7QTGrxnPF5r4ZOd1aS+Xg6A48IQxSM3Id6qugVNihupc C+PuKb/2hwTlyam+mvJO03gsSWi6v5HRw6hdhF9fzRPrWM3/BJGJMVoTOxbE9aszvO/s EHF3G4BIwAc7vT4ZYjgTIR7/sq9ugyQKjo3jubL/PgeJnn2JWdC75SvX5T+Vec9UXq7J JTMu3FkdoYVQwGQ4cfU9f11XicnS/37psN0PDK7YrVgme1gsMhMFjmHMAtEeigMmsIpz EG5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=QoydGrLkpK+aNAm2jhsYxCxJQ+iXDNwe3t9hBWydrEc=; b=dfgH8+erVoZpfwSxlrXBaA3lgYGJvjRy07tDxj1lt2t2ZgS8uhboX9Tbu49YARvmH/ Lu6k9U8LqqpQnyvZ5Led5di5GcR+LcWJpUN3pYhtkYxAGVpD5qrYNQ1KPZZwsOoth2y1 Kr9Agnl2pJUZVy0TiXTRFDWfLIdkNekPtZpq0jXy/V1fm5Qug+3jd31NEK/m92ftKpij o71rSnJ1iTk9Wruq8olUE6L3UZy9PbDHLDh6332WckXI7sGBLmcK1N48O4MACtOiI1TA tAKS8hrJGO3m17vcUqcxMCFPm6gbgxwgcSBJVYRCElsnf/CRLTxunuzSciwxSIIkitzK 8b5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si4858930plp.306.2019.03.21.10.29.57; Thu, 21 Mar 2019 10:30:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728586AbfCUR1p (ORCPT + 99 others); Thu, 21 Mar 2019 13:27:45 -0400 Received: from foss.arm.com ([217.140.101.70]:60482 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728138AbfCUR1p (ORCPT ); Thu, 21 Mar 2019 13:27:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D574D374; Thu, 21 Mar 2019 10:27:44 -0700 (PDT) Received: from [10.37.12.130] (unknown [10.37.12.130]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C0CC3F614; Thu, 21 Mar 2019 10:27:42 -0700 (PDT) Subject: Re: [PATCH RFC 01/14] arm64/mm: Introduce asid_info structure and move asid_generation/asid_map to it To: Suzuki K Poulose , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Cc: christoffer.dall@arm.com, james.morse@arm.com, marc.zyngier@arm.com, julien.thierry@arm.com, catalin.marinas@arm.com, will.deacon@arm.com References: <20190321163623.20219-1-julien.grall@arm.com> <20190321163623.20219-2-julien.grall@arm.com> From: Julien Grall Message-ID: <247efb35-2082-289a-43cf-3342b586b1d8@arm.com> Date: Thu, 21 Mar 2019 17:27:40 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/21/19 5:03 PM, Suzuki K Poulose wrote: > Hi Julien, Hi Suzuki, > On 21/03/2019 16:36, Julien Grall wrote: >> In an attempt to make the ASID allocator generic, create a new structure >> asid_info to store all the information necessary for the allocator. >> >> For now, move the variables asid_generation and asid_map to the new >> structure >> asid_info. Follow-up patches will move more variables. >> >> Note to avoid more renaming aftwards, a local variable 'info' has been >> created and is a pointer to the ASID allocator structure. >> >> Signed-off-by: Julien Grall >> --- >>   arch/arm64/mm/context.c | 46 >> ++++++++++++++++++++++++++-------------------- >>   1 file changed, 26 insertions(+), 20 deletions(-) >> >> diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c >> index 1f0ea2facf24..34db54f1a39a 100644 >> --- a/arch/arm64/mm/context.c >> +++ b/arch/arm64/mm/context.c >> @@ -30,8 +30,11 @@ >>   static u32 asid_bits; >>   static DEFINE_RAW_SPINLOCK(cpu_asid_lock); >> -static atomic64_t asid_generation; >> -static unsigned long *asid_map; >> +struct asid_info >> +{ >> +    atomic64_t    generation; >> +    unsigned long    *map; >> +} asid_info; > > Shouldn't this be static ? Rest looks fine. Yes it should be static. I have updated my code. Thank you for the review! Cheers, > > Cheers > Suzuki -- Julien Grall