Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp247334pxm; Wed, 2 Mar 2022 14:31:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwv1XezpOeRwmnfq20L3BXFWDJbNHztXn/iQI72McakuTOU4fmzI1mgKDCx+Th/iGCr7Z6E X-Received: by 2002:a17:903:191:b0:151:9e58:ce65 with SMTP id z17-20020a170903019100b001519e58ce65mr3287636plg.0.1646260279163; Wed, 02 Mar 2022 14:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646260279; cv=none; d=google.com; s=arc-20160816; b=bieHZiIaGb/cXPygLgjNUppFuG0ytn6yNO1x6x3/Rz1uI6E4Q9DcHk9PMNjlVOdPyO aNOhRr+7zjiRLsAmzxQWOGJdR9s9w6KD3dkMOtN4hPZHPZ2kEulWTo0z39QEdVBE+c/3 03KX7H5TTrGbKoF86bRxJguxtkuy/+kynA9nF+N1tAqoF+CYI14uZzF6QLcEsjtmoo06 mjGDKCl5+3pEVlMKORaJd75AvE1nCIeyfmJRaX5SMtgzKbx+KtO7VvhT8X/w7u7SGBr3 rjQ3VtOYHeGuUX7o+E6bLYvmbnFnYZnZiEKEJAYS1XGp6PhCgaahFJ5YqJR13pLrnrk8 T//g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bz7qotst5wZ2RH1Ycd9IIg729giMypmnjudyWeu+UwU=; b=x8/ZVAmG0sAUZVPLhx14VHcwpmPvwuoX9a+alKsDiaeOBOg52PFqTu1mFsLkXDdgXN t0IjBHliahMdBz3vDjUz9IxMte/ZcfDH3ha8pi/wjLK+eRehrNQN6QR+Zb490YoH8Piv 7C4CjG/kCtMShSekSDSOw4bqYq7r4NhpMerz907UT2qKTAvhGwJepI3s1I6PA84LnOiD BYsNAPTAajpIsugv9BJs5YyNAOmxlhrdLn9FPxblcS79lIWyZ77yFwrhdaqoXb1TZ4nU /9FQnMs+VFB8RBdqRMipdg3VJVV0UX13h+SbcuaiQ5tWvuUwZOiWjlLYY1kLZTw5MqvI k3UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=lvmC6Owy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l18-20020a170903121200b0015171e5370esi295137plh.466.2022.03.02.14.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:31:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=lvmC6Owy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D1833E7290; Wed, 2 Mar 2022 14:30:01 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243773AbiCBRZz (ORCPT + 99 others); Wed, 2 Mar 2022 12:25:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239849AbiCBRZw (ORCPT ); Wed, 2 Mar 2022 12:25:52 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CFC3CA31A for ; Wed, 2 Mar 2022 09:25:06 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id bk29so3903028wrb.4 for ; Wed, 02 Mar 2022 09:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bz7qotst5wZ2RH1Ycd9IIg729giMypmnjudyWeu+UwU=; b=lvmC6OwysBVJcR6sJCUrR+wOrgbPj+ANTmN1KXU72r/93w/a8+Hdqgb8MfLsG43iYE zYMxmv0GrzTjXS2FAs2VhCWlRf5n+pYIN590AcBgJ36WqobqzS6erQN+QMF2T+8TDk33 DPCZ7tKakr8buBALDa2Iv8OIsfNJbvTneuAs7N5W9Rex4CrI4onp2LZYLTghetUf4JCc tR/VEWRSHJwl243How9otm9mr2PKSNztegqbAjdO5gWLxDRvIXKUZnCP2HdYtIdflf/g Cmffy3GqwRa/C+Ycx0agEajPx9vlD3SIWg6+9NoAkyTlAE+ItKPy3tly4uLagG267KHe xupw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bz7qotst5wZ2RH1Ycd9IIg729giMypmnjudyWeu+UwU=; b=UU/tDsiBjKP2Lu42FEuyIXeaHREW4/DAq6kh1sVYD1kWAHKd1tZ+M1lgWYZjXJwQgc pXe7Dc7uVCwCZnd53UMssL28X8RfJl5orcZzkcZ/GyyTMGnp3VtrLFkJgBTu8oANS/Zz IWH+AUg/WuNAKlUlMsA2htAjV+0NoCPOqPCqh5jZ+Qaak6bb7kO6UumB4uQ6WOPCOEJ+ 5vBVyKK0WLHLx+yfPKuxzGgy6/dSIUrV8ZjP0Z/PXFCB+VrN4krNCpvVZc/ooLoiPTDd p4XGsdZ8L8H2/89kUbALuIwdBbzCpDAnRV9uL2w5RmeyKRaKPRAa9gWdlos3Dhug14Xo REWw== X-Gm-Message-State: AOAM531SOSb996h54XxZNaoZE/nGbHU8lEBUQIK6pm7RWxBaeC5XvuJM K2XeLMEF14uimxkyPzvRnkSX8+4Niy1V7yCRlQjVdg== X-Received: by 2002:adf:ca08:0:b0:1ed:c0bc:c212 with SMTP id o8-20020adfca08000000b001edc0bcc212mr23553444wrh.577.1646241904615; Wed, 02 Mar 2022 09:25:04 -0800 (PST) MIME-Version: 1.0 References: <20220225033548.1912117-1-kaleshsingh@google.com> <20220225033548.1912117-3-kaleshsingh@google.com> <87v8ww6bl0.wl-maz@kernel.org> In-Reply-To: <87v8ww6bl0.wl-maz@kernel.org> From: Kalesh Singh Date: Wed, 2 Mar 2022 09:24:53 -0800 Message-ID: Subject: Re: [PATCH v4 2/8] KVM: arm64: Introduce pkvm_alloc_private_va_range() To: Marc Zyngier Cc: Will Deacon , Quentin Perret , Fuad Tabba , Suren Baghdasaryan , "Cc: Android Kernel" , 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 , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , kvmarm , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable 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 Tue, Mar 1, 2022 at 11:46 PM Marc Zyngier wrote: > > 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. Hi Marc, Thanks for clarifying. I think making the alignment implicitly based on the size here will create unnecessary holes where PAGE_SIZE alignment would be ok and potentially overflow the private VA space earlier. Is it not a concern? - Kalesh > > This applies to both this patch and the previous one. > > Thanks, > > M. > > -- > Without deviation from the norm, progress is not possible. > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >