diff --git a/Makefile b/Makefile index 721ed25e1f..16b27f79dd 100644 --- a/Makefile +++ b/Makefile @@ -446,7 +446,7 @@ qemu-version.h: FORCE else \ if test -d .git; then \ pkgvers=$$(git rev-parse --short HEAD 2>/dev/null | tr -d '\n');\ - if ! git diff-index --quiet HEAD &>/dev/null; then \ + if ! git diff --quiet HEAD >/dev/null 2>&1; then \ pkgvers="$${pkgvers}-dirty"; \ fi; \ fi; \ diff --git a/build.sh b/build.sh index be07f506b8..07d324c771 100755 --- a/build.sh +++ b/build.sh @@ -44,7 +44,7 @@ set -x # Print commands from now on --enable-debug \ --extra-cflags="$CFLAGS_COMMON $CFLAGS" \ $CONFIGURE \ - --target-list=i386-softmmu \ + --target-list=i386-softmmu \ --enable-sdl \ --with-sdlabi=2.0 \ --disable-curl \ @@ -60,6 +60,7 @@ set -x # Print commands from now on --disable-libiscsi \ --disable-spice \ --disable-user \ + --disable-stack-protector \ time make -j`nproc` 2>&1 | tee build.log diff --git a/hw/xbox/nv2a/nv2a_vsh.c b/hw/xbox/nv2a/nv2a_vsh.c index 780e46321a..1552e1c70b 100644 --- a/hw/xbox/nv2a/nv2a_vsh.c +++ b/hw/xbox/nv2a/nv2a_vsh.c @@ -674,13 +674,25 @@ static const char* vsh_header = "#define EXP(dest, mask, src) dest.mask = _EXP(_in(src).x).mask\n" "vec4 _EXP(float src)\n" "{\n" - " return vec4(exp2(src));\n" + " vec4 result;\n" + " result.x = exp2(floor(src));\n" + " result.y = src - floor(src);\n" + " result.z = exp2(src);\n" + " result.w = 1.0;\n" + " return result;\n" "}\n" "\n" "#define LOG(dest, mask, src) dest.mask = _LOG(_in(src).x).mask\n" "vec4 _LOG(float src)\n" "{\n" - " return vec4(log2(src));\n" + " float tmp = abs(src);\n" + " if (tmp == 0.0) { return vec4(-INFINITY, 1.0f, -INFINITY, 1.0f); }\n" + " vec4 result;\n" + " result.x = floor(log2(tmp));\n" + " result.y = tmp / exp2(floor(log2(tmp)));\n" + " result.z = log2(tmp);\n" + " result.w = 1.0;\n" + " return result;\n" "}\n" "\n" "#define LIT(dest, mask, src) dest.mask = _LIT(_in(src)).mask\n" diff --git a/hw/xbox/nvnet.c b/hw/xbox/nvnet.c index 6de7b75467..efd94ae54c 100644 --- a/hw/xbox/nvnet.c +++ b/hw/xbox/nvnet.c @@ -28,6 +28,7 @@ #define IOPORT_SIZE 0x8 #define MMIO_SIZE 0x400 +// #define DEBUG #ifdef DEBUG # define NVNET_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) # define NVNET_DUMP_PACKETS_TO_SCREEN @@ -692,6 +693,7 @@ static ssize_t nvnet_dma_packet_from_guest(NvNetState *s) struct RingDesc desc; bool is_last_packet; int i; + bool packet_sent = false; for (i = 0; i < s->tx_ring_size; i++) { /* Read ring descriptor */ @@ -716,6 +718,7 @@ static ssize_t nvnet_dma_packet_from_guest(NvNetState *s) pci_dma_read(&s->dev, desc.packet_buffer, s->txrx_dma_buf, desc.length + 1); nvnet_send_packet(s, s->txrx_dma_buf, desc.length + 1); + packet_sent = true; /* Update descriptor */ is_last_packet = desc.flags & NV_TX_LASTPACKET; @@ -732,9 +735,11 @@ static ssize_t nvnet_dma_packet_from_guest(NvNetState *s) } /* Trigger interrupt */ - NVNET_DPRINTF("Triggering interrupt\n"); - nvnet_set_reg(s, NvRegIrqStatus, NVREG_IRQSTAT_BIT4, 4); - nvnet_update_irq(s); + if (packet_sent) { + NVNET_DPRINTF("Triggering interrupt\n"); + nvnet_set_reg(s, NvRegIrqStatus, NVREG_IRQSTAT_BIT4, 4); + nvnet_update_irq(s); + } return 0; }