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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 0B5B4EE14A9 for ; Wed, 6 Sep 2023 22:11:28 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pg99Aw0d; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pg99Aw0d; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RgxRM4Lq2z3c8D for ; Thu, 7 Sep 2023 08:11:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pg99Aw0d; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pg99Aw0d; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=pbonzini@redhat.com; receiver=lists.ozlabs.org) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RgxQK1Dr4z2y1j for ; Thu, 7 Sep 2023 08:10:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694038227; 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=2sW5n0U9nqfDRjI4qbYKErrgizSRaxysFjpyGkvRHBg=; b=Pg99Aw0dhrjssfj+plRZ73iAzmz80+t6FzoooYMo5YOjDFkLKZv62XF4FxljMbibakqOrb gWlugmjp43pbB5CdnXYoQls8seJQWvdY++J14P9i7h5PP0X9VcuRGlwMkKJAy4kV+FVodZ XQCAdiOokbHqs1rtsWQOjmjv9FyPDWo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694038227; 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=2sW5n0U9nqfDRjI4qbYKErrgizSRaxysFjpyGkvRHBg=; b=Pg99Aw0dhrjssfj+plRZ73iAzmz80+t6FzoooYMo5YOjDFkLKZv62XF4FxljMbibakqOrb gWlugmjp43pbB5CdnXYoQls8seJQWvdY++J14P9i7h5PP0X9VcuRGlwMkKJAy4kV+FVodZ XQCAdiOokbHqs1rtsWQOjmjv9FyPDWo= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-ryw4nu95OJen53EFJpWFyw-1; Wed, 06 Sep 2023 18:10:25 -0400 X-MC-Unique: ryw4nu95OJen53EFJpWFyw-1 Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-44d417b639dso108034137.2 for ; Wed, 06 Sep 2023 15:10:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694038225; x=1694643025; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2sW5n0U9nqfDRjI4qbYKErrgizSRaxysFjpyGkvRHBg=; b=g9lJ/7EAK/s8IXZQGZodomIPKvUj9chF8ShSf66J7g2PapYberxEjoM5wyap5Ski/k TpZDNSiPAAzjOKZ4NLh+zltgyeosnDZ5aQcWDF7LBvW1ns6hIp98YhMijeOYc3EWwDyE QGwlFcJybnPaOpEvkeXuxqYbniU23Sw0dzZCjhV3eELGokOEyUHFu7IFkBB6RrpvLeVh oYZfw/q+C4uTb2N9SXblxBlbPd+CtdiCycRT2hV5KyC9o5XLaKdX26L5AXHZ1i85TxU1 6NEp+L4nXbvCEBHNg8UIMwKyyhKJIoKGxC20BlSfIzsWgFpV3Tq0mnYihCqjlu8YrAH+ fVzQ== X-Gm-Message-State: AOJu0YxUnj2sH/GqJJ0cASECeLuNLd4htuncFVp+1uOKiiZ68zcNdUza 9YVllbJBQOH+ZPqEEz6BJSpk2RC0rNPK+oqkytslPVw8CVNOvMddH2KXyMS3EkyP/nh9+l5LvHr iHjETJnI3/n3Afevh+WlvzwaTmOS8dPq69fydRqnU0g== X-Received: by 2002:a67:ee4d:0:b0:444:17aa:df60 with SMTP id g13-20020a67ee4d000000b0044417aadf60mr4110704vsp.13.1694038225179; Wed, 06 Sep 2023 15:10:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHp5n1WB8R1og/NcZaTM8SckALAeHpMUrTVBDu8TXyXcr3qI/pIRPsrfv30I89brgsoG52emGtevyCvY1jn784= X-Received: by 2002:a67:ee4d:0:b0:444:17aa:df60 with SMTP id g13-20020a67ee4d000000b0044417aadf60mr4110646vsp.13.1694038224758; Wed, 06 Sep 2023 15:10:24 -0700 (PDT) MIME-Version: 1.0 References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-14-seanjc@google.com> <84a908ae-04c7-51c7-c9a8-119e1933a189@redhat.com> In-Reply-To: From: Paolo Bonzini Date: Thu, 7 Sep 2023 00:10:13 +0200 Message-ID: Subject: Re: [RFC PATCH v11 13/29] KVM: Add transparent hugepage support for dedicated guest memory To: Sean Christopherson X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, David Hildenbrand , Yu Zhang , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Chao Peng , linux-riscv@lists.infradead.org, Isaku Yamahata , Paul Moore , Marc Zyngier , Huacai Chen , James Morris , "Matthew Wilcox \(Oracle\)" , Wang , Fuad Tabba , Jarkko Sakkinen , "Serge E. Hallyn" , Maciej Szmigiero , Albert Ou , Vlastimil Babka , Michael Roth , Ackerley Tng , Paul Walmsley , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Quentin Perret , linux-mips@vger.kernel.org, Oliver Upton , linux-s ecurity-module@vger.kernel.org, Palmer Dabbelt , kvm-riscv@lists.infradead.org, Anup Patel , linux-fsdevel@vger.kernel.org, Liam Merwick , Andrew Morton , Vishal Annapurve , linuxppc-dev@lists.ozlabs.org, "Kirill A . Shutemov" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Jul 21, 2023 at 7:13=E2=80=AFPM Sean Christopherson wrote: > On Fri, Jul 21, 2023, Paolo Bonzini wrote: > > On 7/19/23 01:44, Sean Christopherson wrote: > > > @@ -413,6 +454,9 @@ int kvm_gmem_create(struct kvm *kvm, struct kvm_c= reate_guest_memfd *args) > > > u64 flags =3D args->flags; > > > u64 valid_flags =3D 0; > > > + if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) > > > + valid_flags |=3D KVM_GUEST_MEMFD_ALLOW_HUGEPAGE; > > > + > > > > I think it should be always allowed. The outcome would just be "never = have > > a hugepage" if thp is not enabled in the kernel. > > I don't have a strong preference. My thinking was that userspace would p= robably > rather have an explicit error, as opposed to silently running with a misc= onfigured > setup. Considering that is how madvise(MADV_HUGEPAGE) behaves, your patch is good. I disagree but consistency is better. Paolo