Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp466420pxm; Wed, 2 Mar 2022 02:04:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZiqkL6hvrGK2I0Z+3s3wUokIY84qkE28PVUI0PjQ94qyWZbowBcGL+SstE1R7KtiLxU2F X-Received: by 2002:a17:902:b683:b0:150:c60:288f with SMTP id c3-20020a170902b68300b001500c60288fmr29767635pls.61.1646215480027; Wed, 02 Mar 2022 02:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646215480; cv=none; d=google.com; s=arc-20160816; b=aVzPVJFm3bAFcQjPRwrdTcPZ3O7ccMf7Qy3UEU07etS1XeEzrcgbqLSffdnq0egsxy eJM28OhC0ypzWSEgR7q3npIUgLqyVqhckratBXzhViVXw1k48K1/fCA5+BnPOx6X0Ueu F7e+S0v/0mmOGNDu6ck5x+WnmxWN3A3MpO4TDFCom8cL/3MSgJg1ArdvQzRRnzAYShoJ rKnx3LakvkBdhc+6ivffd5mKk7+cjitdvXLvspqaplqtk0nkrYGB6deME3gHM59yqrSh 9Bqro0th09Ui4NnMrTs+d9RLFYX7JLOElgjRp8TsOFTKu+StgWF1h4BrrlCr0AFt6hd5 cEKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=tx/6UWkyn0Y7aF5zbCGSZsxxtr81nKV2RIvAl2KYMik=; b=aaaGJfc8H/luAkJN2ciPiM7Gh/djRQfqRTwYtF/YTzyrtqnzKy1buXnXwOzNzxOwrD rHeKQ81XDg1nZhgl6Nn2Thz+wygivbtu73/8M4k96pW8wFrtQRs2nFYRFmFAby6MGSM/ LSHlDD5/j5vvxI74ZXifXBespB2j5/CS0oBjduG00WPoOrftOGGUv+GoW3Dz5o1EiC9v q1DTfAEQ3GyFFycQ0y8n6fbqW6nb4QMShWdtly7m/9Bn/dC01NjACAUX9KFv3rxV3q01 VbBeCI7zKZexp3WHPpNwSMFOF4gRiC8eOoW0f6kjzPjb1zSHNX8Cb4mJ11UEsLuDYiYd 9AgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ADExU80j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t134-20020a63788c000000b00365948d30e9si14509813pgc.521.2022.03.02.02.04.24; Wed, 02 Mar 2022 02:04:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ADExU80j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239921AbiCBHra (ORCPT + 99 others); Wed, 2 Mar 2022 02:47:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233208AbiCBHr2 (ORCPT ); Wed, 2 Mar 2022 02:47:28 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD0B3B12E7 for ; Tue, 1 Mar 2022 23:46:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5489860916 for ; Wed, 2 Mar 2022 07:46:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3297C340EF; Wed, 2 Mar 2022 07:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646207204; bh=saY4uFacqmTSqZECGMkmCoPAAs90t/+LOjZSwwOwbOs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ADExU80jY0rCuB1MLxUsZbsn2dmH1n/N7E8zpyl2JnH93MaN8Q5ol/fmRPgUsmc2T avv7Uo44zr8igfL2hCz8WrnE396s23ZKOjSWgEo3xPmkfsLp31XbAdezPOWqH1alTw hVyNKN02A/lBCyhc9mto47EraNfvWJpPpuOCGIg6cIh66GJ8aUgvJq6aAyU9pm0ayl VkR9dwE042ukx+SD8foK1q9DsH0dmkpWX8MCNmjWn0Tfbwr6FrVmKO5vBocVrRnrjC +dJ0k6mgIqsM+LYxDOhcNDRQs8tZuUqukTNLqrLBAdmWIuQRWjKfMbZmduLx0nuify Ph/Lt18XMf1wg== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=billy-the-mountain.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nPJh3-00BbhG-UP; Wed, 02 Mar 2022 07:46:42 +0000 Date: Wed, 02 Mar 2022 07:46:35 +0000 Message-ID: <87v8ww6bl0.wl-maz@kernel.org> From: Marc Zyngier To: Kalesh Singh Cc: will@kernel.org, qperret@google.com, tabba@google.com, surenb@google.com, kernel-team@android.com, James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Mark Rutland , Mark Brown , Masami Hiramatsu , Peter Collingbourne , "Madhavan T. Venkataraman" , Andrew Scull , Paolo Bonzini , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/8] KVM: arm64: Introduce pkvm_alloc_private_va_range() In-Reply-To: <20220225033548.1912117-3-kaleshsingh@google.com> References: <20220225033548.1912117-1-kaleshsingh@google.com> <20220225033548.1912117-3-kaleshsingh@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: kaleshsingh@google.com, will@kernel.org, qperret@google.com, tabba@google.com, surenb@google.com, kernel-team@android.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, broonie@kernel.org, mhiramat@kernel.org, pcc@google.com, madvenka@linux.microsoft.com, ascull@google.com, pbonzini@redhat.com, ardb@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Feb 2022 03:34:47 +0000, Kalesh Singh wrote: > > pkvm_hyp_alloc_private_va_range() can be used to reserve private VA ranges > in the pKVM nVHE hypervisor (). Also update __pkvm_create_private_mapping() > to allow specifying an alignment for the private VA mapping. > > These will be used to implement stack guard pages for pKVM nVHE hypervisor > (in a subsequent patch in the series). > > Credits to Quentin Perret for the idea of moving > private VA allocation out of __pkvm_create_private_mapping() > > Signed-off-by: Kalesh Singh > --- > > Changes in v4: > - Handle null ptr in pkvm_alloc_private_va_range() and replace > IS_ERR_OR_NULL checks in callers with IS_ERR checks, per Fuad > - Fix kernel-doc comments format, per Fuad > - Format __pkvm_create_private_mapping() prototype args (< 80 col), per Fuad > > Changes in v3: > - Handle null ptr in IS_ERR_OR_NULL checks, per Mark > > Changes in v2: > - Allow specifying an alignment for the private VA allocations, per Marc I probably badly expressed my earlier concern. Yes, an alignment is necessary. But how often do we want an alignment that isn't naturally aligned to the size of the allocation (i.e. the power of 2 >= the size of the allocation)? This is what the rest of the kernel does (get_order() and co), and I thing we should follow this. This applies to both this patch and the previous one. Thanks, M. -- Without deviation from the norm, progress is not possible.