Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1373756

Re: [PATCH v3 01/11] x86/boot: enumerate documentation for the x86 hardware_subarch

From "Luis R. Rodriguez" <mcgrof@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 01/11] x86/boot: enumerate documentation for the x86 hardware_subarch
Date 2016-04-07 23:00 +0200
Message-ID <rlpbY-16R-13@gated-at.bofh.it> (permalink)
References (1 earlier) <r5fzZ-1Xv-41@gated-at.bofh.it> <r5gZ4-2Qo-13@gated-at.bofh.it> <r5ixQ-3Z2-19@gated-at.bofh.it> <r5s4a-2dy-15@gated-at.bofh.it> <r5D9g-1Oq-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


David, please note below the highlighted code.

On Wed, Feb 24, 2016 at 09:32:59AM +0100, Ingo Molnar wrote:
> 
> * Luis R. Rodriguez <mcgrof@kernel.org> wrote:
> For hard coded platform quirks I'd suggest we add x86_platform.quirks flags. For 
> example the F00F hack for Xen could be done via:
> 
> 	x86_platform.quirks.idt_remap = 0;
> 
> and would be set like this during early init:
> 
> void early_init_platform_quirks(void)
> {
> 	x86_platform.legacy.ebda_search = 0;
> 	x86_platform.quirks.idt_remap = 1;
> 
> 	switch (boot_params.hdr.hardware_subarch) {
> 		case X86_SUBARCH_PC:
> 			x86_platform.legacy.ebda_search = 1;
> 			break;
> 		case X86_SUBARCH_XEN:
> 			x86_platform.quirks.idt_remap = 0;
> 			break;
> 		case X86_SUBARCH_LGUEST:
> 			x86_platform.quirks.idt_remap = 0;
> 			break;
> 	}
> }
> 
> And if also add the legacy RTC flag, it becomes:
> 
> void early_init_hardcoded_platform_quirks(void)
> {
> 	x86_platform.legacy.ebda_search = 0;
> 	x86_platform.quirks.idt_remap = 1;
> 	x86_platform.legacy.rtc = 1;
> 
> 	switch (boot_params.hdr.hardware_subarch) {
> 		case X86_SUBARCH_PC:
> 			x86_platform.legacy.ebda_search = 1;
> 			break;
> 		case X86_SUBARCH_XEN:
> 			x86_platform.quirks.idt_remap = 0;
> 			x86_platform.legacy.rtc = 0;
> 			break;
> 		case X86_SUBARCH_LGUEST:
> 			x86_platform.quirks.idt_remap = 0;
> 			x86_platform.legacy.rtc = 0;
> 			break;
> 	}
> }
> 
> Note that both opt-in and opt-out quirks/legacies are possible this way, and note 
> how cleanly and consistently it's all organized: setup of all hard coded 
> legacies/quirks is concentrated in a single function, and the actual usage sites 
> don't know anything about subarchitectures.

<-- snip -- > 

So.. I went with Ingo's template.

> Furthermore we should probably move a few other existing legacies to this flag 
> space as well, to make all this more consistent.

And this suggestion should explain a bit of the effort I put into making
room for other legacy things, which I'll elaborate in the other thread.

  Luis

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v3 01/11] x86/boot: enumerate documentation for the x86  hardware_subarch "Luis R. Rodriguez" <mcgrof@suse.com> - 2016-04-07 23:00 +0200

csiph-web