~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to arch/x86/kvm/mmu_audit.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
                                     "level = %d\n", sp, level);
100
100
                        return;
101
101
                }
102
 
 
103
 
                if (*sptep == shadow_notrap_nonpresent_pte) {
104
 
                        audit_printk(vcpu->kvm, "notrap spte in unsync "
105
 
                                     "sp: %p\n", sp);
106
 
                        return;
107
 
                }
108
 
        }
109
 
 
110
 
        if (sp->role.direct && *sptep == shadow_notrap_nonpresent_pte) {
111
 
                audit_printk(vcpu->kvm, "notrap spte in direct sp: %p\n",
112
 
                             sp);
113
 
                return;
114
102
        }
115
103
 
116
104
        if (!is_shadow_present_pte(*sptep) || !is_last_spte(*sptep, level))
133
121
 
134
122
static void inspect_spte_has_rmap(struct kvm *kvm, u64 *sptep)
135
123
{
 
124
        static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
136
125
        unsigned long *rmapp;
137
126
        struct kvm_mmu_page *rev_sp;
138
127
        gfn_t gfn;
139
128
 
140
 
 
141
129
        rev_sp = page_header(__pa(sptep));
142
130
        gfn = kvm_mmu_page_get_gfn(rev_sp, sptep - rev_sp->spt);
143
131
 
144
132
        if (!gfn_to_memslot(kvm, gfn)) {
145
 
                if (!printk_ratelimit())
 
133
                if (!__ratelimit(&ratelimit_state))
146
134
                        return;
147
135
                audit_printk(kvm, "no memslot for gfn %llx\n", gfn);
148
136
                audit_printk(kvm, "index %ld of sp (gfn=%llx)\n",
153
141
 
154
142
        rmapp = gfn_to_rmap(kvm, gfn, rev_sp->role.level);
155
143
        if (!*rmapp) {
156
 
                if (!printk_ratelimit())
 
144
                if (!__ratelimit(&ratelimit_state))
157
145
                        return;
158
146
                audit_printk(kvm, "no rmap for writable spte %llx\n",
159
147
                             *sptep);