Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3684762rwj; Mon, 19 Dec 2022 23:58:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtzXkUsc/Gw7HN9TCJxTEFK5mpVOjqaj697E+XAPi6tc1q1C9y7/gkP4P0h5PLX45KaNUSd X-Received: by 2002:a17:902:8c8d:b0:191:1fc4:5c14 with SMTP id t13-20020a1709028c8d00b001911fc45c14mr7257589plo.49.1671523089979; Mon, 19 Dec 2022 23:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671523089; cv=none; d=google.com; s=arc-20160816; b=mNUkw6ZbmELePg8AqzlP4O1hdQdNqJrNpFShpr8BPAnc9o2TBF21UlmTBXJgDJlbf3 OyBviDjdwbNiG6Iebk+4CpH5GUlfSV4uae/pBWDE09H4KMyqVjUQ9H5tMbGAxW10YzNo 2Tz4mwKHPZsFOqEDcQoA6ITMScBbrR1rSy5L3XTBqHM+LKTU1x4/D7FUXilFLgtmmMZO LZD734IhHnrktl+/wPTSrOYdYFa9x8Sg29TlYh5wS8pEehvOlN8edfjXt6iqpFnJvcpa 09u/0rZBoDIexdIgLUd6/9BIbANF9yaIDD1M9Nr4OO1U4GDg17A6atK1t/rjVPl1ahtW Og+A== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=tc9tut3jvpo1xnKA2SPLUBExCXhvJ8ZV5noBTcvwQNY=; b=tP9YlBjPUHPAR0oG2ut8XUOAvCIVUK3krLLOcBrEQ/WzQBKjujEgoTh/QK7eYaqQty NBpkkK6K+NdLj1H2bHGWG20hKLkZyseCg6UvTYShj4q3aRIsaXAg2EkhmdUEnUyGZ5Kr R4vmf4AtndBJLDUQlTyj0gufjC6hpXKbXMBhR1qOc/NVSWWZJDyS5mmkDe9AIEYtsnWj pZGNbv9a4ai9KfcqkEysJOmxaiX6l9hes5ZllqrlP2/5UhJTGcIInbQRjFYEf1EEPU2Q /91wWu9cpE04sTrE5BN1PYmXxI+TY5D6avdHZt3kZiSAcrdB0MAXq+RrNwYBG8IBqtXy sBBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=btMmDhri; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p24-20020a170902b09800b00191108745fesi8619782plr.446.2022.12.19.23.58.01; Mon, 19 Dec 2022 23:58:09 -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=@intel.com header.s=Intel header.b=btMmDhri; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233679AbiLTHaR (ORCPT + 70 others); Tue, 20 Dec 2022 02:30:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233677AbiLTH3o (ORCPT ); Tue, 20 Dec 2022 02:29:44 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97E9417059; Mon, 19 Dec 2022 23:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671521355; x=1703057355; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=fjNSa0+921I8s8ST66iQKKAKKNcHFJo2C7vp0DyF6bU=; b=btMmDhriNUXIYE3RDC/D+VlLnxqJpYdVAtCnKG6Y00TuZKg18RKtoen/ ncKwhvbRaEWA1yueeu/7jrTKZZOoQBLg26c0Jt3b66l28RtiMKqyl9/ZK BgHqrpZBvLVYRk05frWTi7WjlYd3SqywoATxQxUttzwFkOdyx0XW+LztN CT8l4frasDPosl1OcaAHaow6ysNwW+VRk+KO1MvSkc8CdXfQLlS84LxHt PsQDsqnKCjOamEfvwz7swdwU6fxTOAEc4xaYAcKCHBhwLzFWG5Ik71Oci VCft7PHZkTWzSaxoNXv3sAK88Okxl6FcOPm9twU7H/ESpoxPiFwvgzL6V A==; X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="307230620" X-IronPort-AV: E=Sophos;i="5.96,258,1665471600"; d="scan'208";a="307230620" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 23:29:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="775191645" X-IronPort-AV: E=Sophos;i="5.96,258,1665471600"; d="scan'208";a="775191645" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.193.75]) by orsmga004.jf.intel.com with ESMTP; 19 Dec 2022 23:29:03 -0800 Date: Tue, 20 Dec 2022 15:24:46 +0800 From: Chao Peng To: Borislav Petkov 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: <20221220072446.GB1724933@chaop.bj.intel.com> Reply-To: Chao Peng 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=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 11:17:22AM +0100, Borislav Petkov wrote: > 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... Thanks for reminding. Yes KVM api doc is the right place to put these documentation in. Thanks, Chao > > :-) > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette