From patchwork Sun Dec 5 16:11:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takuya Yoshikawa X-Patchwork-Id: 380971 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB5GBfEp002560 for ; Sun, 5 Dec 2010 16:11:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756206Ab0LEQLj (ORCPT ); Sun, 5 Dec 2010 11:11:39 -0500 Received: from mail-yx0-f174.google.com ([209.85.213.174]:39929 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754325Ab0LEQLi (ORCPT ); Sun, 5 Dec 2010 11:11:38 -0500 Received: by yxt3 with SMTP id 3so5079879yxt.19 for ; Sun, 05 Dec 2010 08:11:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=ln1iGG5GyeTEFe0RDDPoF+vkYICXsT+ZGccAfVm9Id0=; b=MvLbiwPW8v1GoAEZNWgXFndl79Buh0iHsB+/GCtSVMpsMJ1kRzjTuTgxtZqThzQz/Q DGqxy97BPiz82cDz4W2zIEn2WzsFFDft9nIRgeN7bbNAlC86sME9GyXQlaOtmSPXuSI+ Pz81WBL0N11ZSN2LfX8tS9G59s5Sk1Ju9eFwc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=Jvvc2T1PTpfmw9KdGD31ip+55LWUp3crxkzIy8URpzSHVop+HzHTwfIsv0Dli5KGRZ JdR2steWCGF1u1D6QjTjYh+oAXMBxpDXt82dFj8qh1gush7YQhQ9dzvF3UkXaMnwO7Sv jyiw0yJge6+LsJsJ0HaMHEE2E7Zwti3dQ4PJ0= Received: by 10.100.108.1 with SMTP id g1mr3181107anc.249.1291565498202; Sun, 05 Dec 2010 08:11:38 -0800 (PST) Received: from amd (x097031.dynamic.ppp.asahi-net.or.jp [122.249.97.31]) by mx.google.com with ESMTPS id b26sm4349666anb.13.2010.12.05.08.11.34 (version=SSLv3 cipher=RC4-MD5); Sun, 05 Dec 2010 08:11:36 -0800 (PST) Date: Mon, 6 Dec 2010 01:11:33 +0900 From: Takuya Yoshikawa To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org, yoshikawa.takuya@oss.ntt.co.jp Subject: [PATCH 1/2 rebased] KVM: MMU: Avoid dropping accessed bit while removing write access Message-Id: <20101206011133.e5487868.takuya.yoshikawa@gmail.com> X-Mailer: Sylpheed 3.1.0beta2 (GTK+ 2.22.0; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 05 Dec 2010 16:11:42 +0000 (UTC) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 04c49b9..d75ba1e 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3446,7 +3446,7 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot) for (i = 0; i < PT64_ENT_PER_PAGE; ++i) /* avoid RMW */ if (is_writable_pte(pt[i])) - pt[i] &= ~PT_WRITABLE_MASK; + update_spte(&pt[i], pt[i] & ~PT_WRITABLE_MASK); } kvm_flush_remote_tlbs(kvm); }