direct-io.hg

view patches/linux-2.6.16.29/net-csum.patch @ 11750:d845c9522d9e

[HVM][SVM] Check if SVM is disabled by the BIOS before enabling it.

Newer BIOS implementations will be able to disable the SVM feature,
although an additional test of an MSR (VMCR 0xC0010114 bit 4) is
necessary (set equals disabled). Bit 4 of MSR 0xc0010114 returns 0
(SVM enabled) on machines with older BIOS' without the SVM disable
feature support.

Signed-off-by: Wei Huang <wei.huang2@amd.com>=20
Signed-off-by: Tom Woller <thomas.woller@amd.com>=20
author kfraser@localhost.localdomain
date Thu Oct 12 16:12:10 2006 +0100 (2006-10-12)
parents 041be3f6b38e
children
line source
1 diff -pruN ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
2 --- ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-09-12 19:02:10.000000000 +0100
3 +++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-09-19 13:59:15.000000000 +0100
4 @@ -129,7 +129,12 @@ tcp_manip_pkt(struct sk_buff **pskb,
5 if (hdrsize < sizeof(*hdr))
6 return 1;
8 - hdr->check = ip_nat_cheat_check(~oldip, newip,
9 +#ifdef CONFIG_XEN
10 + if ((*pskb)->proto_csum_blank)
11 + hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
12 + else
13 +#endif
14 + hdr->check = ip_nat_cheat_check(~oldip, newip,
15 ip_nat_cheat_check(oldport ^ 0xFFFF,
16 newport,
17 hdr->check));
18 diff -pruN ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
19 --- ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_udp.c 2006-09-12 19:02:10.000000000 +0100
20 +++ ./net/ipv4/netfilter/ip_nat_proto_udp.c 2006-09-19 13:59:15.000000000 +0100
21 @@ -113,11 +113,17 @@ udp_manip_pkt(struct sk_buff **pskb,
22 newport = tuple->dst.u.udp.port;
23 portptr = &hdr->dest;
24 }
25 - if (hdr->check) /* 0 is a special case meaning no checksum */
26 - hdr->check = ip_nat_cheat_check(~oldip, newip,
27 + if (hdr->check) { /* 0 is a special case meaning no checksum */
28 +#ifdef CONFIG_XEN
29 + if ((*pskb)->proto_csum_blank)
30 + hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
31 + else
32 +#endif
33 + hdr->check = ip_nat_cheat_check(~oldip, newip,
34 ip_nat_cheat_check(*portptr ^ 0xFFFF,
35 newport,
36 hdr->check));
37 + }
38 *portptr = newport;
39 return 1;
40 }
41 diff -pruN ../orig-linux-2.6.16.29/net/ipv4/xfrm4_output.c ./net/ipv4/xfrm4_output.c
42 --- ../orig-linux-2.6.16.29/net/ipv4/xfrm4_output.c 2006-09-12 19:02:10.000000000 +0100
43 +++ ./net/ipv4/xfrm4_output.c 2006-09-19 13:59:15.000000000 +0100
44 @@ -17,6 +17,8 @@
45 #include <net/xfrm.h>
46 #include <net/icmp.h>
48 +extern int skb_checksum_setup(struct sk_buff *skb);
49 +
50 /* Add encapsulation header.
51 *
52 * In transport mode, the IP header will be moved forward to make space
53 @@ -103,6 +105,10 @@ static int xfrm4_output_one(struct sk_bu
54 struct xfrm_state *x = dst->xfrm;
55 int err;
57 + err = skb_checksum_setup(skb);
58 + if (err)
59 + goto error_nolock;
60 +
61 if (skb->ip_summed == CHECKSUM_HW) {
62 err = skb_checksum_help(skb, 0);
63 if (err)