Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8274930rwp; Wed, 19 Jul 2023 07:40:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+VeitWzkzZ4hDMPneIYOog8DO88f2fYsmYfHUEAmk1zOojmp+JRRkJ4sdTZJPG2XF+8ra X-Received: by 2002:a2e:7408:0:b0:2b6:b98e:fe8f with SMTP id p8-20020a2e7408000000b002b6b98efe8fmr51886ljc.32.1689777652921; Wed, 19 Jul 2023 07:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689777652; cv=none; d=google.com; s=arc-20160816; b=o84isqcX5liLBRKQiU0qIfhPewB9xZINm3nGbqoCyK33psbgnmKB6L/y574bcryMfm IqxMs9Bg+BsMpmqubfvYbMNuBcJkvrTilvz1/srapU3q5TNRXTDSqQTulZw+3sNyimNB zSTqlPqfcVZFSeb+y6P/8MHNH5JCme7WBd+L3M9/T07XPvuL74WW6qlIkkbcxklC7vhd ptgr5G9TZqKK+0KYkBVgowVDV84ncPnz4BUyG2RumucT6wJqoFNN3xcy9HOwfMWHeiiU jMytP7zMRJNi/Oq0eRKzIZZETEXl3LjFrB5golZ1CAQImACgkLArCfzH9uhpuuQEYvZu GdkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=Ply9vOQ7PKiPIjqcvpgXEIwEBxatqkRJB2ZRy5lS2Xc=; fh=wLBaRqEgFJrZWfaqMXMNyaXQxBP/YIz9T/f9ALvcbW8=; b=FRtl4YTbWpZtGhTw2J5wZ4Q1GJWGRBlhm6VtiHnHjrmKY4t/7qaPdXCoEBNQdDRWUF 77ROKzI6hGchVe+rAIZViaw66NdZmeZ27o5zyTa0OAiphBahHb/+S7GTXdj1ivQS9k+g Khf53g0vqznS5mtKjCUHEagMKMJTizTQ+O2v/XSCBJXTiSn1mHn9rHqAkRI9RANrykxU I12InXdpWpY6NcA0hiYNYiBWQ8m/NS4PLGb7C7QK1WwmCME7JqfqQLDQcVkybQ1Bz4f9 T5OMD3pItf5liVwR0DfzdAFZ4A17rCt8YobGJjxSBDNC2JVwdphAaEF8g4qNlpFQy0Fa O3gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=QCgn5pm8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a17090614c900b00991f598188csi2951178ejc.214.2023.07.19.07.40.19; Wed, 19 Jul 2023 07:40:52 -0700 (PDT) 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=@google.com header.s=20221208 header.b=QCgn5pm8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbjGSORA (ORCPT + 99 others); Wed, 19 Jul 2023 10:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbjGSOQ6 (ORCPT ); Wed, 19 Jul 2023 10:16:58 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B479F1A6 for ; Wed, 19 Jul 2023 07:16:56 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-262cf62e9b4so5353434a91.0 for ; Wed, 19 Jul 2023 07:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689776216; x=1692368216; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Ply9vOQ7PKiPIjqcvpgXEIwEBxatqkRJB2ZRy5lS2Xc=; b=QCgn5pm8yPPImP/ZfLF2Ea0jJXDpcGNQ/LF2jNeNTBG71TLZwae17UnwEuo78ONGHP atCG9sArqHfv277Ky9HWUevcQtozR/I9rfoMFWMGzH2p/tn1UptotifJkTzwcjUzjGM4 2mRccC+Qe6eelyvVpzgsii1Dz38eewFROpWBRyPZo22w72yv1RXU/kRjiIgbgdf4vOiO m+eFtOZOtzemALwYg0UpO5hPIX4qNwingmWVGWsEqCwrs8u/CIQrQXsRy9c4nWVOA7nY TgAf9p3r7jbBOiu0L+1TlKBrMt3e7HNn72eYqwvkzNmnIVVzm8emG5isi9/yOnMB2w1e eLcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689776216; x=1692368216; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ply9vOQ7PKiPIjqcvpgXEIwEBxatqkRJB2ZRy5lS2Xc=; b=Nak5T+BBkWdLBngZpPBM0uSeA9Bu5oyQPM7YvLlRm99jFEDM/0faz/ytQHLXZYTaw0 8cFbV5b+Ut8NwfiQaRACG+mHxDsnHSj1OB8s6FxNSxt9VPFZ8u1yMU/x2So7+AlN9Ws2 zQV30BP138hAHPX+iU8RYNts9hQ6sr6baoMindrRui05rjbDWobScU79725qlaPxby0q eTcZ5XYHx+R9ROzYdZq4p2mdnVJOSPnsn/7mWhFMLjOBbbz8F4hB0ezBMdYQv1Rmp91X dfBrRYclLcO/pAXoFpQQ8nfG2IUf/7eapqAfIzM6jrbwntfIxgmQwB3iQ6PRsBv/3Xwg 3mVw== X-Gm-Message-State: ABy/qLbUIf/iLWlnFQtIZh+bxn42exRTAgd9XMweJKZ8PDIzXMPcyt/j j9cgFslGde9I32tMah7y6vMtzNiK264= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90a:e542:b0:25b:f9e3:deab with SMTP id ei2-20020a17090ae54200b0025bf9e3deabmr136275pjb.9.1689776216142; Wed, 19 Jul 2023 07:16:56 -0700 (PDT) Date: Wed, 19 Jul 2023 07:16:54 -0700 In-Reply-To: <20230719075440.m3h653frqggaiusc@yy-desk-7060> Mime-Version: 1.0 References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-8-seanjc@google.com> <20230719075440.m3h653frqggaiusc@yy-desk-7060> Message-ID: Subject: Re: [RFC PATCH v11 07/29] KVM: Add KVM_EXIT_MEMORY_FAULT exit From: Sean Christopherson To: Yuan Yao Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,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 Wed, Jul 19, 2023, Yuan Yao wrote: > On Tue, Jul 18, 2023 at 04:44:50PM -0700, Sean Christopherson wrote: > > From: Chao Peng > > > > This new KVM exit allows userspace to handle memory-related errors. It > > indicates an error happens in KVM at guest memory range [gpa, gpa+size). > > The flags includes additional information for userspace to handle the > > error. Currently bit 0 is defined as 'private memory' where '1' > > indicates error happens due to private memory access and '0' indicates > > error happens due to shared memory access. > > Now it's bit 3: Yeah, I need to update (or write) a lot of changelogs. > #define KVM_MEMORY_EXIT_FLAG_PRIVATE (1ULL << 3) > > I remember some other attributes were introduced in v10 yet: > > #define KVM_MEMORY_ATTRIBUTE_READ (1ULL << 0) > #define KVM_MEMORY_ATTRIBUTE_WRITE (1ULL << 1) > #define KVM_MEMORY_ATTRIBUTE_EXECUTE (1ULL << 2) > #define KVM_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3) > > So KVM_MEMORY_EXIT_FLAG_PRIVATE changed to bit 3 due to above things, > or other reason ? (Sorry I didn't follow v10 too much before). Yep, I want to reserve space for the RWX bits.