]> err.no Git - linux-2.6/log
linux-2.6
17 years ago[TCP] Highspeed: Limited slow-start is nowadays in tcp_slow_start
Ilpo Järvinen [Thu, 3 May 2007 20:28:35 +0000 (13:28 -0700)]
[TCP] Highspeed: Limited slow-start is nowadays in tcp_slow_start

Reuse limited slow-start (RFC3742) included into tcp_cong instead
of having another implementation in High Speed TCP.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Update version and reldate.
Michael Chan [Thu, 3 May 2007 20:25:32 +0000 (13:25 -0700)]
[BNX2]: Update version and reldate.

Update version to 1.5.10.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Print bus information for PCIE devices.
Michael Chan [Thu, 3 May 2007 20:25:11 +0000 (13:25 -0700)]
[BNX2]: Print bus information for PCIE devices.

Fix the code to print PCI or PCIE bus information for all devices.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add 1-shot MSI handler for 5709.
Michael Chan [Thu, 3 May 2007 20:24:48 +0000 (13:24 -0700)]
[BNX2]: Add 1-shot MSI handler for 5709.

The 5709 supports the one-shot MSI handler similar to some of the tg3
chips.  In this mode, the MSI disables itself automatically until it
is re-enabled at the end of NAPI poll.

Put the request_irq/free_irq logic in common procedures.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Restructure PHY event handling.
Michael Chan [Thu, 3 May 2007 20:24:23 +0000 (13:24 -0700)]
[BNX2]: Restructure PHY event handling.

Restructure by adding bnx2_phy_event_is_set() to make code cleaner
and easier to understand.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add indirect spinlock.
Michael Chan [Thu, 3 May 2007 20:24:05 +0000 (13:24 -0700)]
[BNX2]: Add indirect spinlock.

The indirect register access method will be used by more than one
caller in BH context (NAPI poll and timer), so a spinlock is required.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add support for 5709 Serdes.
Michael Chan [Thu, 3 May 2007 20:23:41 +0000 (13:23 -0700)]
[BNX2]: Add support for 5709 Serdes.

Add PCI ID and code to support the 5709 Serdes PHY.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Re-structure the 2.5G Serdes code.
Michael Chan [Thu, 3 May 2007 20:23:13 +0000 (13:23 -0700)]
[BNX2]: Re-structure the 2.5G Serdes code.

Add some common procedures to handle enabling and disabling 2.5G.
Add some missing code to resolve flow control.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Put MII register offsets in the bnx2 struct.
Michael Chan [Thu, 3 May 2007 20:22:52 +0000 (13:22 -0700)]
[BNX2]: Put MII register offsets in the bnx2 struct.

The 5709 Serdes device uses non-standard MII register offsets.  This
re-structuring will make it easier to support 5709 Serdes.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add ipv6 TSO and checksum for 5709.
Michael Chan [Thu, 3 May 2007 20:22:28 +0000 (13:22 -0700)]
[BNX2]: Add ipv6 TSO and checksum for 5709.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Update 5709 firmware.
Michael Chan [Thu, 3 May 2007 20:21:48 +0000 (13:21 -0700)]
[BNX2]: Update 5709 firmware.

Add ipv6 TSO support in firmware.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Update 5708 firmware.
Michael Chan [Thu, 3 May 2007 20:21:13 +0000 (13:21 -0700)]
[BNX2]: Update 5708 firmware.

This fixes the problem of not counting all dropped multicast packets.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Save PCI state during suspend.
Michael Chan [Thu, 3 May 2007 20:20:40 +0000 (13:20 -0700)]
[BNX2]: Save PCI state during suspend.

This is needed to save the MSI state which will be lost during
suspend.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Fix race conditions when calling register_netdev().
Michael Chan [Thu, 3 May 2007 20:20:19 +0000 (13:20 -0700)]
[BNX2]: Fix race conditions when calling register_netdev().

Hot-plug scripts can call bnx2_open() as soon as register_netdev() is
called in bnx2_init_one().  We need to call pci_set_drvdata() and
setup everything before calling register_netdev(). netif_carrier_off()
also needs to be moved to bnx2_open() to avoid race conditions with
the irq.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Add 40-bit DMA workaround for 5708.
Michael Chan [Thu, 3 May 2007 20:19:18 +0000 (13:19 -0700)]
[BNX2]: Add 40-bit DMA workaround for 5708.

The internal PCIE-to-PCIX bridge of the 5708 has the same 40-bit DMA
limitation as some of the tg3 chips.  Set dma_mask and persistent DMA
mask to 40-bit to workaround.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Fix register and memory test on 5709.
Michael Chan [Thu, 3 May 2007 20:18:46 +0000 (13:18 -0700)]
[BNX2]: Fix register and memory test on 5709.

Tweak registers and memory test range for 5709.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Block MII access when ifdown.
Michael Chan [Thu, 3 May 2007 20:18:03 +0000 (13:18 -0700)]
[BNX2]: Block MII access when ifdown.

The device may be in D3hot state and should not allow MII register
access.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[ETHTOOL]: Add 2.5G bit definitions.
Michael Chan [Thu, 3 May 2007 20:17:25 +0000 (13:17 -0700)]
[ETHTOOL]: Add 2.5G bit definitions.

Add 2.5G supported and advertising bit definitions.  2.5G is supported
by the bnx2 driver.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[ARM] 4227/1: minor head.S fixups
Nicolas Pitre [Wed, 21 Feb 2007 14:58:13 +0000 (15:58 +0100)]
[ARM] 4227/1: minor head.S fixups

Let's surround constructs like:

orr r3, r3, #(KERNEL_RAM_PADDR & 0x00f00000)

between .if .endif since (KERNEL_RAM_PADDR & 0x00f00000) is 0 in 99% of
all cases.

Also let's mask PHYS_OFFSET with 0x00f00000 instead of 0x00e00000.
Section mappings are really 1MB not 2MB and the 2MB groupping is
a higher level issue already much better enforced with

#if (PHYS_OFFSET & 0x001fffff)
#error "PHYS_OFFSET must be at an even 2MiB boundary!"
#endif

at the top of the file.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4328/1: Move i.MX UART regs to driver
Sascha Hauer [Thu, 26 Apr 2007 07:26:13 +0000 (08:26 +0100)]
[ARM] 4328/1: Move i.MX UART regs to driver

This patch moves the i.MX UART register descriptions from
include/asm-arm/arch-imx/imx-regs.h to the serial driver itself.
This helps using the driver on other architectures like mx31

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4329/1: fix position of NETX_SYSTEM_REG
Sascha Hauer [Thu, 26 Apr 2007 07:34:41 +0000 (08:34 +0100)]
[ARM] 4329/1: fix position of NETX_SYSTEM_REG

This patch fixes the position of the netx reset control register

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4355/2: AT91: SAM9260-EK and SAM9263-EK board updates
Andrew Victor [Thu, 3 May 2007 13:39:41 +0000 (14:39 +0100)]
[ARM] 4355/2: AT91: SAM9260-EK and SAM9263-EK board updates

Various small changes for the Atmel AT91SAM9260-EK and AT91SAM9263-EK
boards.

SAM9260-EK:
  - Register I2C device.

SAM9263-EK:
  - Add platform_data and register MACB device.
    (Patch by Nicolas Ferre)
  - Add platform_data and register AC97 device.
    (Patch by Nicolas Ferre)
  - Register I2C device.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] ecard: Convert card type enum to a flag
Russell King [Thu, 3 May 2007 09:47:37 +0000 (10:47 +0100)]
[ARM] ecard: Convert card type enum to a flag

'type' in the struct expansion_card is only used to indicate
whether this card is an EASI card or not.  Therefore, having
it as an enum is wasteful (and introduces additional noise
when we come to remove the enum.)  Convert it to a mere flag
instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] ecard: Move private ecard junk out of asm/ecard.h
Russell King [Thu, 3 May 2007 09:20:47 +0000 (10:20 +0100)]
[ARM] ecard: Move private ecard junk out of asm/ecard.h

Move ecard.c private junk from asm/ecard.h to a local header file.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] ecard: silence new warning caused by previous commit
Russell King [Thu, 3 May 2007 09:55:46 +0000 (10:55 +0100)]
[ARM] ecard: silence new warning caused by previous commit

PTR_ERR()'s type is unsigned long, so formats when printing
must be %ld, not %d.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] ecard: convert to use the kthread API
Eric W. Biederman [Thu, 26 Apr 2007 07:04:40 +0000 (00:04 -0700)]
[ARM] ecard: convert to use the kthread API

This patch modifies the startup of kecardd to use kthread_run not a
kernel_thread combination of kernel_thread and daemonize.  Making the code
slightly simpler and more maintainable.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] Add support for ICSIDE interface on RiscPC
Russell King [Thu, 3 May 2007 08:55:52 +0000 (09:55 +0100)]
[ARM] Add support for ICSIDE interface on RiscPC

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] Add platform support for PATA on RiscPC
Russell King [Sat, 21 Apr 2007 14:55:06 +0000 (15:55 +0100)]
[ARM] Add platform support for PATA on RiscPC

Add pata_platform device for RiscPC, thereby converting the primary
IDE channel on the machine to PATA.

Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] Set coherent DMA mask for Acorn expansion cards
Russell King [Mon, 2 Apr 2007 12:53:15 +0000 (13:53 +0100)]
[ARM] Set coherent DMA mask for Acorn expansion cards

Although expansion cards can't do bus-master DMA, subsystems
want to be able to use coherent memory for DMA purposes to
these cards.  Therefore, set the coherent DMA mask to allow
such memory to be allocated.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4357/1: AT91: Support slower serial baud-rates
Andrew Victor [Thu, 3 May 2007 11:26:24 +0000 (12:26 +0100)]
[ARM] 4357/1: AT91: Support slower serial baud-rates

Allow slower serial baud-rates by switching the UART clock from MCK to
MCK/8.

Based on patches by Mike Wolfram and Russell King.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4354/1: AT91: Support ADS7846 touchsceen on SAM9263-EK board
Andrew Victor [Wed, 2 May 2007 17:00:45 +0000 (18:00 +0100)]
[ARM] 4354/1: AT91: Support ADS7846 touchsceen on SAM9263-EK board

Add support for the ADS7846 Touchscreen found on the Atmel
AT91SAM9263-EK board.

Signed-off-by: Nicolas Ferre <nicolas.ferre@rfo.atmel.com>
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4353/1: AT91: Support ADS7846 touchsceen on SAM9261-EK board
Andrew Victor [Wed, 2 May 2007 16:58:51 +0000 (17:58 +0100)]
[ARM] 4353/1: AT91: Support ADS7846 touchsceen on SAM9261-EK board

Add support for the ADS7846 Touchscreen found on the Atmel
AT91SAM9261-EK board.

Original patch by Morten Larsen.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4352/1: AT91: Platform data for LCD and AC97.
Andrew Victor [Wed, 2 May 2007 16:46:49 +0000 (17:46 +0100)]
[ARM] 4352/1: AT91: Platform data for LCD and AC97.

Define resources, platform_device and device registration functions for
the LCD and AC97 controllers on the AT91SAM9263.
Also update the AT91SAM9261 to use the common atmel_lcdfb driver.

Signed-off-by: Nicolas Ferre <nicolas.ferre@rfo.atmel.com>
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4351/1: AT91: Define rest of peripheral clocks
Andrew Victor [Wed, 2 May 2007 16:14:57 +0000 (17:14 +0100)]
[ARM] 4351/1: AT91: Define rest of peripheral clocks

Define and register the remaining peripheral clocks for the AT91
processors.

AT91SAM9261 clocks patch by Ivan Zhakov.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4350/1: AT91: Hardware header for ADC peripheral
Andrew Victor [Wed, 2 May 2007 16:08:13 +0000 (17:08 +0100)]
[ARM] 4350/1: AT91: Hardware header for ADC peripheral

Definitions for Analog-to-Digital Converter (ADC) found on the Atmel
AT91SAM9260 processor.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4356/1: arm: fix handling of svc mode undefined instructions
Dan Williams [Wed, 2 May 2007 23:18:34 +0000 (00:18 +0100)]
[ARM] 4356/1: arm: fix handling of svc mode undefined instructions

Now that do_undefinstr handles kernel and user mode undefined
instruction exceptions it must not assume that interrupts are enabled at
entry.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4342/2: iop13xx: add resource definitions for the tpmi units
Dan Williams [Wed, 2 May 2007 16:47:47 +0000 (17:47 +0100)]
[ARM] 4342/2:  iop13xx: add resource definitions for the tpmi units

The tpmi units interface with the SAS controller on iop348.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] 4348/4: iop3xx: Give Linux control over PCI initialization
Dan Williams [Wed, 2 May 2007 16:59:44 +0000 (17:59 +0100)]
[ARM] 4348/4:  iop3xx: Give Linux control over PCI initialization

Currently the iop3xx platform support code assumes that RedBoot is the
bootloader and has already initialized the ATU.  Linux should handle this
initialization for three reasons:

1/ The memory map that RedBoot sets up is not optimal (page_to_dma and
virt_to_phys return different addresses).  The effect of this is that using
the dma mapping API for the internal bus dma units generates pci bus
addresses that are incorrect for the internal bus.

2/ Not all iop platforms use RedBoot

3/ If the ATU is already initialized it indicates that the iop is an add-in
card in another host, it does not own the PCI bus, and should not be
re-initialized.

Changelog:
* rather than change nr_controllers to zero, simply do not call
  pci_common_init

Cc: Lennert Buytenhek <kernel@wantstofly.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[NETFILTER]: bridge netfilter: consolidate header pushing/pulling code
Patrick McHardy [Thu, 3 May 2007 10:36:16 +0000 (03:36 -0700)]
[NETFILTER]: bridge netfilter: consolidate header pushing/pulling code

Consolidate the common push/pull sequences into a few helper functions.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: sip: Fix RTP address NAT
Herbert Xu [Thu, 3 May 2007 10:35:31 +0000 (03:35 -0700)]
[NETFILTER]: sip: Fix RTP address NAT

I needed to use this recently to talk to a Cisco server.  In my case
I only did SNAT while the Cisco server used a different address for
RTP traffic than the one for SIP.  I discovered that nf_nat_sip NATed
the RTP address to the SIP one which was unnecessary but OK.  However,
in doing so it did not DNAT the destination address on the RTP traffic
to the Cisco back to the original RTP address.

This patch corrects this by noting down the RTP address and using it
when the expectation fires.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: nf_nat_proto_gre: do not modify/corrupt GREv0 packets through NAT
Jorge Boncompte [Thu, 3 May 2007 10:34:42 +0000 (03:34 -0700)]
[NETFILTER]: nf_nat_proto_gre: do not modify/corrupt GREv0 packets through NAT

While porting some changes of the 2.6.21-rc7 pptp/proto_gre conntrack
and nat modules to a 2.4.32 kernel I noticed that the gre_key function
returns a wrong pointer to the GRE key of a version 0 packet thus
corrupting the packet payload.

The intended behaviour for GREv0 packets is to act like
nf_conntrack_proto_generic/nf_nat_proto_unknown so I have ripped the
offending functions (not used anymore) and modified the
nf_nat_proto_gre modules to not touch version 0 (non PPTP) packets.

Signed-off-by: Jorge Boncompte <jorge@dti2.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: ipt_DNAT: accept port randomization option
Patrick McHardy [Thu, 3 May 2007 10:34:03 +0000 (03:34 -0700)]
[NETFILTER]: ipt_DNAT: accept port randomization option

Also accept the --random option for DNAT to allow randomly selecting a
destination port from the given range.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: Use S+L catcher only with SACK for now
Ilpo Järvinen [Thu, 3 May 2007 10:30:34 +0000 (03:30 -0700)]
[TCP]: Use S+L catcher only with SACK for now

TCP has a transitional state when SACK is not in use during
which this invariant is temporarily broken. Without SACK,
tcp_clean_rtx_queue does not decrement sacked_out. Therefore
calls to tcp_sync_left_out before sacked_out is again
corrected by tcp_fastretrans_alert can trigger this trap as
sacked_out still has couple of segments that are already out
of window.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Adjust the new netdevice scanning code
David Howells [Thu, 3 May 2007 10:29:41 +0000 (03:29 -0700)]
[AFS]: Adjust the new netdevice scanning code

Adjust the new netdevice scanning code provided by Patrick McHardy:

 (1) Restore the function banner comments that were dropped.

 (2) Rather than using an array size of 6 in some places and an array size of
     ETH_ALEN in others, pass a pointer instead and pass the array size
     through so that we can actually check it.

 (3) Do the buffer fill count check before checking the for_primary_ifa
     condition again.  This permits us to skip that check should maxbufs be
     reached before we run out of interfaces.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Replace rtnetlink client by direct dev_base walking
Patrick McHardy [Thu, 3 May 2007 10:28:49 +0000 (03:28 -0700)]
[AFS]: Replace rtnetlink client by direct dev_base walking

Replace the large and complicated rtnetlink client by two simple
functions for getting the MAC address for the first ethernet device
and building a list of IPv4 addresses.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: Add __dev_getfirstbyhwtype
Patrick McHardy [Thu, 3 May 2007 10:28:13 +0000 (03:28 -0700)]
[NET]: Add __dev_getfirstbyhwtype

Add __dev_getfirstbyhwtype for callers that don't want a reference but
some data from the device and thus need to take the rtnl anyway.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Fix memory leak in SRXAFSCB_GetCapabilities
Patrick McHardy [Thu, 3 May 2007 10:27:39 +0000 (03:27 -0700)]
[AFS]: Fix memory leak in SRXAFSCB_GetCapabilities

The interface array is not freed on exit.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETLINK]: Fix use after free in netlink_recvmsg
Patrick McHardy [Thu, 3 May 2007 10:27:01 +0000 (03:27 -0700)]
[NETLINK]: Fix use after free in netlink_recvmsg

When the user passes in MSG_TRUNC the skb is used after getting freed.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETLINK]: Kill CB only when socket is unused
Herbert Xu [Thu, 3 May 2007 10:17:14 +0000 (03:17 -0700)]
[NETLINK]: Kill CB only when socket is unused

Since we can still receive packets until all references to the
socket are gone, we don't need to kill the CB until that happens.
This also aligns ourselves with the receive queue purging which
happens at that point.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET] skbuff: fix kernel-doc
Randy Dunlap [Thu, 3 May 2007 10:16:20 +0000 (03:16 -0700)]
[NET] skbuff: fix kernel-doc

Fix skbuff.h kernel-doc:
linux-2.6.21-git4//include/linux/skbuff.h:316): No description found for parameter 'transport_header'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: Delete unused header file net/ipv4/tcp_yeah.h.
Robert P. J. Day [Thu, 3 May 2007 10:13:35 +0000 (03:13 -0700)]
[TCP]: Delete unused header file net/ipv4/tcp_yeah.h.

Delete the apparently unused header file net/ipv4/tcp_yeah.h.

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Fix use of __exit functions from __init path
David Howells [Thu, 3 May 2007 10:12:46 +0000 (03:12 -0700)]
[AFS]: Fix use of __exit functions from __init path

Fix use of __exit functions from __init path.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS/AF_RXRPC]: Miscellaneous fixes.
David Howells [Thu, 3 May 2007 10:11:29 +0000 (03:11 -0700)]
[AFS/AF_RXRPC]: Miscellaneous fixes.

Make miscellaneous fixes to AFS and AF_RXRPC:

 (*) Make AF_RXRPC select KEYS rather than RXKAD or AFS_FS in Kconfig.

 (*) Don't use FS_BINARY_MOUNTDATA.

 (*) Remove a done 'TODO' item in a comemnt on afs_get_sb().

 (*) Don't pass a void * as the page pointer argument of kmap_atomic() as this
     breaks on m68k.  Patch from Geert Uytterhoeven <geert@linux-m68k.org>.

 (*) Use match_*() functions rather than doing my own parsing.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AFS]: Make the match_*() functions take const options.
David Howells [Thu, 3 May 2007 10:10:39 +0000 (03:10 -0700)]
[AFS]: Make the match_*() functions take const options.

Make the match_*() functions take a const pointer to the options table
and make strings pointers in the options table const too.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6]: Get rid of __HAVE_ARCH_ADDR_SET.
Eric Dumazet [Thu, 3 May 2007 10:08:43 +0000 (03:08 -0700)]
[IPV6]: Get rid of __HAVE_ARCH_ADDR_SET.

__HAVE_ARCH_ADDR_SET seems unused these days, just get rid of it.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoKVM: Remove unused 'instruction_length'
Avi Kivity [Sun, 29 Apr 2007 13:25:49 +0000 (16:25 +0300)]
KVM: Remove unused 'instruction_length'

As we no longer emulate in userspace, this is meaningless.  We don't
compute it on SVM anyway.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Don't require explicit indication of completion of mmio or pio
Avi Kivity [Sun, 29 Apr 2007 12:02:17 +0000 (15:02 +0300)]
KVM: Don't require explicit indication of completion of mmio or pio

It is illegal not to return from a pio or mmio request without completing
it, as mmio or pio is an atomic operation.  Therefore, we can simplify
the userspace interface by avoiding the completion indication.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Remove extraneous guest entry on mmio read
Avi Kivity [Wed, 14 Mar 2007 13:54:54 +0000 (15:54 +0200)]
KVM: Remove extraneous guest entry on mmio read

When emulating an mmio read, we actually emulate twice: once to determine
the physical address of the mmio, and, after we've exited to userspace to
get the mmio value, we emulate again to place the value in the result
register and update any flags.

But we don't really need to enter the guest again for that, only to take
an immediate vmexit.  So, if we detect that we're doing an mmio read,
emulate a single instruction before entering the guest again.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: SVM: Only save/restore MSRs when needed
Anthony Liguori [Sun, 29 Apr 2007 08:56:06 +0000 (11:56 +0300)]
KVM: SVM: Only save/restore MSRs when needed

We only have to save/restore MSR_GS_BASE on every VMEXIT.  The rest can be
saved/restored when we leave the VCPU.  Since we don't emulate the DEBUGCTL
MSRs and the guest cannot write to them, we don't have to worry about
saving/restoring them at all.

This shaves a whopping 40% off raw vmexit costs on AMD.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: fix an if() condition
Adrian Bunk [Sat, 28 Apr 2007 19:20:48 +0000 (21:20 +0200)]
KVM: fix an if() condition

It might have worked in this case since PT_PRESENT_MASK is 1, but let's
express this correctly.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: VMX: Add lazy FPU support for VT
Anthony Liguori [Fri, 27 Apr 2007 06:29:49 +0000 (09:29 +0300)]
KVM: VMX: Add lazy FPU support for VT

Only save/restore the FPU host state when the guest is actually using the
FPU.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: VMX: Properly shadow the CR0 register in the vcpu struct
Anthony Liguori [Fri, 27 Apr 2007 06:29:21 +0000 (09:29 +0300)]
KVM: VMX: Properly shadow the CR0 register in the vcpu struct

Set all of the host mask bits for CR0 so that we can maintain a proper
shadow of CR0.  This exposes CR0.TS, paving the way for lazy fpu handling.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Don't complain about cpu erratum AA15
Avi Kivity [Wed, 25 Apr 2007 07:59:52 +0000 (10:59 +0300)]
KVM: Don't complain about cpu erratum AA15

It slows down Windows x64 horribly.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Lazy FPU support for SVM
Anthony Liguori [Mon, 23 Apr 2007 14:17:21 +0000 (09:17 -0500)]
KVM: Lazy FPU support for SVM

Avoid saving and restoring the guest fpu state on every exit.  This
shaves ~100 cycles off the guest/host switch.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Allow passing 64-bit values to the emulated read/write API
Avi Kivity [Sun, 22 Apr 2007 12:28:19 +0000 (15:28 +0300)]
KVM: Allow passing 64-bit values to the emulated read/write API

This simplifies the API somewhat (by eliminating the special-case
cmpxchg8b on i386).

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Per-vcpu statistics
Avi Kivity [Thu, 19 Apr 2007 14:27:43 +0000 (17:27 +0300)]
KVM: Per-vcpu statistics

Make the exit statistics per-vcpu instead of global.  This gives a 3.5%
boost when running one virtual machine per core on my two socket dual core
(4 cores total) machine.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: VMX: Avoid unnecessary vcpu_load()/vcpu_put() cycles
Yaozu Dong [Wed, 25 Apr 2007 13:49:19 +0000 (16:49 +0300)]
KVM: VMX: Avoid unnecessary vcpu_load()/vcpu_put() cycles

By checking if a reschedule is needed, we avoid dropping the vcpu.

[With changes by me, based on Anthony Liguori's observations]

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: MMU: Avoid heavy ASSERT at non debug mode.
Yaozu Dong [Wed, 25 Apr 2007 06:17:25 +0000 (14:17 +0800)]
KVM: MMU: Avoid heavy ASSERT at non debug mode.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: VMX: Only save/restore MSR_K6_STAR if necessary
Avi Kivity [Thu, 19 Apr 2007 11:28:44 +0000 (14:28 +0300)]
KVM: VMX: Only save/restore MSR_K6_STAR if necessary

Intel hosts only support syscall/sysret in long more (and only if efer.sce
is enabled), so only reload the related MSR_K6_STAR if the guest will
actually be able to use it.

This reduces vmexit cost by about 500 cycles (6400 -> 5870) on my setup.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Fold drivers/kvm/kvm_vmx.h into drivers/kvm/vmx.c
Avi Kivity [Thu, 19 Apr 2007 10:26:39 +0000 (13:26 +0300)]
KVM: Fold drivers/kvm/kvm_vmx.h into drivers/kvm/vmx.c

No meat in that file.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: VMX: Don't switch 64-bit msrs for 32-bit guests
Avi Kivity [Thu, 19 Apr 2007 10:22:48 +0000 (13:22 +0300)]
KVM: VMX: Don't switch 64-bit msrs for 32-bit guests

Some msrs are only used by x86_64 instructions, and are therefore
not needed when the guest is legacy mode.  By not bothering to switch
them, we reduce vmexit latency by 2400 cycles (from about 8800) when
running a 32-bt guest on a 64-bit host.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: VMX: Reduce unnecessary saving of host msrs
Avi Kivity [Tue, 17 Apr 2007 12:30:24 +0000 (15:30 +0300)]
KVM: VMX: Reduce unnecessary saving of host msrs

THe automatically switched msrs are never changed on the host (with
the exception of MSR_KERNEL_GS_BASE) and thus there is no need to save
them on every vm entry.

This reduces vmexit latency by ~400 cycles on i386 and by ~900 cycles (10%)
on x86_64.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Handle guest page faults when emulating mmio
Avi Kivity [Tue, 17 Apr 2007 07:53:22 +0000 (10:53 +0300)]
KVM: Handle guest page faults when emulating mmio

Usually, guest page faults are detected by the kvm page fault handler,
which detects if they are shadow faults, mmio faults, pagetable faults,
or normal guest page faults.

However, in ceratin circumstances, we can detect a page fault much later.
One of these events is the following combination:

- A two memory operand instruction (e.g. movsb) is executed.
- The first operand is in mmio space (which is the fault reported to kvm)
- The second operand is in an ummaped address (e.g. a guest page fault)

The Windows 2000 installer does such an access, an promptly hangs.  Fix
by adding the missing page fault injection on that path.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: SVM: Report hardware exit reason to userspace instead of dmesg
Avi Kivity [Mon, 16 Apr 2007 11:28:40 +0000 (14:28 +0300)]
KVM: SVM: Report hardware exit reason to userspace instead of dmesg

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Retry sleeping allocation if atomic allocation fails
Avi Kivity [Mon, 16 Apr 2007 08:53:17 +0000 (11:53 +0300)]
KVM: Retry sleeping allocation if atomic allocation fails

This avoids -ENOMEM under memory pressure.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Use slab caches to allocate mmu data structures
Avi Kivity [Sun, 15 Apr 2007 13:31:09 +0000 (16:31 +0300)]
KVM: Use slab caches to allocate mmu data structures

Better leak detection, statistics, memory use, speed -- goodness all
around.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Handle partial pae pdptr
Avi Kivity [Thu, 12 Apr 2007 14:35:58 +0000 (17:35 +0300)]
KVM: Handle partial pae pdptr

Some guests (Solaris) do not set up all four pdptrs, but leave some invalid.
kvm incorrectly treated these as valid page directories, pinning the
wrong pages and causing general confusion.

Fix by checking the valid bit of a pae pdpte.  This closes sourceforge bug
1698922.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Initialize cr0 to indicate an fpu is present
Avi Kivity [Thu, 12 Apr 2007 10:03:01 +0000 (13:03 +0300)]
KVM: Initialize cr0 to indicate an fpu is present

Solaris panics if it sees a cpu with no fpu, and it seems to rely on this
bit.  Closes sourceforge bug 1698920.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Fix overflow bug in overflow detection code
Eric Sesterhenn / Snakebyte [Mon, 9 Apr 2007 14:15:05 +0000 (16:15 +0200)]
KVM: Fix overflow bug in overflow detection code

The expression

   sp - 6 < sp

where sp is a u16 is undefined in C since 'sp - 6' is promoted to int,
and signed overflow is undefined in C.  gcc 4.2 actually warns about it.
Replace with a simpler test.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Use kernel-standard types
Avi Kivity [Mon, 2 Apr 2007 10:05:50 +0000 (13:05 +0300)]
KVM: Use kernel-standard types

Noted by Joerg Roedel.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: SVM: enable LBRV virtualization if available
Joerg Roedel [Fri, 30 Mar 2007 14:02:14 +0000 (17:02 +0300)]
KVM: SVM: enable LBRV virtualization if available

This patch enables the virtualization of the last branch record MSRs on
SVM if this feature is available in hardware. It also introduces a small
and simple check feature for specific SVM extensions.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Add fpu get/set operations
Avi Kivity [Sun, 1 Apr 2007 13:34:31 +0000 (16:34 +0300)]
KVM: Add fpu get/set operations

These are really helpful when migrating an floating point app to another
machine.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Add physical memory aliasing feature
Avi Kivity [Fri, 30 Mar 2007 13:54:30 +0000 (16:54 +0300)]
KVM: Add physical memory aliasing feature

With this, we can specify that accesses to one physical memory range will
be remapped to another.  This is useful for the vga window at 0xa0000 which
is used as a movable window into the (much larger) framebuffer.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Simply gfn_to_page()
Avi Kivity [Fri, 30 Mar 2007 11:02:32 +0000 (14:02 +0300)]
KVM: Simply gfn_to_page()

Mapping a guest page to a host page is a common operation.  Currently,
one has first to find the memory slot where the page belongs (gfn_to_memslot),
then locate the page itself (gfn_to_page()).

This is clumsy, and also won't work well with memory aliases.  So simplify
gfn_to_page() not to require memory slot translation first, and instead do it
internally.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Add mmu cache clear function
Dor Laor [Fri, 30 Mar 2007 10:06:33 +0000 (13:06 +0300)]
KVM: Add mmu cache clear function

Functions that play around with the physical memory map
need a way to clear mappings to possibly nonexistent or
invalid memory.  Both the mmu cache and the processor tlb
are cleared.

Signed-off-by: Dor Laor <dor.laor@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: x86 emulator: fix bit string operations operand size
Avi Kivity [Wed, 28 Mar 2007 18:04:16 +0000 (20:04 +0200)]
KVM: x86 emulator: fix bit string operations operand size

On x86, bit operations operate on a string of bits that can reside in
multiple words.  For example, 'btsl %eax, (blah)' will touch the word
at blah+4 if %eax is between 32 and 63.

The x86 emulator compensates for that by advancing the operand address
by (bit offset / BITS_PER_LONG) and truncating the bit offset to the
range (0..BITS_PER_LONG-1).  This has a side effect of forcing the operand
size to 8 bytes on 64-bit hosts.

Now, a 32-bit guest goes and fork()s a process.  It write protects a stack
page at 0xbffff000 using the 'btr' instruction, at offset 0xffc in the page
table, with bit offset 1 (for the write permission bit).

The emulator now forces the operand size to 8 bytes as previously described,
and an innocent page table update turns into a cross-page-boundary write,
which is assumed by the mmu code not to be a page table, so it doesn't
actually clear the corresponding shadow page table entry.  The guest and
host permissions are out of sync and guest memory is corrupted soon
afterwards, leading to guest failure.

Fix by not using BITS_PER_LONG as the word size; instead use the actual
operand size, so we get a 32-bit write in that case.

Note we still have to teach the mmu to handle cross-page-boundary writes
to guest page table; but for now this allows Damn Small Linux 0.4 (2.4.20)
to boot.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Remove debug message
Avi Kivity [Tue, 27 Mar 2007 15:50:20 +0000 (17:50 +0200)]
KVM: Remove debug message

No longer interesting.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Use list_move()
Avi Kivity [Mon, 26 Mar 2007 17:31:52 +0000 (19:31 +0200)]
KVM: Use list_move()

Use list_move() where possible.  Noticed by Dor Laor.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Remove unused function
Michal Piotrowski [Sun, 25 Mar 2007 15:59:32 +0000 (17:59 +0200)]
KVM: Remove unused function

Remove unused function

CC      drivers/kvm/svm.o
drivers/kvm/svm.c:207: warning: ‘inject_db’ defined but not used

Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: SVM: Ensure timestamp counter monotonicity
Avi Kivity [Sun, 25 Mar 2007 10:07:27 +0000 (12:07 +0200)]
KVM: SVM: Ensure timestamp counter monotonicity

When a vcpu is migrated from one cpu to another, its timestamp counter
may lose its monotonic property if the host has unsynced timestamp counters.
This can confuse the guest, sometimes to the point of refusing to boot.

As the rdtsc instruction is rather fast on AMD processors (7-10 cycles),
we can simply record the last host tsc when we drop the cpu, and adjust
the vcpu tsc offset when we detect that we've migrated to a different cpu.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: MMU: Fix hugepage pdes mapping same physical address with different access
Avi Kivity [Fri, 23 Mar 2007 07:55:25 +0000 (09:55 +0200)]
KVM: MMU: Fix hugepage pdes mapping same physical address with different access

The kvm mmu keeps a shadow page for hugepage pdes; if several such pdes map
the same physical address, they share the same shadow page.  This is a fairly
common case (kernel mappings on i386 nonpae Linux, for example).

However, if the two pdes map the same memory but with different permissions, kvm
will happily use the cached shadow page.  If the access through the more
permissive pde will occur after the access to the strict pde, an endless pagefault
loop will be generated and the guest will make no progress.

Fix by making the access permissions part of the cache lookup key.

The fix allows Xen pae to boot on kvm and run guest domains.

Thanks to Jeremy Fitzhardinge for reporting the bug and testing the fix.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: SVM: forbid guest to execute monitor/mwait
Joerg Roedel [Wed, 21 Mar 2007 18:47:00 +0000 (19:47 +0100)]
KVM: SVM: forbid guest to execute monitor/mwait

This patch forbids the guest to execute monitor/mwait instructions on
SVM. This is necessary because the guest can execute these instructions
if they are available even if the kvm cpuid doesn't report its
existence.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Handle writes to MCG_STATUS msr
Sergey Kiselev [Thu, 22 Mar 2007 12:06:18 +0000 (14:06 +0200)]
KVM: Handle writes to MCG_STATUS msr

Some older (~2.6.7) kernels write MCG_STATUS register during kernel
boot (mce_clear_all() function, called from mce_init()). It's not
currently handled by kvm and will cause it to inject a GPF.
Following patch adds a "nop" handler for this.

Signed-off-by: Sergey Kiselev <sergey.kiselev@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Remove unused and write-only variables
Avi Kivity [Wed, 21 Mar 2007 16:14:42 +0000 (18:14 +0200)]
KVM: Remove unused and write-only variables

Trivial cleanup.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Don't allow the guest to turn off the cpu cache
Avi Kivity [Wed, 21 Mar 2007 16:11:36 +0000 (18:11 +0200)]
KVM: Don't allow the guest to turn off the cpu cache

The cpu cache is a host resource; the guest should not be able to turn
it off (even for itself).

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Hack real-mode segments on vmx from KVM_SET_SREGS
Avi Kivity [Wed, 21 Mar 2007 15:58:32 +0000 (17:58 +0200)]
KVM: Hack real-mode segments on vmx from KVM_SET_SREGS

As usual, we need to mangle segment registers when emulating real mode
as vm86 has specific constraints.  We special case the reset segment base,
and set the "access rights" (or descriptor flags) to vm86 comaptible values.

This fixes reboot on vmx.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Modify guest segments after potentially switching modes
Avi Kivity [Wed, 21 Mar 2007 11:44:58 +0000 (13:44 +0200)]
KVM: Modify guest segments after potentially switching modes

The SET_SREGS ioctl modifies both cr0.pe (real mode/protected mode) and
guest segment registers.  Since segment handling is modified by the mode on
Intel procesors, update the segment registers after the mode switch has taken
place.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Remove set_cr0_no_modeswitch() arch op
Avi Kivity [Tue, 20 Mar 2007 16:44:51 +0000 (18:44 +0200)]
KVM: Remove set_cr0_no_modeswitch() arch op

set_cr0_no_modeswitch() was a hack to avoid corrupting segment registers.
As we now cache the protected mode values on entry to real mode, this
isn't an issue anymore, and it interferes with reboot (which usually _is_
a modeswitch).

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: Workaround vmx inability to virtualize the reset state
Avi Kivity [Tue, 20 Mar 2007 16:40:40 +0000 (18:40 +0200)]
KVM: Workaround vmx inability to virtualize the reset state

The reset state has cs.selector == 0xf000 and cs.base == 0xffff0000,
which aren't compatible with vm86 mode, which is used for real mode
virtualization.

When we create a vcpu, we set cs.base to 0xf0000, but if we get there by
way of a reset, the values are inconsistent and vmx refuses to enter
guest mode.

Workaround by detecting the state and munging it appropriately.

Signed-off-by: Avi Kivity <avi@qumranet.com>
17 years agoKVM: MMU: Remove global pte tracking
Avi Kivity [Tue, 20 Mar 2007 12:34:28 +0000 (14:34 +0200)]
KVM: MMU: Remove global pte tracking

The initial, noncaching, version of the kvm mmu flushed the all nonglobal
shadow page table translations (much like a native tlb flush).  The new
implementation flushes translations only when they change, rendering global
pte tracking superfluous.

This removes the unused tracking mechanism and storage space.

Signed-off-by: Avi Kivity <avi@qumranet.com>