Matthew Fioravante
2012-Sep-17 21:58 UTC
[PATCH mini-os enhancements for vtpm 4/8] disable mfn_is_ram
This patch disables the mfn_is_ram check in mini-os. The current check is insufficient and fails on some systems with larger than 4gb memory. diff --git a/extras/mini-os/arch/x86/mm.c b/extras/mini-os/arch/x86/mm.c --- a/extras/mini-os/arch/x86/mm.c +++ b/extras/mini-os/arch/x86/mm.c @@ -850,6 +850,8 @@ unsigned long alloc_contig_pages(int order, unsigned int addr_bits) static long system_ram_end_mfn; int mfn_is_ram(unsigned long mfn) { + /* This is broken on systems with large ammounts of ram. Always return 0 for now */ + return 0; /* very crude check if a given MFN is memory or not. Probably should * make this a little more sophisticated ;) */ return (mfn <= system_ram_end_mfn) ? 1 : 0; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Samuel Thibault
2012-Sep-17 22:13 UTC
Re: [PATCH mini-os enhancements for vtpm 4/8] disable mfn_is_ram
Matthew Fioravante, le Mon 17 Sep 2012 17:58:31 -0400, a écrit :> This patch disables the mfn_is_ram check in mini-os. The current check > is insufficient and fails on some systems with larger than 4gb memory.And it is only used for checks, not for actual decisions. Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Samuel
Ian Campbell
2012-Sep-18 07:30 UTC
Re: [PATCH mini-os enhancements for vtpm 4/8] disable mfn_is_ram
On Mon, 2012-09-17 at 23:13 +0100, Samuel Thibault wrote:> Matthew Fioravante, le Mon 17 Sep 2012 17:58:31 -0400, a écrit : > > This patch disables the mfn_is_ram check in mini-os. The current check > > is insufficient and fails on some systems with larger than 4gb memory.How does it fail? What are the symptoms? What are the inputs to this function which cause it to fail?> And it is only used for checks, not for actual decisions.It''s made completely useless here though, why not either fix it or remove it altogether? There''s certainly no reason to leave the dead code after the return statement.> > Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> > > Samuel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
Samuel Thibault
2012-Sep-18 07:43 UTC
Re: [PATCH mini-os enhancements for vtpm 4/8] disable mfn_is_ram
Ian Campbell, le Tue 18 Sep 2012 08:30:50 +0100, a écrit :> On Mon, 2012-09-17 at 23:13 +0100, Samuel Thibault wrote: > > Matthew Fioravante, le Mon 17 Sep 2012 17:58:31 -0400, a écrit : > > > This patch disables the mfn_is_ram check in mini-os. The current check > > > is insufficient and fails on some systems with larger than 4gb memory. > > How does it fail?When there is more than 4gb memory, there is IO memory between e.g. 3gb and 4gb, which will be considered as RAM.> > And it is only used for checks, not for actual decisions. > > It''s made completely useless here though, why not either fix it or > remove it altogether?We can probably just remove the check in __do_ioremap, which AFAIK is the only call. Samuel