From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 8C7F91422C6 for ; Mon, 29 Apr 2024 20:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714421607; cv=none; b=dEZc45yA8lPaMs9TXDDnNBt1AVRDByAYhNO+VUhGlo8Y1pknZ4q4XaLDP8uNp9jZiXjln6n6UPsY7w+D2PBG8K2jEMKH5IyqxeI70h7CiyL3fX8b2lh555ZIUcEL4zOce9NbE/Kb/pXReaYTcGq0UpB2q/znDpMLROdbJgTqcwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714421607; c=relaxed/simple; bh=mGDBw08jwclV2/Usl0LbH8eCl3nupNz84hqMoPwtcpg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hQfARIUMPBM9J+DFMhqXWwvtyrVRkT5nDpeCjAt1lGYtL49gAHWnuIYGq+AzgAl3ZDvnC7yg+WW9zdbc8z0d1FeddkfxRG/nFYNfYrA/FCSXp1S+0JWt4gq80EshzxQKoDkmgIKfPrZbbYfR0PEtFv8kogXTvzOliWs1JM1mNv4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cu62vQiO; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cu62vQiO" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc64f63d768so9640340276.2 for ; Mon, 29 Apr 2024 13:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714421605; x=1715026405; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=mGDBw08jwclV2/Usl0LbH8eCl3nupNz84hqMoPwtcpg=; b=cu62vQiOumAzDp5sqJCoOO7HfIugQQ8ljEOBXqFn2L7wp1IGeY6nuKGKdZs6InoHjY enr5DRQMN/AzN17l2k8Y8CzqPFgzmljWogHD3GW3ragDs7XXiKmdXRE4vqUZ89VP6i+d u/Wc6w7G6rz/pmwCC0aJ80b6ARiseTqQ2CeS7OaMX7khk22vT0evgAIBSjO47BwjlKjt s1uhyXDY/S/70CLVKoyIxVz1hUcz8yKJG2n8tWxl097GpHkRAjzLU4G3mWFmBwFJ++3x hdfMFxKuDJ4Ai5ZDX57U2z+APTX6QjYvE7Szzz4v6STc5c8QradLlw0piAMaT523Fs8q Uu2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714421605; x=1715026405; 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=mGDBw08jwclV2/Usl0LbH8eCl3nupNz84hqMoPwtcpg=; b=w1xrqJ/UDtSIHj8p5PzakacEx+Kn71FdAf55nbtIlkhJuOrLZ5jYw/KXKnzlf1/uj4 5pOj6tUqZKBktTRzoopHaAgrkzuxHR+dVvYhljnmGu93km+QjNUVP7MTzfdoT7EBd6c7 4og8xvPXRPCnzTeVH1rokhp5AvE9wQlUaI0VycKkySPsyK2sEE8OqYZ69LSN6jPG1m9l Gn8EAKw7w71HTzABMLAyJuCh3qiICA6cHG8dSsEhqLfOlEqQ/KUtb7LIUJUWHoQLtOoI G+y/SX1XPdhvYAitznHwUcbt6xxuygSYOzYzO4JWFoBV1HdCe8yPd1uRaMGavuk1B4IJ KcGw== X-Forwarded-Encrypted: i=1; AJvYcCWSMYQj0O0A9zwdGUHcm3wzXoGLfcBZ95yvu1BL2W474U5MBR4oPlGJ19A+dFHcyVlFvMIUV4RFPTVlzY41M0ZnS/cP X-Gm-Message-State: AOJu0YwbDjDsG6zkkm904qIby6kHR/BzVbrESiQaaT+0dj2PRQFDgyac qNRgZkzFxEaYjL8IxWoXVstH1kEj+9Rw4rRrfXX/EUs2StPcfO8K4Gq5nxmzK3Z5RgyvwiglFO3 d6A== X-Google-Smtp-Source: AGHT+IHjDqwZzVZOdkMIdoNtlrbF2jMShdObuIn9ReDuQkS3FkeKyRuyz6S9asMeDRgcN9m+fLWxaXsOvH0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:2281:b0:de5:2325:72dc with SMTP id dn1-20020a056902228100b00de5232572dcmr3419262ybb.5.1714421605683; Mon, 29 Apr 2024 13:13:25 -0700 (PDT) Date: Mon, 29 Apr 2024 13:13:24 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240423024933.80143-1-kele@cs.columbia.edu> Message-ID: Subject: Re: [1/1] KVM: restrict kvm_gfn_to_hva_cache_init() to only accept address ranges within one page From: Sean Christopherson To: Kele Huang Cc: Zide Chen , pbonzini@redhat.com, kvm@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Sat, Apr 27, 2024, Kele Huang wrote: > Although, it is a bit not straightforward to me because it needs to call > designed functions to do the guest memory read and write even though people > assume the cache is initialized, or need to do the ghc->memslot checking > manually before using the fast path. Oh, don't get me wrong, I completely agree that the code isn't straightforward. But I don't think this is a problem that can be reasonably solved in the caching code, at least not easily, as a lot of the oddities stem from KVM's memslots, and KVM's contracts with userspace and the guest.