Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2315105rwj; Mon, 19 Dec 2022 02:53:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXuutFziUG2N0SzOK0V2QzKlxrqYgJuC4zS1dW/rOTGx7TjxIBI3m5mtoRgI6iEuzQy5CiTv X-Received: by 2002:a17:906:2e8e:b0:7c0:9805:4060 with SMTP id o14-20020a1709062e8e00b007c098054060mr153339eji.38.1671447200565; Mon, 19 Dec 2022 02:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671447200; cv=none; d=google.com; s=arc-20160816; b=qmktL38G1riy+hkJLzLacnUEzwXDWmCmGI/uZ7nvfYCJbe8fyccFo1WPOXHM8g0WYM WvH7k2duQpVu7aKMv2a7Eyf+5WgwGnz2Q3CAXofvX6ISHYMqfOmTXrjMVAuSyelQ+nY8 Jek3zitnjj6v0d4FSxUZ/wZ8z/kHCRwoEdTqGP7Jg2Vok7rmJNoOLRjr0QL2P/L/LsbM XvUrwXAESg2QHgQapzA/lrvX93sKpl9GH5PlvSnj9pc8oNT+iWACmFIf4GYhoano4qE9 lD/lf4tOqwd/QV5GeTxdk20kr2lJvX74BGdbcqEkVgU0GTogSPFIiBU6K10KMI15c4L0 /J3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Td6DN6d9KHuO8Ni0x4sFSPaN76BIetZ9amTLwGfBuQY=; b=NJxO/PZqskjYbaz81kdsOrtx+HcKl4lwi+JHeivtWcYMAAu+5FDaiKUruDGBJcSq5s 5hpBAW83mXNIsKnWXzyBazX8pBEgWtItzZGYm/V7xkXcOgaLMMDqg7UxkNGMa1REuh/G 1Lef5/o9Qv8ORgiWLUBYXZMHL3+U4kweXlkVza7nHvbIPkRpx9i9W5ioYdNBvHRdOEZ5 2giSEKOji2IgwTMeeL6koTOWC/i0sf/w7XXzSe4v1Ec8VE/2G8uTNOOZzaBRYs7sHyx8 9MhChv3ZFBXlxLEeizydeieaVtY0ZssMeOv8Muoa5QsChItYdCbqQPG3TGFI5ya2r7YR c3jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Gi31Brcu; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a17090699c400b0078c3197bf86si9867164ejn.533.2022.12.19.02.53.03; Mon, 19 Dec 2022 02:53:20 -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=@alien8.de header.s=dkim header.b=Gi31Brcu; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231689AbiLSKRf (ORCPT + 70 others); Mon, 19 Dec 2022 05:17:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbiLSKR3 (ORCPT ); Mon, 19 Dec 2022 05:17:29 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00FCF2DFD; Mon, 19 Dec 2022 02:17:27 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 241F21EC0662; Mon, 19 Dec 2022 11:17:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1671445046; 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:in-reply-to:in-reply-to: references:references; bh=Td6DN6d9KHuO8Ni0x4sFSPaN76BIetZ9amTLwGfBuQY=; b=Gi31BrcudDAIpa+PJzR9Rm2IwbH2EvgIUujPE8wya8WJCeKy/2ekrtTK9r05L2S9b69Vty nPxnhxFIIyGflDiLpYzFN3KhRz/d2AlJ8y/q4NmLiN36+iptFsaIT87iBVCGpQcQ6JiTDL XdJKVV4+vR907NBBpfad61/X4A6kZl0= Date: Mon, 19 Dec 2022 11:17:22 +0100 From: Borislav Petkov To: Chao Peng Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Arnd Bergmann , Naoya Horiguchi , Miaohe Lin , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , tabba@google.com, Michael Roth , mhocko@suse.com, wei.w.wang@intel.com Subject: Re: [PATCH v10 2/9] KVM: Introduce per-page memory attributes Message-ID: References: <20221202061347.1070246-1-chao.p.peng@linux.intel.com> <20221202061347.1070246-3-chao.p.peng@linux.intel.com> <20221219081532.GD1691829@chaop.bj.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221219081532.GD1691829@chaop.bj.intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Mon, Dec 19, 2022 at 04:15:32PM +0800, Chao Peng wrote: > Tamping down with error number a bit: > > if (attrs->flags) > return -ENXIO; > if (attrs->attributes & ~supported_attrs) > return -EOPNOTSUPP; > if (!PAGE_ALIGNED(attrs->address) || !PAGE_ALIGNED(attrs->size) || > attrs->size == 0) > return -EINVAL; > if (attrs->address + attrs->size < attrs->address) > return -E2BIG; Yap, better. I guess you should add those to the documentation of the ioctl too so that people can find out why it fails. Or, well, they can look at the code directly too but still... imagine some blurb about user-friendliness here... :-) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette