Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86_misc_for_7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 updates from Dave Hansen:
"The usual smattering of x86/misc changes.

The IPv6 patch in here surprised me in a couple of ways. First, the
function it inlines is able to eat a lot more CPU time than I would
have expected. Second, the inlining does not seem to bloat the kernel,
at least in the configs folks have tested.

- Inline x86-specific IPv6 checksum helper

- Update IOMMU docs to use stable identifiers

- Print unhashed pointers on fatal stack overflows"

* tag 'x86_misc_for_7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/traps: Print unhashed pointers on stack overflow
Documentation/x86: Update IOMMU spec references to use stable identifiers
x86/lib: Inline csum_ipv6_magic()

+39 -39
+4 -3
Documentation/arch/x86/iommu.rst
··· 2 2 x86 IOMMU Support 3 3 ================= 4 4 5 - The architecture specs can be obtained from the below locations. 5 + The architecture specs can be obtained from the vendor websites. 6 + Search for the following documents to obtain the latest versions: 6 7 7 - - Intel: http://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/vt-directed-io-spec.pdf 8 - - AMD: https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/specifications/48882_3_07_PUB.pdf 8 + - Intel: Intel Virtualization Technology for Directed I/O Architecture Specification (ID: D51397) 9 + - AMD: AMD I/O Virtualization Technology (IOMMU) Specification (ID: 48882) 9 10 10 11 This guide gives a quick cheat sheet for some basic understanding. 11 12
+34 -13
arch/x86/include/asm/checksum_64.h
··· 9 9 */ 10 10 11 11 #include <linux/compiler.h> 12 + #include <linux/in6.h> 12 13 #include <asm/byteorder.h> 13 14 14 15 /** ··· 146 145 */ 147 146 extern __sum16 ip_compute_csum(const void *buff, int len); 148 147 148 + static inline unsigned add32_with_carry(unsigned a, unsigned b) 149 + { 150 + asm("addl %2,%0\n\t" 151 + "adcl $0,%0" 152 + : "=r" (a) 153 + : "0" (a), "rm" (b)); 154 + return a; 155 + } 156 + 157 + #define _HAVE_ARCH_IPV6_CSUM 1 158 + 149 159 /** 150 160 * csum_ipv6_magic - Compute checksum of an IPv6 pseudo header. 151 161 * @saddr: source address ··· 170 158 * Returns the unfolded 32bit checksum. 171 159 */ 172 160 173 - struct in6_addr; 174 - 175 - #define _HAVE_ARCH_IPV6_CSUM 1 176 - extern __sum16 177 - csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, 178 - __u32 len, __u8 proto, __wsum sum); 179 - 180 - static inline unsigned add32_with_carry(unsigned a, unsigned b) 161 + static inline __sum16 csum_ipv6_magic( 162 + const struct in6_addr *_saddr, const struct in6_addr *_daddr, 163 + __u32 len, __u8 proto, __wsum sum) 181 164 { 182 - asm("addl %2,%0\n\t" 183 - "adcl $0,%0" 184 - : "=r" (a) 185 - : "0" (a), "rm" (b)); 186 - return a; 165 + const unsigned long *saddr = (const unsigned long *)_saddr; 166 + const unsigned long *daddr = (const unsigned long *)_daddr; 167 + __u64 sum64; 168 + 169 + sum64 = (__force __u64)htonl(len) + (__force __u64)htons(proto) + 170 + (__force __u64)sum; 171 + 172 + asm(" addq %1,%[sum64]\n" 173 + " adcq %2,%[sum64]\n" 174 + " adcq %3,%[sum64]\n" 175 + " adcq %4,%[sum64]\n" 176 + " adcq $0,%[sum64]\n" 177 + 178 + : [sum64] "+r" (sum64) 179 + : "m" (saddr[0]), "m" (saddr[1]), 180 + "m" (daddr[0]), "m" (daddr[1])); 181 + 182 + return csum_fold( 183 + (__force __wsum)add32_with_carry(sum64 & 0xffffffff, sum64>>32)); 187 184 } 188 185 189 186 #define HAVE_ARCH_CSUM_ADD
+1 -1
arch/x86/kernel/traps.c
··· 549 549 { 550 550 const char *name = stack_type_name(info->type); 551 551 552 - printk(KERN_EMERG "BUG: %s stack guard page was hit at %p (stack is %p..%p)\n", 552 + printk(KERN_EMERG "BUG: %s stack guard page was hit at %px (stack is %px..%px)\n", 553 553 name, (void *)fault_address, info->begin, info->end); 554 554 555 555 die("stack guard page", regs, 0);
-22
arch/x86/lib/csum-wrappers_64.c
··· 68 68 } 69 69 EXPORT_SYMBOL(csum_partial_copy_nocheck); 70 70 71 - __sum16 csum_ipv6_magic(const struct in6_addr *saddr, 72 - const struct in6_addr *daddr, 73 - __u32 len, __u8 proto, __wsum sum) 74 - { 75 - __u64 rest, sum64; 76 - 77 - rest = (__force __u64)htonl(len) + (__force __u64)htons(proto) + 78 - (__force __u64)sum; 79 - 80 - asm(" addq (%[saddr]),%[sum]\n" 81 - " adcq 8(%[saddr]),%[sum]\n" 82 - " adcq (%[daddr]),%[sum]\n" 83 - " adcq 8(%[daddr]),%[sum]\n" 84 - " adcq $0,%[sum]\n" 85 - 86 - : [sum] "=r" (sum64) 87 - : "[sum]" (rest), [saddr] "r" (saddr), [daddr] "r" (daddr)); 88 - 89 - return csum_fold( 90 - (__force __wsum)add32_with_carry(sum64 & 0xffffffff, sum64>>32)); 91 - } 92 - EXPORT_SYMBOL(csum_ipv6_magic);