You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let reserved = old_flags& !(ApicFlags::all().bits());
795
+
letnew_flags = reserved | flags.bits();
796
796
797
797
unsafe{
798
-
Self::write_raw(new_value);
798
+
Self::write_raw(frame, new_flags);
799
799
}
800
800
}
801
801
@@ -808,29 +808,14 @@ mod x86_64 {
808
808
///
809
809
/// ## Safety
810
810
///
811
-
/// Unsafe because it's possible to set reserved bits to `1`.
811
+
/// Unsafe because it's possible to set reserved bits to `1` and changing the APIC base address allows hijacking a page of physical memory space in ways that would violate Rust's memory rules.
812
812
#[inline]
813
-
pubunsafefnwrite_raw(flags:u64){
813
+
pubunsafefnwrite_raw(frame:PhysFrame,flags:u64){
814
+
let addr = frame.start_address();
814
815
letmut msr = Self::MSR;
815
816
unsafe{
816
-
msr.write(flags);
817
+
msr.write(flags | addr.as_u64());
817
818
}
818
819
}
819
-
820
-
/// Update IA32_APIC_BASE flags.
821
-
///
822
-
/// Preserves the value of reserved fields.
823
-
///
824
-
/// The APIC_BASE must be supported on the CPU, otherwise a general protection exception will
825
-
/// occur. Support can be detected using the `cpuid` instruction.
0 commit comments