linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
@ 2014-12-14  5:09 허종만
  0 siblings, 0 replies; 8+ messages in thread
From: 허종만 @ 2014-12-14  5:09 UTC (permalink / raw)
  To: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 3243 bytes --]


Hi,

My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.

commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
Author: Juergen Gross 
Date:   Mon Nov 3 14:02:03 2014 +0100

    x86: Enable PAT to use cache mode translation tables

Unfortunately I can't see any console log.
Reverting the commit fixes my boot issue. git bisect log follows,

$ git bisect log
git bisect start
# bad: [92a578b064d0227a3a7fbbdb9e29dbab7f8d400e] Merge tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
git bisect bad 92a578b064d0227a3a7fbbdb9e29dbab7f8d400e
# good: [b2776bf7149bddd1f4161f14f79520f17fc1d71d] Linux 3.18
git bisect good b2776bf7149bddd1f4161f14f79520f17fc1d71d
# good: [6da314122ddc11936c6f054753bbb956a499d020] Merge tag 'dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
git bisect good 6da314122ddc11936c6f054753bbb956a499d020
# good: [482a3767e5087f6e6ad2486a6655aaa5f3d59301] exit: reparent: call forget_original_parent() under tasklist_lock
git bisect good 482a3767e5087f6e6ad2486a6655aaa5f3d59301
# bad: [cbfe0de303a55ed96d8831c2d5f56f8131cd6612] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
git bisect bad cbfe0de303a55ed96d8831c2d5f56f8131cd6612
# bad: [a6b849578ef3e0b131b1ea4063473a4f935a65e9] Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
git bisect bad a6b849578ef3e0b131b1ea4063473a4f935a65e9
# bad: [c9f861c77269bc9950c16c6404a9476062241671] Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
git bisect bad c9f861c77269bc9950c16c6404a9476062241671
# good: [773fed910d41e443e495a6bfa9ab1c2b7b13e012] Merge branches 'x86-platform-for-linus' and 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
git bisect good 773fed910d41e443e495a6bfa9ab1c2b7b13e012
# good: [773fed910d41e443e495a6bfa9ab1c2b7b13e012] Merge branches 'x86-platform-for-linus' and 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
git bisect good 773fed910d41e443e495a6bfa9ab1c2b7b13e012
# good: [f439c429c320981943f8b64b2a4049d946cb492b] x86: Support PAT bit in pagetable dump for lower levels
git bisect good f439c429c320981943f8b64b2a4049d946cb492b
# good: [e3480271f59253cb60d030aa5e615bf00b731fea] x86, mce, severity: Extend the the mce_severity mechanism to handle UCNA/DEFERRED error
git bisect good e3480271f59253cb60d030aa5e615bf00b731fea
# bad: [0dbcae884779fdf7e2239a97ac7488877f0693d9] x86: mm: Move PAT only functions to mm/pat.c
git bisect bad 0dbcae884779fdf7e2239a97ac7488877f0693d9
# bad: [bd809af16e3ab1f8d55b3e2928c47c67e2a865d2] x86: Enable PAT to use cache mode translation tables
git bisect bad bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
# good: [f5b2831d654167d77da8afbef4d2584897b12d0c] x86: Respect PAT bit when copying pte values between large and normal pages
git bisect good f5b2831d654167d77da8afbef4d2584897b12d0c
# first bad commit: [bd809af16e3ab1f8d55b3e2928c47c67e2a865d2] x86: Enable PAT to use cache mode translation tables

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
  2014-12-17  2:46 Jongman Heo
@ 2014-12-17  5:39 ` Thomas Hellstrom
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Hellstrom @ 2014-12-17  5:39 UTC (permalink / raw)
  To: jongman.heo; +Cc: Peter Hurley, Juergen Gross, linux-kernel

Thanks,

>From what I understand, there is indeed a virtual processor bug. It's
fixed in HardWare Version 11, so that the PAT registers return the
correct value.

Thanks,
Thomas


On 12/17/2014 03:46 AM, Jongman Heo wrote:
> Hi,
>
> I'm using VMWare workstation, version 10.0.3 build-1895310, on Windows 7 64-bit.
> Guest is Fedora 21.
>
> ------- Original Message -------
> Sender : Thomas Hellstrom<thellstrom@vmware.com>
> Date : 2014-12-17 00:12 (GMT+09:00)
> Title : Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
>
> Jongman, what product (player, ws, esx) and version are you using?
>
> Thanks,
> Thomas
>
>
> On 12/16/2014 02:08 PM, Peter Hurley wrote:
>> VMware guys probably already know this but just in case
>>
>> [ +cc Thomas Hellstrom ]
>>
>> Jongman - you need to fix your mailer to use plaintext and not base64.
>>
>> On 12/16/2014 01:46 AM, Jongman Heo wrote:
>>>> Sender : Juergen Gross
>>>> On 12/16/2014 07:29 AM, Jongman Heo wrote:
>>>>>> Sender : Juergen Gross
>>>>>> On 12/16/2014 05:40 AM, Jongman Heo wrote:
>>>>>>>> Sender : Juergen Gross
>>>>>>>> On 12/15/2014 08:52 AM, Jongman Heo wrote:
>>>>>>>>>> Sender : Juergen Gross
>>>>>>>>>> On 12/14/2014 06:07 AM, 허종만 wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.
>>>>>>>>>>>
>>>>>>>>>>> commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
>>>>>>>>>>> Author: Juergen Gross
>>>>>>>>>>> Date:   Mon Nov 3 14:02:03 2014 +0100
>>>>>>>>>>>
>>>>>>>>>>>         x86: Enable PAT to use cache mode translation tables
>>>>>>>>>>>
>>>>>>>>>>> Unfortunately I can't see any console log.
>>>>>>>>>> Hmm, weird. Could you provide some more information?
>>>>>>>>>>
>>>>>>>>>> Kernel config, hardware used, /proc/cpuinfo of working kernel?
>>>>>>>>>> Anything you see with earlyprintk enabled?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Juergen
>>>>>>>>> (Sorry for resending this email, previous one bounced from mailing list due to HTML format)
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I'm using Fedora 21, with custom built kernel.
>>>>>>>>> Host PC is windows 7 64-bit, and running VMWare workstation 10 for guest Fedora Linux.
>>>>>>>>>
>>>>>>>>> With earlyprintk, just following message is printed.
>>>>>>>>>
>>>>>>>>>      early console in setup code
>>>>>>>>>
>>>>>>>>> and nothing more...
>>>>>>>> Can you try attached diagnostic patch, please? I suspect a problem
>>>>>>>> regarding VMWares PAT emulation...
>>>>>>>>
>>>>>>>>
>>>>>>>> Juergen
>>>>>>> Hi,
>>>>>>>
>>>>>>> With the commit reverted, the patch doesn't apply.
>>>>>> Sure.
>>>>>>
>>>>>>> Without revert, kernel (patch applied) doesn't boot and I can't see any message.
>>>>>> What are your kernel parameters? There must be some message with the
>>>>>> diagnostic patch, as the first pr_info() is called before any other
>>>>>> part of the critical patch is becoming active. Could it be you have
>>>>>> instructed the kernel to be "quiet"? I'd recommend:
>>>>>>
>>>>>> earlyprintk=vga ignore_loglevel
>>>>>>
>>>>>> and no quiet. I don't know VMWare settings, so may be you can use
>>>>>> earlyprintk=ttyS0 instead of vga.
>>>>>>
>>>>>>> Let me show you my PAT values (the commit reverted)
>>>>>>>
>>>>>>> # dmesg | grep PAT
>>>>>>> [    0.000000] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>>>>>> [    0.314631] x86 PAT enabled: cpu 3, old 0x0, new 0x7010600070106
>>>>>>> [    0.314703] x86 PAT enabled: cpu 1, old 0x0, new 0x7010600070106
>>>>>>> [    0.314780] x86 PAT enabled: cpu 2, old 0x0, new 0x7010600070106
>>>>>>> [    0.314852] x86 PAT enabled: cpu 4, old 0x0, new 0x7010600070106
>>>>>>> [    0.314923] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>>>>>> [    0.314997] x86 PAT enabled: cpu 6, old 0x0, new 0x7010600070106
>>>>>>> [    0.315069] x86 PAT enabled: cpu 7, old 0x0, new 0x7010600070106
>>>>>>> [    0.315142] x86 PAT enabled: cpu 5, old 0x0, new 0x7010600070106
>>>>>> These are the expected values. But these values are the ones which are
>>>>>> written, not the ones which have been read from the PAT MSR again.
>>>>>>
>>>>>> Without applying the critical patch you could add:
>>>>>>
>>>>>> rdmsrl(MSR_IA32_CR_PAT, pat);
>>>>>> printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>>>>>>
>>>>>> at the end of pat_init() to verify VMWare is handling reads of the PAT
>>>>>> MSR properly.
>>>>>>
>>>>>> Juergen
>>>>>>
>>>>> Hi,
>>>>>
>>>>> With earlyprintk=vga, I can see the log.
>>>>> But due to call trace, I can't see what the pat value is.
>>>>>
>>>>> Call chain is as follows.
>>>>>
>>>>>    i386_start_kernel -> start_kernel -> setup_arch ->
>>>>>    mtrr_bp_init -> get_mtrr_state -> pat_init ->
>>>>>    pat_init_cache_mode_entry -> update_cache_mode_entry ->
>>>>>    early_idt_handler -> dump_stack
>>>>>
>>>>> So, I blocked update_cache_mode_entry() call like below...
>>>>>
>>>>> --- a/arch/x86/mm/pat.c
>>>>> +++ b/arch/x86/mm/pat.c
>>>>> @@ -182,11 +182,12 @@ void pat_init_cache_modes(void)
>>>>>          u64 pat;
>>>>>   
>>>>>          rdmsrl(MSR_IA32_CR_PAT, pat);
>>>>> +       pr_info("read pat %0llx\n", pat);
>>>>>          pat_msg[32] = 0;
>>>>>          for (i = 7; i >= 0; i--) {
>>>>>                  cache = pat_get_cache_mode((pat >> (i * 8)) & 7,
>>>>>                                             pat_msg + 4 * i);
>>>>> -               update_cache_mode_entry(i, cache);
>>>>> +               //update_cache_mode_entry(i, cache);
>>>>>          }
>>>>>          pr_info("PAT configuration [0-7]: %s\n", pat_msg);
>>>>>   }
>>>>> @@ -238,9 +239,13 @@ void pat_init(void)
>>>>>                  rdmsrl(MSR_IA32_CR_PAT, boot_pat_state);
>>>>>   
>>>>>          wrmsrl(MSR_IA32_CR_PAT, pat);
>>>>> +       pr_info("about to write pat %0llx\n", pat);
>>>>>   
>>>>>          if (boot_cpu)
>>>>>                  pat_init_cache_modes();
>>>>> +
>>>>> +       rdmsrl(MSR_IA32_CR_PAT, pat);
>>>>> +       printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>>>>>   }
>>>>>   
>>>>>
>>>>> Then boot is fine, and PAT values are as follows.
>>>>>
>>>>>
>>>>> # dmesg|grep -i "pat "
>>>>> [    0.000000] about to write pat 7010600070106
>>>>> [    0.000000] read pat 0
>>>>> [    0.000000] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.000000] PAT read: cpu 0, 0x0
>>>>> [    0.320559] about to write pat 7010600070106
>>>>> [    0.320876] read pat 0
>>>>> [    0.321090] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.321260] PAT read: cpu 5, 0x0
>>>>> [    0.321403] about to write pat 7010600070106
>>>>> [    0.321818] read pat 0
>>>>> [    0.322033] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.322205] PAT read: cpu 6, 0x0
>>>>> [    0.322334] about to write pat 7010600070106
>>>>> [    0.322417] read pat 0
>>>>> [    0.322479] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.322573] PAT read: cpu 0, 0x0
>>>>> [    0.322703] about to write pat 7010600070106
>>>>> [    0.323012] read pat 0
>>>>> [    0.323228] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.323400] PAT read: cpu 1, 0x0
>>>>> [    0.323537] about to write pat 7010600070106
>>>>> [    0.323833] read pat 0
>>>>> [    0.324055] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.324224] PAT read: cpu 7, 0x0
>>>>> [    0.324362] about to write pat 7010600070106
>>>>> [    0.324662] read pat 0
>>>>> [    0.324877] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.325048] PAT read: cpu 2, 0x0
>>>>> [    0.325185] about to write pat 7010600070106
>>>>> [    0.325483] read pat 0
>>>>> [    0.325695] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.325863] PAT read: cpu 4, 0x0
>>>>> [    0.325997] about to write pat 7010600070106
>>>>> [    0.326288] read pat 0
>>>>> [    0.326507] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>>> [    0.326677] PAT read: cpu 3, 0x0
>>>> Okay, so VMWare doesn't seem to return the correct PAT MSR value.
>>>>
>>>> I suggest you try "nopat" as kernel option. This should disable all the
>>>> PAT handling and VMWare can't wreck the kernel this way.
>>>>
>>>> I'll write a patch which detects this VMWare bug by checking the PAT
>>>> value after writing it.
>>>>
>>>> Thanks for reporting that case,
>>>>
>>>>
>>>> Juergen
>>>>
>>>>
>>> OK, my VMWare works with "nopat" option.
>>>
>>> Thanks~.N


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
  2014-12-16 13:08 ` Peter Hurley
@ 2014-12-16 15:12   ` Thomas Hellstrom
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Hellstrom @ 2014-12-16 15:12 UTC (permalink / raw)
  To: jongman.heo; +Cc: Peter Hurley, Juergen Gross, linux-kernel

Jongman, what product (player, ws, esx) and version are you using?

Thanks,
Thomas


On 12/16/2014 02:08 PM, Peter Hurley wrote:
> VMware guys probably already know this but just in case
>
> [ +cc Thomas Hellstrom ]
>
> Jongman - you need to fix your mailer to use plaintext and not base64.
>
> On 12/16/2014 01:46 AM, Jongman Heo wrote:
>>> Sender : Juergen Gross<jgross@suse.com>
>>> On 12/16/2014 07:29 AM, Jongman Heo wrote:
>>>>> Sender : Juergen Gross
>>>>> On 12/16/2014 05:40 AM, Jongman Heo wrote:
>>>>>>> Sender : Juergen Gross
>>>>>>> On 12/15/2014 08:52 AM, Jongman Heo wrote:
>>>>>>>>> Sender : Juergen Gross
>>>>>>>>> On 12/14/2014 06:07 AM, 허종만 wrote:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.
>>>>>>>>>>
>>>>>>>>>> commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
>>>>>>>>>> Author: Juergen Gross
>>>>>>>>>> Date:   Mon Nov 3 14:02:03 2014 +0100
>>>>>>>>>>
>>>>>>>>>>         x86: Enable PAT to use cache mode translation tables
>>>>>>>>>>
>>>>>>>>>> Unfortunately I can't see any console log.
>>>>>>>>> Hmm, weird. Could you provide some more information?
>>>>>>>>>
>>>>>>>>> Kernel config, hardware used, /proc/cpuinfo of working kernel?
>>>>>>>>> Anything you see with earlyprintk enabled?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Juergen
>>>>>>>> (Sorry for resending this email, previous one bounced from mailing list due to HTML format)
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm using Fedora 21, with custom built kernel.
>>>>>>>> Host PC is windows 7 64-bit, and running VMWare workstation 10 for guest Fedora Linux.
>>>>>>>>
>>>>>>>> With earlyprintk, just following message is printed.
>>>>>>>>
>>>>>>>>      early console in setup code
>>>>>>>>
>>>>>>>> and nothing more...
>>>>>>> Can you try attached diagnostic patch, please? I suspect a problem
>>>>>>> regarding VMWares PAT emulation...
>>>>>>>
>>>>>>>
>>>>>>> Juergen
>>>>>> Hi,
>>>>>>
>>>>>> With the commit reverted, the patch doesn't apply.
>>>>> Sure.
>>>>>
>>>>>> Without revert, kernel (patch applied) doesn't boot and I can't see any message.
>>>>> What are your kernel parameters? There must be some message with the
>>>>> diagnostic patch, as the first pr_info() is called before any other
>>>>> part of the critical patch is becoming active. Could it be you have
>>>>> instructed the kernel to be "quiet"? I'd recommend:
>>>>>
>>>>> earlyprintk=vga ignore_loglevel
>>>>>
>>>>> and no quiet. I don't know VMWare settings, so may be you can use
>>>>> earlyprintk=ttyS0 instead of vga.
>>>>>
>>>>>> Let me show you my PAT values (the commit reverted)
>>>>>>
>>>>>> # dmesg | grep PAT
>>>>>> [    0.000000] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>>>>> [    0.314631] x86 PAT enabled: cpu 3, old 0x0, new 0x7010600070106
>>>>>> [    0.314703] x86 PAT enabled: cpu 1, old 0x0, new 0x7010600070106
>>>>>> [    0.314780] x86 PAT enabled: cpu 2, old 0x0, new 0x7010600070106
>>>>>> [    0.314852] x86 PAT enabled: cpu 4, old 0x0, new 0x7010600070106
>>>>>> [    0.314923] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>>>>> [    0.314997] x86 PAT enabled: cpu 6, old 0x0, new 0x7010600070106
>>>>>> [    0.315069] x86 PAT enabled: cpu 7, old 0x0, new 0x7010600070106
>>>>>> [    0.315142] x86 PAT enabled: cpu 5, old 0x0, new 0x7010600070106
>>>>> These are the expected values. But these values are the ones which are
>>>>> written, not the ones which have been read from the PAT MSR again.
>>>>>
>>>>> Without applying the critical patch you could add:
>>>>>
>>>>> rdmsrl(MSR_IA32_CR_PAT, pat);
>>>>> printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>>>>>
>>>>> at the end of pat_init() to verify VMWare is handling reads of the PAT
>>>>> MSR properly.
>>>>>
>>>>> Juergen
>>>>>
>>>> Hi,
>>>>
>>>> With earlyprintk=vga, I can see the log.
>>>> But due to call trace, I can't see what the pat value is.
>>>>
>>>> Call chain is as follows.
>>>>
>>>>    i386_start_kernel -> start_kernel -> setup_arch ->
>>>>    mtrr_bp_init -> get_mtrr_state -> pat_init ->
>>>>    pat_init_cache_mode_entry -> update_cache_mode_entry ->
>>>>    early_idt_handler -> dump_stack
>>>>
>>>> So, I blocked update_cache_mode_entry() call like below...
>>>>
>>>> --- a/arch/x86/mm/pat.c
>>>> +++ b/arch/x86/mm/pat.c
>>>> @@ -182,11 +182,12 @@ void pat_init_cache_modes(void)
>>>>          u64 pat;
>>>>   
>>>>          rdmsrl(MSR_IA32_CR_PAT, pat);
>>>> +       pr_info("read pat %0llx\n", pat);
>>>>          pat_msg[32] = 0;
>>>>          for (i = 7; i >= 0; i--) {
>>>>                  cache = pat_get_cache_mode((pat >> (i * 8)) & 7,
>>>>                                             pat_msg + 4 * i);
>>>> -               update_cache_mode_entry(i, cache);
>>>> +               //update_cache_mode_entry(i, cache);
>>>>          }
>>>>          pr_info("PAT configuration [0-7]: %s\n", pat_msg);
>>>>   }
>>>> @@ -238,9 +239,13 @@ void pat_init(void)
>>>>                  rdmsrl(MSR_IA32_CR_PAT, boot_pat_state);
>>>>   
>>>>          wrmsrl(MSR_IA32_CR_PAT, pat);
>>>> +       pr_info("about to write pat %0llx\n", pat);
>>>>   
>>>>          if (boot_cpu)
>>>>                  pat_init_cache_modes();
>>>> +
>>>> +       rdmsrl(MSR_IA32_CR_PAT, pat);
>>>> +       printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>>>>   }
>>>>   
>>>>
>>>> Then boot is fine, and PAT values are as follows.
>>>>
>>>>
>>>> # dmesg|grep -i "pat "
>>>> [    0.000000] about to write pat 7010600070106
>>>> [    0.000000] read pat 0
>>>> [    0.000000] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.000000] PAT read: cpu 0, 0x0
>>>> [    0.320559] about to write pat 7010600070106
>>>> [    0.320876] read pat 0
>>>> [    0.321090] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.321260] PAT read: cpu 5, 0x0
>>>> [    0.321403] about to write pat 7010600070106
>>>> [    0.321818] read pat 0
>>>> [    0.322033] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.322205] PAT read: cpu 6, 0x0
>>>> [    0.322334] about to write pat 7010600070106
>>>> [    0.322417] read pat 0
>>>> [    0.322479] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.322573] PAT read: cpu 0, 0x0
>>>> [    0.322703] about to write pat 7010600070106
>>>> [    0.323012] read pat 0
>>>> [    0.323228] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.323400] PAT read: cpu 1, 0x0
>>>> [    0.323537] about to write pat 7010600070106
>>>> [    0.323833] read pat 0
>>>> [    0.324055] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.324224] PAT read: cpu 7, 0x0
>>>> [    0.324362] about to write pat 7010600070106
>>>> [    0.324662] read pat 0
>>>> [    0.324877] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.325048] PAT read: cpu 2, 0x0
>>>> [    0.325185] about to write pat 7010600070106
>>>> [    0.325483] read pat 0
>>>> [    0.325695] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.325863] PAT read: cpu 4, 0x0
>>>> [    0.325997] about to write pat 7010600070106
>>>> [    0.326288] read pat 0
>>>> [    0.326507] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>>> [    0.326677] PAT read: cpu 3, 0x0
>>> Okay, so VMWare doesn't seem to return the correct PAT MSR value.
>>>
>>> I suggest you try "nopat" as kernel option. This should disable all the
>>> PAT handling and VMWare can't wreck the kernel this way.
>>>
>>> I'll write a patch which detects this VMWare bug by checking the PAT
>>> value after writing it.
>>>
>>> Thanks for reporting that case,
>>>
>>>
>>> Juergen
>>>
>>>
>> OK, my VMWare works with "nopat" option.
>>
>> Thanks~.N


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
  2014-12-16  6:46 Jongman Heo
@ 2014-12-16 13:08 ` Peter Hurley
  2014-12-16 15:12   ` Thomas Hellstrom
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Hurley @ 2014-12-16 13:08 UTC (permalink / raw)
  To: jongman.heo, Juergen Gross, linux-kernel, Thomas Hellstrom

VMware guys probably already know this but just in case

[ +cc Thomas Hellstrom ]

Jongman - you need to fix your mailer to use plaintext and not base64.

On 12/16/2014 01:46 AM, Jongman Heo wrote:
>> Sender : Juergen Gross<jgross@suse.com>
>> On 12/16/2014 07:29 AM, Jongman Heo wrote:
>>>> Sender : Juergen Gross
>>>> On 12/16/2014 05:40 AM, Jongman Heo wrote:
>>>>>> Sender : Juergen Gross
>>>>>> On 12/15/2014 08:52 AM, Jongman Heo wrote:
>>>>>>>> Sender : Juergen Gross
>>>>>>>> On 12/14/2014 06:07 AM, 허종만 wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.
>>>>>>>>>
>>>>>>>>> commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
>>>>>>>>> Author: Juergen Gross
>>>>>>>>> Date:   Mon Nov 3 14:02:03 2014 +0100
>>>>>>>>>
>>>>>>>>>         x86: Enable PAT to use cache mode translation tables
>>>>>>>>>
>>>>>>>>> Unfortunately I can't see any console log.
>>>>>>>>
>>>>>>>> Hmm, weird. Could you provide some more information?
>>>>>>>>
>>>>>>>> Kernel config, hardware used, /proc/cpuinfo of working kernel?
>>>>>>>> Anything you see with earlyprintk enabled?
>>>>>>>>
>>>>>>>>
>>>>>>>> Juergen
>>>>>>>
>>>>>>> (Sorry for resending this email, previous one bounced from mailing list due to HTML format)
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm using Fedora 21, with custom built kernel.
>>>>>>> Host PC is windows 7 64-bit, and running VMWare workstation 10 for guest Fedora Linux.
>>>>>>>
>>>>>>> With earlyprintk, just following message is printed.
>>>>>>>
>>>>>>>      early console in setup code
>>>>>>>
>>>>>>> and nothing more...
>>>>>>
>>>>>> Can you try attached diagnostic patch, please? I suspect a problem
>>>>>> regarding VMWares PAT emulation...
>>>>>>
>>>>>>
>>>>>> Juergen
>>>>>
>>>>> Hi,
>>>>>
>>>>> With the commit reverted, the patch doesn't apply.
>>>>
>>>> Sure.
>>>>
>>>>> Without revert, kernel (patch applied) doesn't boot and I can't see any message.
>>>>
>>>> What are your kernel parameters? There must be some message with the
>>>> diagnostic patch, as the first pr_info() is called before any other
>>>> part of the critical patch is becoming active. Could it be you have
>>>> instructed the kernel to be "quiet"? I'd recommend:
>>>>
>>>> earlyprintk=vga ignore_loglevel
>>>>
>>>> and no quiet. I don't know VMWare settings, so may be you can use
>>>> earlyprintk=ttyS0 instead of vga.
>>>>
>>>>>
>>>>> Let me show you my PAT values (the commit reverted)
>>>>>
>>>>> # dmesg | grep PAT
>>>>> [    0.000000] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>>>> [    0.314631] x86 PAT enabled: cpu 3, old 0x0, new 0x7010600070106
>>>>> [    0.314703] x86 PAT enabled: cpu 1, old 0x0, new 0x7010600070106
>>>>> [    0.314780] x86 PAT enabled: cpu 2, old 0x0, new 0x7010600070106
>>>>> [    0.314852] x86 PAT enabled: cpu 4, old 0x0, new 0x7010600070106
>>>>> [    0.314923] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>>>> [    0.314997] x86 PAT enabled: cpu 6, old 0x0, new 0x7010600070106
>>>>> [    0.315069] x86 PAT enabled: cpu 7, old 0x0, new 0x7010600070106
>>>>> [    0.315142] x86 PAT enabled: cpu 5, old 0x0, new 0x7010600070106
>>>>
>>>> These are the expected values. But these values are the ones which are
>>>> written, not the ones which have been read from the PAT MSR again.
>>>>
>>>> Without applying the critical patch you could add:
>>>>
>>>> rdmsrl(MSR_IA32_CR_PAT, pat);
>>>> printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>>>>
>>>> at the end of pat_init() to verify VMWare is handling reads of the PAT
>>>> MSR properly.
>>>>
>>>> Juergen
>>>>
>>>
>>> Hi,
>>>
>>> With earlyprintk=vga, I can see the log.
>>> But due to call trace, I can't see what the pat value is.
>>>
>>> Call chain is as follows.
>>>
>>>    i386_start_kernel -> start_kernel -> setup_arch ->
>>>    mtrr_bp_init -> get_mtrr_state -> pat_init ->
>>>    pat_init_cache_mode_entry -> update_cache_mode_entry ->
>>>    early_idt_handler -> dump_stack
>>>
>>> So, I blocked update_cache_mode_entry() call like below...
>>>
>>> --- a/arch/x86/mm/pat.c
>>> +++ b/arch/x86/mm/pat.c
>>> @@ -182,11 +182,12 @@ void pat_init_cache_modes(void)
>>>          u64 pat;
>>>   
>>>          rdmsrl(MSR_IA32_CR_PAT, pat);
>>> +       pr_info("read pat %0llx\n", pat);
>>>          pat_msg[32] = 0;
>>>          for (i = 7; i >= 0; i--) {
>>>                  cache = pat_get_cache_mode((pat >> (i * 8)) & 7,
>>>                                             pat_msg + 4 * i);
>>> -               update_cache_mode_entry(i, cache);
>>> +               //update_cache_mode_entry(i, cache);
>>>          }
>>>          pr_info("PAT configuration [0-7]: %s\n", pat_msg);
>>>   }
>>> @@ -238,9 +239,13 @@ void pat_init(void)
>>>                  rdmsrl(MSR_IA32_CR_PAT, boot_pat_state);
>>>   
>>>          wrmsrl(MSR_IA32_CR_PAT, pat);
>>> +       pr_info("about to write pat %0llx\n", pat);
>>>   
>>>          if (boot_cpu)
>>>                  pat_init_cache_modes();
>>> +
>>> +       rdmsrl(MSR_IA32_CR_PAT, pat);
>>> +       printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>>>   }
>>>   
>>>
>>> Then boot is fine, and PAT values are as follows.
>>>
>>>
>>> # dmesg|grep -i "pat "
>>> [    0.000000] about to write pat 7010600070106
>>> [    0.000000] read pat 0
>>> [    0.000000] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.000000] PAT read: cpu 0, 0x0
>>> [    0.320559] about to write pat 7010600070106
>>> [    0.320876] read pat 0
>>> [    0.321090] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.321260] PAT read: cpu 5, 0x0
>>> [    0.321403] about to write pat 7010600070106
>>> [    0.321818] read pat 0
>>> [    0.322033] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.322205] PAT read: cpu 6, 0x0
>>> [    0.322334] about to write pat 7010600070106
>>> [    0.322417] read pat 0
>>> [    0.322479] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.322573] PAT read: cpu 0, 0x0
>>> [    0.322703] about to write pat 7010600070106
>>> [    0.323012] read pat 0
>>> [    0.323228] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.323400] PAT read: cpu 1, 0x0
>>> [    0.323537] about to write pat 7010600070106
>>> [    0.323833] read pat 0
>>> [    0.324055] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.324224] PAT read: cpu 7, 0x0
>>> [    0.324362] about to write pat 7010600070106
>>> [    0.324662] read pat 0
>>> [    0.324877] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.325048] PAT read: cpu 2, 0x0
>>> [    0.325185] about to write pat 7010600070106
>>> [    0.325483] read pat 0
>>> [    0.325695] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.325863] PAT read: cpu 4, 0x0
>>> [    0.325997] about to write pat 7010600070106
>>> [    0.326288] read pat 0
>>> [    0.326507] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
>>> [    0.326677] PAT read: cpu 3, 0x0
>>
>> Okay, so VMWare doesn't seem to return the correct PAT MSR value.
>>
>> I suggest you try "nopat" as kernel option. This should disable all the
>> PAT handling and VMWare can't wreck the kernel this way.
>>
>> I'll write a patch which detects this VMWare bug by checking the PAT
>> value after writing it.
>>
>> Thanks for reporting that case,
>>
>>
>> Juergen
>>
>>
> 
> OK, my VMWare works with "nopat" option.
> 
> Thanks~.N

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
  2014-12-16  6:29 Jongman Heo
@ 2014-12-16  6:36 ` Juergen Gross
  0 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2014-12-16  6:36 UTC (permalink / raw)
  To: jongman.heo, linux-kernel

On 12/16/2014 07:29 AM, Jongman Heo wrote:
>>
>> ------- Original Message -------
>> Sender : Juergen Gross<jgross@suse.com>
>> Date : 2014-12-16 14:14 (GMT+09:00)
>> Title : Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
>>
>> On 12/16/2014 05:40 AM, Jongman Heo wrote:
>>>> ------- Original Message -------
>>>> Sender : Juergen Gross
>>>> Date : 2014-12-15 20:52 (GMT+09:00)
>>>> Title : Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
>>>>
>>>> On 12/15/2014 08:52 AM, Jongman Heo wrote:
>>>>>> ------- Original Message -------
>>>>>> Sender : Juergen Gross
>>>>>> Date : 2014-12-15 14:04 (GMT+09:00)
>>>>>> Title : Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
>>>>>>
>>>>>> On 12/14/2014 06:07 AM, 허종만 wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.
>>>>>>>
>>>>>>> commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
>>>>>>> Author: Juergen Gross
>>>>>>> Date:   Mon Nov 3 14:02:03 2014 +0100
>>>>>>>
>>>>>>>         x86: Enable PAT to use cache mode translation tables
>>>>>>>
>>>>>>> Unfortunately I can't see any console log.
>>>>>>
>>>>>> Hmm, weird. Could you provide some more information?
>>>>>>
>>>>>> Kernel config, hardware used, /proc/cpuinfo of working kernel?
>>>>>> Anything you see with earlyprintk enabled?
>>>>>>
>>>>>>
>>>>>> Juergen
>>>>>
>>>>> (Sorry for resending this email, previous one bounced from mailing list due to HTML format)
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm using Fedora 21, with custom built kernel.
>>>>> Host PC is windows 7 64-bit, and running VMWare workstation 10 for guest Fedora Linux.
>>>>>
>>>>> With earlyprintk, just following message is printed.
>>>>>
>>>>>      early console in setup code
>>>>>
>>>>> and nothing more...
>>>>
>>>> Can you try attached diagnostic patch, please? I suspect a problem
>>>> regarding VMWares PAT emulation...
>>>>
>>>>
>>>> Juergen
>>>
>>> Hi,
>>>
>>> With the commit reverted, the patch doesn't apply.
>>
>> Sure.
>>
>>> Without revert, kernel (patch applied) doesn't boot and I can't see any message.
>>
>> What are your kernel parameters? There must be some message with the
>> diagnostic patch, as the first pr_info() is called before any other
>> part of the critical patch is becoming active. Could it be you have
>> instructed the kernel to be "quiet"? I'd recommend:
>>
>> earlyprintk=vga ignore_loglevel
>>
>> and no quiet. I don't know VMWare settings, so may be you can use
>> earlyprintk=ttyS0 instead of vga.
>>
>>>
>>> Let me show you my PAT values (the commit reverted)
>>>
>>> # dmesg | grep PAT
>>> [    0.000000] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>> [    0.314631] x86 PAT enabled: cpu 3, old 0x0, new 0x7010600070106
>>> [    0.314703] x86 PAT enabled: cpu 1, old 0x0, new 0x7010600070106
>>> [    0.314780] x86 PAT enabled: cpu 2, old 0x0, new 0x7010600070106
>>> [    0.314852] x86 PAT enabled: cpu 4, old 0x0, new 0x7010600070106
>>> [    0.314923] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
>>> [    0.314997] x86 PAT enabled: cpu 6, old 0x0, new 0x7010600070106
>>> [    0.315069] x86 PAT enabled: cpu 7, old 0x0, new 0x7010600070106
>>> [    0.315142] x86 PAT enabled: cpu 5, old 0x0, new 0x7010600070106
>>
>> These are the expected values. But these values are the ones which are
>> written, not the ones which have been read from the PAT MSR again.
>>
>> Without applying the critical patch you could add:
>>
>> rdmsrl(MSR_IA32_CR_PAT, pat);
>> printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>>
>> at the end of pat_init() to verify VMWare is handling reads of the PAT
>> MSR properly.
>>
>> Juergen
>>
> 
> Hi,
> 
> With earlyprintk=vga, I can see the log.
> But due to call trace, I can't see what the pat value is.
> 
> Call chain is as follows.
> 
>    i386_start_kernel -> start_kernel -> setup_arch ->
>    mtrr_bp_init -> get_mtrr_state -> pat_init ->
>    pat_init_cache_mode_entry -> update_cache_mode_entry ->
>    early_idt_handler -> dump_stack
> 
> So, I blocked update_cache_mode_entry() call like below...
> 
> --- a/arch/x86/mm/pat.c
> +++ b/arch/x86/mm/pat.c
> @@ -182,11 +182,12 @@ void pat_init_cache_modes(void)
>          u64 pat;
>   
>          rdmsrl(MSR_IA32_CR_PAT, pat);
> +       pr_info("read pat %0llx\n", pat);
>          pat_msg[32] = 0;
>          for (i = 7; i >= 0; i--) {
>                  cache = pat_get_cache_mode((pat >> (i * 8)) & 7,
>                                             pat_msg + 4 * i);
> -               update_cache_mode_entry(i, cache);
> +               //update_cache_mode_entry(i, cache);
>          }
>          pr_info("PAT configuration [0-7]: %s\n", pat_msg);
>   }
> @@ -238,9 +239,13 @@ void pat_init(void)
>                  rdmsrl(MSR_IA32_CR_PAT, boot_pat_state);
>   
>          wrmsrl(MSR_IA32_CR_PAT, pat);
> +       pr_info("about to write pat %0llx\n", pat);
>   
>          if (boot_cpu)
>                  pat_init_cache_modes();
> +
> +       rdmsrl(MSR_IA32_CR_PAT, pat);
> +       printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);
>   }
>   
> 
> Then boot is fine, and PAT values are as follows.
> 
> 
> # dmesg|grep -i "pat "
> [    0.000000] about to write pat 7010600070106
> [    0.000000] read pat 0
> [    0.000000] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.000000] PAT read: cpu 0, 0x0
> [    0.320559] about to write pat 7010600070106
> [    0.320876] read pat 0
> [    0.321090] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.321260] PAT read: cpu 5, 0x0
> [    0.321403] about to write pat 7010600070106
> [    0.321818] read pat 0
> [    0.322033] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.322205] PAT read: cpu 6, 0x0
> [    0.322334] about to write pat 7010600070106
> [    0.322417] read pat 0
> [    0.322479] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.322573] PAT read: cpu 0, 0x0
> [    0.322703] about to write pat 7010600070106
> [    0.323012] read pat 0
> [    0.323228] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.323400] PAT read: cpu 1, 0x0
> [    0.323537] about to write pat 7010600070106
> [    0.323833] read pat 0
> [    0.324055] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.324224] PAT read: cpu 7, 0x0
> [    0.324362] about to write pat 7010600070106
> [    0.324662] read pat 0
> [    0.324877] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.325048] PAT read: cpu 2, 0x0
> [    0.325185] about to write pat 7010600070106
> [    0.325483] read pat 0
> [    0.325695] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.325863] PAT read: cpu 4, 0x0
> [    0.325997] about to write pat 7010600070106
> [    0.326288] read pat 0
> [    0.326507] PAT configuration [0-7]: UC  UC  UC  UC  UC  UC  UC  UC
> [    0.326677] PAT read: cpu 3, 0x0

Okay, so VMWare doesn't seem to return the correct PAT MSR value.

I suggest you try "nopat" as kernel option. This should disable all the
PAT handling and VMWare can't wreck the kernel this way.

I'll write a patch which detects this VMWare bug by checking the PAT
value after writing it.

Thanks for reporting that case,


Juergen


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
  2014-12-16  4:40 Jongman Heo
@ 2014-12-16  5:14 ` Juergen Gross
  0 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2014-12-16  5:14 UTC (permalink / raw)
  To: jongman.heo, linux-kernel

On 12/16/2014 05:40 AM, Jongman Heo wrote:
>> ------- Original Message -------
>> Sender : Juergen Gross<jgross@suse.com>
>> Date : 2014-12-15 20:52 (GMT+09:00)
>> Title : Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
>>
>> On 12/15/2014 08:52 AM, Jongman Heo wrote:
>>>> ------- Original Message -------
>>>> Sender : Juergen Gross
>>>> Date : 2014-12-15 14:04 (GMT+09:00)
>>>> Title : Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
>>>>
>>>> On 12/14/2014 06:07 AM, 허종만 wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.
>>>>>
>>>>> commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
>>>>> Author: Juergen Gross
>>>>> Date:   Mon Nov 3 14:02:03 2014 +0100
>>>>>
>>>>>        x86: Enable PAT to use cache mode translation tables
>>>>>
>>>>> Unfortunately I can't see any console log.
>>>>
>>>> Hmm, weird. Could you provide some more information?
>>>>
>>>> Kernel config, hardware used, /proc/cpuinfo of working kernel?
>>>> Anything you see with earlyprintk enabled?
>>>>
>>>>
>>>> Juergen
>>>
>>> (Sorry for resending this email, previous one bounced from mailing list due to HTML format)
>>>
>>> Hi,
>>>
>>> I'm using Fedora 21, with custom built kernel.
>>> Host PC is windows 7 64-bit, and running VMWare workstation 10 for guest Fedora Linux.
>>>
>>> With earlyprintk, just following message is printed.
>>>
>>>     early console in setup code
>>>
>>> and nothing more...
>>
>> Can you try attached diagnostic patch, please? I suspect a problem
>> regarding VMWares PAT emulation...
>>
>>
>> Juergen
> 
> Hi,
> 
> With the commit reverted, the patch doesn't apply.

Sure.

> Without revert, kernel (patch applied) doesn't boot and I can't see any message.

What are your kernel parameters? There must be some message with the
diagnostic patch, as the first pr_info() is called before any other
part of the critical patch is becoming active. Could it be you have
instructed the kernel to be "quiet"? I'd recommend:

earlyprintk=vga ignore_loglevel

and no quiet. I don't know VMWare settings, so may be you can use
earlyprintk=ttyS0 instead of vga.

> 
> Let me show you my PAT values (the commit reverted)
> 
> # dmesg | grep PAT
> [    0.000000] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
> [    0.314631] x86 PAT enabled: cpu 3, old 0x0, new 0x7010600070106
> [    0.314703] x86 PAT enabled: cpu 1, old 0x0, new 0x7010600070106
> [    0.314780] x86 PAT enabled: cpu 2, old 0x0, new 0x7010600070106
> [    0.314852] x86 PAT enabled: cpu 4, old 0x0, new 0x7010600070106
> [    0.314923] x86 PAT enabled: cpu 0, old 0x0, new 0x7010600070106
> [    0.314997] x86 PAT enabled: cpu 6, old 0x0, new 0x7010600070106
> [    0.315069] x86 PAT enabled: cpu 7, old 0x0, new 0x7010600070106
> [    0.315142] x86 PAT enabled: cpu 5, old 0x0, new 0x7010600070106

These are the expected values. But these values are the ones which are
written, not the ones which have been read from the PAT MSR again.

Without applying the critical patch you could add:

rdmsrl(MSR_IA32_CR_PAT, pat);
printk(KERN_INFO "PAT read: cpu %d, 0x%Lx\n", smp_processor_id(), pat);

at the end of pat_init() to verify VMWare is handling reads of the PAT
MSR properly.

Juergen


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
  2014-12-15  7:52 Jongman Heo
@ 2014-12-15 11:52 ` Juergen Gross
  0 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2014-12-15 11:52 UTC (permalink / raw)
  To: jongman.heo, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]

On 12/15/2014 08:52 AM, Jongman Heo wrote:
>> ------- Original Message -------
>> Sender : Juergen Gross
>> Date : 2014-12-15 14:04 (GMT+09:00)
>> Title : Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
>>
>> On 12/14/2014 06:07 AM, 허종만 wrote:
>>>
>>> Hi,
>>>
>>> My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.
>>>
>>> commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
>>> Author: Juergen Gross
>>> Date:   Mon Nov 3 14:02:03 2014 +0100
>>>
>>>       x86: Enable PAT to use cache mode translation tables
>>>
>>> Unfortunately I can't see any console log.
>>
>> Hmm, weird. Could you provide some more information?
>>
>> Kernel config, hardware used, /proc/cpuinfo of working kernel?
>> Anything you see with earlyprintk enabled?
>>
>>
>> Juergen
> 
> (Sorry for resending this email, previous one bounced from mailing list due to HTML format)
> 
> Hi,
> 
> I'm using Fedora 21, with custom built kernel.
> Host PC is windows 7 64-bit, and running VMWare workstation 10 for guest Fedora Linux.
> 
> With earlyprintk, just following message is printed.
> 
>    early console in setup code
> 
> and nothing more...

Can you try attached diagnostic patch, please? I suspect a problem
regarding VMWares PAT emulation...


Juergen

[-- Attachment #2: diag.patch --]
[-- Type: text/x-patch, Size: 569 bytes --]

diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index edf299c..d77d6a8 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -182,6 +182,7 @@ void pat_init_cache_modes(void)
 	u64 pat;
 
 	rdmsrl(MSR_IA32_CR_PAT, pat);
+	pr_info("read pat %0llx\n", pat);
 	pat_msg[32] = 0;
 	for (i = 7; i >= 0; i--) {
 		cache = pat_get_cache_mode((pat >> (i * 8)) & 7,
@@ -237,6 +238,8 @@ void pat_init(void)
 	if (!boot_pat_state)
 		rdmsrl(MSR_IA32_CR_PAT, boot_pat_state);
 
+	pr_info("about to write pat %0llx\n", pat);
+
 	wrmsrl(MSR_IA32_CR_PAT, pat);
 
 	if (boot_cpu)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables")
       [not found] <1983011076.75441418533626741.JavaMail.weblogic@epmlwas09c>
@ 2014-12-15  5:17 ` Juergen Gross
  0 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2014-12-15  5:17 UTC (permalink / raw)
  To: jongman.heo, linux-kernel

On 12/14/2014 06:07 AM, 허종만 wrote:
> 
> Hi,
> 
> My Linux virtual machine on (Windows) VMWare workstation 10 can't boot with following commit.
> 
> commit bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
> Author: Juergen Gross <jgross@suse.com>
> Date:   Mon Nov 3 14:02:03 2014 +0100
> 
>      x86: Enable PAT to use cache mode translation tables
> 
> Unfortunately I can't see any console log.

Hmm, weird. Could you provide some more information?

Kernel config, hardware used, /proc/cpuinfo of working kernel?
Anything you see with earlyprintk enabled?


Juergen

> Reverting the commit fixes my boot issue. git bisect log follows,
> 
> $ git bisect log
> git bisect start
> # bad: [92a578b064d0227a3a7fbbdb9e29dbab7f8d400e] Merge tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
> git bisect bad 92a578b064d0227a3a7fbbdb9e29dbab7f8d400e
> # good: [b2776bf7149bddd1f4161f14f79520f17fc1d71d] Linux 3.18
> git bisect good b2776bf7149bddd1f4161f14f79520f17fc1d71d
> # good: [6da314122ddc11936c6f054753bbb956a499d020] Merge tag 'dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
> git bisect good 6da314122ddc11936c6f054753bbb956a499d020
> # good: [482a3767e5087f6e6ad2486a6655aaa5f3d59301] exit: reparent: call forget_original_parent() under tasklist_lock
> git bisect good 482a3767e5087f6e6ad2486a6655aaa5f3d59301
> # bad: [cbfe0de303a55ed96d8831c2d5f56f8131cd6612] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
> git bisect bad cbfe0de303a55ed96d8831c2d5f56f8131cd6612
> # bad: [a6b849578ef3e0b131b1ea4063473a4f935a65e9] Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6
> git bisect bad a6b849578ef3e0b131b1ea4063473a4f935a65e9
> # bad: [c9f861c77269bc9950c16c6404a9476062241671] Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect bad c9f861c77269bc9950c16c6404a9476062241671
> # good: [773fed910d41e443e495a6bfa9ab1c2b7b13e012] Merge branches 'x86-platform-for-linus' and 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect good 773fed910d41e443e495a6bfa9ab1c2b7b13e012
> # good: [773fed910d41e443e495a6bfa9ab1c2b7b13e012] Merge branches 'x86-platform-for-linus' and 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect good 773fed910d41e443e495a6bfa9ab1c2b7b13e012
> # good: [f439c429c320981943f8b64b2a4049d946cb492b] x86: Support PAT bit in pagetable dump for lower levels
> git bisect good f439c429c320981943f8b64b2a4049d946cb492b
> # good: [e3480271f59253cb60d030aa5e615bf00b731fea] x86, mce, severity: Extend the the mce_severity mechanism to handle UCNA/DEFERRED error
> git bisect good e3480271f59253cb60d030aa5e615bf00b731fea
> # bad: [0dbcae884779fdf7e2239a97ac7488877f0693d9] x86: mm: Move PAT only functions to mm/pat.c
> git bisect bad 0dbcae884779fdf7e2239a97ac7488877f0693d9
> # bad: [bd809af16e3ab1f8d55b3e2928c47c67e2a865d2] x86: Enable PAT to use cache mode translation tables
> git bisect bad bd809af16e3ab1f8d55b3e2928c47c67e2a865d2
> # good: [f5b2831d654167d77da8afbef4d2584897b12d0c] x86: Respect PAT bit when copying pte values between large and normal pages
> git bisect good f5b2831d654167d77da8afbef4d2584897b12d0c
> # first bad commit: [bd809af16e3ab1f8d55b3e2928c47c67e2a865d2] x86: Enable PAT to use cache mode translation tables
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-17  5:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-14  5:09 [3.18+] Can't boot with commit bd809af1 ("x86: Enable PAT to use cache mode translation tables") 허종만
     [not found] <1983011076.75441418533626741.JavaMail.weblogic@epmlwas09c>
2014-12-15  5:17 ` Juergen Gross
2014-12-15  7:52 Jongman Heo
2014-12-15 11:52 ` Juergen Gross
2014-12-16  4:40 Jongman Heo
2014-12-16  5:14 ` Juergen Gross
2014-12-16  6:29 Jongman Heo
2014-12-16  6:36 ` Juergen Gross
2014-12-16  6:46 Jongman Heo
2014-12-16 13:08 ` Peter Hurley
2014-12-16 15:12   ` Thomas Hellstrom
2014-12-17  2:46 Jongman Heo
2014-12-17  5:39 ` Thomas Hellstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).