From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Date: Wed, 19 Jul 2023 07:16:54 -0700 Subject: [RFC PATCH v11 07/29] KVM: Add KVM_EXIT_MEMORY_FAULT exit In-Reply-To: <20230719075440.m3h653frqggaiusc@yy-desk-7060> References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-8-seanjc@google.com> <20230719075440.m3h653frqggaiusc@yy-desk-7060> Message-ID: List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9789125AD for ; Wed, 19 Jul 2023 14:16:56 +0000 (UTC) Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-267a0a0382eso2197439a91.1 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=OmzBht1QbVTbvlr8lf8iWRd/3lApx2cDadJ2bXojcH6cxcty6aMnUGxrpFNiPqBkFM 9JVUZpB1l277o1m6+qjvKsWPwBUp2SXKvcvIXFOdo9T5AgJ6kOzGmXulEczTTyubOnBA s870ibdF002a9jEKuj2BD+7atnIb/NfBme1/4Iq7uTPPL+j7IwmNVM5NhmjWgWf5tNN1 cCmrQ+PnAh8Qond66DVfIoeqqFLLmakdr+BoxI3VUu90VsCthHkEM/bvkxw8g25D7SRN h9dFZZJi4uVABxAJxSspo9AqURbg8advNfXsGHUFaMoeJm2lyEMhgpTmn8ufbZf5DEdF /z0w== X-Gm-Message-State: ABy/qLa6I3f45U1VoA1hRyexXHqKQc92L6YOhDbqyle22PuealjSs7nx 9cxMzPCG/2ZG5BG9zjOvu+bx/OOOJ4g= X-Google-Smtp-Source: APBJJlHe5KmJdZof+vQtZ6M87xlqjK1Ejx8t4AB5DMX6de6h21FipxJ2lQkyFnlQoXRyf3eYpC2jq3S2bQ0= 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> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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" 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. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 AE19AC001DE for ; Wed, 19 Jul 2023 14:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VjsiJZ4Y+d+aZJd/XRaCsahl9FWhZsaOw/EUaEeNeO0=; b=xesDNdIAe+yr8jYWmp5Ft0Ze7M cTip9mWhNqg0NWufpxrGQZh8NVg3V+KtYLbVB1ljHNhspu2YoO4yeZ5rK9zuhxnDeizf86aWY84AJ a9Q0YvraIAn23IchV/9Tb2p135eX8to90M5IReWok4AAsYqzA0A8kQYU+BIQw+VSLA0VaTeHEHtgQ O3oLMzNWm/6hc9bQb5S/y+tkM1XFTtgH7wwrr00kDE7H9pApfYVomJtEMh1n7XFT+zxB1IY0nq41A yEPIIbaywB/lE2cbnLw6SmBVwM02qLZ/SL8vfBeuiQZdYufBB4qXNoYoGTeJVNB0hYqyvAea0twyo /P5lIlmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM7zA-007h2o-2X; Wed, 19 Jul 2023 14:17:00 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM7z7-007h1K-2L for linux-riscv@lists.infradead.org; Wed, 19 Jul 2023 14:16:59 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-267a0a0382eso2197437a91.1 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=Li8zExdunXsDOKSks5HmNo3A6tmoPRcnmuh5DDnu4fT29s8SHyLE9uKV47ZOE+bnp6 pH6QeBN8QueS6phsF/AbQLGzT0PewlGbLNqdOeKA8s4EEEiEaj1X9UwM+FIbewVVY0Yo HR+29U5Qv2YLBqQxVtidjw2XFNoikBHmW1Y0h9dyhZaXS6FiUgSfTftgOnSh4NBRZGPh YaubVHvIxk60h8QQsVeuGmvW+3hKpcF77gQAwNJ37juDq6zCSEdPxAwu11YNo7ESpKU5 Mz/2YuT/bXlftV4JYLJnX7HhZKPGt0S7XR5KwIqtJfn0YLwWrRJD++L2S3AysAuUeXIV j+4Q== X-Gm-Message-State: ABy/qLb5xWIjJ12S42B7FzPYHQuJpIcllmZ6/q/labUVAAL7GU3CQ2oY Gz2iYdMTieZ2utHC55GJ8jk7d70alzE= X-Google-Smtp-Source: APBJJlHe5KmJdZof+vQtZ6M87xlqjK1Ejx8t4AB5DMX6de6h21FipxJ2lQkyFnlQoXRyf3eYpC2jq3S2bQ0= 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230719_071657_782478_DDDFA3FD X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 D8FDBC001DE for ; Wed, 19 Jul 2023 14:17:53 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20221208 header.b=QCgn5pm8; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4R5dFX2sT8z30gF for ; Thu, 20 Jul 2023 00:17:52 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20221208 header.b=QCgn5pm8; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=flex--seanjc.bounces.google.com (client-ip=2607:f8b0:4864:20::1049; helo=mail-pj1-x1049.google.com; envelope-from=3wpc3zaykdeuzlhuqjnvvnsl.jvtspu14wwj-kl2spz0z.v6shiz.vyn@flex--seanjc.bounces.google.com; receiver=lists.ozlabs.org) Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) (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 4R5dDW3Lfhz2ynD for ; Thu, 20 Jul 2023 00:16:59 +1000 (AEST) Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-262cf62e9b4so5353440a91.0 for ; Wed, 19 Jul 2023 07:16:59 -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=SbUcGs8dnDiNsLp86I3Hj9E8NoRLLquJGnWT1pDq6mgjSTkZf2zoQsUCKujNlfjdai e0XwC+6ed2e3+a6+UNonUHUzeAWwml/FLpf43u2zSr1lujlVowPSD+zUMGCliUdgf8+f GoueiqMvYCOW7CVWOb/4efwS9zqz5pvCkd0uu0RAW4ksLQJaIuhYLcIKtUZe0zkoBxSS 2qVPga9hDNk5FV8q6wyr4AvsoPWAN659LeuhehxR/Z+rdpgi5x+8Z8/CpQiWZOsKlaok 5OdcAAFVhO+80oo7fMIw0Pem44EF4VMq8FbyotbSmN7QlogFnAAXe+jCJQsPtkNA+pH4 h02w== X-Gm-Message-State: ABy/qLY03PMZL8CGoHUc14NgpFxOHBPFVX+HSyFa8pogW8nQ2GOA0sDv nmopZ83X3DscT6wVYkAVKI/s9SRxsg4= X-Google-Smtp-Source: APBJJlHe5KmJdZof+vQtZ6M87xlqjK1Ejx8t4AB5DMX6de6h21FipxJ2lQkyFnlQoXRyf3eYpC2jq3S2bQ0= 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 Content-Type: text/plain; charset="us-ascii" 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 , Liam Merwick , linux-mips@vger.kernel.org, Oliver Upton , linux-security-module@vger.kernel.org, Palmer Dabbelt , kvm-riscv@lists.infradead.org, Anup Patel , linux-fsdevel@vger.kernel.org, Paolo Bonzini , 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 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. 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3CD55EB64DA for ; Wed, 19 Jul 2023 14:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ZGAw6FKRliU2szHUkfNc08LRVXFCFTRTntYP2/1zxTU=; b=y/RsqPQhqpcfKU2WHtAeG73kBm buJg10IPqh3RfG2d2dShpHEUd/kzX/iYrtG+zxFRSDbR3eGA6ZZM3Tgojf2j1fDFdGiMKfMSZj5Li grqBXLH+PJCN3dg9PEeQYwv4w6Fid2fO7DqypwVKpH2D+E9kCDfMF7XrknB9eudK/BLXmV39bvC+b TXWc1KOf8j+HRr3oxOT3PrxQ3Pdbn7kdtOuWPJsl/iC14IviMYqau6Qb3TPE9J2/ILLg2Jvd8MhVj hn1zo+8uXrbwvQKxRcIUBCACKuvhfVPMvnvnSdZZVeZTs5GZQMBbPzk+goYiJbDeCh+hNAekVS3si zYMulunQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM7zB-007h37-1k; Wed, 19 Jul 2023 14:17:01 +0000 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM7z7-007h1I-2w for linux-arm-kernel@lists.infradead.org; Wed, 19 Jul 2023 14:16:59 +0000 Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-262cf62e9b4so5353432a91.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=Oml45PvI1ReLgVvIz5ztHjWkTQL1PuNmxO9xxlWvtLDNQUlwvsY0fSonQ/tp87MBEa m10p3izMgicUWwvr9Muy+nSDEGcQcwYZ/tTrFlnLPmkW123EJENZkfr6Zb+zkaAExbQy M8ukVTRcWhQ2D3gx5/KaWrNzmI3A33P2FS97e90pvLOYcCwf5yNF8m7SYhZo/YQIKgLr Um7swWJhOZCFxqhCL+apGYUMUeVci+/ONkLw6jHGAX/mh8ueY2cWTMY1bfcEDpodeZ5/ Iq7FX0aH9HmgELyehXn5ohngHtCNb9XPTJLKdAWzN6v3tEazrMWeOVVeDIQIOQ4AHVnf D9kQ== X-Gm-Message-State: ABy/qLYZIpw+Nw1qWW2EspdcL3vwXCpNoQKpAuKaQ+4QmzX0eoS+h4NS bP0Y7YBPJd5F3+QrNKWhMASvUSS4yC0= X-Google-Smtp-Source: APBJJlHe5KmJdZof+vQtZ6M87xlqjK1Ejx8t4AB5DMX6de6h21FipxJ2lQkyFnlQoXRyf3eYpC2jq3S2bQ0= 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230719_071657_948954_6FF45539 X-CRM114-Status: GOOD ( 14.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel