[lkml]   [2012]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [Xen-devel] [PATCH 1/3] xen/mce: Add mcelog support for Xen platform (v2)
Konrad Rzeszutek Wilk wrote:
>>>>>> -static struct miscdevice mce_chrdev_device = {
>>>>>> +struct miscdevice mce_chrdev_device = {
>>>>>> "mcelog",
>>>>>> &mce_chrdev_ops,
>>>>> You're still reusing those - pls, define your own 'struct
>>>>> miscdevice mce_chrdev_device' in drivers/xen/ or somewhere
>>>>> convenient and
>>>>> your own mce_chrdev_ops. The only thing you should be touching in
>>>>> arch/x86/.../mcheck/ is the export of MISC_MCELOG_MINOR.
>>>>> Thanks.
>>>> I'm *not* reuse native code.
>>>> I have defined 'struct miscdevice xen_mce_chrdev_device' in
>>>> drivers/xen, and I also implement xen_mce_chrdev_ops, they are all
>>>> xen-self-contained.
>>>> The patch just redirect native mce_chrdev_device to
>>>> xen_mce_chrdev_device when running under xen environment.
>>>> It didn't change any native code (except just cancel
>>>> mce_chrdev_device 'static'), and will not break native logic.
>>> Why are you doing that?
>>> Why don't you do
>>> misc_register(&xen_mce_chrdev_device);
>>> in xen_early_init_mcelog() ?
>>> This way there'll be no arch/x86/ dependencies at all.
>> The reason is, if we do so, it would be covered by native
>> misc_register(&mce_chrdev_device) later when native kernel init (xen
>> init first and then start native kernel).
> Won't the second registration (so the original one) of the major
> fail? So the mce_log would just error out since somebody already
> registered?

No, that would be device confliction, the 2nd register return as -EBUSY and un-predicetable result.
I test it in your way, mcelog fail to fetch any error log.


 \ /
  Last update: 2012-05-25 20:21    [W:0.243 / U:5.944 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site