aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ldt.c
Commit message (Collapse)AuthorAge
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* cpumask: use mm_cpumask() wrapper: x86Rusty Russell2009-09-23
| | | | | | | | | Makes code futureproof against the impending change to mm->cpu_vm_mask (to be a pointer). It's also a chance to use the new cpumask_ ops which take a pointer (the older ones are deprecated, but there's no hurry for arch code). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* x86: ldt.c fix style problemsJaswinder Singh Rajput2009-01-02
| | | | | | | | | | | | | | Impact: cleanup Fixes style problems: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> ERROR: space required before the open parenthesis '(' total: 1 errors, 1 warnings Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* Merge branch 'linus' into x86/xenIngo Molnar2008-10-12
|\ | | | | | | | | | | | | Conflicts: arch/x86/kernel/cpu/common.c arch/x86/kernel/process_64.c arch/x86/xen/enlighten.c
| * Merge commit 'v2.6.27-rc3' into x86/prototypesIngo Molnar2008-08-14
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: include/asm-x86/dma-mapping.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * | x86: Introducing asm/syscalls.hJaswinder Singh2008-07-22
| | | | | | | | | | | | | | | | | | Declaring arch-dependent syscalls for x86 architecture Signed-off-by: Jaswinder Singh <jaswinder@infradead.org>
* | | Merge branch 'linus' into x86/xenIngo Molnar2008-07-31
|\ \ \ | | |/ | |/|
| * | cpumask: change cpumask_of_cpu_ptr to use new cpumask_of_cpuMike Travis2008-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replace previous instances of the cpumask_of_cpu_ptr* macros with a the new (lvalue capable) generic cpumask_of_cpu(). Signed-off-by: Mike Travis <travis@sgi.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jack Steiner <steiner@sgi.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | | x86/paravirt/xen: properly fill out the ldt opsJeremy Fitzhardinge2008-07-24
|/ / | | | | | | | | | | | | | | | | LTP testing showed that Xen does not properly implement sys_modify_ldt(). This patch does the final little bits needed to make the ldt work properly. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* / cpumask: Optimize cpumask_of_cpu in arch/x86/kernel/ldt.cMike Travis2008-07-18
|/ | | | | | | | * Optimize various places where a pointer to the cpumask_of_cpu value will result in reducing stack pressure. Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* Merge branch 'generic-ipi' into generic-ipi-for-linusIngo Molnar2008-07-15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/powerpc/Kconfig arch/s390/kernel/time.c arch/x86/kernel/apic_32.c arch/x86/kernel/cpu/perfctr-watchdog.c arch/x86/kernel/i8259_64.c arch/x86/kernel/ldt.c arch/x86/kernel/nmi_64.c arch/x86/kernel/smpboot.c arch/x86/xen/smp.c include/asm-x86/hw_irq_32.h include/asm-x86/hw_irq_64.h include/asm-x86/mach-default/irq_vectors.h include/asm-x86/mach-voyager/irq_vectors.h include/asm-x86/smp.h kernel/Makefile Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * smp_call_function: get rid of the unused nonatomic/retry argumentJens Axboe2008-06-26
| | | | | | | | | | | | | | | | It's never used and the comments refer to nonatomic and retry interchangably. So get rid of it. Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* | x86: avoid re-loading LDT in unrelated address spacesJan Beulich2008-05-22
|/ | | | | | | | Performance optimization. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: cleanup - eliminate numbers in LDT allocation codeCyrill Gorcunov2008-02-04
| | | | | | | | | | | | | | | | | | | This patch eliminates numbers in LDT allocation code trying to make it clear to understand from where these numbers come. No code changed: text data bss dec hex filename 1896 0 0 1896 768 ldt.o.before 1896 0 0 1896 768 ldt.o.after md5: 6cbec8705008ddb4b704aade60bceda3 ldt.o.before.asm 6cbec8705008ddb4b704aade60bceda3 ldt.o.after.asm Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: adjust/fix LDT handling for XenJan Beulich2008-01-30
| | | | | | | | | | | | | | | | | | | Based on patch from Jan Beulich <jbeulich@novell.com>. Don't rely on kmalloc(PAGE_SIZE) returning PAGE_SIZE aligned memory (Xen requires GDT *and* LDT to be page-aligned). Using the page allocator interface also removes the (albeit small) slab allocator overhead. The same change being done for 64-bits for consistency. Further, the Xen hypercall interface expects the LDT address to be virtual, not machine. [ Adjusted to unified ldt.c - Jeremy ] Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: change write_ldt_entry signatureGlauber de Oliveira Costa2008-01-30
| | | | | | | | | | this patch changes the signature of write_ldt_entry. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> CC: Zachary Amsden <zach@vmware.com> CC: Jeremy Fitzhardinge <Jeremy.Fitzhardinge.citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: introduce fill_ldtGlauber de Oliveira Costa2008-01-30
| | | | | | | | | | This patch introduces fill_ldt(), which populates a ldt descriptor from a user_desc in once, instead of relying in the LDT_entry_a and LDT_entry_b macros Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: modify write_ldt functionGlauber de Oliveira Costa2008-01-30
| | | | | | | | | | This patch modifies the write_ldt() function to make use of the new struct desc_struct instead of entry_1 and entry_2 entries Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* x86: merge arch/x86/kernel/ldt_32/64.cThomas Gleixner2008-01-30
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
index to the start of the queue. */ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index); /** * rt2x00queue_stop_queues - Halt all data queues * @rt2x00dev: Pointer to &struct rt2x00_dev. * * This function will loop through all available queues to stop * any pending outgoing frames. */ void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev); /** * rt2x00queue_init_queues - Initialize all data queues * @rt2x00dev: Pointer to &struct rt2x00_dev. * * This function will loop through all available queues to clear all * index numbers and set the queue entry to the correct initialization * state. */ void rt2x00queue_init_queues(struct rt2x00_dev *rt2x00dev); int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev); void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev); int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev); void rt2x00queue_free(struct rt2x00_dev *rt2x00dev); /** * rt2x00link_update_stats - Update link statistics from RX frame * @rt2x00dev: Pointer to &struct rt2x00_dev. * @skb: Received frame * @rxdesc: Received frame descriptor * * Update link statistics based on the information from the * received frame descriptor. */ void rt2x00link_update_stats(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb, struct rxdone_entry_desc *rxdesc); /** * rt2x00link_start_tuner - Start periodic link tuner work * @rt2x00dev: Pointer to &struct rt2x00_dev. * * This start the link tuner periodic work, this work will * be executed periodically until &rt2x00link_stop_tuner has * been called. */ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev); /** * rt2x00link_stop_tuner - Stop periodic link tuner work * @rt2x00dev: Pointer to &struct rt2x00_dev. * * After this function completed the link tuner will not * be running until &rt2x00link_start_tuner is called. */ void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev); /** * rt2x00link_reset_tuner - Reset periodic link tuner work * @rt2x00dev: Pointer to &struct rt2x00_dev. * @antenna: Should the antenna tuning also be reset * * The VGC limit configured in the hardware will be reset to 0 * which forces the driver to rediscover the correct value for * the current association. This is needed when configuration * options have changed which could drastically change the * SNR level or link quality (i.e. changing the antenna setting). * * Resetting the link tuner will also cause the periodic work counter * to be reset. Any driver which has a fixed limit on the number * of rounds the link tuner is supposed to work will accept the * tuner actions again if this limit was previously reached. * * If @antenna is set to true a the software antenna diversity * tuning will also be reset. */ void rt2x00link_reset_tuner(struct rt2x00_dev *rt2x00dev, bool antenna); /** * rt2x00link_register - Initialize link tuning functionality * @rt2x00dev: Pointer to &struct rt2x00_dev. * * Initialize work structure and all link tuning related * parameters. This will not start the link tuning process itself. */ void rt2x00link_register(struct rt2x00_dev *rt2x00dev); /* * Firmware handlers. */ #ifdef CONFIG_RT2X00_LIB_FIRMWARE int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev); void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev); #else static inline int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev) { return 0; } static inline void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev) { } #endif /* CONFIG_RT2X00_LIB_FIRMWARE */ /* * Debugfs handlers. */ #ifdef CONFIG_RT2X00_LIB_DEBUGFS void rt2x00debug_register(struct rt2x00_dev *rt2x00dev); void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev); void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev, struct rxdone_entry_desc *rxdesc); #else static inline void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) { } static inline void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev) { } static inline void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev, struct rxdone_entry_desc *rxdesc) { } #endif /* CONFIG_RT2X00_LIB_DEBUGFS */ /* * Crypto handlers. */ #ifdef CONFIG_RT2X00_LIB_CRYPTO enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key); void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, struct txentry_desc *txdesc); unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb); void rt2x00crypto_tx_copy_iv(struct sk_buff *skb, struct txentry_desc *txdesc); void rt2x00crypto_tx_remove_iv(struct sk_buff *skb, struct txentry_desc *txdesc); void rt2x00crypto_tx_insert_iv(struct sk_buff *skb, unsigned int header_length); void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, unsigned int header_length, struct rxdone_entry_desc *rxdesc); #else static inline enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key) { return CIPHER_NONE; } static inline void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, struct txentry_desc *txdesc) { } static inline unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) { return 0; } static inline void rt2x00crypto_tx_copy_iv(struct sk_buff *skb, struct txentry_desc *txdesc) { } static inline void rt2x00crypto_tx_remove_iv(struct sk_buff *skb, struct txentry_desc *txdesc) { } static inline void rt2x00crypto_tx_insert_iv(struct sk_buff *skb, unsigned int header_length) { } static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, unsigned int header_length, struct rxdone_entry_desc *rxdesc) { } #endif /* CONFIG_RT2X00_LIB_CRYPTO */ /* * HT handlers. */ #ifdef CONFIG_RT2X00_LIB_HT void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, struct txentry_desc *txdesc, const struct rt2x00_rate *hwrate); #else static inline void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, struct txentry_desc *txdesc, const struct rt2x00_rate *hwrate) { } #endif /* CONFIG_RT2X00_LIB_HT */ /* * RFkill handlers. */ static inline void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev) { if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) wiphy_rfkill_start_polling(rt2x00dev->hw->wiphy); } static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev) { if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) wiphy_rfkill_stop_polling(rt2x00dev->hw->wiphy); } /* * LED handlers */ #ifdef CONFIG_RT2X00_LIB_LEDS void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi); void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled); void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled); void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled); void rt2x00leds_register(struct rt2x00_dev *rt2x00dev); void rt2x00leds_unregister(struct rt2x00_dev *rt2x00dev); void rt2x00leds_suspend(struct rt2x00_dev *rt2x00dev); void rt2x00leds_resume(struct rt2x00_dev *rt2x00dev); #else static inline void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi) { } static inline void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled) { } static inline void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled) { } static inline void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled) { } static inline void rt2x00leds_register(struct rt2x00_dev *rt2x00dev) { } static inline void rt2x00leds_unregister(struct rt2x00_dev *rt2x00dev) { } static inline void rt2x00leds_suspend(struct rt2x00_dev *rt2x00dev) { } static inline void rt2x00leds_resume(struct rt2x00_dev *rt2x00dev) { } #endif /* CONFIG_RT2X00_LIB_LEDS */ #endif /* RT2X00LIB_H */